fix:修正玻纤单个扫码批次数量有误问题
This commit is contained in:
parent
d97aa84768
commit
6fd4734841
|
@ -18,8 +18,8 @@
|
|||
style="padding: 0 10px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="关联任务" v-if="!isfix">
|
||||
<el-col :md="12" :sm="12" :xs="24" v-if="!isfix">
|
||||
<el-form-item label="关联任务">
|
||||
<el-select
|
||||
v-model="form.mtask"
|
||||
placeholder="关联任务"
|
||||
|
@ -233,6 +233,7 @@ export default {
|
|||
mlog: "",
|
||||
material_in__isnull: 0,
|
||||
},
|
||||
bwItemForms:[],
|
||||
bwItemForm:{
|
||||
wpr:"",
|
||||
mlogb:"",
|
||||
|
@ -375,7 +376,7 @@ export default {
|
|||
}else{//单件
|
||||
that.$API.wpm.wpr.list.req({number:code,page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
let index = res.length-1;
|
||||
let index = res.length-1;//最后一条记录
|
||||
let bwitem = {};
|
||||
bwitem.mlogb="";
|
||||
bwitem.number=res[index].number;
|
||||
|
@ -398,10 +399,12 @@ export default {
|
|||
}else{
|
||||
that.form.batch = arr[0].batch;
|
||||
that.form.wm_in = arr[0].id;
|
||||
that.form.count_use = 1;
|
||||
that.wm_in = arr[0].batch;
|
||||
that.form.count_use += 1;
|
||||
that.wm_in = '';
|
||||
that.batchs = arr[0].id;
|
||||
}
|
||||
that.bwItemForm = bwitem;
|
||||
that.bwItemForms.push(bwitem);
|
||||
// that.bwItemForm = bwitem;
|
||||
}else{
|
||||
that.wm_in = '';
|
||||
that.$message.error("批次号不存在");
|
||||
|
@ -409,24 +412,34 @@ export default {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
let that = this;
|
||||
if(that.hasMlogbIn){
|
||||
that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {
|
||||
that.$message.success("添加成功");
|
||||
that.wm_in = '';
|
||||
that.form.mtask = '';
|
||||
that.form.batch = '';
|
||||
that.form.parent = '';
|
||||
that.form.count_use = 0;
|
||||
that.$emit("closed");
|
||||
that.visible = false;
|
||||
})
|
||||
that.bwItemForms.forEach(item=>{
|
||||
item.mlogb = res.id;
|
||||
that.$API.wpm.mlogbw.create.req(item).then((res1) => {
|
||||
that.wm_in = '';
|
||||
that.form.mtask = '';
|
||||
that.form.batch = '';
|
||||
that.form.parent = '';
|
||||
that.form.count_use = 0;
|
||||
that.$emit("closed");
|
||||
that.visible = false;
|
||||
})
|
||||
})
|
||||
// that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {
|
||||
// that.$message.success("添加成功");
|
||||
// that.wm_in = '';
|
||||
// that.form.mtask = '';
|
||||
// that.form.batch = '';
|
||||
// that.form.parent = '';
|
||||
// that.form.count_use = 0;
|
||||
// that.$emit("closed");
|
||||
// that.visible = false;
|
||||
// })
|
||||
}else{
|
||||
that.form.mlog = that.mlog;
|
||||
that.$API.wpm.mlogb.in.req(that.form).then((res) => {
|
||||
|
@ -436,11 +449,17 @@ export default {
|
|||
that.form.batch = '';
|
||||
that.form.parent = '';
|
||||
that.form.count_use = 0;
|
||||
if(that.scanKyes!=='mat'&&that.mlogbInCount>1){
|
||||
that.bwItemForm.mlogb = res.id;
|
||||
that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {
|
||||
that.$emit("closed");
|
||||
if(that.scanKyes!=='mat'&&that.bwItemForms.length>1){
|
||||
that.bwItemForms.forEach(item=>{
|
||||
item.mlogb = res.id;
|
||||
that.$API.wpm.mlogbw.create.req(item).then((res1) => {
|
||||
that.$emit("closed");
|
||||
})
|
||||
})
|
||||
// that.bwItemForm.mlogb = res.id;
|
||||
// that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {
|
||||
// that.$emit("closed");
|
||||
// })
|
||||
}else{
|
||||
that.$emit("closed");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue