| | |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | // 将未入库金额并入已入库金额,未入库金额置0 |
| | | const mergeUnshippedAmount = row => { |
| | | if (row && row.unshippedAmount) { |
| | | row.shippedAmount = (Number(row.shippedAmount) || 0) + (Number(row.unshippedAmount) || 0); |
| | | row.unshippedAmount = 0; |
| | | } |
| | | return row; |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | paymentLedgerList({ |
| | |
| | | }).then(res => { |
| | | let result = res.data; |
| | | tableLoading.value = false; |
| | | tableData.value = result.records || []; |
| | | tableData.value = (result.records || []).map(mergeUnshippedAmount); |
| | | total.value = result.total || 0; |
| | | if (tableData.value.length > 0) { |
| | | currentSupplierId.value = tableData.value[0].supplierId; |
| | |
| | | tableLoadingSon.value = false; |
| | | let result = res.data; |
| | | if (Array.isArray(result)) { |
| | | tableDataSon.value = result; |
| | | tableDataSon.value = result.map(mergeUnshippedAmount); |
| | | sonPage.total = result.length; |
| | | handlePagination({ page: sonPage.current, limit: sonPage.size }); |
| | | } else { |
| | | originalTableDataSon.value = result.records || []; |
| | | originalTableDataSon.value = (result.records || []).map(mergeUnshippedAmount); |
| | | sonPage.total = result.total || 0; |
| | | } |
| | | }) |