gongchunyi
5 天以前 07996cb21a635fd19b1861017e302b8fc8c953d9
fix: 允许下发数量超出
已修改1个文件
13 ■■■■■ 文件已修改
src/views/productionPlan/productionPlan/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionPlan/productionPlan/index.vue
@@ -135,7 +135,6 @@
        <el-form-item label="生产数量">
          <el-input-number v-model="mergeForm.totalAssignedQuantity"
                           :min="0"
                           :max="sumAssignedQuantity"
                           @change="onBlur"
                           style="width: 100%" />
        </el-form-item>
@@ -432,8 +431,6 @@
            mergeForm.planCompleteTime = row.requiredDate || "";
            mergeForm.productId = row.productId || "";
            mergeForm.ids = [row.id];
            sumAssignedQuantity.value =
              Number(row.qtyRequired || 0) - Number(row.quantityIssued || 0);
            isShowNewModal.value = true;
          },
        },
@@ -723,7 +720,6 @@
  };
  // 拉取数据按钮操作
  const loadProdDataLoading = ref(false);
  const sumAssignedQuantity = ref(0);
  // 处理合并下发按钮点击
  const handleMerge = () => {
@@ -740,8 +736,6 @@
      return sum + Number(row.qtyRequired || 0) - Number(row.quantityIssued || 0);
    }, 0);  // 避免浮点数精度问题(如 37.800000000000004)
    const fixedTotal = Number(totalAssignedQuantity.toFixed(10));
    sumAssignedQuantity.value = fixedTotal;
    console.log(fixedTotal);
    // 设置表单数据
    mergeForm.productName = productName;
    mergeForm.model = firstRow.model || "";
@@ -766,13 +760,6 @@
  const handleMergeSubmit = () => {
    if (mergeForm.totalAssignedQuantity === 0) {
      ElMessage.warning("请输入生产数量");
      return;
    }
    console.log(sumAssignedQuantity.value, "sumAssignedQuantity");
    // 验证totalAssignedQuantity不能大于总方数
    if (mergeForm.totalAssignedQuantity > sumAssignedQuantity.value) {
      ElMessage.error("生产数量不能大于当前计算的总值");
      return;
    }