gaoluyang
4 天以前 41eba8fb2ffa59c1f640f40be00e9312f0bad4d5
fix(salesLedger): 已发货的销售订单禁止编辑

编辑按钮增加 isFh 判断,并在打开编辑弹窗时按产品发货状态兜底校验,
避免列表接口未返回 isFh 时已全部发货的订单仍可编辑。

Co-Authored-By: Claude Code <noreply@anthropic.com>
已修改1个文件
20 ■■■■■ 文件已修改
src/views/salesManagement/salesLedger/index.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue
@@ -273,7 +273,8 @@
              :disabled="
                !scope.row.isEdit ||
                scope.row.hasProductionRecord ||
                !canEditLedger(scope.row)
                !canEditLedger(scope.row) ||
                scope.row.isFh
              "
              >编辑
            </el-button>
@@ -1746,6 +1747,23 @@
    proxy.$modal.msgWarning("当前系统登录人不是维护人,不能编辑数据");
    return;
  }
  // 已发货的销售订单不允许编辑(列表接口未返回 isFh 时按产品发货状态兜底判断)
  if (type === "edit" && row) {
    let products =
      row.children && row.children.length > 0 ? row.children : null;
    if (!products) {
      try {
        const res = await productList({ salesLedgerId: row.id, type: 1 });
        products = res.data || [];
      } catch {
        products = [];
      }
    }
    if (hasShippedProducts(products)) {
      proxy.$modal.msgWarning("该销售订单已发货,不能编辑");
      return;
    }
  }
  operationType.value = type;
  form.value = {};
  productData.value = [];