Browse Source

账户管理接口

ZaiZai 2 năm trước cách đây
mục cha
commit
9b4fd790f5
2 tập tin đã thay đổi với 17 bổ sung11 xóa
  1. 1 1
      src/config/index.json
  2. 16 10
      src/views/system/user.vue

+ 1 - 1
src/config/index.json

@@ -1,6 +1,6 @@
 {
     "version": "20230607160059",
-    "target": "http://192.168.0.100:8090",
+    "target": "http://192.168.0.109:8090",
     "smsPhone": "",
     "vite": {
         "port": 5174,

+ 16 - 10
src/views/system/user.vue

@@ -325,18 +325,24 @@ const initPostData = async (id, index) => {
             postData.value[index] = []
         }
         //处理负责人限制
-        const deptList = formModel.value.deptList
         let isLader = 0;
+        const deptList = formModel.value.deptList
         deptList.forEach((item, indexs) => {
-            if (item.isLader === 1 && isLader !== 1) {
-                isLader = 1
-            }
-            if (item.deptId === id && indexs !== index) {
-                formModel.value.deptList[indexs].isLader = isLader
-                formModel.value.deptList[indexs].isLaderDisabled = true
+            if (item.deptId === id) {
+                //如果当前相同部门项的负责人存在,就全局存在
+                if (item.isLader === 1) {
+                    isLader = 1
+                }
+                //设置其它相同部门项的负责人
+                if (indexs !== index) {
+                    item.isLader = isLader
+                    item.isLaderDisabled = true
+                }
             }
         })
-        formModel.value.deptList[index].isLaderDisabled = false
+        //设置当前项的负责人
+        deptList[index].isLader = isLader
+        deptList[index].isLaderDisabled = false
     }
 }
 
@@ -344,9 +350,9 @@ const initPostData = async (id, index) => {
 const isLaderChange = (id, index) => {
     const deptList = formModel.value.deptList
     const deptId = deptList[index].deptId
-    deptList.forEach((item, indexs) => {
+    deptList.forEach((item) => {
         if (item.deptId === deptId) {
-            formModel.value.deptList[indexs].isLader = item.isLader
+            item.isLader = id
         }
     })
 }