Browse Source

Merge pull request '修改主生产计划保存逻辑' (#136) from xuxiaoming into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_AdvancedPlanner_Front/pulls/136
pull/137/head
xuxiaoming 3 years ago
parent
commit
8c55291f16
1 changed files with 20 additions and 1 deletions
  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: "", selectKey: "",
tableWidth: "calc(100% - 15px)", tableWidth: "calc(100% - 15px)",
promptMessage:"", promptMessage:"",
editKeyList:[],
}; };
}, },
created() { created() {
@ -347,6 +348,9 @@ export default {
}, },
// //
editRow(data) { 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.editKey = this.selectKey;
this.editField = data; this.editField = data;
}, },
@ -418,6 +422,19 @@ export default {
// this.$message({ type: "error", message: "访" }); // 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() { saveDemandData() {
// if (!this.editField) { // if (!this.editField) {
@ -428,7 +445,7 @@ export default {
let param = {}; let param = {};
param.customerid = this.customerId; param.customerid = this.customerId;
param.artid = this.artId; param.artid = this.artId;
param.maplist = this.getTableDataJson();
param.maplist = this.getEditTableDataJson();
this.INIT_evaluationSecondResourceListData(); this.INIT_evaluationSecondResourceListData();
this.INIT_evaluationMainResourceData(); this.INIT_evaluationMainResourceData();
this.SET_evaluationMainResourceLoading(true); this.SET_evaluationMainResourceLoading(true);
@ -438,6 +455,8 @@ export default {
this.SET_evaluationSecondResourceListData(data["ArticleSecondResourceMpsGroupLst"] || []); this.SET_evaluationSecondResourceListData(data["ArticleSecondResourceMpsGroupLst"] || []);
this.SET_evaluationSecondResourceLoading(false); this.SET_evaluationSecondResourceLoading(false);
this.SET_evaluationMainResourceLoading(false); this.SET_evaluationMainResourceLoading(false);
this.handleQuery()
this.editKeyList = []
this.$message({ type: "success", message: "保存成功" }); this.$message({ type: "success", message: "保存成功" });
}).catch(() => { }).catch(() => {
this.SET_evaluationSecondResourceLoading(false); this.SET_evaluationSecondResourceLoading(false);


Loading…
Cancel
Save