From 0a5a9346a5abf6631a74612aa7703d30d4a17ad8 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 24 六月 2026 13:24:16 +0800
Subject: [PATCH] 已领用并且被销售模块引用的公海客户不能回收或者编辑操作,已被销售模块引用的私海客户也不能编辑操作

---
 src/views/basicData/customerFile/index.vue |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 7091a02..c565a69 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -800,7 +800,12 @@
         {
           name: "缂栬緫",
           type: "text",
+          showHide: row => !isCustomerEditLocked(row),
           clickFun: row => {
+            if (isCustomerEditLocked(row)) {
+              proxy.$modal.msgWarning("宸茶閿�鍞ā鍧楀紩鐢ㄧ殑绉佹捣瀹㈡埛涓嶈兘缂栬緫");
+              return;
+            }
             openForm("edit", row);
           },
         },
@@ -1001,6 +1006,10 @@
   }
   // 鎵撳紑寮规
   const openForm = (type, row) => {
+    if (type === "edit" && isCustomerEditLocked(row)) {
+      proxy.$modal.msgWarning("宸茶閿�鍞ā鍧楀紩鐢ㄧ殑绉佹捣瀹㈡埛涓嶈兘缂栬緫");
+      return;
+    }
     operationType.value = type;
     form.value = {};
     form.value.maintainer = userStore.nickName;
@@ -1030,6 +1039,12 @@
     }
     dialogFormVisible.value = true;
   };
+  const isCustomerEditLocked = row => {
+    const salesReferenced = Number(row?.salesReferenceFlag || 0) === 1;
+    const customerType = Number(row?.type);
+    const usageStatus = Number(row?.usageStatus || 0);
+    return salesReferenced && (customerType === 0 || (customerType === 1 && usageStatus === 1));
+  };
   // 鎻愪氦琛ㄥ崟
   const submitForm = () => {
     proxy.$refs["formRef"].validate(valid => {

--
Gitblit v1.9.3