fix:光芯合批时新批次号改动

This commit is contained in:
shijing 2026-01-07 11:16:35 +08:00
parent 5e24ad9c66
commit 00b3af30c1
1 changed files with 30 additions and 31 deletions

View File

@ -187,15 +187,7 @@
</el-col>
<el-col :md="12" :sm="24" v-if="change_batch">
<el-form-item label="新批次号" required>
<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-input v-model="form.new_batch" placeholder="新批次号"></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="route_code=='tuihuo' || form.oinfo_json.test_file">
@ -394,19 +386,19 @@ export default {
//
if(that.type==20&&that.mgroupName!=='废品库'){
//
that.paramsM = {mgroup: that.mgroupId,page: 0,state__in:'20,34',tag : 'done'};
that.paramsM = {mgroup: that.mgroupId,state__in:'20,34',tag : 'done'};
}else if(that.type==20&&that.mgroupName=='废品库'){
//
that.paramsM = {page: 0,state : 50,state_all: 1};
that.paramsM = {state : 50,state_all: 1};
}else if(that.type==40){
//
that.paramsM = {mgroupx: that.mgroupId,page: 0,state:20};
that.paramsM = {mgroupx: that.mgroupId,state:20};
}else if(that.type==50){
//
that.paramsM = {mgroupx: that.mgroupId,page: 0};
that.paramsM = {mgroupx: that.mgroupId};
}else{
//
that.paramsM = {mgroup: that.mgroupId,page: 0,state:10,tag : 'done'};
that.paramsM = {mgroup: that.mgroupId,state:10,tag : 'done'};
}
that.apiObjM = this.$API.wpm.wmaterial.list;
if(that.type==40||that.type==20){
@ -675,24 +667,31 @@ export default {
that.form.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(that.mtype==30){
let params = {};
params.material = that.form.handoverb[0].material;
params.batch = that.form.new_batch;
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.form.new_wm = res[0].id;
}
console.log('that.form.new_wm',that.form.new_wm);
console.log('that.form.new_batch',that.form.new_batch);
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.$message.success("操作成功");
}).catch((err) => {
that.isSaveing = false;
return err;
});
})
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){
}else if(that.mtype==20||that.type==40){
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");