| | |
| | | prop="unit" |
| | | width="70" /> |
| | | <el-table-column label="待入库数量" |
| | | prop="availableQuality" |
| | | prop="pendingInboundQuantity" |
| | | width="100" /> |
| | | <el-table-column label="本次入库数量" |
| | | width="130"> |
| | |
| | | <el-input-number v-model="scope.row.inboundQuantity" |
| | | :step="0.01" |
| | | :min="0" |
| | | :max="scope.row.availableQuality" |
| | | :max="scope.row.pendingInboundQuantity" |
| | | @change="handleInboundChange(scope.row)" |
| | | controls-position="right" |
| | | style="width: 100%" /> |
| | |
| | | batchGeneratePurchaseInboundSteps, |
| | | manualStockIn, |
| | | } from "@/api/procurementManagement/procurementLedger.js"; |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import dayjs from "dayjs"; |
| | | import FileUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | | const FileList = defineAsyncComponent(() => |
| | | import("@/components/Dialog/FileList.vue") |
| | |
| | | }); |
| | | const total = ref(0); |
| | | const fileList = ref([]); |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import dayjs from "dayjs"; |
| | | import FileUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | | |
| | | // 订单审批状态显示文本 |
| | | const approvalStatusText = { |
| | |
| | | proxy.$modal.loading("正在加载产品信息..."); |
| | | const res = await productList({ salesLedgerId: row.id, type: 2 }); |
| | | if (res.code === 200) { |
| | | // 过滤掉已经完全入库的产品(如果有这个状态的话,或者直接显示所有可用数量大于0的产品) |
| | | stockInForm.details = (res.data || []) |
| | | .filter(item => (item.availableQuality || 0) > 0) |
| | | .map(item => ({ |
| | | const productDetails = (res.data || []).map(item => { |
| | | const pendingInboundQuantity = Number(item.pendingInboundQuantity || 0); |
| | | return { |
| | | ...item, |
| | | inboundQuantity: item.availableQuality || 0, // 默认入库全部可用数量 |
| | | pendingInboundQuantity, |
| | | inboundQuantity: pendingInboundQuantity, // 默认入库全部待入库数量 |
| | | isContainsWater: false, |
| | | waterContent: 0, |
| | | actualInboundQuantity: item.availableQuality || 0, |
| | | })); |
| | | actualInboundQuantity: pendingInboundQuantity, |
| | | }; |
| | | }); |
| | | |
| | | // 过滤掉已经完全入库的产品 |
| | | stockInForm.details = productDetails.filter( |
| | | item => (item.pendingInboundQuantity || 0) > 0 |
| | | ); |
| | | |
| | | if (stockInForm.details.length === 0) { |
| | | proxy.$modal.msgWarning("该合同下没有可入库的产品记录"); |
| | |
| | | } |
| | | |
| | | const overLimit = stockInForm.details.some( |
| | | item => item.inboundQuantity > item.availableQuality |
| | | item => item.inboundQuantity > item.pendingInboundQuantity |
| | | ); |
| | | if (overLimit) { |
| | | proxy.$modal.msgWarning("入库数量不能超过可用数量"); |
| | | proxy.$modal.msgWarning("入库数量不能超过待入库数量"); |
| | | return; |
| | | } |
| | | |