张诺
5 小时以前 278cfc7b1d36ce98ad62749ec816d60aa09173ea
fix(workOrder): 修复生产数量验证和表单初始化问题

- 添加待生产数量验证,防止生产数量超过计划数量
- 修正表单中quantity字段的初始化逻辑
- 优化报告对话框中的数据绑定流程
- 添加数量超限时的警告提示功能
- 确保表单数据与实际计划数量保持一致
已修改1个文件
10 ■■■■■ 文件已修改
src/views/productionManagement/workOrder/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/index.vue
@@ -1184,6 +1184,12 @@
  if (isNaN(num)) {
    return;
  }
  // 如果超过待生产数量
  if (num > reportForm.planQuantity) {
    proxy.$modal.msgWarning("本次生产数量不能大于待生产数量");
    reportForm.quantity = reportForm.planQuantity;
    return;
  }
  // 如果小于1,清除
  if (num < 1) {
    reportForm.quantity = null;
@@ -1378,13 +1384,15 @@
};
const showReportDialog = row => {
  currentReportRowData.value = row;
  reportForm.planQuantity = row.planQuantity - row.completeQuantity;
  reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
  reportForm.quantity = row.planQuantity !== undefined && row.planQuantity !== null ? row.planQuantity : null;
  reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
  reportForm.workOrderId = row.id;
  reportForm.reportWork = row.reportWork;
  reportForm.productMainId = row.productMainId;
  reportForm.planQuantity = row.planQuantity;
  reportForm.startTime = "";
  reportForm.endTime = "";
  reportForm.replenishQty = 0;