|
|
@ -13,6 +13,8 @@ |
|
|
|
:Height="tableHeight+'px'" |
|
|
|
:TableData="tableData" |
|
|
|
@saveDemandData="saveDemandData" |
|
|
|
@refreshData="refreshData" |
|
|
|
@calcHandle="calcHandle" |
|
|
|
@calculateTableHeight="calculateTableHeight" |
|
|
|
/> |
|
|
|
<ArticleChar |
|
|
@ -28,7 +30,7 @@ |
|
|
|
</ContentContainer> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { getCustomerArticleDemand,saveDemand } from "@/server/productionPlanning/customerForecastDemandReview"; |
|
|
|
import { getCustomerArticleDemand,saveDemand,refreshData,changeMpsPlan } from "@/server/productionPlanning/customerForecastDemandReview"; |
|
|
|
// 物料需求表 |
|
|
|
import ArticleDemand from "./articleDemand"; |
|
|
|
// 物料需求图 |
|
|
@ -54,6 +56,11 @@ export default { |
|
|
|
type: String, |
|
|
|
default: "", |
|
|
|
}, |
|
|
|
// 资源ID |
|
|
|
resourceId:{ |
|
|
|
type: String, |
|
|
|
default:"" |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -88,6 +95,45 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
refreshData(data) { |
|
|
|
if(data) { |
|
|
|
this.apiData.forEach(item => { |
|
|
|
let key = "WK" + item['AP_ArticleDemand-DemandWeek'] |
|
|
|
item[this.keyLabelMap[data['-']]] = data[key] |
|
|
|
}) |
|
|
|
} |
|
|
|
refreshData(this.apiData).then( ( {data = []} )=> { |
|
|
|
this.tableData = []; |
|
|
|
this.headers = []; |
|
|
|
this.dealData(data); |
|
|
|
this.$message({ |
|
|
|
type:"success", |
|
|
|
message: "刷新成功" |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
this.$message({ |
|
|
|
type:"error", |
|
|
|
message: "刷新失败" |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
calcHandle(obj){ |
|
|
|
console.log('%cindex.vue line:121 obj', 'color: #007acc;', obj); |
|
|
|
let data = obj.data |
|
|
|
if(data) { |
|
|
|
this.apiData.forEach(item => { |
|
|
|
let key = "WK" + item['AP_ArticleDemand-DemandWeek'] |
|
|
|
item[this.keyLabelMap[data['-']]] = data[key] |
|
|
|
}) |
|
|
|
} |
|
|
|
this.$emit("calcHandle",{ |
|
|
|
mpstype : obj.mode, |
|
|
|
demandlistdata : JSON.stringify({"ArticleDemandLst":this.apiData}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
saveDemandData(data){ |
|
|
|
this.apiData.forEach(item => { |
|
|
|
let key = "WK" + item['AP_ArticleDemand-DemandWeek'] |
|
|
@ -103,7 +149,6 @@ export default { |
|
|
|
type:"error", |
|
|
|
message: "保存失败" |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
handlePublic(){ |
|
|
@ -116,7 +161,7 @@ export default { |
|
|
|
// 获取获得数据 |
|
|
|
getDataList(customerId, artId) { |
|
|
|
this.loading = true; |
|
|
|
// 用于测试数据 |
|
|
|
|
|
|
|
this.articleLoading = true; |
|
|
|
getCustomerArticleDemand(customerId, artId) |
|
|
|
.then(({ data = [] }) => { |
|
|
|