update:新增订单打包费和合计显示修改

This commit is contained in:
lihaoyuan 2025-12-11 10:46:04 +08:00
parent 3180a7d199
commit 30fa538c93

View File

@ -121,6 +121,14 @@
{{ detail.voucher_price }} {{ detail.voucher_price }}
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :offset="18" :span="3" style="text-align: right">
<span>{{ __('打包费:¥') }}</span>
</el-col>
<el-col :span="3">
{{ detail.packing_fee }}
</el-col>
</el-row>
<el-row> <el-row>
<el-col :offset="18" :span="3" style="text-align: right"> <el-col :offset="18" :span="3" style="text-align: right">
<span> <span>
@ -901,22 +909,24 @@
if (!data) return sums if (!data) return sums
columns.forEach((column, index) => { columns.forEach((column, index) => {
if (index === 1) { if (index === 0) {
sums[index] = '合计' sums[index] = '合计'
return return
} }
if (index === 6 || index === 5) { if (index === 7) {
const values = data.map((item) => Number(item[column.property])) // const values = data.map((item) => Number(item[column.property]))
if (!values.every((value) => isNaN(value))) { // if (!values.every((value) => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => { // sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) // const value = Number(curr)
if (!isNaN(value)) { // if (!isNaN(value)) {
return prev + curr // return prev + curr
} else { // } else {
return prev // return prev
} // }
}, 0) // }, 0)
} // }
sums[index] = this.detail.order_item_amount || 0;
return;
} }
}) })
return sums return sums