统一结账押金字段为押金赔付扣除
号主修正去掉无效的其他押金扣款,仅保留押金赔付扣除; 前后端与账单文案统一,修正时 other 与 deduct 对齐。
This commit is contained in:
@@ -821,7 +821,7 @@ function paymentPaidAt(record: AdminPayment) {
|
||||
<dd>{{ moneyCent(order.checkout.owner_income_amount_cent) }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>押金扣除</dt>
|
||||
<dt>押金赔付扣除</dt>
|
||||
<dd>{{ moneyCent(order.checkout.deposit_deduct_amount_cent) }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -107,7 +107,7 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event:
|
||||
订单快照 {{ quantity(props.snapshotHafCoinM) }}M,预计剩余
|
||||
{{ quantity(props.remainingHafCoinM) }}M
|
||||
</div>
|
||||
<van-field label="其他押金赔付" label-width="100px">
|
||||
<van-field label="押金赔付扣除" label-width="100px">
|
||||
<template #input>
|
||||
<div class="coin-input-wrap">
|
||||
<input
|
||||
@@ -131,9 +131,9 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event:
|
||||
<em>计入实际结算租金</em>
|
||||
</div>
|
||||
<div>
|
||||
<span>其他押金赔付</span>
|
||||
<span>押金赔付扣除</span>
|
||||
<strong>¥{{ money(props.checkoutForm.otherAmountYuan) }}</strong>
|
||||
<em>从押金赔付扣除</em>
|
||||
<em>从预收押金中扣除</em>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -225,7 +225,7 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event:
|
||||
<div class="checkout-number-card deposit">
|
||||
<div class="checkout-number-copy">
|
||||
<div class="checkout-number-title">
|
||||
<strong>其他押金赔付</strong>
|
||||
<strong>押金赔付扣除</strong>
|
||||
<span>仅押金扣除项</span>
|
||||
</div>
|
||||
<p>封禁、违规、资产损坏等需要从押金赔付的费用,不含额外消耗品。</p>
|
||||
@@ -250,9 +250,9 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event:
|
||||
<em>按上方物资数量自动计算,计入实际结算租金</em>
|
||||
</div>
|
||||
<div>
|
||||
<span>其他押金赔付</span>
|
||||
<span>押金赔付扣除</span>
|
||||
<strong>¥{{ money(props.checkoutForm.otherAmountYuan) }}</strong>
|
||||
<em>作为押金赔付扣除,和额外消耗品分开展示</em>
|
||||
<em>从预收押金中扣除,与额外消耗品分开展示</em>
|
||||
</div>
|
||||
</div>
|
||||
<el-input
|
||||
|
||||
@@ -92,7 +92,6 @@ export interface CheckoutFormState {
|
||||
export interface CounterFormState {
|
||||
consumableAmountYuan: number
|
||||
coin_consumed_m: number
|
||||
otherAmountYuan: number
|
||||
depositDeductAmountYuan: number
|
||||
reason: string
|
||||
evidenceText: string
|
||||
@@ -112,7 +111,6 @@ function createCounterForm(): CounterFormState {
|
||||
return {
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
otherAmountYuan: 0,
|
||||
depositDeductAmountYuan: 0,
|
||||
reason: '',
|
||||
evidenceText: '',
|
||||
@@ -395,7 +393,8 @@ export function useOrderActions(options: UseOrderActionsOptions) {
|
||||
content: reasonText,
|
||||
consumableAmountYuan: counterForm.value.consumableAmountYuan,
|
||||
coin_consumed_m: counterForm.value.coin_consumed_m,
|
||||
otherAmountYuan: counterForm.value.otherAmountYuan,
|
||||
// 号主修正只保留「押金赔付扣除」;与 other 同步写入,兼容旧字段语义
|
||||
otherAmountYuan: counterForm.value.depositDeductAmountYuan,
|
||||
depositDeductAmountYuan: counterForm.value.depositDeductAmountYuan,
|
||||
reason: reasonText,
|
||||
evidence_urls: linesToList(counterForm.value.evidenceText),
|
||||
|
||||
@@ -11,7 +11,6 @@ export interface CheckoutFormSnapshot {
|
||||
export interface CounterFormSnapshot {
|
||||
consumableAmountYuan: number
|
||||
coin_consumed_m: number
|
||||
otherAmountYuan: number
|
||||
depositDeductAmountYuan: number
|
||||
reason: string
|
||||
evidenceText: string
|
||||
@@ -181,11 +180,16 @@ export function buildCheckoutContentWithSummary(options: {
|
||||
}
|
||||
|
||||
export function hydrateCounterFormFromCheckout(checkout: Checkout): CounterFormSnapshot {
|
||||
// 号主修正只暴露押金赔付扣除;优先用结算字段,兼容旧单 only other 的情况
|
||||
const depositDeductYuan = amountYuan(
|
||||
checkout.deposit_deduct_amount_cent > 0
|
||||
? checkout.deposit_deduct_amount_cent
|
||||
: checkout.other_amount_cent
|
||||
)
|
||||
return {
|
||||
consumableAmountYuan: amountYuan(checkout.consumable_amount_cent),
|
||||
coin_consumed_m: checkout.coin_consumed_m,
|
||||
otherAmountYuan: amountYuan(checkout.other_amount_cent),
|
||||
depositDeductAmountYuan: amountYuan(checkout.deposit_deduct_amount_cent),
|
||||
depositDeductAmountYuan: depositDeductYuan,
|
||||
reason: '',
|
||||
evidenceText: '',
|
||||
}
|
||||
@@ -193,16 +197,9 @@ export function hydrateCounterFormFromCheckout(checkout: Checkout): CounterFormS
|
||||
|
||||
export function calculateCounterTotal(counterForm: {
|
||||
consumableAmountYuan: number
|
||||
coin_consumed_m: number
|
||||
otherAmountYuan: number
|
||||
depositDeductAmountYuan: number
|
||||
}) {
|
||||
return roundMoney(
|
||||
counterForm.consumableAmountYuan +
|
||||
counterForm.coin_consumed_m +
|
||||
counterForm.otherAmountYuan +
|
||||
counterForm.depositDeductAmountYuan
|
||||
)
|
||||
return roundMoney(counterForm.consumableAmountYuan + counterForm.depositDeductAmountYuan)
|
||||
}
|
||||
|
||||
export function getSnapshotHafCoinM(order: Order | null) {
|
||||
|
||||
@@ -465,15 +465,6 @@ async function copyListingCode() {
|
||||
/>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field label="其他押金扣款">
|
||||
<template #input>
|
||||
<input
|
||||
v-model.number="counterForm.otherAmountYuan"
|
||||
type="number"
|
||||
class="custom-inline-input"
|
||||
/>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field label="押金赔付扣除" required>
|
||||
<template #input>
|
||||
<input
|
||||
|
||||
@@ -508,16 +508,7 @@ watch([() => route.query.focus, order, loading], () => {
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="其他押金扣款(元)">
|
||||
<el-input-number
|
||||
v-model="counterForm.otherAmountYuan"
|
||||
class="full-control"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="押金扣除(元)">
|
||||
<el-form-item label="押金赔付扣除(元)">
|
||||
<el-input-number
|
||||
v-model="counterForm.depositDeductAmountYuan"
|
||||
class="full-control"
|
||||
|
||||
Reference in New Issue
Block a user