fix:车间出入库调整,massage语法错误修改

This commit is contained in:
shijing 2025-05-20 09:48:43 +08:00
parent 8040516eb7
commit 833eba96c5
2 changed files with 25 additions and 41 deletions

View File

@ -217,7 +217,7 @@ export default {
})
}
}else{
that.$message.console.error("请先设置打印机");
that.$message.error("请先设置打印机");
}
},
},

View File

@ -282,18 +282,11 @@ export default {
if (that.mgroupId != null &&that.mgroupId != undefined &&that.mgroupId != "") {
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
that.wbatchOptions = res;
if(res.length>0&&that.codeText!==''){
if(that.codeText!==''){
setTimeout(() => {
that.codeTextChange(that.codeText);
// let arr = [];
// arr = res.filter(item => item.batch == that.codeText);
// if(arr.length>0){
// that.selectBatch = arr[0].id;
// that.form.batch = arr[0].batch;
// that.form.wm = arr[0].id;
// that.form.count = arr[0].count;
// }else{
// this.$message.warning("");
// }
this.codeText = '';
}, 100);
}
});
}
@ -306,21 +299,6 @@ export default {
obj.material = that.form.material;
this.$API.inm.warehouse.batch.req(obj).then((res) => {
this.batchOptions = res;
if(res.length>0&&that.codeText!==''){
that.codeTextChange(that.codeText);
// let arr = [];
// arr = res.filter(item => item.batch == that.codeText);
// if(arr.length>0){
// that.form.material = arr[0].material
// that.selectBatch = arr[0].id;
// that.form.batch = arr[0].batch;
// that.form.warehouse = arr[0].warehouse;
// that.form.mb = arr[0].id;
// that.form.count = arr[0].count;
// }else{
// this.$message.warning("");
// }
}
});
},
codeTextChange(data){
@ -337,11 +315,15 @@ export default {
}else{//----
arr = this.wbatchOptions.filter(item => item.batch == res.batch);
}
console.log('arr',arr);
if(arr.length>0){
// that.selectBatch = arr[0].id;
if(that.mode == "add"){
that.selectBatch.push(arr[0].id);
let arrF = that.selectList.filter(item =>
item.batch == arr[0].batch
)
if(arrF.length>0){
that.$message.error("该批次已存在");
that.codeText = "";
}else{
let obj = {};
obj.batch = arr[0].batch;
obj.warehouse = arr[0].warehouse;
@ -354,6 +336,7 @@ export default {
obj.wm = arr[0].id;
}
that.selectList.push(obj);
}
}else{
that.selectBatch = arr[0].id;
that.form.material = arr[0].material;
@ -368,6 +351,7 @@ export default {
}
}else{
that.$message.error("该批次不存在")
that.codeText = "";
}
})
},