fix:光芯合批时批次号可用一使用过的批次号

This commit is contained in:
shijing 2025-12-24 13:22:34 +08:00
parent a179619519
commit ced6d4cb58
4 changed files with 83 additions and 9 deletions

View File

@ -101,20 +101,15 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="物料" prop="material_name" min-width="120"></el-table-column>
label="物料"
prop="material_name"
min-width="120"
></el-table-column>
<el-table-column label="数量" prop="count" width="80"></el-table-column> <el-table-column label="数量" prop="count" width="80"></el-table-column>
<el-table-column label="批次" prop="batch" width="60"> <el-table-column label="批次" prop="batch" min-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="new_batch" min-width="80"> <el-table-column label="新批次号" prop="new_batch" min-width="80">
</el-table-column> </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>

View File

@ -186,8 +186,16 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="change_batch"> <el-col :md="12" :sm="24" v-if="change_batch">
<el-form-item label="新批次号" prop="new_batch"> <el-form-item label="新批次号" required>
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input> <el-select filterable remote :remote-method="remoFun" v-model="new_batch" @selsect="new_batch_change">
<el-option
v-for="item in batchList"
:key="item.id"
:label="item.batch"
:value="item.id"
></el-option>
</el-select>
<!-- <el-input v-model="form.new_batch" placeholder="新批次号"></el-input> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="route_code=='tuihuo' || form.oinfo_json.test_file"> <el-col :md="12" :sm="24" v-if="route_code=='tuihuo' || form.oinfo_json.test_file">
@ -340,12 +348,14 @@ export default {
}, },
], ],
}, },
new_batch:'',
listParams:{}, listParams:{},
totalCount: 0, totalCount: 0,
mtype:10, mtype:10,
deptID:'', deptID:'',
route_code:'', route_code:'',
codeText: "", codeText: "",
batchList:[],
fileList:[], fileList:[],
userList: [], userList: [],
userList2: [], userList2: [],
@ -406,6 +416,14 @@ export default {
} }
that.getTid(); that.getTid();
}, },
watch: {
batchList:{
deep:true,
handler (v) {
console.log('batchList',v)
}
}
},
methods: { methods: {
getTid (){ getTid (){
var that = this; var that = this;
@ -514,6 +532,44 @@ export default {
that.userList2 = res; that.userList2 = res;
}); });
}, },
remoFun(val){
let that = this;
let params = {};
that.batchList = [];
params.material = that.form.handoverb[0].material;
params.batch = val;
params.mgroup = that.mgroupId;
params.count_all = 1;
params.defect = that.form.handoverb[0].defect!=null?that.form.handoverb[0].defect:'';
params.defect__isnull = that.form.handoverb[0].defect!=null?false:true;
params.page = 0;
that.$API.wpm.wmaterial.list.req(params).then(res=>{
if(res.length>0){
that.batchList = res;
}else{
let obj = {};
obj.batch = val;
obj.id = val;
that.batchList.push(obj);
}
})
},
new_batch_change(){
let that = this;
let arr = that.batchList.filter(item=>{
return item.batch == that.new_batch;
})
if(arr.length>0){
that.form.new_batch = arr[0].batch;
}else{
that.batchList.forEach(item=>{
if(item.id == that.new_batch){
that.form.new_batch = item.batch;
that.form.new_wm = item.id;
}
})
}
},
addMaterial(){ addMaterial(){
this.addShow = true; this.addShow = true;
}, },
@ -538,6 +594,8 @@ export default {
obj.wm = item.wm; obj.wm = item.wm;
obj.label = item.label; obj.label = item.label;
obj.batch = item.batch; obj.batch = item.batch;
obj.defect = item.defect;
obj.material = item.material;
obj.count_cando = item.count_canhandover; obj.count_cando = item.count_canhandover;
obj.count = item.count_canhandover; obj.count = item.count_canhandover;
this.form.handoverb.push(obj); this.form.handoverb.push(obj);
@ -617,6 +675,23 @@ export default {
that.form.mtype=30; that.form.mtype=30;
that.mtype==30 that.mtype==30
} }
if(that.mtype==30&&that.form.new_batch==null&&that.form.new_batch==undefined&&that.new_batch!=''){
let arr = that.batchList.filter(item=>{
return item.batch == that.new_batch;
})
if(arr.length>0){
that.form.new_batch = arr[0].batch;
}else{
that.batchList.forEach(item=>{
if(item.id == that.new_batch){
that.form.new_batch = item.batch;
that.form.new_wm = item.id;
}
})
}
}
console.log('that.form.new_wm',that.form.new_wm);
console.log('that.form.new_batch',that.form.new_batch);
if(that.mtype==20||that.mtype==30||that.type==40){ if(that.mtype==20||that.mtype==30||that.type==40){
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => { that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;

View File

@ -324,6 +324,8 @@ export default {
let obj = {}; let obj = {};
obj.wm = item.id; obj.wm = item.id;
obj.batch = item.batch; obj.batch = item.batch;
obj.defect = item.defect;
obj.material = item.material;
obj.count_canhandover = item.count_canhandover; obj.count_canhandover = item.count_canhandover;
obj.count = item.count_canhandover; obj.count = item.count_canhandover;
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')'; obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';

View File

@ -409,6 +409,8 @@ export default {
let obj = {}; let obj = {};
obj.wm = item.id; obj.wm = item.id;
obj.batch = item.batch; obj.batch = item.batch;
obj.defect = item.defect;
obj.material = item.material;
obj.count_canhandover = item.count_canhandover; obj.count_canhandover = item.count_canhandover;
obj.count = item.count_canhandover; obj.count = item.count_canhandover;
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')'; obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';