收敛前端金额表单命名

This commit is contained in:
yml
2026-06-09 20:59:50 +08:00
parent 60324765c5
commit 9cc959afc4
19 changed files with 103 additions and 232 deletions
@@ -51,17 +51,17 @@ const listingCode = computed(() =>
const handoffContent = ref('')
const checkoutForm = ref({
content: '',
consumable_amount: 0,
consumableAmountYuan: 0,
coin_consumed_m: 0,
other_amount: 0,
otherAmountYuan: 0,
evidenceText: '',
})
const resourceUsage = ref<Record<string, number>>({})
const counterForm = ref({
consumable_amount: 0,
consumableAmountYuan: 0,
coin_consumed_m: 0,
other_amount: 0,
deposit_deduct_amount: 0,
otherAmountYuan: 0,
depositDeductAmountYuan: 0,
reason: '',
evidenceText: '',
})
@@ -231,19 +231,19 @@ async function handleSubmitCheckout() {
returning.value = true
try {
const consumableAmount = resourceChargeAmount.value
checkoutForm.value.consumable_amount = consumableAmount
checkoutForm.value.consumableAmountYuan = consumableAmount
await submitCheckout(order.value.id, {
content: checkoutContentWithSummary(),
consumable_amount: consumableAmount,
consumableAmountYuan: consumableAmount,
coin_consumed_m: checkoutForm.value.coin_consumed_m,
other_amount: checkoutForm.value.other_amount,
otherAmountYuan: checkoutForm.value.otherAmountYuan,
evidence_urls: linesToList(checkoutForm.value.evidenceText),
})
checkoutForm.value = {
content: '',
consumable_amount: 0,
consumableAmountYuan: 0,
coin_consumed_m: 0,
other_amount: 0,
otherAmountYuan: 0,
evidenceText: '',
}
resourceUsage.value = {}
@@ -283,10 +283,10 @@ async function handleCounterCheckout() {
const reasonText = counterForm.value.reason.trim()
await counterCheckout(order.value.id, {
content: reasonText,
consumable_amount: counterForm.value.consumable_amount,
consumableAmountYuan: counterForm.value.consumableAmountYuan,
coin_consumed_m: counterForm.value.coin_consumed_m,
other_amount: counterForm.value.other_amount,
deposit_deduct_amount: counterForm.value.deposit_deduct_amount,
otherAmountYuan: counterForm.value.otherAmountYuan,
depositDeductAmountYuan: counterForm.value.depositDeductAmountYuan,
reason: reasonText,
evidence_urls: linesToList(counterForm.value.evidenceText),
})
@@ -592,10 +592,10 @@ function isRecord(value: unknown): value is Record<string, unknown> {
function hydrateCounterForm() {
if (!order.value?.checkout) return
const checkout = order.value.checkout
counterForm.value.consumable_amount = amountYuan(checkout.consumable_amount_cent)
counterForm.value.consumableAmountYuan = amountYuan(checkout.consumable_amount_cent)
counterForm.value.coin_consumed_m = checkout.coin_consumed_m
counterForm.value.other_amount = amountYuan(checkout.other_amount_cent)
counterForm.value.deposit_deduct_amount = amountYuan(checkout.deposit_deduct_amount_cent)
counterForm.value.otherAmountYuan = amountYuan(checkout.other_amount_cent)
counterForm.value.depositDeductAmountYuan = amountYuan(checkout.deposit_deduct_amount_cent)
}
function linesToList(value: string) {
@@ -882,7 +882,7 @@ async function copyListingCode() {
<template #input>
<div class="coin-input-wrap">
<input
v-model.number="checkoutForm.other_amount"
v-model.number="checkoutForm.otherAmountYuan"
type="number"
placeholder="不含上方额外物资"
class="custom-inline-input"
@@ -901,7 +901,7 @@ async function copyListingCode() {
</div>
<div>
<span>其他押金赔付</span>
<strong>¥{{ money(checkoutForm.other_amount) }}</strong>
<strong>¥{{ money(checkoutForm.otherAmountYuan) }}</strong>
<em>从押金赔付扣除</em>
</div>
</div>
@@ -1090,7 +1090,7 @@ async function copyListingCode() {
<van-field label="额外消耗品已用">
<template #input>
<input
v-model.number="counterForm.consumable_amount"
v-model.number="counterForm.consumableAmountYuan"
type="number"
class="custom-inline-input"
/>
@@ -1108,7 +1108,7 @@ async function copyListingCode() {
<van-field label="其他押金扣款">
<template #input>
<input
v-model.number="counterForm.other_amount"
v-model.number="counterForm.otherAmountYuan"
type="number"
class="custom-inline-input"
/>
@@ -1117,7 +1117,7 @@ async function copyListingCode() {
<van-field label="押金赔付扣除" required>
<template #input>
<input
v-model.number="counterForm.deposit_deduct_amount"
v-model.number="counterForm.depositDeductAmountYuan"
type="number"
class="custom-inline-input"
/>