| | |
| | | tableData.value = res.data.records; |
| | | tableData.value.map((item) => { |
| | | item.children = []; |
| | | // 前端计算总价 |
| | | const inboundNum = Number(item.inboundNum) || 0; |
| | | if (activeTab.value === 'production') { |
| | | // 成品出库:总价 = unitPrice × inboundNum |
| | | const unitPrice = Number(item.unitPrice) || 0; |
| | | item.totalPrice = (unitPrice * inboundNum).toFixed(2); |
| | | } else { |
| | | // 原料和材料出库:总价 = taxInclusiveUnitPrice × inboundNum |
| | | const taxInclusiveUnitPrice = Number(item.taxInclusiveUnitPrice) || 0; |
| | | item.taxInclusiveTotalPrice = (taxInclusiveUnitPrice * inboundNum).toFixed(2); |
| | | } |
| | | }); |
| | | total.value = res.data.total; |
| | | }) |
| | |
| | | } |
| | | } |
| | | </style> |
| | | |
| | | |