This commit is contained in:
Leo
2025-11-21 23:26:33 +08:00
parent bea1e46deb
commit d3a9f5039a

View File

@@ -1329,29 +1329,25 @@ export default {
// 数量固定为1 // 数量固定为1
const quantity = '1' const quantity = '1'
// 姓名(下单人)
const buyer = row.buyer || ''
// 地址 // 地址
const address = row.address || '' const address = row.address || ''
// 售价(京粉实际价格,如果没有则用付款金额-后返金额 // 姓名(从地址中提取,地址格式通常是"姓名 电话 详细地址"
let sellingPrice = row.jingfenActualPrice let buyer = ''
if (!sellingPrice || sellingPrice === 0) { if (address) {
const payment = row.paymentAmount || 0 // 提取地址中的第一个词作为姓名
const rebate = row.rebateAmount || 0 const addressParts = address.trim().split(/\s+/)
sellingPrice = payment - rebate if (addressParts.length > 0) {
buyer = addressParts[0]
}
} }
const sellingPriceStr = (sellingPrice && sellingPrice > 0)
? sellingPrice.toFixed(2) : ''
// 成本(售价 - 利润,利润是后返金额 // 售价固定为0
const sellingPriceStr = '0'
// 成本(售价 - 利润售价是0
const rebate = row.rebateAmount || 0 const rebate = row.rebateAmount || 0
let cost = null const costStr = '' // 售价是0成本也设为空
if (sellingPrice && sellingPrice > 0 && rebate > 0) {
cost = sellingPrice - rebate
}
const costStr = (cost && cost > 0) ? cost.toFixed(2) : ''
// 利润(后返金额) // 利润(后返金额)
const profitStr = (rebate > 0) ? rebate.toFixed(2) : '' const profitStr = (rebate > 0) ? rebate.toFixed(2) : ''