This commit is contained in:
van
2026-05-16 22:04:03 +08:00
parent 0c16afd4d7
commit e0b9226ebb

View File

@@ -442,6 +442,21 @@
/>
</div>
</div>
<div class="field-row field-row--pricing">
<span class="field-label">额外成本</span>
<div class="field-value field-value--pricing-control">
<el-input-number
v-model="row.extraCost"
:min="0"
:step="1"
:precision="2"
size="small"
controls-position="right"
class="mobile-pricing-input"
@change="onOrderExtraCostChange(row)"
/>
</div>
</div>
<div class="field-row field-row--pricing" v-if="isFanDistributionMark(row.distributionMark)">
<span class="field-label">售价渠道</span>
<span class="field-value field-value--pricing-control">
@@ -700,6 +715,13 @@
<span v-else>{{ scope.row.sellingPrice != null ? toYuan(scope.row.sellingPrice) : '' }}</span>
</template>
</el-table-column>
<el-table-column label="额外成本" prop="extraCost" min-width="112" align="right" class-name="jd-col-money jd-col-money--extra-cost">
<template slot-scope="scope">
<div class="jd-cell-stretch jd-cell-stretch--num">
<el-input-number v-model="scope.row.extraCost" :min="0" :step="1" :precision="2" size="mini" controls-position="right" class="jd-order-input-money jd-order-input-money--rebate" @change="onOrderExtraCostChange(scope.row)" />
</div>
</template>
</el-table-column>
<el-table-column label="利润" prop="profit" min-width="118" align="right" class-name="jd-col-money jd-col-money--profit">
<template slot-scope="scope">
<template v-if="isFanDistributionMark(scope.row.distributionMark) || scope.row.distributionMark === 'H-TF'">
@@ -1693,7 +1715,8 @@ export default {
isInvoiceOpened: item.isInvoiceOpened != null ? item.isInvoiceOpened : 0,
isReviewPosted: item.isReviewPosted != null ? item.isReviewPosted : 0,
sellingPriceManual: item.sellingPriceManual != null ? item.sellingPriceManual : 0,
profitManual: item.profitManual != null ? item.profitManual : 0
profitManual: item.profitManual != null ? item.profitManual : 0,
extraCost: item.extraCost != null ? Number(item.extraCost) : 0
}
},
assignListFromResponse(res) {
@@ -1997,7 +2020,7 @@ export default {
if (Number.isNaN(num)) return n
return num.toFixed(2)
},
/** 录单 Excel成本 = 下单付款 - 后返(与后台利润口径一致) */
/** 录单 Excel成本 = 下单付款 后返 + 额外成本(与后台自动利润口径一致) */
formatExcelCost(row) {
if (!row) return ''
const hasPay = row.paymentAmount != null && row.paymentAmount !== ''
@@ -2005,7 +2028,8 @@ export default {
if (!hasPay && !hasReb) return ''
const pay = hasPay ? Number(row.paymentAmount) : 0
const reb = hasReb ? Number(row.rebateAmount) : 0
return (pay - reb).toFixed(2)
const extra = row.extraCost != null && row.extraCost !== '' ? Number(row.extraCost) : 0
return (pay - reb + extra).toFixed(2)
},
/** 保存后拉取单条,展示服务端重算后的利润/售价 */
patchOrderRowFromServer(id) {
@@ -2092,6 +2116,11 @@ export default {
row.profitManual = 0
this.persistOrderRow(row)
},
/** 额外成本变更:解除利润手填并按规则重算 */
onOrderExtraCostChange(row) {
row.profitManual = 0
this.persistOrderRow(row)
},
onOrderSellingPriceChange(row) {
row.sellingPriceManual = 1
row.profitManual = 0