From b4d09a09d2a8ffc939e97f8b400ff94a64d13eb7 Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期一, 04 三月 2024 17:46:01 +0800
Subject: [PATCH] 优化用户管理页面表单填写界面选择设备功能,车间重新选择后重置选择设备

---
 src/views/system/modules/UserModal.vue |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/views/system/modules/UserModal.vue b/src/views/system/modules/UserModal.vue
index 05b0da8..5d5f949 100644
--- a/src/views/system/modules/UserModal.vue
+++ b/src/views/system/modules/UserModal.vue
@@ -403,9 +403,13 @@
       },
       'model.selectedProduction': {
         handler(newVal, oldVal) {
-          console.log('瑙﹀彂鐩戝惉', 'newVal=', newVal, 'oldVal=', oldVal)
-          // if ((newVal !== oldVal && oldVal) || !newVal) this.model.equipmentIds = ''
-          if (newVal && this.$refs.selectDeviceModal) this.$refs.selectDeviceModal.queryTreeData(newVal)
+          if (newVal && this.$refs.selectDeviceModal) {
+            // 濡傛灉杞﹂棿閫夋嫨鍓嶅悗涓嶄竴鑷村垯閲嶇疆閫夋嫨璁惧
+            if ((oldVal && newVal !== oldVal)) this.model.equipmentIds = ''
+            this.$refs.selectDeviceModal.queryTreeData(newVal)
+          }
+          // 濡傛灉娓呯┖杞﹂棿鍊煎垯閲嶇疆閫夋嫨璁惧
+          if (newVal === '') this.model.equipmentIds = ''
         }
       }
     },
@@ -466,7 +470,6 @@
           that.getUserRoles(record.id)
           that.getUserDeparts(record.id)
         }
-        console.log('that.model', that.model)
       },
       isDisabledAuth(code) {
         return disabledAuthFilter(code)
@@ -497,7 +500,6 @@
               let c = { label: item.name, value: item.id + '' }
               return c
             })
-            console.log('this.tenantsOptions: ', this.tenantsOptions)
           }
         })
       },
@@ -509,16 +511,13 @@
               let c = { label: item.roleName, value: item.id }
               return c
             })
-            console.log('this.rolesOptions: ', this.rolesOptions)
           }
         })
       },
       getUserRoles(userid) {
         queryUserRole({ userid: userid }).then((res) => {
           if (res.success) {
-            // this.model.selectedroles = res.result.join(',')
             this.$set(this.model, 'selectedroles', res.result.join(','))
-            console.log('that.model.selectedroles=', this.model.selectedroles)
           }
         })
       },
@@ -538,11 +537,8 @@
               })
             }
 
-            // that.model.selecteddeparts = selectDepartKeys.join(',')
             this.$set(this.model, 'selecteddeparts', selectDepartKeys.join(','))
-
             that.nextDepartOptions = departOptions
-            console.log('that.nextDepartOptions=', that.nextDepartOptions)
           }
         })
 
@@ -560,10 +556,8 @@
               })
             }
 
-            // that.model.selectedProduction = selectProductKeys.join(',')
             this.$set(this.model, 'selectedProduction', selectProductKeys.join(','))
             that.nextProductionOptions = ProductionOptions
-            console.log('that.nextProductionOptions=', that.nextProductionOptions)
           }
         })
         //杞﹂棿鐨剈rl

--
Gitblit v1.9.3