fix:交接变动,返工可以选择合格品

This commit is contained in:
shijing 2025-04-24 13:30:45 +08:00
parent 7ecd788427
commit d49ee2c635
2 changed files with 117 additions and 28 deletions

View File

@ -98,14 +98,17 @@
<el-table-column <el-table-column
label="物料" label="物料"
prop="material_name" prop="material_name"
min-width="140" min-width="120"
></el-table-column> ></el-table-column>
<el-table-column label="批次" prop="batch" min-width="140"> <el-table-column label="数量" prop="count" width="80"></el-table-column>
<el-table-column label="批次" prop="batch" width="60">
<template #default="scope"> <template #default="scope">
<el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text> <el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" prop="count" width="80"></el-table-column> <el-table-column label="新批次号" prop="new_batch" min-width="80">
</el-table-column>
<el-table-column label="交接类型" prop="type" width="100"> <el-table-column label="交接类型" prop="type" width="100">
<template #default="scope"> <template #default="scope">
<el-text v-if="scope.row.mtype==20" type="warning">拆批</el-text> <el-text v-if="scope.row.mtype==20" type="warning">拆批</el-text>
@ -145,10 +148,15 @@
prop="recive_user_name" prop="recive_user_name"
width="80" width="80"
></el-table-column> ></el-table-column>
<el-table-column
label="备注"
prop="note"
width="80"
></el-table-column>
<el-table-column <el-table-column
label="交接日期" label="交接日期"
prop="send_date" prop="send_date"
width="120" width="100"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
@ -232,16 +240,40 @@
@closed="dialog.save = false" @closed="dialog.save = false"
> >
</save-dialog> </save-dialog>
<!-- <el-dialog title="打印机设置" v-model="setNameVisible" width="600px"> <el-dialog title="退料操作" v-model="backDialogVisible" style="width: 70%;">
<el-form label-width="100px"> <el-row v-for="item in handoverbList" :key="item.id" style="padding: 10px 10px 0 20px;">
<el-form-item label="打印机名称"> <el-col style="display: flex;border-bottom: 1px dashed #eee;">
<el-input v-model="printer_name"></el-input> <el-checkbox v-model="item.checked" :label="item.batch"/>
<el-form-item label="退料数量" label-width="150px" style="margin-bottom: 10px;">
<el-input-number v-model="item.count" :min="0" controls-position="right"/>
</el-form-item>
</el-col>
</el-row>
<el-form ref="backForm" label-width="100px" :rules="rules" :model="form" style="margin-top: 15px;">
<el-form-item label="接收工段" prop="recive_mgroup">
<el-select
v-model="form.recive_mgroup"
placeholder="接收工段"
clearable
filterable
style="width: 100%"
>
<el-option
v-for="item in mgroupOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="退料原因">
<el-input v-model="form.note"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-footer> <el-footer>
<el-button type="primary" @click="savePrinter">保存</el-button> <el-button type="primary" @click="savePrinter">保存</el-button>
</el-footer> </el-footer>
</el-dialog> --> </el-dialog>
<el-dialog v-model="printVisible" width="1200px"> <el-dialog v-model="printVisible" width="1200px">
<print :baseData="handoverItem" :tableData="handoverItem.handoverb" :type="'handover'" @closePrint="printVisible=false"/> <print :baseData="handoverItem" :tableData="handoverItem.handoverb" :type="'handover'" @closePrint="printVisible=false"/>
</el-dialog> </el-dialog>
@ -303,6 +335,8 @@ export default {
options: ["交送", "接收"], options: ["交送", "接收"],
tableData: [], tableData: [],
selection: [], selection: [],
mgroupOptions:[],
handoverbList:[],
handoverItem:{}, handoverItem:{},
values: "交送", values: "交送",
mtask: "", mtask: "",
@ -311,6 +345,13 @@ export default {
codeText2:"", codeText2:"",
printer_name: "", printer_name: "",
printVisible:false, printVisible:false,
backDialogVisible:false,
form: { },
rules: {
recive_mgroup: [
{ required: true, message: "请选择接收工段", trigger: "blur" },
],
},
// setNameVisible: false, // setNameVisible: false,
}; };
}, },
@ -321,9 +362,24 @@ export default {
that.params.mgroup = that.mgroupId; that.params.mgroup = that.mgroupId;
that.apiObj = that.$API.wpm.handover.list; that.apiObj = that.$API.wpm.handover.list;
that.$refs.table.refresh(); that.$refs.table.refresh();
that.getMgroupOptions();
}, },
methods: { methods: {
//
getMgroupOptions() {
let that = this;
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
that.mgroupOptions = res;
if(that.type==40){
res.forEach(item=>{
if(item.name=="废品库"){
that.form.recive_mgroup = item.id;
}
})
that.getCkUserList();//
}
});
},
// //
table_add(type) { table_add(type) {
this.dialog.save = true; this.dialog.save = true;
@ -408,7 +464,7 @@ export default {
that.query.recive_dept = ""; that.query.recive_dept = "";
that.query.send_dept = ""; that.query.send_dept = "";
} }
console.log(that.query); // console.log(that.query);
this.$refs.table.queryData(that.query); this.$refs.table.queryData(that.query);
}, },
table_receive(row) { table_receive(row) {
@ -425,33 +481,49 @@ export default {
form.send_mgroup = row.recive_mgroup; form.send_mgroup = row.recive_mgroup;
form.recive_mgroup = row.send_mgroup; form.recive_mgroup = row.send_mgroup;
form.handoverb = []; form.handoverb = [];
that.handoverbList = [];
row.handoverb.forEach((item) => { row.handoverb.forEach((item) => {
let obj = {}; let obj = {};
obj.wm = item.wm_to; obj.wm = item.wm_to;
obj.checked = true;
obj.batch = item.batch; obj.batch = item.batch;
obj.count = item.count; obj.count = item.count;
form.handoverb.push(obj) form.handoverb.push(obj);
that.handoverbList.push(obj);
}) })
form.send_user = that.$TOOL.data.get('USER_INFO').id; form.send_user = that.$TOOL.data.get('USER_INFO').id;
form.send_date = that.$TOOL.dateFormat2(new Date()); form.send_date = that.$TOOL.dateFormat2(new Date());
form.type = 60; form.type = 60;//退
that.$API.wpm.handover.create.req(form).then((res) => { that.form = form;
that.$message.success("操作成功"); that.backDialogVisible = true;
}).catch((err) => {
return err;
});
}, },
table_print(row) { table_print(row) {
let that = this; let that = this;
that.handoverItem = row; that.handoverItem = row;
that.printVisible = true; that.printVisible = true;
}, },
// savePrinter() { savePrinter() {
// let that = this; let that = this;
// localStorage.setItem("printer_name", that.printer_name); that.form.handoverb = [];
// that.setNameVisible = false; that.handoverbList.forEach(item=>{
// that.$message.success(""); if(item.checked){
// }, let obj = {};
obj.wm = item.wm;
obj.batch = item.batch;
obj.count = item.count;
that.form.handoverb.push(obj);
}
})
// console.log(that.form)
that.$API.wpm.handover.create.req(that.form).then((res) => {
that.$message.success("操作成功");
that.backDialogVisible = false;
that.$refs.table.refresh();
that.form = {};
}).catch((err) => {
return err;
});
},
// //
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {

View File

@ -51,6 +51,7 @@
:value="item.id" :value="item.id"
> >
<span>{{ item.batch }}</span> <span>{{ item.batch }}</span>
<span>({{ item.material_name }})</span>
<div style="float: right"> <div style="float: right">
<span>{{ item.count }}</span> <span>{{ item.count }}</span>
<span v-if="item.notok_sign_name !== null" style="color: #aaaaaa"> <span v-if="item.notok_sign_name !== null" style="color: #aaaaaa">
@ -320,12 +321,15 @@ export default {
that.getUserList(); that.getUserList();
} }
// //
if((that.type==20&&that.mgroupName!=='废品库')||that.type==40){ if(that.type==20&&that.mgroupName!=='废品库'){
// //
that.getMaterialNotok(); that.getMaterialRework();
}else if(that.type==20&&that.mgroupName=='废品库'){ }else if(that.type==20&&that.mgroupName=='废品库'){
// //
that.getMaterialFP(); that.getMaterialFP();
}else if(that.type==40){
//
that.getMaterialNotok();
}else{ }else{
// //
that.getMaterial(); that.getMaterial();
@ -406,6 +410,19 @@ export default {
that.materialOptions = res; that.materialOptions = res;
}); });
}, },
getMaterialRework(){
let that = this;
that.materialOptions = [];
var req = {
mgroup: that.mgroupId,
page: 0,
tag : 'done'
};
that.listParams = req;
this.$API.wpm.wmaterial.list.req(req).then((res) => {
that.materialOptions = res;
});
},
// //
getMaterialFP() { getMaterialFP() {
let that = this; let that = this;