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