src/views/productionManagement/productionOrder/New.vue
@@ -426,7 +426,8 @@
    const items = res.data || [];
    processRouteItemsOptions.value = items;
    
    // 自动添加工序
    // 自动添加工序,计划数使用基本信息的需求数量
    const demandQty = formState.value.quantity || 1;
    processRouteItems.value = items.map(item => ({
      processId: item.processId,
      processName: item.processName,
@@ -434,7 +435,7 @@
      userPower: item.userPower ? item.userPower.split(',') : [],
      planStartTime: "",
      planEndTime: "",
      planNum: 1,
      planNum: demandQty,
      isQuality: item.isQuality || false,
    }));
  });
@@ -496,13 +497,20 @@
  }
}, { deep: true });
// 监听需求数量变化,重新计算物料需求数量
// 监听需求数量变化,重新计算物料需求数量和工序计划数
watch(() => formState.value.quantity, (newQty) => {
  // 更新物料清单的需求数量
  if (productStructureRecords.value.length > 0 && newQty) {
    productStructureRecords.value.forEach(item => {
      item.demandedQuantity = (item.unitQuantity || 1) * newQty;
    });
  }
  // 更新工序的计划数
  if (processRouteItems.value.length > 0 && newQty) {
    processRouteItems.value.forEach(item => {
      item.planNum = newQty;
    });
  }
});
// 单位产出需要数量变化处理