diff --git a/src/views/modules/quote/detail/primary/quoteDetailBom.vue b/src/views/modules/quote/detail/primary/quoteDetailBom.vue index 8dd3852..f282166 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailBom.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailBom.vue @@ -588,8 +588,31 @@ export default { json += "}" return eval("(" + json + ")") }, + formatCostValue(value) { + return Number.isFinite(value) ? value.toFixed(6) : '' + }, + getCalcUnitCost(row) { + let qtyPerAssembly = Number(row.qtyPerAssembly) + let unitPrice = Number(row.unitPrice) + return this.formatCostValue(qtyPerAssembly * unitPrice) + }, + getCalcSetupCost(row) { + let quoteQty = Number(this.quoteDetail.qty) + if (!quoteQty) { + return '' + } + let componentScrap = Number(row.componentScrap) + let unitPrice = Number(row.unitPrice) + return this.formatCostValue(componentScrap * unitPrice / quoteQty) + }, createExportData() { - return this.dataList; + return this.dataList.map(item => { + return { + ...item, + calcUnitCost: this.getCalcUnitCost(item), + calcSetupCost: this.getCalcSetupCost(item), + } + }); }, startDownload() { this.exportLoading = true @@ -667,10 +690,10 @@ export default { {{ scope.row[item.columnProp] }}