| | |
| | | <el-table-column label="数量" |
| | | prop="stockInNum" |
| | | width="100" /> |
| | | <el-table-column label="销售发货数量" |
| | | prop="saleOutQuantity" |
| | | width="120" /> |
| | | <el-table-column label="可退货数量" |
| | | prop="unQuantity" |
| | | width="130" /> |
| | | <el-table-column label="已退货数量" |
| | | width="130"> |
| | | <template #default="scope"> |
| | | {{ calcAlreadyReturned(scope.row) }} |
| | | {{ formattedNumber(scope.row, null, scope.row.totalReturnNum || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="退货数量" |
| | |
| | | const toNumber = (val) => { |
| | | const num = Number(val) |
| | | return Number.isNaN(num) ? 0 : num |
| | | } |
| | | |
| | | /** 已退货数量 = 入库行总数量 − 当前可退货数量(剩余) */ |
| | | const calcAlreadyReturned = (row) => { |
| | | const total = Number(row?.stockInNum ?? row?.totalQuantity ?? row?.quantity ?? 0) |
| | | const un = Number(row?.unQuantity ?? 0) |
| | | if (!Number.isFinite(total) || !Number.isFinite(un)) return 0 |
| | | return Math.max(total - un, 0) |
| | | } |
| | | |
| | | const getReturnTotal = (row) => { |