fix:只有合批才展示更改批次

This commit is contained in:
shijing 2025-09-09 14:57:47 +08:00
parent c85bac30e4
commit b20337454c
1 changed files with 21 additions and 16 deletions

View File

@ -161,7 +161,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="type==10">
<el-col :md="12" :sm="24" v-if="type==10&&mtype==30">
<el-form-item label="更改批次">
<el-switch v-model="change_batch"></el-switch>
</el-form-item>
@ -171,7 +171,7 @@
<el-input v-model="form.note" placeholder="处理备注"></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="type==10&&change_batch">
<el-col :md="12" :sm="24" v-if="change_batch">
<el-form-item label="新批次号" prop="new_batch">
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
</el-form-item>
@ -327,6 +327,7 @@ export default {
fileList:[],
userList: [],
userList2: [],
handoverbIds:[],
mgroupOptions: [],
materialOptions: [],
addShow: false,
@ -519,24 +520,28 @@ export default {
this.visible = true;
return this;
},
//handoverb
materialChange0(){
let that = this;
that.form.handoverb = [];
// that.form.handoverb = [];
// that.handoverbIds = [];
that.totalCount = 0;
that.selectObjs.forEach(item=>{
let obj = {};
obj.wm = item.id;
obj.state = item.state;
obj.batch = item.batch;
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
obj.count = item.count_canhandover;
obj.defect = item.defect;
obj.defect_name = item.defect_name;
obj.count_cando = item.count_canhandover;
obj.material = item.material;
that.totalCount += Number(obj.count);
that.form.handoverb.push(obj);
that.getResaveMgroups(obj.material);
if(that.handoverbIds.indexOf(item.id)==-1){
let obj = {};
obj.wm = item.id;
obj.state = item.state;
obj.batch = item.batch;
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
obj.count = item.count_canhandover;
obj.defect = item.defect;
obj.defect_name = item.defect_name;
obj.count_cando = item.count_canhandover;
obj.material = item.material;
that.totalCount += Number(obj.count);
that.form.handoverb.push(obj);
that.getResaveMgroups(obj.material);
}
})
},
countChange(){