| | |
| | | prop="unQuantity" |
| | | width="100" /> |
| | | <el-table-column label="已退货数量" |
| | | prop="totalReturnNum" |
| | | width="100" /> |
| | | width="100"> |
| | | <template #default="scope"> |
| | | {{ calcAlreadyReturned(scope.row) }} |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="库存预警数量" prop="warnNum" width="120" /> --> |
| | | <!-- <el-table-column label="税率(%)" prop="taxRate" width="90" /> --> |
| | | <el-table-column |
| | |
| | | return num.toFixed(2); |
| | | }; |
| | | |
| | | /** 已退货数量 = 入库行总数量 − 当前可退货数量(剩余) */ |
| | | 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); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |