diff --git a/src/views/system/jdorder/orderList.vue b/src/views/system/jdorder/orderList.vue index f93a14e..777a446 100644 --- a/src/views/system/jdorder/orderList.vue +++ b/src/views/system/jdorder/orderList.vue @@ -1581,6 +1581,16 @@ export default { if (Number.isNaN(num)) return n return num.toFixed(2) }, + /** 录单 Excel:成本 = 下单付款 - 后返(与后台利润口径一致) */ + formatExcelCost(row) { + if (!row) return '' + const hasPay = row.paymentAmount != null && row.paymentAmount !== '' + const hasReb = row.rebateAmount != null && row.rebateAmount !== '' + if (!hasPay && !hasReb) return '' + const pay = hasPay ? Number(row.paymentAmount) : 0 + const reb = hasReb ? Number(row.rebateAmount) : 0 + return (pay - reb).toFixed(2) + }, persistOrderRow(row, successMsg) { return updateJDOrder(row) .then(() => { @@ -2334,7 +2344,7 @@ export default { } const sellingPriceStr = row.sellingPrice != null && row.sellingPrice !== '' ? Number(row.sellingPrice).toFixed(2) : '0' - const costStr = '' + const costStr = this.formatExcelCost(row) const profitStr = row.profit != null && row.profit !== '' ? Number(row.profit).toFixed(2) : '' // 京东单号 @@ -2605,7 +2615,7 @@ export default { } const sellingPriceStr = row.sellingPrice != null && row.sellingPrice !== '' ? Number(row.sellingPrice).toFixed(2) : '0' - const costStr = '' + const costStr = this.formatExcelCost(row) const profitStr = row.profit != null && row.profit !== '' ? Number(row.profit).toFixed(2) : '' // 京东单号