fix:禅道307
This commit is contained in:
parent
2072004c00
commit
1c927d1ba8
|
|
@ -829,8 +829,8 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let mioitemw = [];
|
||||||
if(that.mTracking==20&&that.form.count>1&&(that.form.type == 'pur_in'||that.form.type == 'other_in')){
|
if(that.mTracking==20&&that.form.count>1&&(that.form.type == 'pur_in'||that.form.type == 'other_in')){
|
||||||
let mioitemw = [];
|
|
||||||
that.mioitems.forEach((item,index) => {
|
that.mioitems.forEach((item,index) => {
|
||||||
mioitemw[index]={ number: item };
|
mioitemw[index]={ number: item };
|
||||||
})
|
})
|
||||||
|
|
@ -841,7 +841,6 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}else if(that.form.type == 'sale_out'&&that.project_code=='bxerp'){
|
}else if(that.form.type == 'sale_out'&&that.project_code=='bxerp'){
|
||||||
let mioitemw = [];
|
|
||||||
that.mioitems.forEach((item,index) => {
|
that.mioitems.forEach((item,index) => {
|
||||||
mioitemw[index]={
|
mioitemw[index]={
|
||||||
number: that.wprList[index]? that.wprList[index].number:'' ,
|
number: that.wprList[index]? that.wprList[index].number:'' ,
|
||||||
|
|
@ -851,22 +850,36 @@ export default {
|
||||||
})
|
})
|
||||||
that.form.mioitemw = mioitemw.filter(item=>item.wpr!==null);
|
that.form.mioitemw = mioitemw.filter(item=>item.wpr!==null);
|
||||||
}
|
}
|
||||||
try {
|
let obj = {},duplicates = [];
|
||||||
let res;
|
for (let item of that.mioitems) {
|
||||||
if (that.mode == "add") {
|
if (obj[item]) {
|
||||||
res = await that.$API.inm.mioitem.create.req(that.form);
|
if (!duplicates.includes(item)) {
|
||||||
} else if (that.mode == "edit") {
|
duplicates.push(item);
|
||||||
res = await that.$API.inm.mioitem.update.req(that.form.id,that.form);
|
}
|
||||||
|
} else {
|
||||||
|
obj[item] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (duplicates.length > 0) {
|
||||||
|
that.$message.error("重复的项有: " + duplicates.join(", "));
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
let res;
|
||||||
|
if (that.mode == "add") {
|
||||||
|
res = await that.$API.inm.mioitem.create.req(that.form);
|
||||||
|
} else if (that.mode == "edit") {
|
||||||
|
res = await that.$API.inm.mioitem.update.req(that.form.id,that.form);
|
||||||
|
}
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.$emit("success", that.form, that.mode);
|
||||||
|
that.visible = false;
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
//可以处理校验错误
|
||||||
|
that.isSaveing = false;
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
that.isSaveing = false;
|
|
||||||
that.$emit("success", that.form, that.mode);
|
|
||||||
that.visible = false;
|
|
||||||
that.$message.success("操作成功");
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err);
|
|
||||||
//可以处理校验错误
|
|
||||||
that.isSaveing = false;
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue