| | |
| | | form.value.ccUserName = ""; |
| | | |
| | | // 将库存不足的产品填充到表格 |
| | | // 兼容领料和补料的数据结构 |
| | | tableData.value = props.insufficientItems.map((item) => ({ |
| | | tempId: generateTempId(), |
| | | productModelId: item.materialModelId, |
| | | productName: item.materialName, |
| | | model: item.materialModel, |
| | | productModelId: item.materialModelId || item.productModelId, |
| | | productName: item.materialName || item.productName, |
| | | model: item.materialModel || item.model, |
| | | unit: item.unit, |
| | | quantity: Math.max(1, Math.ceil((item.demandedQuantity || 0) - (item.stockQuantity || 0))), |
| | | })); |