| | |
| | | getProductInventory, |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import { getStockInventoryByModelId } from "@/api/inventoryManagement/stockInventory.js"; |
| | | import { getWasteByModelId } from "@/api/inventoryManagement/stockUninventory.js"; |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | | import dayjs from "dayjs"; |
| | |
| | | item => Number(item?.deliveryQuantity || 0) > 0 |
| | | ); |
| | | }; |
| | | const getDeliveryBatchNoList = async productModelId => { |
| | | const getDeliveryBatchNoList = async (productModelId, stockType) => { |
| | | if (!productModelId) return []; |
| | | const res = await getStockInventoryByModelId(productModelId); |
| | | const type = stockType === "waste" ? "waste" : "qualified"; |
| | | const res = |
| | | type === "waste" |
| | | ? await getWasteByModelId(productModelId) |
| | | : await getStockInventoryByModelId(productModelId); |
| | | const rawList = Array.isArray(res?.data) |
| | | ? res.data |
| | | : res?.data?.records || res?.data?.rows || []; |
| | |
| | | } |
| | | |
| | | currentDeliveryRow.value = row; |
| | | const ledgerRecord = findLedgerRecordByRow(row); |
| | | const stockType = ledgerRecord?.stockType || "qualified"; |
| | | const batchNoList = await getDeliveryBatchNoList( |
| | | row.productModelId || row.modelId |
| | | row.productModelId || row.modelId, |
| | | stockType |
| | | ); |
| | | deliveryForm.value = { |
| | | shippingCarNumber: "", |