只有修改时,才触发接口
This commit is contained in:
parent
3743974f43
commit
8a152e8cea
|
|
@ -418,26 +418,28 @@ export default {
|
|||
data: postdata,
|
||||
useBigInt: true,
|
||||
}).then(() => { // 成功回调
|
||||
let insertList = [];
|
||||
let updateList = [];
|
||||
let deleteList = this.deleteList;
|
||||
if(this.isEdit){
|
||||
let insertList = [];
|
||||
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("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
|
|
|
|||
Loading…
Reference in New Issue