预估退税 添加 自定义输入 重新计算利润
This commit is contained in:
@@ -1385,6 +1385,21 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
// 当用户手动输入预估退税额时,重新计算利润
|
||||
watch(
|
||||
() => items.value.map((item: any) => item.tax_refund),
|
||||
() => {
|
||||
if (isPopulating.value) return
|
||||
items.value.forEach((it: any, index: number) => {
|
||||
if (!items.value[index]) return
|
||||
const profit = calcProfit(it)
|
||||
items.value[index].profit = isNaN(profit) ? 0 : Number(profit.toFixed(2))
|
||||
;(items.value[index] as any).profit_currency = (it as any).profit_currency || 'CNY'
|
||||
})
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
// 处理用户编辑状态的方法
|
||||
const handleUserEdit = (index: number) => {
|
||||
// 标记用户正在编辑这一行
|
||||
|
||||
@@ -455,8 +455,8 @@
|
||||
</ElCol>
|
||||
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
|
||||
<ElFormItem label="预估退税额" label-width="85px">
|
||||
<ElInput
|
||||
v-model="item.tax_refund"
|
||||
<ElInput
|
||||
v-model="item.tax_refund"
|
||||
placeholder="正在计算预估退税额"
|
||||
@input="handleUserEdit(idx)"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user