| | |
| | | item.operateQuantity = String(Math.max(0, n)); |
| | | }; |
| | | |
| | | const hasEditableInboundItems = computed(() => { |
| | | if (!recordList.value?.length) return false; |
| | | return recordList.value.some(item => !isFullyStocked(item)); |
| | | }); |
| | | |
| | | const formatCell = (item, row, idx) => { |
| | | if (row.key === "index") { |
| | | const v = item.index; |
| | |
| | | modal.msgError("缺少订单信息,请重新扫码"); |
| | | return; |
| | | } |
| | | if (!hasEditableInboundItems.value) { |
| | | modal.msgError("该产品已经全部入库"); |
| | | return; |
| | | } |
| | | const salesLedgerProductList = buildSalesLedgerProductList(recordList.value); |
| | | if (!hasAnyPositiveStockedQty(salesLedgerProductList)) { |
| | | modal.msgError("请至少填写一行大于 0 的入库数量"); |
| | |
| | | return; |
| | | } |
| | | const runApi = currentSubmitConfig.runApi; |
| | | const inboundApproveUserIds = stockApproverNodes.value.map(node => node.userId).join(","); |
| | | const approveUserIds = stockApproverNodes.value.map(node => node.userId).join(","); |
| | | const payload = currentSubmitConfig.payloadBuilder( |
| | | salesLedgerProductList, |
| | | inboundApproveUserIds |
| | | approveUserIds |
| | | ); |
| | | try { |
| | | submitLoading.value = true; |