allen пре 2 година
родитељ
комит
85d5e840fd

+ 5 - 1
src/components/SelectTree/index.vue

@@ -57,7 +57,8 @@ export default {
     checkVal: {
       handler(val) {
         this.node.cusareaName = val
-      }
+      },
+      deep: true,
     },
     checkedList: {
       handler(val) {
@@ -78,6 +79,9 @@ export default {
       this.checkList = this.$refs.treeForm.getCheckedKeys()
       const checkNode = this.$refs.treeForm.getCheckedNodes()
       this.node.cusareaName = val?.cusareaName
+      if (!this.checkList.length) {
+        this.node.cusareaName = ''
+      }
       this.$emit('getCheckTree', this.checkList)
       this.$emit('getCheckTreeNode', checkNode)
     }

+ 13 - 0
src/views/waterManage/component/associationManage.vue

@@ -223,6 +223,19 @@ export default {
         this.treeNodeList = treeNodeList
       },
       deep: true
+    },
+    baseForm: {
+      handler(val) {
+        const { areaIds } = val
+        if (areaIds != '') {
+          this.cusareaName = ''
+          
+          this.$refs?.baseForm?.clearValidate(['areaIds'])
+        } else { 
+          this.$refs['baseForm'].validateField('areaIds')
+        }
+      },
+      deep: true
     }
   },
   methods: {