1
This commit is contained in:
@@ -1581,6 +1581,16 @@ export default {
|
|||||||
if (Number.isNaN(num)) return n
|
if (Number.isNaN(num)) return n
|
||||||
return num.toFixed(2)
|
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) {
|
persistOrderRow(row, successMsg) {
|
||||||
return updateJDOrder(row)
|
return updateJDOrder(row)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -2334,7 +2344,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sellingPriceStr = row.sellingPrice != null && row.sellingPrice !== '' ? Number(row.sellingPrice).toFixed(2) : '0'
|
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) : ''
|
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 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) : ''
|
const profitStr = row.profit != null && row.profit !== '' ? Number(row.profit).toFixed(2) : ''
|
||||||
|
|
||||||
// 京东单号
|
// 京东单号
|
||||||
|
|||||||
Reference in New Issue
Block a user