| | |
| | | |
| | | </view> |
| | | |
| | | <view |
| | | |
| | | <view v-if="!isFullyOutbound(item)" |
| | | class="stocked-qty-block"> |
| | | |
| | | <view class="kv-row stocked-qty-row"> |
| | |
| | | |
| | | }; |
| | | |
| | | const parseUnqualifiedInboundQty = item => { |
| | | return ( |
| | | parseOptionalNumber( |
| | | item?.unqualifiedStockedQuantity ?? |
| | | item?.unQualifiedStockedQuantity ?? |
| | | item?.unqualifiedStockedQty ?? |
| | | item?.unqualifiedInboundQuantity |
| | | ) ?? 0 |
| | | ); |
| | | }; |
| | | |
| | | const parseUnqualifiedOutboundQty = item => { |
| | | return ( |
| | | parseOptionalNumber( |
| | | item?.unqualifiedShippedQuantity ?? |
| | | item?.unQualifiedShippedQuantity ?? |
| | | item?.unqualifiedShippedQty ?? |
| | | item?.unqualifiedOutboundQuantity |
| | | ) ?? 0 |
| | | ); |
| | | }; |
| | | |
| | | const isFullyOutbound = item => { |
| | | if (type.value === QUALITY_TYPE.unqualified) { |
| | | return parseUnqualifiedInboundQty(item) - parseUnqualifiedOutboundQty(item) <= 0; |
| | | } |
| | | const remaining = parseOptionalNumber(item?.remainingShippedQuantity); |
| | | if (remaining !== null) return remaining <= 0; |
| | | const fallback = parseOptionalNumber(defaultStockedQuantityFromRow(item, "outbound")); |
| | | return fallback !== null ? fallback <= 0 : false; |
| | | }; |
| | | |
| | | const hasEditableOutboundItems = computed(() => { |
| | | if (!recordList.value?.length) return false; |
| | | return recordList.value.some(item => !isFullyOutbound(item)); |
| | | }); |
| | | |
| | | |
| | | |
| | | const formatCell = (item, row, idx) => { |
| | |
| | | return; |
| | | |
| | | } |
| | | if (!hasEditableOutboundItems.value) { |
| | | modal.msgError("该产品已经全部出库"); |
| | | return; |
| | | } |
| | | |
| | | const salesLedgerProductList = buildSalesLedgerProductList(recordList.value); |
| | | |