#136 修改主生产计划保存逻辑

Merged
xuxiaoming merged 2 commits from xuxiaoming into develop 3 years ago
  1. +20
    -1
      src/views/productionPlanning/customerForecastDemandReview/demandPlanning/articleDemand/index.vue

+ 20
- 1
src/views/productionPlanning/customerForecastDemandReview/demandPlanning/articleDemand/index.vue View File

@ -195,6 +195,7 @@ export default {
selectKey: "",
tableWidth: "calc(100% - 15px)",
promptMessage:"",
editKeyList:[],
};
},
created() {
@ -347,6 +348,9 @@ export default {
},
//
editRow(data) {
if( !this.editKeyList.includes(this.selectKey) ) this.editKeyList.push(this.selectKey)
console.log('%cindex.vue line:353 this.editKeyList', 'color: #007acc;', this.editKeyList);
this.editKey = this.selectKey;
this.editField = data;
},
@ -418,6 +422,19 @@ export default {
// this.$message({ type: "error", message: "访" });
});
},
getEditTableDataJson(){
let editMapList = JSON.parse(JSON.stringify(this.TableData)).filter(item => this.editKeyList.includes(item.key))
editMapList.forEach(item => {
item["AP_ArticleDemand-ArtId"] = item.key;
delete item.index;
delete item.show;
delete item.key;
delete item.Label;
});
console.log('%cindex.vue line:435 editMapList', 'color: #007acc;', editMapList);
return JSON.stringify(editMapList);
},
//
saveDemandData() {
// if (!this.editField) {
@ -428,7 +445,7 @@ export default {
let param = {};
param.customerid = this.customerId;
param.artid = this.artId;
param.maplist = this.getTableDataJson();
param.maplist = this.getEditTableDataJson();
this.INIT_evaluationSecondResourceListData();
this.INIT_evaluationMainResourceData();
this.SET_evaluationMainResourceLoading(true);
@ -438,6 +455,8 @@ export default {
this.SET_evaluationSecondResourceListData(data["ArticleSecondResourceMpsGroupLst"] || []);
this.SET_evaluationSecondResourceLoading(false);
this.SET_evaluationMainResourceLoading(false);
this.handleQuery()
this.editKeyList = []
this.$message({ type: "success", message: "保存成功" });
}).catch(() => {
this.SET_evaluationSecondResourceLoading(false);


Loading…
Cancel
Save