Browse Source

修复保存错误

pull/90/head
xuxiaoming 3 years ago
parent
commit
09d705bfd6
1 changed files with 17 additions and 5 deletions
  1. +17
    -5
      src/views/productionPlanning/customerForecastDemandReview/demandPlanning/articleDemand/index.vue

+ 17
- 5
src/views/productionPlanning/customerForecastDemandReview/demandPlanning/articleDemand/index.vue View File

@ -195,6 +195,7 @@ export default {
"articleDemandLoading",
"artId",
"xAxis",
"articleDemandData",
"articleDemandHeight",
"showChar",
"selectArticleDemandRow",
@ -318,17 +319,27 @@ export default {
this.$message({ type: "error", message: "请先查询数据" });
return false
}
let maplist = JSON.parse(JSON.stringify(this.articleDemandData));
maplist.Item.forEach(item => {
item["AP_ArticleDemand-ArtId"] = item.key;
delete item.index;
delete item.show;
delete item.key;
delete item.Label;
});
exportData(this.getTableDataJson()).then(({ data = [] }) => {
exportData(JSON.stringify(maplist)).then(({ data = "" }) => {
console.log('%cindex.vue line:332 data', 'color: #007acc;', data);
let link = document.createElement('a');
link.style.display = 'none';
link.href = (process.env.VUE_APP_BASE_URL || "http://101.201.121.115:9003/") + data;
dataInfo = data.splice("/")
let dataInfo = data.split("/")
console.log('%cindex.vue line:336 dataInfo', 'color: #007acc;', dataInfo);
link.setAttribute('download', dataInfo[dataInfo.length - 1]);
document.body.appendChild(link);
link.click();
}).catch(() => {
this.$message({ type: "error", message: "导出失败" });
}).catch((e) => {
this.$message({ type: "error", message: "导出失败"+e });
});
},
//
@ -436,8 +447,9 @@ export default {
},
//
setSelectRow(row) {
this.SET_artId(row.artid)
if (row.Label == "净生产量") {
this.SET_artId(row.artid)
this.setRowStatus(row.key);
this.$emit("editTableData", row);
}


Loading…
Cancel
Save