只有修改时,才触发接口
This commit is contained in:
parent
3743974f43
commit
8a152e8cea
|
|
@ -418,26 +418,28 @@ export default {
|
||||||
data: postdata,
|
data: postdata,
|
||||||
useBigInt: true,
|
useBigInt: true,
|
||||||
}).then(() => { // 成功回调
|
}).then(() => { // 成功回调
|
||||||
let insertList = [];
|
if(this.isEdit){
|
||||||
let updateList = [];
|
let insertList = [];
|
||||||
let deleteList = this.deleteList;
|
let updateList = [];
|
||||||
|
let deleteList = this.deleteList;
|
||||||
|
this.soilQualityMaterialAliasList.forEach(item => {
|
||||||
|
item.customer_id = this.$mk.toBigInt(item.customer_id);
|
||||||
|
item.price = Number(item.price);
|
||||||
|
item.soil_quality_material_id = postdata.id;
|
||||||
|
if(item.id){
|
||||||
|
updateList.push(item)
|
||||||
|
}else if(item.customer_id){
|
||||||
|
insertList.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$mk.post({
|
||||||
|
url: this.actions.SoilQualityMaterialAliasBatchHandle,
|
||||||
|
data: {insertList,updateList,deleteList},
|
||||||
|
useBigInt: true,
|
||||||
|
}).then(() => { // 成功回调
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.soilQualityMaterialAliasList.forEach(item => {
|
|
||||||
item.customer_id = this.$mk.toBigInt(item.customer_id);
|
|
||||||
item.price = Number(item.price);
|
|
||||||
item.soil_quality_material_id = postdata.id;
|
|
||||||
if(item.id){
|
|
||||||
updateList.push(item)
|
|
||||||
}else if(item.customer_id){
|
|
||||||
insertList.push(item)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.$mk.post({
|
|
||||||
url: this.actions.SoilQualityMaterialAliasBatchHandle,
|
|
||||||
data: {insertList,updateList,deleteList},
|
|
||||||
useBigInt: true,
|
|
||||||
}).then(() => { // 成功回调
|
|
||||||
})
|
|
||||||
this.$mk.success("保存成功");
|
this.$mk.success("保存成功");
|
||||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||||
this.back();
|
this.back();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue