Parcourir la source

Merge branch 'master' of http://git.shengws.com/csx/Pad_New

csx il y a 4 ans
Parent
révision
04c4613a23

+ 215 - 105
src/pages/console/managementConsole/staff_role/addStaff/index.vue Voir le fichier

@@ -7,7 +7,7 @@
7 7
     </div>
8 8
     <div class="editStaffTip">必填</div>
9 9
     <div class="staffBox">
10
-      <van-field v-model="name" label="姓名" clearable placeholder="请输入姓名" />
10
+      <van-field v-model="name" label="姓名" clearable placeholder="请输入姓名"/>
11 11
       <van-field
12 12
         v-model="tel"
13 13
         type="tel"
@@ -28,7 +28,8 @@
28 28
                 shape="square"
29 29
                 v-for="(item, index) in roles"
30 30
                 :key="index"
31
-              >{{item.name}}</van-checkbox>
31
+              >{{item.name}}
32
+              </van-checkbox>
32 33
             </van-checkbox-group>
33 34
           </div>
34 35
         </template>
@@ -39,12 +40,12 @@
39 40
           <span class="custom-title" style="width:90px">职称</span>
40 41
           <div style="display:flex;">
41 42
             <div style="margin-right:2rem;display: flex;align-items: center;" @click="show1 = true">
42
-              <span>请选择</span>
43
-              <van-icon name="arrow-down" />
43
+              <span>{{type_name}}</span>
44
+              <van-icon name="arrow-down"/>
44 45
             </div>
45
-            <div style="margin-right:2rem;display: flex;align-items: center;">
46
-              <span>请选择</span>
47
-              <van-icon name="arrow-down" />
46
+            <div style="margin-right:2rem;display: flex;align-items: center;" @click="show2 = true">
47
+              <span>{{titles_name}}</span>
48
+              <van-icon name="arrow-down"/>
48 49
             </div>
49 50
           </div>
50 51
         </template>
@@ -52,114 +53,209 @@
52 53
     </div>
53 54
     <div class="editStaffTip">选填</div>
54 55
     <div class="staffBox">
55
-      <van-field v-model="title" label="职位" placeholder="请填写" />
56
+      <van-field v-model="title" label="职位" placeholder="请填写"/>
56 57
     </div>
57 58
     <div class="addnewStaff" @click="save(2)">
58
-      <van-icon class="addIcon" name="add" />
59
+      <van-icon class="addIcon" name="add"/>
59 60
       <p>保存并继续新增员工</p>
60 61
     </div>
61 62
     <van-popup v-model="show1" position="bottom" :style="{ height: '40%' }">
62
-      <van-picker show-toolbar :columns="columns" @cancel="onCancel" @confirm="onConfirm" />
63
+      <van-picker show-toolbar :columns="user_type_name" @cancel="onCancel" @confirm="onUserTypeConfirm"/>
63 64
     </van-popup>
64 65
     <van-popup v-model="show2" position="bottom" :style="{ height: '40%' }">
65
-      <van-picker show-toolbar :columns="columns" @cancel="onCancel" @confirm="onConfirm" />
66
+      <van-picker show-toolbar :columns="user_titles_name" @cancel="onCancel" @confirm="onUserTitleConfirm"/>
66 67
     </van-popup>
68
+
67 69
   </div>
68 70
 </template>
69 71
 
70 72
 <script>
71
-import { AdminInitData, CreateAdminUser } from "@/api/admin_user";
72
-import { checkMobile } from "@/utils/tools";
73
-import { setRem } from "@/libs/functionRem";
74
-
75
-export default {
76
-  data() {
77
-    return {
78
-      name: "",
79
-      tel: "",
80
-      role_ids: [],
81
-      title: "",
82
-      value1: "",
83
-      roles: [],
84
-      show1: false,
85
-      show2: false,
86
-      columns: ["杭州", "宁波", "温州", "嘉兴", "湖州"]
87
-    };
88
-  },
89
-  methods: {
90
-    GetAdminUserInitData() {
91
-      AdminInitData().then(response => {
92
-        if (response.data.state === 1) {
93
-          for (let i = 0; i < response.data.data.roles.length; i++) {
94
-            if (!response.data.data.roles[i].is_super_admin) {
95
-              this.roles.push(response.data.data.roles[i]);
96
-            }
73
+  import {AdminInitData, CreateAdminUser} from "@/api/admin_user";
74
+  import {checkMobile} from "@/utils/tools";
75
+  import {setRem} from "@/libs/functionRem";
76
+
77
+  export default {
78
+    data() {
79
+      return {
80
+        name: "",
81
+        tel: "",
82
+        role_ids: [],
83
+        title: "",
84
+        value1: "",
85
+        roles: [],
86
+        show1: false,
87
+        show2: false,
88
+        type_name:"",
89
+        titles_name:"",
90
+        user_type:2,
91
+        user_title:1,
92
+
93
+        user_types: [
94
+          {index: 2, name: '医生'},
95
+          {index: 3, name: '护士'}
96
+        ],
97
+        user_titles: [
98
+          {index: 1, name: '医士'},
99
+          {index: 2, name: '医师'},
100
+          {index: 3, name: '住院医师'},
101
+          {index: 4, name: '主治医师'},
102
+          {index: 5, name: '副主任医师'},
103
+          {index: 6, name: '主任医师'},
104
+          {index: 7, name: '护士'},
105
+          {index: 8, name: '护师'},
106
+          {index: 9, name: '主管护师'},
107
+          {index: 10, name: '副主任护师'},
108
+          {index: 11, name: '主任护师'},
109
+          {index: 12, name: '运营专员'},
110
+          {index: 13, name: '运营主管'}
111
+        ],
112
+
113
+        user_type_name: [
114
+          '医生',
115
+          '护士'
116
+        ],
117
+
118
+        user_titles_name: [
119
+          '医士',
120
+          '医师',
121
+          '住院医师',
122
+          '主治医师',
123
+          '副主任医师',
124
+          '主任医师',
125
+          '护士',
126
+          '护师',
127
+          '主管护师',
128
+          '副主任护师',
129
+          '主任护师',
130
+          '运营专员',
131
+          '运营主管'
132
+        ],
133
+
134
+      };
135
+    },
136
+    methods: {
137
+      onUserTypeConfirm(value, index){
138
+        this.show1 = false
139
+        for (let i = 0; i < this.user_types.length; i++){
140
+          if (this.user_types[i].name == value){
141
+            this.user_type = this.user_types[i].index
142
+            this.type_name= this.user_types[i].name
143
+
97 144
           }
98
-        } else {
99
-          this.$toast({
100
-            message: response.data.msg
101
-          });
145
+
102 146
         }
103
-      });
104
-    },
105
-    save(type) {
106
-      if (this.name.trim().length == 0) {
107
-        this.$toast({
108
-          message: "姓名不能为空!"
109
-        });
110
-        return;
111
-      }
112
-      if (!checkMobile(this.tel)) {
113
-        this.$toast({
114
-          message: "请填写正确的手机号码!"
115
-        });
116
-        return;
117
-      }
118
-      if (this.role_ids.length <= 0) {
119
-        this.$toast({
120
-          message: "至少选择一种角色"
121
-        });
122
-        return;
123
-      }
124 147
 
125
-      let params = {
126
-        name: this.name,
127
-        mobile: this.tel,
128
-        role_ids: this.role_ids.join(","),
129
-        title: this.title
130
-      };
131
-      console.log(params);
132
-      CreateAdminUser(params).then(response => {
133
-        if (response.data.state === 1) {
134
-          this.$toast({ message: "新增成功" });
135
-          if (type == 1) {
136
-            this.$router.go(-1);
148
+      },
149
+      onUserTitleConfirm(value, index){
150
+        this.show2 = false
151
+
152
+        for (let i = 0; i < this.user_titles.length; i++){
153
+          if (this.user_titles[i].name == value){
154
+            this.user_title = this.user_titles[i].index
155
+            this.titles_name= this.user_titles[i].name
156
+
157
+          }
158
+        }
159
+
160
+
161
+      },
162
+      onCancel() {
163
+        this.show1 = false
164
+        this.show2 = false
165
+
166
+
167
+      },
168
+
169
+      GetAdminUserInitData() {
170
+        AdminInitData().then(response => {
171
+          if (response.data.state === 1) {
172
+            for (let i = 0; i < response.data.data.roles.length; i++) {
173
+              if (!response.data.data.roles[i].is_super_admin) {
174
+                if(this.$store.getters.user.admin.is_super_admin){
175
+                  this.roles.push(response.data.data.roles[i]);
176
+                }else{
177
+                  if(response.data.data.roles[i].is_system != 1 && response.data.data.roles[i].name != "子管理员"){
178
+                    this.roles.push(response.data.data.roles[i]);
179
+                  }
180
+
181
+                }
182
+              }
183
+            }
137 184
           } else {
138
-            this.name = "";
139
-            this.mobile = "";
140
-            this.role_ids = [];
141
-            this.title = "";
185
+            this.$toast({
186
+              message: response.data.msg
187
+            });
142 188
           }
143
-        } else {
189
+        });
190
+      },
191
+      save(type) {
192
+        if (this.name.trim().length == 0) {
144 193
           this.$toast({
145
-            message: response.data.msg
194
+            message: "姓名不能为空!"
146 195
           });
196
+          return;
147 197
         }
148
-      });
198
+        if (!checkMobile(this.tel)) {
199
+          this.$toast({
200
+            message: "请填写正确的手机号码!"
201
+          });
202
+          return;
203
+        }
204
+        if (this.role_ids.length <= 0) {
205
+          this.$toast({
206
+            message: "至少选择一种角色"
207
+          });
208
+          return;
209
+        }
210
+
211
+        let params = {
212
+          name: this.name,
213
+          mobile: this.tel,
214
+          role_ids: this.role_ids.join(","),
215
+          title: this.title,
216
+          user_type: this.user_type,
217
+          user_title: this.user_title
218
+        };
219
+        CreateAdminUser(params).then(response => {
220
+          if (response.data.state === 1) {
221
+            this.$toast({message: "新增成功"});
222
+            if (type == 1) {
223
+              this.$router.go(-1);
224
+            } else {
225
+              this.name = "";
226
+              this.tel = "";
227
+              this.role_ids = [];
228
+              this.title = "";
229
+              this.user_type = 2
230
+              this.user_title = 1
231
+              this.titles_name = this.user_titles_name[0]
232
+              this.type_name = this.user_type_name[0]
233
+
234
+            }
235
+          } else {
236
+            this.$toast({
237
+              message: response.data.msg
238
+            });
239
+          }
240
+        });
241
+      }
242
+    },
243
+    created() {
244
+      this.GetAdminUserInitData();
245
+      this.titles_name = this.user_titles_name[0]
246
+      this.type_name = this.user_type_name[0]
247
+
248
+      setRem();
149 249
     }
150
-  },
151
-  created() {
152
-    this.GetAdminUserInitData();
153
-    setRem();
154
-  }
155
-};
250
+  };
156 251
 </script>
157 252
 
158 253
 <style lang="scss" scoped>
159
-.page_addStaff {
160
-  height: 100%;
161
-  overflow: hidden;
162
-  background: #fafafa;
254
+  .page_addStaff {
255
+    height: 100%;
256
+    overflow: hidden;
257
+    background: #fafafa;
258
+
163 259
   .editStaffTitle {
164 260
     height: 3.125rem;
165 261
     display: flex;
@@ -169,15 +265,18 @@ export default {
169 265
     padding: 0 1.125rem;
170 266
     background: #fff;
171 267
   }
268
+
172 269
   .jiantou {
173 270
     font-size: 1.5rem;
174 271
     font-weight: 600;
175 272
     margin-right: 1.25rem;
176 273
   }
274
+
177 275
   .titleName {
178 276
     font-size: 1.125rem;
179 277
     font-weight: 600;
180 278
   }
279
+
181 280
   .editStaffTip {
182 281
     height: 1.875rem;
183 282
     line-height: 1.875rem;
@@ -185,24 +284,31 @@ export default {
185 284
     padding-left: 0.875rem;
186 285
     color: #989898;
187 286
   }
287
+
188 288
   .staffBox {
189
-    .van-cell {
190
-      font-size: 1rem;
191
-    }
192
-    .newCell {
193
-      padding-right: 0;
194
-    }
289
+
290
+  .van-cell {
291
+    font-size: 1rem;
292
+  }
293
+
294
+  .newCell {
295
+    padding-right: 0;
296
+  }
297
+
195 298
   }
196 299
   .van-cell__title {
197 300
     display: flex;
198 301
   }
302
+
199 303
   .van-checkbox-group {
200 304
     display: flex;
201 305
     flex-wrap: wrap;
202 306
   }
307
+
203 308
   .van-checkbox {
204 309
     margin-bottom: 0.625rem;
205 310
   }
311
+
206 312
   .addnewStaff {
207 313
     height: 2.8125rem;
208 314
     line-height: 2.8125rem;
@@ -212,19 +318,23 @@ export default {
212 318
     display: flex;
213 319
     align-items: center;
214 320
     padding-left: 1rem;
215
-    .addIcon {
216
-      color: #338afb;
217
-      font-size: 1.5rem;
218
-      margin-right: 0.625rem;
219
-    }
321
+
322
+  .addIcon {
323
+    color: #338afb;
324
+    font-size: 1.5rem;
325
+    margin-right: 0.625rem;
326
+  }
327
+
328
+  }
220 329
   }
221
-}
222 330
 </style>
223 331
 <style lang="scss">
224
-.page_editStaff {
332
+  .page_editStaff {
333
+
225 334
   .van-cell__value {
226 335
     display: flex;
227 336
     align-items: center;
228 337
   }
229
-}
338
+
339
+  }
230 340
 </style>

+ 160 - 6
src/pages/console/managementConsole/staff_role/editStaff/index.vue Voir le fichier

@@ -26,13 +26,39 @@
26 26
           </div>
27 27
         </template>
28 28
       </van-cell>
29
+
30
+
31
+      <van-cell class="newCell">
32
+        <!-- 使用 title 插槽来自定义标题 -->
33
+        <template slot="title">
34
+          <span class="custom-title" style="width:90px">职称</span>
35
+          <div style="display:flex;">
36
+            <div style="margin-right:2rem;display: flex;align-items: center;" @click="show1 = true">
37
+              <span>{{type_name}}</span>
38
+              <van-icon name="arrow-down"/>
39
+            </div>
40
+            <div style="margin-right:2rem;display: flex;align-items: center;" @click="show2 = true">
41
+              <span>{{titles_name}}</span>
42
+              <van-icon name="arrow-down"/>
43
+            </div>
44
+          </div>
45
+        </template>
46
+      </van-cell>
47
+
29 48
     </div>
30 49
     <div class="editStaffTip">选填</div>
31 50
     <div class="staffBox">
32 51
       <van-field v-model="title" label="职位" placeholder="请填写"/>
33 52
     </div>
34
-    <div v-if="adminInfo.status == 1" class="stop" @click="onClick(2)">禁用该员工账号</div>
35
-    <div v-if="adminInfo.status != 1" class="stop1" @click="onClick(1)">恢复该员工账号</div>
53
+    <div v-if="adminInfo.status == 1 && !adminInfo.admin.is_super_admin  &&  !adminInfo.is_sub_super_admin" class="stop" @click="onClick(2)">禁用该员工账号</div>
54
+    <div v-if="adminInfo.status != 1 && !adminInfo.admin.is_super_admin  &&  !adminInfo.is_sub_super_admin " class="stop1" @click="onClick(1)">恢复该员工账号</div>
55
+
56
+    <van-popup v-model="show1" position="bottom" :style="{ height: '40%' }">
57
+      <van-picker show-toolbar :columns="user_type_name" @cancel="onCancel" @confirm="onUserTypeConfirm"/>
58
+    </van-popup>
59
+    <van-popup v-model="show2" position="bottom" :style="{ height: '40%' }">
60
+      <van-picker show-toolbar :columns="user_titles_name" @cancel="onCancel" @confirm="onUserTitleConfirm"/>
61
+    </van-popup>
36 62
   </div>
37 63
 </template>
38 64
 
@@ -53,10 +79,97 @@
53 79
         name: "",
54 80
         tel: "",
55 81
         title: "",
56
-        adminInfo: {},
82
+        adminInfo: {
83
+          admin:{},
84
+
85
+        },
86
+        show1: false,
87
+        show2: false,
88
+        type_name:"",
89
+        titles_name:"",
90
+        user_type:2,
91
+        user_title:1,
92
+        user_types: [
93
+          {index: 2, name: '医生'},
94
+          {index: 3, name: '护士'}
95
+        ],
96
+        user_titles: [
97
+          {index: 1, name: '医士'},
98
+          {index: 2, name: '医师'},
99
+          {index: 3, name: '住院医师'},
100
+          {index: 4, name: '主治医师'},
101
+          {index: 5, name: '副主任医师'},
102
+          {index: 6, name: '主任医师'},
103
+          {index: 7, name: '护士'},
104
+          {index: 8, name: '护师'},
105
+          {index: 9, name: '主管护师'},
106
+          {index: 10, name: '副主任护师'},
107
+          {index: 11, name: '主任护师'},
108
+          {index: 12, name: '运营专员'},
109
+          {index: 13, name: '运营主管'}
110
+        ],
111
+
112
+        user_type_name: [
113
+          '医生',
114
+          '护士'
115
+        ],
116
+
117
+        user_titles_name: [
118
+          '医士',
119
+          '医师',
120
+          '住院医师',
121
+          '主治医师',
122
+          '副主任医师',
123
+          '主任医师',
124
+          '护士',
125
+          '护师',
126
+          '主管护师',
127
+          '副主任护师',
128
+          '主任护师',
129
+          '运营专员',
130
+          '运营主管'
131
+        ],
57 132
       };
58 133
     },
59 134
     methods: {
135
+      onUserTypeConfirm(value, index){
136
+        this.type_name = value
137
+        this.show1 = false
138
+
139
+        for (let i = 0; i < this.user_types.length; i++){
140
+          if (this.user_types[i].name == value){
141
+            this.user_type = this.user_types[i].index
142
+            this.type_name= this.user_types[i].name
143
+
144
+          }
145
+
146
+        }
147
+
148
+
149
+
150
+      },
151
+      onUserTitleConfirm(value, index){
152
+        this.titles_name = value
153
+        this.show2 = false
154
+
155
+        for (let i = 0; i < this.user_titles.length; i++){
156
+          if (this.user_titles[i].name == value){
157
+            this.user_title = this.user_titles[i].index
158
+            this.titles_name= this.user_titles[i].name
159
+
160
+          }
161
+        }
162
+
163
+
164
+
165
+
166
+      },
167
+      onCancel() {
168
+        this.show1 = false
169
+        this.show2 = false
170
+
171
+
172
+      },
60 173
       save() {
61 174
         if (this.name.trim().length == 0) {
62 175
           this.$toast({
@@ -76,6 +189,8 @@
76 189
           mobile: this.tel,
77 190
           role_ids: this.role_ids.join(","),
78 191
           title: this.title,
192
+          user_type: this.user_type,
193
+          user_title: this.user_title
79 194
         }
80 195
         EditAdmin(params).then(response => {
81 196
           if (response.data.state === 1) {
@@ -95,6 +210,7 @@
95 210
         GetAdminUserInfo(params).then(response => {
96 211
           if (response.data.state === 1) {
97 212
             this.adminInfo = response.data.data.user_info
213
+            console.log(this.adminInfo)
98 214
             // this.name = this.adminInfo.
99 215
             this.name = this.adminInfo.user_name
100 216
             this.tel = this.adminInfo.admin.mobile
@@ -103,6 +219,31 @@
103 219
             for (let i = 0; i < roles.length; i++) {
104 220
               this.role_ids.push(parseInt(roles[i]))
105 221
             }
222
+
223
+            for (let i = 0; i < this.user_types.length; i++){
224
+              if (this.user_types[i].index == this.adminInfo.user_type){
225
+                  this.user_type = this.adminInfo.user_type
226
+                  this.type_name= this.user_types[i].name
227
+
228
+              }
229
+
230
+            }
231
+            for (let i = 0; i < this.user_titles.length; i++){
232
+              if (this.user_titles[i].index == this.adminInfo.user_title){
233
+                this.user_title = this.adminInfo.user_title
234
+                this.titles_name= this.user_titles[i].name
235
+              }
236
+            }
237
+
238
+            //如果当前用户是超级管理员,而且是在编辑自己的信息的时候,将子管理员角色去除
239
+            for (let i = 0; i < this.roles.length; i++){
240
+              if(this.adminInfo.admin.id == this.$store.getters.user.admin.id && this.$store.getters.user.admin.is_super_admin && this.roles[i].is_system == 1 && this.roles[i].name == "子管理员"){
241
+                this.roles.splice(i,1)
242
+                i = i - 1;
243
+              }
244
+            }
245
+
246
+
106 247
           } else {
107 248
             this.$toast({
108 249
               message: response.data.msg
@@ -129,20 +270,34 @@
129 270
           }
130 271
         });
131 272
       },
273
+
132 274
       GetAdminUserInitData() {
133 275
         AdminInitData().then(response => {
134 276
           if (response.data.state === 1) {
135 277
             for (let i = 0; i < response.data.data.roles.length; i++) {
136 278
               if (!response.data.data.roles[i].is_super_admin) {
137
-                this.roles.push(response.data.data.roles[i])
279
+                if(this.$store.getters.user.admin.is_super_admin){
280
+                  this.roles.push(response.data.data.roles[i]);
281
+                }else{
282
+                  if(response.data.data.roles[i].is_system != 1 && response.data.data.roles[i].name != "子管理员"){
283
+                    this.roles.push(response.data.data.roles[i]);
284
+                  }
285
+
286
+                }
138 287
               }
139 288
             }
289
+
290
+            this.GetAdminUserInfo(this.$route.query.id)
291
+
292
+
293
+
140 294
           } else {
141 295
             this.$toast({
142 296
               message: response.data.msg
143 297
             });
144 298
           }
145 299
         });
300
+
146 301
       },
147 302
       onClick(id) {
148 303
         if (id == 2) {
@@ -165,8 +320,7 @@
165 320
       }
166 321
     }, created() {
167 322
       this.GetAdminUserInitData()
168
-      var id = this.$route.query.id
169
-      this.GetAdminUserInfo(id)
323
+
170 324
       setRem()
171 325
 
172 326
     }

+ 6 - 3
src/pages/console/managementConsole/staff_role/employeeList/index.vue Voir le fichier

@@ -75,16 +75,19 @@ export default {
75 75
             if (this.admin_user[i].role_ids.length > 0) {
76 76
               let isExist = -1;
77 77
               let ids = this.admin_user[i].role_ids.split(",");
78
-              console.log(ids);
79 78
               isExist = ids.indexOf(this.$route.query.id.toString());
80
-              console.log(isExist);
81
-
82 79
               if (isExist >= 0) {
83 80
                 this.admin_user.splice(i, 1);
84 81
                 i = i - 1;
85 82
               }
86 83
             }
87 84
           }
85
+          for (let i = 0; i < this.admin_user.length; i++) {
86
+              if(this.admin_user[i].user_id == this.$store.getters.user.org.creator){
87
+                this.admin_user.splice(i, 1);
88
+                i = i - 1;
89
+              }
90
+          }
88 91
         } else {
89 92
           this.$toast({
90 93
             message: response.data.msg

+ 1 - 0
src/pages/console/managementConsole/staff_role/newAddRole/index.vue Voir le fichier

@@ -8,6 +8,7 @@
8 8
       <van-field
9 9
         v-model="name"
10 10
         required
11
+        maxlength="30"
11 12
         label="角色名称"
12 13
         placeholder="请填写角色名称"
13 14
       />

+ 109 - 2
src/pages/console/managementConsole/staff_role/newAddStaff/index.vue Voir le fichier

@@ -21,6 +21,23 @@
21 21
         placeholder="请输入手机号"
22 22
         clearable
23 23
       />
24
+      <van-cell class="newCell">
25
+        <!-- 使用 title 插槽来自定义标题 -->
26
+        <template slot="title">
27
+          <span class="custom-title" style="width:90px">职称</span>
28
+          <div style="display:flex;">
29
+            <div style="margin-right:2rem;display: flex;align-items: center;" @click="show1 = true">
30
+              <span>{{type_name}}</span>
31
+              <van-icon name="arrow-down"/>
32
+            </div>
33
+            <div style="margin-right:2rem;display: flex;align-items: center;" @click="show2 = true">
34
+              <span>{{titles_name}}</span>
35
+              <van-icon name="arrow-down"/>
36
+            </div>
37
+          </div>
38
+        </template>
39
+      </van-cell>
40
+
24 41
     </div>
25 42
     <div class="editStaffTip">选填</div>
26 43
     <div class="staffBox">
@@ -30,6 +47,13 @@
30 47
       <van-icon class="addIcon" name="add" />
31 48
       <p>保存并继续新增员工</p>
32 49
     </div>
50
+    <van-popup v-model="show1" position="bottom" :style="{ height: '40%' }">
51
+      <van-picker show-toolbar :columns="user_type_name" @cancel="onCancel" @confirm="onUserTypeConfirm"/>
52
+    </van-popup>
53
+    <van-popup v-model="show2" position="bottom" :style="{ height: '40%' }">
54
+      <van-picker show-toolbar :columns="user_titles_name" @cancel="onCancel" @confirm="onUserTitleConfirm"/>
55
+    </van-popup>
56
+
33 57
   </div>
34 58
 </template>
35 59
 
@@ -46,10 +70,89 @@ export default {
46 70
       role_ids: [],
47 71
       title: "",
48 72
       value1: "",
49
-      roles: []
73
+      roles: [],
74
+      show1: false,
75
+      show2: false,
76
+      type_name:"",
77
+      titles_name:"",
78
+      user_type:2,
79
+      user_title:1,
80
+
81
+      user_types: [
82
+        {index: 2, name: '医生'},
83
+        {index: 3, name: '护士'}
84
+      ],
85
+      user_titles: [
86
+        {index: 1, name: '医士'},
87
+        {index: 2, name: '医师'},
88
+        {index: 3, name: '住院医师'},
89
+        {index: 4, name: '主治医师'},
90
+        {index: 5, name: '副主任医师'},
91
+        {index: 6, name: '主任医师'},
92
+        {index: 7, name: '护士'},
93
+        {index: 8, name: '护师'},
94
+        {index: 9, name: '主管护师'},
95
+        {index: 10, name: '副主任护师'},
96
+        {index: 11, name: '主任护师'},
97
+        {index: 12, name: '运营专员'},
98
+        {index: 13, name: '运营主管'}
99
+      ],
100
+
101
+      user_type_name: [
102
+        '医生',
103
+        '护士'
104
+      ],
105
+
106
+      user_titles_name: [
107
+        '医士',
108
+        '医师',
109
+        '住院医师',
110
+        '主治医师',
111
+        '副主任医师',
112
+        '主任医师',
113
+        '护士',
114
+        '护师',
115
+        '主管护师',
116
+        '副主任护师',
117
+        '主任护师',
118
+        '运营专员',
119
+        '运营主管'
120
+      ],
121
+
50 122
     };
51 123
   },
52 124
   methods: {
125
+    onUserTypeConfirm(value, index){
126
+      this.show1 = false
127
+      for (let i = 0; i < this.user_types.length; i++){
128
+        if (this.user_types[i].name == value){
129
+          this.user_type = this.user_types[i].index
130
+          this.type_name= this.user_types[i].name
131
+
132
+        }
133
+
134
+      }
135
+
136
+    },
137
+    onUserTitleConfirm(value, index){
138
+      this.show2 = false
139
+
140
+      for (let i = 0; i < this.user_titles.length; i++){
141
+        if (this.user_titles[i].name == value){
142
+          this.user_title = this.user_titles[i].index
143
+          this.titles_name= this.user_titles[i].name
144
+
145
+        }
146
+      }
147
+
148
+
149
+    },
150
+    onCancel() {
151
+      this.show1 = false
152
+      this.show2 = false
153
+
154
+
155
+    },
53 156
     GetAdminUserInitData() {
54 157
       AdminInitData().then(response => {
55 158
         if (response.data.state === 1) {
@@ -89,7 +192,9 @@ export default {
89 192
         name: this.name,
90 193
         mobile: this.tel,
91 194
         role_ids: this.role_ids.join(","),
92
-        title: this.title
195
+        title: this.title,
196
+        user_type: this.user_type,
197
+        user_title: this.user_title
93 198
       };
94 199
       CreateAdminUser(params).then(response => {
95 200
         if (response.data.state === 1) {
@@ -112,6 +217,8 @@ export default {
112 217
   },
113 218
   created() {
114 219
     this.GetAdminUserInitData();
220
+    this.titles_name = this.user_titles_name[0]
221
+    this.type_name = this.user_type_name[0]
115 222
     this.role_ids.push(this.$route.query.id);
116 223
     setRem();
117 224
   }

+ 43 - 3
src/pages/console/managementConsole/staff_role/staffManagement/index.vue Voir le fichier

@@ -83,15 +83,55 @@ export default {
83 83
         if (response.data.state === 1) {
84 84
           for(let i = 0; i < response.data.data.admins.length; i++){
85 85
             if(response.data.data.admins[i].status == 1){
86
-              this.admin_user.push(response.data.data.admins[i])
86
+              if(response.data.data.isSubSuperAdmin){ //当前用户为子管理员,不展示管理员信息
87
+                  if(response.data.data.admins[i].user_id != response.data.data.org_creator){
88
+                    this.admin_user.push(response.data.data.admins[i])
89
+                  }
90
+              }else{
91
+                this.admin_user.push(response.data.data.admins[i])
92
+
93
+              }
87 94
             }else{
88
-              this.del_admin_user.push(response.data.data.admins[i])
95
+              if(response.data.data.isSubSuperAdmin){ //当前用户为子管理员,不展示管理员信息
96
+                if(response.data.data.admins[i].user_id != response.data.data.org_creator){
97
+                  // this.admin_user.push(response.data.data.admins[i])
98
+                  this.del_admin_user.push(response.data.data.admins[i])
99
+
100
+                }
101
+              }else{
102
+                // this.admin_user.push(response.data.data.admins[i])
103
+                this.del_admin_user.push(response.data.data.admins[i])
104
+
105
+
106
+              }
107
+
108
+
109
+            }
110
+          }
111
+
112
+
113
+          for(let i = 0; i < this.admin_user.length; i++) {
114
+            if(response.data.data.isSubSuperAdmin){ //当前用户为子管理员,不展示管理员和其他子管理信息
115
+              if(this.admin_user[i].is_sub_admin && this.admin_user[i].user_id != this.$store.getters.user.admin.id){
116
+                this.admin_user.splice(i,1)
117
+                i = i - 1;
118
+              }
119
+            }
120
+          }
121
+
122
+
123
+          for(let i = 0; i < this.del_admin_user.length; i++) {
124
+            if(response.data.data.isSubSuperAdmin){ //当前用户为子管理员,不展示管理员和其他子管理信息
125
+              if(this.del_admin_user[i].is_sub_admin && this.del_admin_user[i].user_id != this.$store.getters.user.admin.id){
126
+                this.del_admin_user.splice(i,1)
127
+                i = i - 1;
128
+              }
89 129
             }
90 130
           }
91 131
 
92 132
 
93 133
 
94
-        } else {
134
+          } else {
95 135
           this.$toast({
96 136
             message: response.data.msg
97 137
           });

+ 12 - 5
src/pages/console/managementConsole/staff_role/userManage/index.vue Voir le fichier

@@ -12,6 +12,8 @@
12 12
         v-for="(item, index) in admin_user"
13 13
         :key="index"
14 14
         v-if="admin_user.length > 0"
15
+        @click="goEditStaff(item.user_id,item.is_sub_admin)"
16
+
15 17
       >
16 18
         <img v-if="item.avatar.length > 0" :src="item.avatar" alt />
17 19
         <img
@@ -19,10 +21,10 @@
19 21
           src="../../../../../assets/images/default_avatar.jpg"
20 22
           alt
21 23
         />
22
-        <p>
24
+        <p >
23 25
           <span>{{ item.user_name }}</span>
24 26
           <i
25
-            @click="goEditStaff(item.user_id)"
27
+            v-if="!item.is_sub_admin && org_creator != item.user_id"
26 28
             class="iconfont icon-bianji bianji"
27 29
           ></i>
28 30
         </p>
@@ -39,7 +41,8 @@ export default {
39 41
   data() {
40 42
     return {
41 43
       active: 0,
42
-      admin_user: []
44
+      admin_user: [],
45
+      org_creator:0,
43 46
     };
44 47
   },
45 48
   methods: {
@@ -65,8 +68,10 @@ export default {
65 68
         }
66 69
       });
67 70
     },
68
-    goEditStaff: function(id) {
69
-      this.$router.push({ path: "/staff/editstaff?id=" + id });
71
+    goEditStaff: function(id,is_sub_admin) {
72
+      if (!is_sub_admin && org_creator != id){
73
+        this.$router.push({ path: "/staff/editstaff?id=" + id });
74
+      }
70 75
     },
71 76
     goAddStaff: function() {
72 77
       this.$router.push({ path: "/staff/addstaff" });
@@ -75,6 +80,8 @@ export default {
75 80
   created() {
76 81
     setRem();
77 82
     //获取没被禁用的用户
83
+    this.org_creator  = this.$store.getters.user.org.creator
84
+    console.log(this.org_creator)
78 85
     this.GetAllStaff();
79 86
   }
80 87
 };

+ 10 - 2
src/pages/homeIndex/index.vue Voir le fichier

@@ -228,7 +228,10 @@
228 228
 
229 229
       },
230 230
       jump(url){
231
-        window.location.href = url
231
+        if (url.length != 0){
232
+          window.location.href = url
233
+        }
234
+
232 235
       },jumpApp(app){
233 236
         if(!this.isCreateOrg){
234 237
           Toast('你尚未创建机构,请先创建机构')
@@ -302,15 +305,20 @@
302 305
                 let obj= {
303 306
                   text: this.orgs[i].org_name,
304 307
                   value: this.orgs[i].id
305
-
306 308
                 }
307 309
                 this.org_arr.push(obj)
308 310
               }
309 311
               this.value1 = this.$store.getters.user.org.id
312
+              this.show = false
310 313
             }else{
311 314
               this.apps = response.data.data.apps
312 315
               this.banners = response.data.data.banners
316
+              this.show = true
313 317
             }
318
+
319
+
320
+
321
+
314 322
           } else {
315 323
             this.$toast({
316 324
               message: response.data.msg

+ 6 - 1
src/utils/request.js Voir le fichier

@@ -28,7 +28,12 @@ service.interceptors.response.use(
28 28
         Toast("登录超时");
29 29
         location.reload();
30 30
         return Promise.reject("error");
31
-      } else {
31
+      } else if (res.code == 20035){
32
+        Toast("你已经被管理员禁用,无法使用该系统");
33
+        location.reload();
34
+        return Promise.reject("error");
35
+
36
+      }else {
32 37
         return response;
33 38
       }
34 39
     } else {