From 6b3732b8c43165342b7521b1e3ea788e471d58e8 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 19 六月 2023 20:19:31 +0800
Subject: [PATCH] Merge branch '2.6.8' into wvp-28181-2.0

---
 web_src/src/components/dialog/catalogEdit.vue |   44 +++++++++++++++++++++++++++-----------------
 1 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/web_src/src/components/dialog/catalogEdit.vue b/web_src/src/components/dialog/catalogEdit.vue
index e1cd8d2..e2fe59b 100644
--- a/web_src/src/components/dialog/catalogEdit.vue
+++ b/web_src/src/components/dialog/catalogEdit.vue
@@ -46,12 +46,11 @@
 export default {
   name: "catalogEdit",
   computed: {},
-  props: ['platformId'],
+  props: ['platformId', 'platformDeviceId'],
   created() {},
   data() {
     let checkId = (rule, value, callback) => {
       console.log("checkId")
-      console.log(this.treeType)
       console.log(rule)
       console.log(value)
       console.log(value.length)
@@ -59,21 +58,34 @@
       if (!value) {
         return callback(new Error('缂栧彿涓嶈兘涓虹┖'));
       }
-      if (this.treeType === "BusinessGroup" && value.length !== 20) {
-        return callback(new Error('缂栧彿蹇呴』鐢�20浣嶆暟瀛楃粍鎴�'));
-      }
-      if (this.treeType === "CivilCode" && value.length <= 8 && value.length%2 !== 0) {
-        return callback(new Error('琛屾斂鍖哄垝蹇呴』鏄叓浣嶄互涓嬬殑鍋舵暟涓暟瀛楃粍鎴�'));
-      }
-      if (this.treeType === "BusinessGroup") {
+      if (value.trim().length <= 8) {
+        if (value.trim().length%2 !== 0) {
+          return callback(new Error('琛屾斂鍖哄垝缂栧彿蹇呴』涓�2/4/6/8浣�'));
+        }
+        if (this.form.parentId !== this.platformDeviceId && this.form.parentId.length >= value.trim().length) {
+          return callback(new Error('琛屾斂鍖哄垝缂栧彿闀垮害搴旇姣忔涓や綅閫掑'));
+        }
+      }else {
+        if (value.trim().length !== 20) {
+          return callback(new Error('缂栧彿蹇呴』涓�2/4/6/8浣嶇殑琛屾斂鍖哄垝鎴�20浣嶇殑铏氭嫙缁勭粐/涓氬姟鍒嗙粍'));
+        }
         let catalogType = value.substring(10, 13);
         console.log(catalogType)
-        // 216 涓鸿櫄鎷熺粍缁� 215 涓轰笟鍔″垎缁勶紱鐩綍绗竴绾у繀椤讳负涓氬姟鍒嗙粍锛� 涓氬姟鍒嗙粍涓嬩负铏氭嫙缁勭粐锛岃櫄鎷熺粍缁囦笅鍙互鏈夊叾浠栬櫄鎷熺粍缁�
-        if (this.level === 1 && catalogType !== "215") {
-          return callback(new Error('涓氬姟鍒嗙粍妯″紡涓嬬涓�灞傜洰褰曠殑缂栧彿11鍒�13浣嶅繀椤讳负215'));
+        if (catalogType !== "215" && catalogType !== "216") {
+          return callback(new Error('缂栧彿閿欒锛屼笟鍔″垎缁�11-13浣嶄负215锛岃櫄鎷熺粍缁�11-13浣嶄负216'));
         }
-        if (this.level > 1 && catalogType !== "216") {
-          return callback(new Error('涓氬姟鍒嗙粍妯″紡涓嬬涓�灞備互涓嬬洰褰曠殑缂栧彿11鍒�13浣嶅繀椤讳负216'));
+        if (catalogType === "216") {
+
+          if (this.form.parentId !== this.platformDeviceId){
+            if (this.form.parentId.length <= 8) {
+              return callback(new Error('缂栧彿閿欒锛屽缓绔嬭櫄鎷熺粍缁囧墠蹇呴』鍏堝缓绔嬩笟鍔″垎缁勶紙11-13浣嶄负215锛�'));
+            }
+          }
+        }
+        if (catalogType === "215") {
+          if (this.form.parentId.length === "215") {
+            return callback(new Error('缂栧彿閿欒锛屼笟鍔″垎缁勪笅鍙兘寤虹珛铏氭嫙缁勭粐锛�11-13浣嶄负216锛�'));
+          }
         }
       }
       callback();
@@ -83,7 +95,6 @@
       showDialog: false,
       isLoging: false,
       isEdit: false,
-      treeType: null,
       level: 0,
       form: {
         id: null,
@@ -98,7 +109,7 @@
     };
   },
   methods: {
-    openDialog: function (isEdit, id, name, parentId, treeType, level, callback) {
+    openDialog: function (isEdit, id, name, parentId, level, callback) {
       console.log("parentId: " + parentId)
       console.log(this.form)
       this.isEdit = isEdit;
@@ -108,7 +119,6 @@
       this.form.parentId = parentId;
       this.showDialog = true;
       this.submitCallback = callback;
-      this.treeType = treeType;
       this.level = level;
     },
     onSubmit: function () {

--
Gitblit v1.8.0