csx vor 4 Jahren
Ursprung
Commit
7f2f900a2b

+ 11 - 30
package-lock.json Datei anzeigen

4740
         "ansi-regex": {
4740
         "ansi-regex": {
4741
           "version": "2.1.1",
4741
           "version": "2.1.1",
4742
           "bundled": true,
4742
           "bundled": true,
4743
-          "dev": true,
4744
-          "optional": true
4743
+          "dev": true
4745
         },
4744
         },
4746
         "aproba": {
4745
         "aproba": {
4747
           "version": "1.2.0",
4746
           "version": "1.2.0",
4764
         "balanced-match": {
4763
         "balanced-match": {
4765
           "version": "1.0.0",
4764
           "version": "1.0.0",
4766
           "bundled": true,
4765
           "bundled": true,
4767
-          "dev": true,
4768
-          "optional": true
4766
+          "dev": true
4769
         },
4767
         },
4770
         "brace-expansion": {
4768
         "brace-expansion": {
4771
           "version": "1.1.11",
4769
           "version": "1.1.11",
4772
           "resolved": false,
4770
           "resolved": false,
4773
           "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
4771
           "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
4774
           "dev": true,
4772
           "dev": true,
4775
-          "optional": true,
4776
           "requires": {
4773
           "requires": {
4777
             "balanced-match": "^1.0.0",
4774
             "balanced-match": "^1.0.0",
4778
             "concat-map": "0.0.1"
4775
             "concat-map": "0.0.1"
4788
         "code-point-at": {
4785
         "code-point-at": {
4789
           "version": "1.1.0",
4786
           "version": "1.1.0",
4790
           "bundled": true,
4787
           "bundled": true,
4791
-          "dev": true,
4792
-          "optional": true
4788
+          "dev": true
4793
         },
4789
         },
4794
         "concat-map": {
4790
         "concat-map": {
4795
           "version": "0.0.1",
4791
           "version": "0.0.1",
4796
           "resolved": false,
4792
           "resolved": false,
4797
           "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
4793
           "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
4798
-          "dev": true,
4799
-          "optional": true
4794
+          "dev": true
4800
         },
4795
         },
4801
         "console-control-strings": {
4796
         "console-control-strings": {
4802
           "version": "1.1.0",
4797
           "version": "1.1.0",
4803
           "resolved": false,
4798
           "resolved": false,
4804
           "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
4799
           "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
4805
-          "dev": true,
4806
-          "optional": true
4800
+          "dev": true
4807
         },
4801
         },
4808
         "core-util-is": {
4802
         "core-util-is": {
4809
           "version": "1.0.2",
4803
           "version": "1.0.2",
4933
         "inherits": {
4927
         "inherits": {
4934
           "version": "2.0.3",
4928
           "version": "2.0.3",
4935
           "bundled": true,
4929
           "bundled": true,
4936
-          "dev": true,
4937
-          "optional": true
4930
+          "dev": true
4938
         },
4931
         },
4939
         "ini": {
4932
         "ini": {
4940
           "version": "1.3.5",
4933
           "version": "1.3.5",
4948
           "resolved": false,
4941
           "resolved": false,
4949
           "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
4942
           "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
4950
           "dev": true,
4943
           "dev": true,
4951
-          "optional": true,
4952
           "requires": {
4944
           "requires": {
4953
             "number-is-nan": "^1.0.0"
4945
             "number-is-nan": "^1.0.0"
4954
           }
4946
           }
4965
           "resolved": false,
4957
           "resolved": false,
4966
           "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
4958
           "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
4967
           "dev": true,
4959
           "dev": true,
4968
-          "optional": true,
4969
           "requires": {
4960
           "requires": {
4970
             "brace-expansion": "^1.1.7"
4961
             "brace-expansion": "^1.1.7"
4971
           }
4962
           }
4973
         "minimist": {
4964
         "minimist": {
4974
           "version": "0.0.8",
4965
           "version": "0.0.8",
4975
           "bundled": true,
4966
           "bundled": true,
4976
-          "dev": true,
4977
-          "optional": true
4967
+          "dev": true
4978
         },
4968
         },
4979
         "minipass": {
4969
         "minipass": {
4980
           "version": "2.3.5",
4970
           "version": "2.3.5",
4981
           "resolved": false,
4971
           "resolved": false,
4982
           "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
4972
           "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
4983
           "dev": true,
4973
           "dev": true,
4984
-          "optional": true,
4985
           "requires": {
4974
           "requires": {
4986
             "safe-buffer": "^5.1.2",
4975
             "safe-buffer": "^5.1.2",
4987
             "yallist": "^3.0.0"
4976
             "yallist": "^3.0.0"
5002
           "resolved": false,
4991
           "resolved": false,
5003
           "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
4992
           "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
5004
           "dev": true,
4993
           "dev": true,
5005
-          "optional": true,
5006
           "requires": {
4994
           "requires": {
5007
             "minimist": "0.0.8"
4995
             "minimist": "0.0.8"
5008
           }
4996
           }
5090
         "number-is-nan": {
5078
         "number-is-nan": {
5091
           "version": "1.0.1",
5079
           "version": "1.0.1",
5092
           "bundled": true,
5080
           "bundled": true,
5093
-          "dev": true,
5094
-          "optional": true
5081
+          "dev": true
5095
         },
5082
         },
5096
         "object-assign": {
5083
         "object-assign": {
5097
           "version": "4.1.1",
5084
           "version": "4.1.1",
5105
           "resolved": false,
5092
           "resolved": false,
5106
           "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
5093
           "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
5107
           "dev": true,
5094
           "dev": true,
5108
-          "optional": true,
5109
           "requires": {
5095
           "requires": {
5110
             "wrappy": "1"
5096
             "wrappy": "1"
5111
           }
5097
           }
5200
         "safe-buffer": {
5186
         "safe-buffer": {
5201
           "version": "5.1.2",
5187
           "version": "5.1.2",
5202
           "bundled": true,
5188
           "bundled": true,
5203
-          "dev": true,
5204
-          "optional": true
5189
+          "dev": true
5205
         },
5190
         },
5206
         "safer-buffer": {
5191
         "safer-buffer": {
5207
           "version": "2.1.2",
5192
           "version": "2.1.2",
5243
           "resolved": false,
5228
           "resolved": false,
5244
           "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
5229
           "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
5245
           "dev": true,
5230
           "dev": true,
5246
-          "optional": true,
5247
           "requires": {
5231
           "requires": {
5248
             "code-point-at": "^1.0.0",
5232
             "code-point-at": "^1.0.0",
5249
             "is-fullwidth-code-point": "^1.0.0",
5233
             "is-fullwidth-code-point": "^1.0.0",
5265
           "resolved": false,
5249
           "resolved": false,
5266
           "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
5250
           "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
5267
           "dev": true,
5251
           "dev": true,
5268
-          "optional": true,
5269
           "requires": {
5252
           "requires": {
5270
             "ansi-regex": "^2.0.0"
5253
             "ansi-regex": "^2.0.0"
5271
           }
5254
           }
5313
         "wrappy": {
5296
         "wrappy": {
5314
           "version": "1.0.2",
5297
           "version": "1.0.2",
5315
           "bundled": true,
5298
           "bundled": true,
5316
-          "dev": true,
5317
-          "optional": true
5299
+          "dev": true
5318
         },
5300
         },
5319
         "yallist": {
5301
         "yallist": {
5320
           "version": "3.0.3",
5302
           "version": "3.0.3",
5321
           "resolved": false,
5303
           "resolved": false,
5322
           "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
5304
           "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
5323
-          "dev": true,
5324
-          "optional": true
5305
+          "dev": true
5325
         }
5306
         }
5326
       }
5307
       }
5327
     },
5308
     },

+ 6 - 4
src/api/advice.js Datei anzeigen

30
   })
30
   })
31
 }
31
 }
32
 
32
 
33
-export function ExecDoctorAdvice(patient, id, time) {
33
+export function ExecDoctorAdvice(patient, id, time,mode) {
34
   var params = {
34
   var params = {
35
     id: id,
35
     id: id,
36
     patient: patient,
36
     patient: patient,
37
-    execution_time: time
37
+    execution_time: time,
38
+    mode:mode
38
   }
39
   }
39
   return request({
40
   return request({
40
     url: '/api/patients/advice/exec',
41
     url: '/api/patients/advice/exec',
42
     params: params
43
     params: params
43
   })
44
   })
44
 }
45
 }
45
-export function CheckDoctorAdvice(patient, id) {
46
+export function CheckDoctorAdvice(patient, id,mode) {
46
   var params = {
47
   var params = {
47
     id: id,
48
     id: id,
48
-    patient: patient
49
+    patient: patient,
50
+    mode:mode
49
     // execution_time: time,
51
     // execution_time: time,
50
   }
52
   }
51
   return request({
53
   return request({

+ 25 - 8
src/api/dialysis.js Datei anzeigen

149
     url: '/api/dialysis/prescription',
149
     url: '/api/dialysis/prescription',
150
     method: 'Post',
150
     method: 'Post',
151
     params: params,
151
     params: params,
152
+    headers:{"Permission":2},
152
   })
153
   })
153
 }
154
 }
154
 
155
 
156
   return request({
157
   return request({
157
     url: '/api/dialysis/soulution',
158
     url: '/api/dialysis/soulution',
158
     method: 'Post',
159
     method: 'Post',
159
-    params: params
160
+    params: params,
161
+    headers:{"Permission":3},
162
+
160
   })
163
   })
161
 }
164
 }
162
 
165
 
164
   return request({
167
   return request({
165
     url: '/api/dialysis/dobule',
168
     url: '/api/dialysis/dobule',
166
     method: 'Post',
169
     method: 'Post',
167
-    params: params
170
+    params: params,
171
+    headers:{"Permission":2},
172
+
168
   })
173
   })
169
 }
174
 }
170
 
175
 
172
   return request({
177
   return request({
173
     url: '/api/dialysis/accepts',
178
     url: '/api/dialysis/accepts',
174
     method: 'Post',
179
     method: 'Post',
175
-    params: params
180
+    params: params,
181
+    headers:{"Permission":2},
182
+
176
   })
183
   })
177
 }
184
 }
178
 
185
 
180
   return request({
187
   return request({
181
     url: '/api/dialysis/assessmentbeforedislysis',
188
     url: '/api/dialysis/assessmentbeforedislysis',
182
     method: 'Post',
189
     method: 'Post',
183
-    params: params
190
+    params: params,
191
+    headers:{"Permission":2},
192
+
184
   })
193
   })
185
 }
194
 }
186
 
195
 
188
   return request({
197
   return request({
189
     url: '/api/dialysis/treatmentsummary',
198
     url: '/api/dialysis/treatmentsummary',
190
     method: 'Post',
199
     method: 'Post',
191
-    params: params
200
+    params: params,
201
+    headers:{"Permission":2},
202
+
192
   })
203
   })
193
 }
204
 }
194
 
205
 
197
     url: '/api/dialysis/assessmentafterdislysis',
208
     url: '/api/dialysis/assessmentafterdislysis',
198
     method: 'Post',
209
     method: 'Post',
199
     params: params,
210
     params: params,
200
-    data: data
211
+    data: data,
212
+    headers:{"Permission":2},
213
+
201
   })
214
   })
202
 }
215
 }
203
 
216
 
214
   return request({
227
   return request({
215
     url: '/api/advice_remind/create?id=' + id + '&groupno=' + groupno,
228
     url: '/api/advice_remind/create?id=' + id + '&groupno=' + groupno,
216
     method: 'post',
229
     method: 'post',
217
-    data: advices
230
+    data: advices,
231
+    headers:{"Permission":2},
232
+
218
   })
233
   })
219
 }
234
 }
220
 
235
 
230
   return request({
245
   return request({
231
     url: '/api/dryweight/commit',
246
     url: '/api/dryweight/commit',
232
     method: 'post',
247
     method: 'post',
233
-    params: params
248
+    params: params,
249
+    headers:{"Permission":2},
250
+
234
   })
251
   })
235
 }
252
 }

+ 23 - 8
src/api/dialysis_record.js Datei anzeigen

30
   })
30
   })
31
 }
31
 }
32
 
32
 
33
-export function editMonitor(patient_id, schedule_date, data) {
33
+export function editMonitor(patient_id, schedule_date, data,mode) {
34
   var params = {
34
   var params = {
35
     patient_id: patient_id,
35
     patient_id: patient_id,
36
-    schedule_date: schedule_date
36
+    schedule_date: schedule_date,
37
+    mode:mode
37
   }
38
   }
38
   return request({
39
   return request({
39
     url: '/api/dislysis/monitor/edit',
40
     url: '/api/dislysis/monitor/edit',
40
     method: 'post',
41
     method: 'post',
41
     params: params,
42
     params: params,
42
-    data: data
43
+    data: data,
44
+    headers:{"Permission":2},
45
+
43
   })
46
   })
44
 }
47
 }
45
 
48
 
46
-export function startDialysis(patient_id, schedule_date, nurse_id, bed_id, lood_drawing, puncture_nurse_id, start_time,schedual_type) {
49
+export function startDialysis(patient_id, schedule_date, nurse_id, bed_id, lood_drawing, puncture_nurse_id, start_time,schedual_type,mode) {
47
   var params = {
50
   var params = {
48
     patient_id: patient_id,
51
     patient_id: patient_id,
49
     date: schedule_date,
52
     date: schedule_date,
53
     start_time: start_time,
56
     start_time: start_time,
54
     lood_drawing: lood_drawing,
57
     lood_drawing: lood_drawing,
55
     schedual_type:schedual_type,
58
     schedual_type:schedual_type,
59
+    mode:mode,
56
   }
60
   }
57
   return request({
61
   return request({
58
     url: '/api/dialysis/start_record',
62
     url: '/api/dialysis/start_record',
59
     method: 'post',
63
     method: 'post',
60
-    params: params
64
+    params: params,
65
+    headers:{"Permission":2},
66
+
61
   })
67
   })
62
 }
68
 }
63
 
69
 
64
-export function finishDialysis(patient_id, schedule_date,end_time, nurse_id) {
70
+export function finishDialysis(patient_id, schedule_date,end_time, nurse_id,mode) {
65
   var params = {
71
   var params = {
66
     patient_id: patient_id,
72
     patient_id: patient_id,
67
     date: schedule_date,
73
     date: schedule_date,
68
     nurse: nurse_id,
74
     nurse: nurse_id,
69
     end_time:end_time,
75
     end_time:end_time,
76
+    mode:mode,
70
   }
77
   }
71
   return request({
78
   return request({
72
     url: '/api/dialysis/finish',
79
     url: '/api/dialysis/finish',
73
     method: 'post',
80
     method: 'post',
74
-    params: params
81
+    params: params,
82
+    headers:{"Permission":2},
83
+
75
   })
84
   })
76
 }
85
 }
77
 
86
 
79
   return request({
88
   return request({
80
     url: '/api/dialysis/monitor/del',
89
     url: '/api/dialysis/monitor/del',
81
     method: 'post',
90
     method: 'post',
82
-    params: params
91
+    params: params,
92
+    headers:{"Permission":2},
93
+
83
   })
94
   })
84
 }
95
 }
85
 
96
 
111
     url:'/api/start_dialysis/modify',
122
     url:'/api/start_dialysis/modify',
112
     method:'Post',
123
     method:'Post',
113
     params:params,
124
     params:params,
125
+    headers:{"Permission":2},
126
+
114
   })
127
   })
115
 }
128
 }
116
 
129
 
125
     url:'/api/finish_dialysis/modify',
138
     url:'/api/finish_dialysis/modify',
126
     method:'Post',
139
     method:'Post',
127
     params:params,
140
     params:params,
141
+    headers:{"Permission":2},
142
+
128
   })
143
   })
129
 }
144
 }
130
 
145
 

+ 11 - 6
src/api/patient.js Datei anzeigen

57
   })
57
   })
58
 }
58
 }
59
 
59
 
60
-export function createPatientDialysisSolution(id, solution) {
60
+export function createPatientDialysisSolution(id, solution,mode) {
61
   return request({
61
   return request({
62
-    url: '/api/patients/dialysissolution/create?patient=' + id,
62
+    url: '/api/patients/dialysissolution/create?patient=' + id +"&mode="+mode,
63
     method: 'post',
63
     method: 'post',
64
-    data: solution
64
+    data: solution,
65
+    headers:{"Permission":2},
66
+
67
+
65
   })
68
   })
66
 }
69
 }
67
 
70
 
68
-export function editPatientDialysisSolution(patient, id, solution) {
71
+export function editPatientDialysisSolution(patient, id, solution,mode) {
69
   return request({
72
   return request({
70
-    url: '/api/patients/dialysissolution/edit?patient=' + patient + '&id=' + id,
73
+    url: '/api/patients/dialysissolution/edit?patient=' + patient + '&id=' + id+"&mode="+mode,
71
     method: 'put',
74
     method: 'put',
72
-    data: solution
75
+    data: solution,
76
+    headers:{"Permission":2},
77
+
73
   })
78
   })
74
 }
79
 }
75
 
80
 

+ 14 - 11
src/api/role/admin.js Datei anzeigen

25
     })
25
     })
26
 }
26
 }
27
 
27
 
28
-export function addAdmin(mobile, name, type, title, role, intro) {
28
+export function addAdmin(mobile, name, type, title, role, intro,user_title_name) {
29
     const params = {
29
     const params = {
30
         mobile: mobile,
30
         mobile: mobile,
31
-        name: name, 
32
-        type: type, 
33
-        title: title, 
34
-        role: role, 
31
+        name: name,
32
+        type: type,
33
+        title: title,
34
+        role: role,
35
         intro: intro,
35
         intro: intro,
36
+        user_title_name: user_title_name
36
     }
37
     }
37
     return request({
38
     return request({
38
         url: '/api/admin/add',
39
         url: '/api/admin/add',
52
     })
53
     })
53
 }
54
 }
54
 
55
 
55
-export function modifyAdmin(uid, name, type, title, role, intro) {
56
+export function modifyAdmin(uid, name, type, title, role, intro,user_title_name) {
56
     const params = {
57
     const params = {
57
         uid: uid,
58
         uid: uid,
58
-        name: name, 
59
-        type: type, 
60
-        title: title, 
61
-        role: role, 
59
+        name: name,
60
+        type: type,
61
+        title: title,
62
+        role: role,
62
         intro: intro,
63
         intro: intro,
64
+      user_title_name: user_title_name
65
+
63
     }
66
     }
64
     return request({
67
     return request({
65
         url: '/api/admin/edit',
68
         url: '/api/admin/edit',
96
         method: 'post',
99
         method: 'post',
97
         params: params,
100
         params: params,
98
     })
101
     })
99
-}
102
+}

+ 26 - 1
src/api/role/role.js Datei anzeigen

69
         method: 'post',
69
         method: 'post',
70
         params: params,
70
         params: params,
71
     })
71
     })
72
-}
72
+}
73
+
74
+
75
+export function getRolesList() {
76
+  return request({
77
+    url: '/api/roles/list',
78
+    method: 'get',
79
+  })
80
+}
81
+
82
+export function getStaffsList() {
83
+  return request({
84
+    url: '/api/staff',
85
+    method: 'get',
86
+  })
87
+}
88
+
89
+
90
+export function AddUserRole(params){
91
+  return request({
92
+    url:'/api/role/addStaff',
93
+    method:'post',
94
+    params:params,
95
+  })
96
+}
97
+

+ 7 - 0
src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue Datei anzeigen

582
 
582
 
583
         ParamsQuery['patient'] = this.patient.id
583
         ParamsQuery['patient'] = this.patient.id
584
         ParamsQuery['record_date'] = this.record_date
584
         ParamsQuery['record_date'] = this.record_date
585
+        ParamsQuery['mode'] = "1"
586
+        if(this.assessment_after_dislysis.creater > 0){
587
+          ParamsQuery['mode'] = "2"
588
+          if(this.assessment_after_dislysis.creater != this.$store.getters.xt_user.user.id){
589
+            ParamsQuery['mode'] = "3"
590
+          }
591
+        }
585
 
592
 
586
         const data = {}
593
         const data = {}
587
         data['weight_after'] = this.form.weight_after ? parseFloat(this.form.weight_after) : 0
594
         data['weight_after'] = this.form.weight_after ? parseFloat(this.form.weight_after) : 0

+ 68 - 67
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue Datei anzeigen

271
   import {
271
   import {
272
     CheckDoctorAdvice,
272
     CheckDoctorAdvice,
273
     CreateDoctorAdvice,
273
     CreateDoctorAdvice,
274
-    CreateGroupAdvice,
275
     DeleteDoctorAdvice,
274
     DeleteDoctorAdvice,
276
     DeleteGroupAdvice,
275
     DeleteGroupAdvice,
277
     EditDoctorAdvice,
276
     EditDoctorAdvice,
471
         })
470
         })
472
       },
471
       },
473
 
472
 
474
-      submitGroupAdvice() {
475
-        if (this.groupForm.start_time.length == 0) {
476
-          this.$message.error('请选择开始时间')
477
-          return
478
-        }
479
-        CreateGroupAdvice(this.patient.id, this.groupForm).then(response => {
480
-          if (response.data.state == 0) {
481
-            this.$message.error(response.data.msg)
482
-            return false
483
-          } else {
484
-            this.$notify({
485
-              title: '成功',
486
-              message: '新增成功',
487
-              type: 'success',
488
-              duration: 2000
489
-            })
490
-            this.currentIndex = -1
491
-            this.currentRow = null
492
-            this.setCurrent()
493
-            this.hideGroupForm()
494
-            for (const index in response.data.data.advices) {
495
-              this.doctor_advices.unshift(response.data.data.advices[index])
496
-            }
497
-            this.groupForm = {
498
-              advice_type: 2,
499
-              advice_date: '',
500
-              start_time: '',
501
-              adviceNames: [],
502
-              advice_doctor: '',
503
-              remark: '',
504
-              parent_id: 0
505
-            }
506
-            return false
507
-          }
508
-        })
509
-      },
510
-      submitTempForm() {
511
-        var _this = this
512
-        if (this.templateForm.id.length == 0) {
513
-          this.$message.error('请选择医嘱模板')
514
-          return
515
-        }
516
-        if (_this.templateForm.id in _this.adviceTemplateMaps) {
517
-          var mapid = _this.templateForm.id
518
-          for (const index in _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate) {
519
-            var item = {
520
-              advice_name: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
521
-              single_dose: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose,
522
-              single_dose_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose_unit,
523
-              drug_spec: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
524
-              drug_spec_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
525
-              prescribing_number: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number,
526
-              prescribing_number_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number_unit,
527
-              delivery_way: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].delivery_way,
528
-              execution_frequency: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
529
-              isEdit: 0,
530
-              index: 0
531
-            }
532
-            _this.groupForm.adviceNames.push(item)
533
-          }
534
-        }
535
-        this.title = '新增医嘱'
536
-        this.showTemplateForm = false
537
-        this.showGroupForm = true
538
-      },
473
+      // submitGroupAdvice() {
474
+      //   if (this.groupForm.start_time.length == 0) {
475
+      //     this.$message.error('请选择开始时间')
476
+      //     return
477
+      //   }
478
+      //   CreateGroupAdvice(this.patient.id, this.groupForm).then(response => {
479
+      //     if (response.data.state == 0) {
480
+      //       this.$message.error(response.data.msg)
481
+      //       return false
482
+      //     } else {
483
+      //       this.$notify({
484
+      //         title: '成功',
485
+      //         message: '新增成功',
486
+      //         type: 'success',
487
+      //         duration: 2000
488
+      //       })
489
+      //       this.currentIndex = -1
490
+      //       this.currentRow = null
491
+      //       this.setCurrent()
492
+      //       this.hideGroupForm()
493
+      //       for (const index in response.data.data.advices) {
494
+      //         this.doctor_advices.unshift(response.data.data.advices[index])
495
+      //       }
496
+      //       this.groupForm = {
497
+      //         advice_type: 2,
498
+      //         advice_date: '',
499
+      //         start_time: '',
500
+      //         adviceNames: [],
501
+      //         advice_doctor: '',
502
+      //         remark: '',
503
+      //         parent_id: 0
504
+      //       }
505
+      //       return false
506
+      //     }
507
+      //   })
508
+      // },
509
+      // submitTempForm() {
510
+      //   var _this = this
511
+      //   if (this.templateForm.id.length == 0) {
512
+      //     this.$message.error('请选择医嘱模板')
513
+      //     return
514
+      //   }
515
+      //   if (_this.templateForm.id in _this.adviceTemplateMaps) {
516
+      //     var mapid = _this.templateForm.id
517
+      //     for (const index in _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate) {
518
+      //       var item = {
519
+      //         advice_name: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
520
+      //         single_dose: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose,
521
+      //         single_dose_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose_unit,
522
+      //         drug_spec: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
523
+      //         drug_spec_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
524
+      //         prescribing_number: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number,
525
+      //         prescribing_number_unit: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number_unit,
526
+      //         delivery_way: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].delivery_way,
527
+      //         execution_frequency: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
528
+      //         isEdit: 0,
529
+      //         index: 0
530
+      //       }
531
+      //       _this.groupForm.adviceNames.push(item)
532
+      //     }
533
+      //   }
534
+      //   this.title = '新增医嘱'
535
+      //   this.showTemplateForm = false
536
+      //   this.showGroupForm = true
537
+      // },
539
       openAdviceTemplate() {
538
       openAdviceTemplate() {
540
         this.templateForm = { id: '' }
539
         this.templateForm = { id: '' }
541
         this.title = '选择医嘱模板'
540
         this.title = '选择医嘱模板'
952
           type: 'warning'
951
           type: 'warning'
953
         }).then(() => {
952
         }).then(() => {
954
           this.deleLoading = true
953
           this.deleLoading = true
955
-          CheckDoctorAdvice(this.patient.id, this.currentRow.id).then(response => {
954
+          let mode = "7"
955
+
956
+          CheckDoctorAdvice(this.patient.id, this.currentRow.id,mode).then(response => {
956
             if (response.data.state == 0) {
957
             if (response.data.state == 0) {
957
               this.$message.error(response.data.msg)
958
               this.$message.error(response.data.msg)
958
 
959
 

+ 9 - 0
src/xt_pages/dialysis/details/dialog/acceptsTreatmentDialog.vue Datei anzeigen

235
         let ParamsQuery = this.receiveTreatmentAsses
235
         let ParamsQuery = this.receiveTreatmentAsses
236
         ParamsQuery['patient'] = this.patient.id
236
         ParamsQuery['patient'] = this.patient.id
237
         ParamsQuery['record_date'] = this.record_date
237
         ParamsQuery['record_date'] = this.record_date
238
+        console.log(this.receiver_treatment_access)
239
+        ParamsQuery['mode'] = "1"
240
+        if(this.receiver_treatment_access.id > 0){
241
+          ParamsQuery['mode'] = "2"
242
+          if(this.$store.getters.xt_user.user.id != this.receiver_treatment_access.creater){
243
+            ParamsQuery['mode'] = "3"
244
+          }
245
+        }
246
+
238
         postAccepts(ParamsQuery).then(response => {
247
         postAccepts(ParamsQuery).then(response => {
239
           if (response.data.state == 0) {
248
           if (response.data.state == 0) {
240
             this.$message.error(response.data.msg)
249
             this.$message.error(response.data.msg)

+ 9 - 0
src/xt_pages/dialysis/details/dialog/assessmentBeforeDislysisDialog.vue Datei anzeigen

761
         const ParamsQuery = this.assessmentBeforeDislysis
761
         const ParamsQuery = this.assessmentBeforeDislysis
762
         ParamsQuery['patient'] = this.patient.id
762
         ParamsQuery['patient'] = this.patient.id
763
         ParamsQuery['record_date'] = this.record_date
763
         ParamsQuery['record_date'] = this.record_date
764
+        ParamsQuery['mode'] = 1
765
+        console.log(this.predialysis_evaluation)
766
+        if (this.predialysis_evaluation.creator > 0){
767
+          ParamsQuery['mode'] = 2
768
+          if(this.predialysis_evaluation.creator != this.$store.getters.xt_user.user.id){
769
+            ParamsQuery['mode'] = 3
770
+          }
771
+        }
772
+
764
         postAssessmentBeforeDislysis(ParamsQuery).then(response => {
773
         postAssessmentBeforeDislysis(ParamsQuery).then(response => {
765
           if (response.data.state == 0) {
774
           if (response.data.state == 0) {
766
             this.$message.error(response.data.msg)
775
             this.$message.error(response.data.msg)

+ 55 - 73
src/xt_pages/dialysis/details/dialog/computer_dialog.vue Datei anzeigen

5
 
5
 
6
         <el-form-item label="班次">
6
         <el-form-item label="班次">
7
           <el-select v-model="schedual_type" placeholder="请选择班次" @change="changeSchedualType">
7
           <el-select v-model="schedual_type" placeholder="请选择班次" @change="changeSchedualType">
8
-            <el-option v-for="(item, index) in schedules_type" :key="index" :value="item.id" :label="item.name" ></el-option>
8
+            <el-option v-for="(item, index) in schedules_type" :key="index" :value="item.id"
9
+                       :label="item.name"></el-option>
9
           </el-select>
10
           </el-select>
10
         </el-form-item>
11
         </el-form-item>
11
 
12
 
12
         <el-form-item label="上机床位">
13
         <el-form-item label="上机床位">
13
-          <el-select v-model="form.bed_id" placeholder="请选择上机床位" >
14
+          <el-select v-model="form.bed_id" placeholder="请选择上机床位">
14
             <el-option v-for="(bed, index) in zone_beds" :key="index" :value="bed.id" :label="bed.number"></el-option>
15
             <el-option v-for="(bed, index) in zone_beds" :key="index" :value="bed.id" :label="bed.number"></el-option>
15
           </el-select>
16
           </el-select>
16
         </el-form-item>
17
         </el-form-item>
17
         <el-form-item label="上机护士">
18
         <el-form-item label="上机护士">
18
-          <el-select v-model="form.nurse_id" placeholder="请选择上机护士" >
19
+          <el-select v-model="form.nurse_id" placeholder="请选择上机护士">
19
             <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
20
             <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
20
           </el-select>
21
           </el-select>
21
         </el-form-item>
22
         </el-form-item>
22
         <el-form-item label="穿刺护士">
23
         <el-form-item label="穿刺护士">
23
-          <el-select v-model="form.puncture_nurse_id" placeholder="请选择穿刺护士" >
24
+          <el-select v-model="form.puncture_nurse_id" placeholder="请选择穿刺护士">
24
             <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
25
             <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
25
           </el-select>
26
           </el-select>
26
         </el-form-item>
27
         </el-form-item>
27
-        <el-form-item label="引血(ml/min)" v-if="template_id == 6" >
28
+        <el-form-item label="引血(ml/min)" v-if="template_id == 6">
28
           <el-input type="number" v-model="form.blood_drawing" style="width:200px;"></el-input>
29
           <el-input type="number" v-model="form.blood_drawing" style="width:200px;"></el-input>
29
         </el-form-item>
30
         </el-form-item>
30
 
31
 
41
         <el-form-item>
42
         <el-form-item>
42
           <el-button v-if="dialysis_order.id == 0" @click="submit" type="primary" :loading="loading">执行上机</el-button>
43
           <el-button v-if="dialysis_order.id == 0" @click="submit" type="primary" :loading="loading">执行上机</el-button>
43
           <el-button v-else type="info" :disabled="true">已上机</el-button>
44
           <el-button v-else type="info" :disabled="true">已上机</el-button>
44
-          <el-button v-if="dialysis_order.id > 0 && (isPremission || this.$store.getters.xt_user.user.id == this.creator)" type="primary" @click="editOrder">修改上机</el-button>
45
+          <el-button
46
+            v-if="dialysis_order.id > 0 && (isPremission || this.$store.getters.xt_user.user.id == this.creator)"
47
+            type="primary" @click="editOrder">修改上机
48
+          </el-button>
45
 
49
 
46
         </el-form-item>
50
         </el-form-item>
47
       </el-form>
51
       </el-form>
51
 </template>
55
 </template>
52
 
56
 
53
 <script>
57
 <script>
54
-  import { startDialysis,GetSchedualNumber,PostModifyStartDialysis } from '@/api/dialysis_record'
58
+  import { GetSchedualNumber, PostModifyStartDialysis, startDialysis } from '@/api/dialysis_record'
55
   import { parseTime } from '@/utils'
59
   import { parseTime } from '@/utils'
56
 
60
 
57
   export default {
61
   export default {
58
     name: 'ComputerDialog',
62
     name: 'ComputerDialog',
59
     data() {
63
     data() {
60
       return {
64
       return {
61
-        zone_beds:[],
65
+        zone_beds: [],
62
         visible: false,
66
         visible: false,
63
         loading: false,
67
         loading: false,
64
         template_id: 0,
68
         template_id: 0,
65
         patient_id: 0,
69
         patient_id: 0,
66
         schedule_date: 0,
70
         schedule_date: 0,
67
         start_time: 0,
71
         start_time: 0,
68
-        creator:0,
72
+        creator: 0,
69
         form: {
73
         form: {
70
           bed_id: '',
74
           bed_id: '',
71
           nurse_id: '',
75
           nurse_id: '',
73
           puncture_nurse_id: '',
77
           puncture_nurse_id: '',
74
           blood_drawing: 100
78
           blood_drawing: 100
75
         },
79
         },
76
-        schedual_type:0,
80
+        schedual_type: 0,
77
         schedules_type: [
81
         schedules_type: [
78
-          {id: 1, name:"上午"},
79
-          {id: 2, name:"下午"},
80
-          {id: 3, name:"晚上"},
82
+          { id: 1, name: '上午' },
83
+          { id: 2, name: '下午' },
84
+          { id: 3, name: '晚上' }
81
         ], // 该排班的区里的床位
85
         ], // 该排班的区里的床位
82
-        isPremission:false,
86
+        isPremission: false
83
       }
87
       }
84
     },
88
     },
85
     props: {
89
     props: {
96
         type: Array
100
         type: Array
97
       },
101
       },
98
       special_premission: {
102
       special_premission: {
99
-        type: Array,
100
-      },
101
-    },mounted(){
102
-
103
-
104
-
103
+        type: Array
104
+      }
105
+    }, mounted() {
105
 
106
 
106
     },
107
     },
107
     created() {
108
     created() {
115
         this.form.puncture_nurse_id = this.$store.getters.xt_user.user.id
116
         this.form.puncture_nurse_id = this.$store.getters.xt_user.user.id
116
       }
117
       }
117
 
118
 
118
-
119
-
120
-
121
-
122
-
123
-
124
     },
119
     },
125
     watch: {
120
     watch: {
126
       'schedule.id': function() {
121
       'schedule.id': function() {
127
       },
122
       },
128
       'dialysis_order.id': function() {
123
       'dialysis_order.id': function() {
129
 
124
 
130
-
131
-
132
         this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
125
         this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
133
         this.form.puncture_nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.puncture_nurse
126
         this.form.puncture_nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.puncture_nurse
134
 
127
 
147
           (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
140
           (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
148
         this.form.start_time = this.dialysis_order.id == 0 ? time : this.getTime(this.dialysis_order.start_time, '{y}-{m}-{d} {h}:{i}')
141
         this.form.start_time = this.dialysis_order.id == 0 ? time : this.getTime(this.dialysis_order.start_time, '{y}-{m}-{d} {h}:{i}')
149
 
142
 
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
       }
143
       }
158
     },
144
     },
159
-    computed: {
160
-      // zone_beds: function() {
161
-      //   var beds = []
162
-      //   for (let index = 0; index < this.device_numbers.length; index++) {
163
-      //     const device_number = this.device_numbers[index]
164
-      //     beds.push(device_number)
165
-      //   }
166
-      //   console.log(this.device_numbers)
167
-      //   return beds
168
-      // }
169
-    },
145
+    computed: {},
170
     methods: {
146
     methods: {
171
-      changeSchedualType:function(schedual_type){
147
+      changeSchedualType: function(schedual_type) {
172
         let ParamsQuery = {}
148
         let ParamsQuery = {}
173
         ParamsQuery['schedual_type'] = schedual_type
149
         ParamsQuery['schedual_type'] = schedual_type
174
         GetSchedualNumber(ParamsQuery).then(response => {
150
         GetSchedualNumber(ParamsQuery).then(response => {
178
             this.temp_device_numbers = response.data.data.number
154
             this.temp_device_numbers = response.data.data.number
179
             for (let index = 0; index < this.temp_device_numbers.length; index++) {
155
             for (let index = 0; index < this.temp_device_numbers.length; index++) {
180
               const device_number = this.temp_device_numbers[index]
156
               const device_number = this.temp_device_numbers[index]
181
-              this.temp_device_numbers[index]['number'] = device_number['zone_name']+'-'+device_number['number']
157
+              this.temp_device_numbers[index]['number'] = device_number['zone_name'] + '-' + device_number['number']
182
             }
158
             }
183
             this.zone_beds = this.temp_device_numbers
159
             this.zone_beds = this.temp_device_numbers
184
             this.form.bed_id = this.zone_beds[0].id
160
             this.form.bed_id = this.zone_beds[0].id
187
         })
163
         })
188
 
164
 
189
       },
165
       },
190
-      GetSchedualNumber:function(){
166
+      GetSchedualNumber: function() {
191
         let ParamsQuery = {}
167
         let ParamsQuery = {}
192
         ParamsQuery['schedual_type'] = this.schedual_type
168
         ParamsQuery['schedual_type'] = this.schedual_type
193
         GetSchedualNumber(ParamsQuery).then(response => {
169
         GetSchedualNumber(ParamsQuery).then(response => {
198
             this.temp_device_numbers = response.data.data.number
174
             this.temp_device_numbers = response.data.data.number
199
             for (let index = 0; index < this.temp_device_numbers.length; index++) {
175
             for (let index = 0; index < this.temp_device_numbers.length; index++) {
200
               const device_number = this.temp_device_numbers[index]
176
               const device_number = this.temp_device_numbers[index]
201
-              this.temp_device_numbers[index]['number'] = device_number['zone_name']+'-'+device_number['number']
177
+              this.temp_device_numbers[index]['number'] = device_number['zone_name'] + '-' + device_number['number']
202
             }
178
             }
203
             this.zone_beds = this.temp_device_numbers
179
             this.zone_beds = this.temp_device_numbers
204
 
180
 
205
             this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
181
             this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
206
-            if(this.dialysis_order.id == 0) {
182
+            if (this.dialysis_order.id == 0) {
207
               let isFilter = true
183
               let isFilter = true
208
               for (let i = 0; i < this.zone_beds.length; i++) {
184
               for (let i = 0; i < this.zone_beds.length; i++) {
209
-                if(this.zone_beds[i].id == this.schedule.bed_id ){
185
+                if (this.zone_beds[i].id == this.schedule.bed_id) {
210
                   isFilter = false
186
                   isFilter = false
211
 
187
 
212
                 }
188
                 }
213
               }
189
               }
214
-              if(isFilter){
190
+              if (isFilter) {
215
                 this.form.bed_id = this.zone_beds[0].id
191
                 this.form.bed_id = this.zone_beds[0].id
216
               }
192
               }
217
-            }else{
218
-              for (let i = 0; i < this.device_numbers.length; i++){
219
-                if (this.device_numbers[i].id == this.dialysis_order.bed_id){
193
+            } else {
194
+              for (let i = 0; i < this.device_numbers.length; i++) {
195
+                if (this.device_numbers[i].id == this.dialysis_order.bed_id) {
220
                   let obj = {}
196
                   let obj = {}
221
                   obj = this.device_numbers[i]
197
                   obj = this.device_numbers[i]
222
-                  if(obj['number'].indexOf(this.device_numbers[i]['zone_name']) == -1) {
223
-                    obj['number'] = this.device_numbers[i]['zone_name'] + "-" + this.device_numbers[i]['number']
198
+                  if (obj['number'].indexOf(this.device_numbers[i]['zone_name']) == -1) {
199
+                    obj['number'] = this.device_numbers[i]['zone_name'] + '-' + this.device_numbers[i]['number']
224
                   }
200
                   }
225
                   this.zone_beds.unshift(obj)
201
                   this.zone_beds.unshift(obj)
226
-                  this.zone_beds.sort((a, b) => a.id -b.id)
202
+                  this.zone_beds.sort((a, b) => a.id - b.id)
227
                 }
203
                 }
228
               }
204
               }
229
             }
205
             }
261
         if (this.dialysis_order.id == 0) {
237
         if (this.dialysis_order.id == 0) {
262
           let now = new Date()
238
           let now = new Date()
263
           let hour = now.getHours()
239
           let hour = now.getHours()
264
-          if (hour >= 6 && hour < 12){
240
+          if (hour >= 6 && hour < 12) {
265
             this.schedual_type = 1
241
             this.schedual_type = 1
266
 
242
 
267
-          }else if(hour >= 12 && hour < 18){
243
+          } else if (hour >= 12 && hour < 18) {
268
 
244
 
269
             this.schedual_type = 2
245
             this.schedual_type = 2
270
 
246
 
271
-
272
-          }else if(hour >= 18){
247
+          } else if (hour >= 18) {
273
             this.schedual_type = 3
248
             this.schedual_type = 3
274
           }
249
           }
275
         } else {
250
         } else {
277
           this.schedual_type = this.dialysis_order.schedual_type
252
           this.schedual_type = this.dialysis_order.schedual_type
278
         }
253
         }
279
 
254
 
280
-
281
         if (this.dialysis_order.id > 0) {
255
         if (this.dialysis_order.id > 0) {
282
           for (let i = 0; i < this.special_premission.length; i++) {
256
           for (let i = 0; i < this.special_premission.length; i++) {
283
             if (this.$store.getters.xt_user.user.id == this.special_premission[i].admin_user_id) {
257
             if (this.$store.getters.xt_user.user.id == this.special_premission[i].admin_user_id) {
300
         this.visible = false
274
         this.visible = false
301
       },
275
       },
302
       submit: function() {
276
       submit: function() {
303
-        if(this.form.start_time == "" || this.form.start_time == null){
304
-          this.$message.error("开始时间不能为空")
277
+        if (this.form.start_time == '' || this.form.start_time == null) {
278
+          this.$message.error('开始时间不能为空')
305
           return
279
           return
306
         }
280
         }
281
+        console.log(this.dialysis_order)
307
         this.loading = true
282
         this.loading = true
308
-        startDialysis(this.patient_id, parseTime(this.schedule_date, '{y}-{m}-{d}'), this.form.nurse_id, this.form.bed_id, this.form.lood_drawing, this.form.puncture_nurse_id, this.form.start_time,this.schedual_type).then(rs => {
283
+        let mode = '1'
284
+
285
+        startDialysis(this.patient_id, parseTime(this.schedule_date, '{y}-{m}-{d}'), this.form.nurse_id, this.form.bed_id, this.form.lood_drawing, this.form.puncture_nurse_id, this.form.start_time, this.schedual_type, mode).then(rs => {
309
           this.loading = false
286
           this.loading = false
310
           var resp = rs.data
287
           var resp = rs.data
311
           if (resp.state == 1) {
288
           if (resp.state == 1) {
315
               this.$set(this_order, key, resp_dialysis_order[key])
292
               this.$set(this_order, key, resp_dialysis_order[key])
316
             }
293
             }
317
             this.hide()
294
             this.hide()
318
-            this.$emit('monitor',  resp.data.monitor)
319
-            this.$message.success("上机成功")
295
+            this.$emit('monitor', resp.data.monitor)
296
+            this.$message.success('上机成功')
320
           } else {
297
           } else {
321
             this.$message.error(resp.msg)
298
             this.$message.error(resp.msg)
322
           }
299
           }
323
         })
300
         })
324
-      }, editOrder(){
301
+      }, editOrder() {
325
         let ParamsQuery = {}
302
         let ParamsQuery = {}
326
         ParamsQuery['schedual_type'] = this.schedual_type
303
         ParamsQuery['schedual_type'] = this.schedual_type
327
         ParamsQuery['id'] = this.dialysis_order.id
304
         ParamsQuery['id'] = this.dialysis_order.id
328
         ParamsQuery['nurse'] = this.form.nurse_id
305
         ParamsQuery['nurse'] = this.form.nurse_id
329
         ParamsQuery['bed'] = this.form.bed_id
306
         ParamsQuery['bed'] = this.form.bed_id
330
-        ParamsQuery['start_time'] =  this.form.start_time
307
+        ParamsQuery['start_time'] = this.form.start_time
331
         ParamsQuery['puncture_nurse'] = this.form.puncture_nurse_id
308
         ParamsQuery['puncture_nurse'] = this.form.puncture_nurse_id
309
+
310
+        ParamsQuery['mode'] = "2"
311
+        if (this.dialysis_order.creator != this.$store.getters.xt_user.user.id) {
312
+          ParamsQuery['mode'] = "3"
313
+        }
332
         PostModifyStartDialysis(ParamsQuery).then(rs => {
314
         PostModifyStartDialysis(ParamsQuery).then(rs => {
333
           var resp = rs.data
315
           var resp = rs.data
334
           if (resp.state == 1) {
316
           if (resp.state == 1) {
335
-            this.$message.success("修改成功")
317
+            this.$message.success('修改成功')
336
 
318
 
337
             var resp_dialysis_order = resp.data.dialysis_order
319
             var resp_dialysis_order = resp.data.dialysis_order
338
             var this_order = this.dialysis_order
320
             var this_order = this.dialysis_order
346
             this.$message.error(resp.msg)
328
             this.$message.error(resp.msg)
347
           }
329
           }
348
         })
330
         })
349
-      },
331
+      }
350
 
332
 
351
     }
333
     }
352
   }
334
   }

+ 101 - 1
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue Datei anzeigen

836
 
836
 
837
           no_anticoagulant_shouji: '0',
837
           no_anticoagulant_shouji: '0',
838
           no_anticoagulant_weichi: '0',
838
           no_anticoagulant_weichi: '0',
839
-          no_anticoagulant_zongliang: '0'
839
+          no_anticoagulant_zongliang: '0',
840
+
841
+
842
+          creater:0,
840
 
843
 
841
         },
844
         },
842
 
845
 
995
             ParamsQuery['patient'] = this.patient.id
998
             ParamsQuery['patient'] = this.patient.id
996
             ParamsQuery['record_date'] = this.record_date
999
             ParamsQuery['record_date'] = this.record_date
997
 
1000
 
1001
+            console.log(this.prescription)
1002
+
1003
+            if(this.prescription.creater <= 0){
1004
+              mode = 1
1005
+            }else {
1006
+              mode = 2
1007
+            }
1008
+
1009
+
998
             postPrescription(ParamsQuery).then(response => {
1010
             postPrescription(ParamsQuery).then(response => {
999
               if (response.data.state == 0) {
1011
               if (response.data.state == 0) {
1000
                 this.$message.error(response.data.msg)
1012
                 this.$message.error(response.data.msg)
1105
             const ParamsQuery = this.dialysisPrescription
1117
             const ParamsQuery = this.dialysisPrescription
1106
             ParamsQuery['patient'] = this.patient.id
1118
             ParamsQuery['patient'] = this.patient.id
1107
             ParamsQuery['record_date'] = this.record_date
1119
             ParamsQuery['record_date'] = this.record_date
1120
+            console.log(this.prescription)
1121
+
1122
+            if(this.prescription.creater <= 0){
1123
+              mode = 1
1124
+            }else {
1125
+              mode = 2
1126
+            }
1127
+
1108
 
1128
 
1109
             postPrescription(ParamsQuery).then(response => {
1129
             postPrescription(ParamsQuery).then(response => {
1110
               if (response.data.state == 0) {
1130
               if (response.data.state == 0) {
1243
             const ParamsQuery = this.dialysisPrescription
1263
             const ParamsQuery = this.dialysisPrescription
1244
             ParamsQuery['patient'] = this.patient.id
1264
             ParamsQuery['patient'] = this.patient.id
1245
             ParamsQuery['record_date'] = this.record_date
1265
             ParamsQuery['record_date'] = this.record_date
1266
+            console.log(this.prescription)
1267
+
1268
+            if(this.prescription.creater <= 0){
1269
+              mode = 1
1270
+            }else {
1271
+              mode = 2
1272
+            }
1273
+
1246
 
1274
 
1247
             postPrescription(ParamsQuery).then(response => {
1275
             postPrescription(ParamsQuery).then(response => {
1248
               if (response.data.state == 0) {
1276
               if (response.data.state == 0) {
1280
               const ParamsQuery = this.dialysisPrescription
1308
               const ParamsQuery = this.dialysisPrescription
1281
               ParamsQuery['patient'] = this.patient.id
1309
               ParamsQuery['patient'] = this.patient.id
1282
               ParamsQuery['record_date'] = this.record_date
1310
               ParamsQuery['record_date'] = this.record_date
1311
+              console.log(this.prescription)
1312
+
1313
+              if(this.prescription.creater <= 0){
1314
+                mode = 1
1315
+              }else {
1316
+                mode = 2
1317
+              }
1318
+
1283
 
1319
 
1284
               postPrescription(ParamsQuery).then(response => {
1320
               postPrescription(ParamsQuery).then(response => {
1285
                 if (response.data.state == 0) {
1321
                 if (response.data.state == 0) {
1333
               const ParamsQuery = this.dialysisPrescription
1369
               const ParamsQuery = this.dialysisPrescription
1334
               ParamsQuery['patient'] = this.patient.id
1370
               ParamsQuery['patient'] = this.patient.id
1335
               ParamsQuery['record_date'] = this.record_date
1371
               ParamsQuery['record_date'] = this.record_date
1372
+              console.log(this.prescription)
1373
+
1374
+              if(this.prescription.creater <= 0){
1375
+                mode = 1
1376
+              }else {
1377
+                mode = 2
1378
+              }
1379
+
1336
 
1380
 
1337
               postPrescription(ParamsQuery).then(response => {
1381
               postPrescription(ParamsQuery).then(response => {
1338
                 if (response.data.state == 0) {
1382
                 if (response.data.state == 0) {
1365
               const ParamsQuery = this.dialysisPrescription
1409
               const ParamsQuery = this.dialysisPrescription
1366
               ParamsQuery['patient'] = this.patient.id
1410
               ParamsQuery['patient'] = this.patient.id
1367
               ParamsQuery['record_date'] = this.record_date
1411
               ParamsQuery['record_date'] = this.record_date
1412
+              console.log(this.prescription)
1413
+
1414
+              if(this.prescription.creater <= 0){
1415
+                mode = 1
1416
+              }else {
1417
+                mode = 2
1418
+              }
1419
+
1368
 
1420
 
1369
               postPrescription(ParamsQuery).then(response => {
1421
               postPrescription(ParamsQuery).then(response => {
1370
                 if (response.data.state == 0) {
1422
                 if (response.data.state == 0) {
1401
               const ParamsQuery = this.dialysisPrescription
1453
               const ParamsQuery = this.dialysisPrescription
1402
               ParamsQuery['patient'] = this.patient.id
1454
               ParamsQuery['patient'] = this.patient.id
1403
               ParamsQuery['record_date'] = this.record_date
1455
               ParamsQuery['record_date'] = this.record_date
1456
+              console.log(this.prescription)
1457
+
1458
+              if(this.prescription.creater <= 0){
1459
+                mode = 1
1460
+              }else {
1461
+                mode = 2
1462
+              }
1463
+
1404
 
1464
 
1405
               postPrescription(ParamsQuery).then(response => {
1465
               postPrescription(ParamsQuery).then(response => {
1406
                 if (response.data.state == 0) {
1466
                 if (response.data.state == 0) {
1438
                 const ParamsQuery = this.dialysisPrescription
1498
                 const ParamsQuery = this.dialysisPrescription
1439
                 ParamsQuery['patient'] = this.patient.id
1499
                 ParamsQuery['patient'] = this.patient.id
1440
                 ParamsQuery['record_date'] = this.record_date
1500
                 ParamsQuery['record_date'] = this.record_date
1501
+                console.log(this.prescription)
1502
+
1503
+                if(this.prescription.creater <= 0){
1504
+                  mode = 1
1505
+                }else {
1506
+                  mode = 2
1507
+                }
1508
+
1441
 
1509
 
1442
                 postPrescription(ParamsQuery).then(response => {
1510
                 postPrescription(ParamsQuery).then(response => {
1443
                   if (response.data.state == 0) {
1511
                   if (response.data.state == 0) {
1491
                 const ParamsQuery = this.dialysisPrescription
1559
                 const ParamsQuery = this.dialysisPrescription
1492
                 ParamsQuery['patient'] = this.patient.id
1560
                 ParamsQuery['patient'] = this.patient.id
1493
                 ParamsQuery['record_date'] = this.record_date
1561
                 ParamsQuery['record_date'] = this.record_date
1562
+                console.log(this.prescription)
1563
+
1564
+                if(this.prescription.creater <= 0){
1565
+                  mode = 1
1566
+                }else {
1567
+                  mode = 2
1568
+                }
1569
+
1494
 
1570
 
1495
                 postPrescription(ParamsQuery).then(response => {
1571
                 postPrescription(ParamsQuery).then(response => {
1496
                   if (response.data.state == 0) {
1572
                   if (response.data.state == 0) {
1523
                 const ParamsQuery = this.dialysisPrescription
1599
                 const ParamsQuery = this.dialysisPrescription
1524
                 ParamsQuery['patient'] = this.patient.id
1600
                 ParamsQuery['patient'] = this.patient.id
1525
                 ParamsQuery['record_date'] = this.record_date
1601
                 ParamsQuery['record_date'] = this.record_date
1602
+                console.log(this.prescription)
1603
+
1604
+                if(this.prescription.creater <= 0){
1605
+                  mode = 1
1606
+                }else {
1607
+                  mode = 2
1608
+                }
1609
+
1526
 
1610
 
1527
                 postPrescription(ParamsQuery).then(response => {
1611
                 postPrescription(ParamsQuery).then(response => {
1528
                   if (response.data.state == 0) {
1612
                   if (response.data.state == 0) {
1557
             const ParamsQuery = this.dialysisPrescription
1641
             const ParamsQuery = this.dialysisPrescription
1558
             ParamsQuery['patient'] = this.patient.id
1642
             ParamsQuery['patient'] = this.patient.id
1559
             ParamsQuery['record_date'] = this.record_date
1643
             ParamsQuery['record_date'] = this.record_date
1644
+            console.log(this.prescription)
1645
+
1646
+            if(this.prescription.creater <= 0){
1647
+              mode = 1
1648
+            }else {
1649
+              mode = 2
1650
+            }
1651
+
1560
 
1652
 
1561
             postPrescription(ParamsQuery).then(response => {
1653
             postPrescription(ParamsQuery).then(response => {
1562
               if (response.data.state == 0) {
1654
               if (response.data.state == 0) {
1708
               const ParamsQuery = this.dialysisPrescription
1800
               const ParamsQuery = this.dialysisPrescription
1709
               ParamsQuery['patient'] = this.patient.id
1801
               ParamsQuery['patient'] = this.patient.id
1710
               ParamsQuery['record_date'] = this.record_date
1802
               ParamsQuery['record_date'] = this.record_date
1803
+              console.log(this.prescription)
1804
+
1805
+              if(this.prescription.creater <= 0){
1806
+                mode = 1
1807
+              }else {
1808
+                mode = 2
1809
+              }
1810
+
1711
 
1811
 
1712
               postPrescription(ParamsQuery).then(response => {
1812
               postPrescription(ParamsQuery).then(response => {
1713
                 if (response.data.state == 0) {
1813
                 if (response.data.state == 0) {

+ 6 - 1
src/xt_pages/dialysis/details/dialog/finish_dialog.vue Datei anzeigen

169
         ParamsQuery["id"] = this.dialysis_order.id;
169
         ParamsQuery["id"] = this.dialysis_order.id;
170
         ParamsQuery["nurse"] = this.form.nurse_id;
170
         ParamsQuery["nurse"] = this.form.nurse_id;
171
         ParamsQuery["end_time"] = this.end_time;
171
         ParamsQuery["end_time"] = this.end_time;
172
+        ParamsQuery["mode"] = "2"
173
+        if(this.dialysis_order.finish_creator  != this.$store.getters.xt_user.user.id){
174
+          ParamsQuery["mode"] = "3"
175
+        }
172
         PostModifyFinishDialysis(ParamsQuery).then(response => {
176
         PostModifyFinishDialysis(ParamsQuery).then(response => {
173
           if (response.data.state == 0) {
177
           if (response.data.state == 0) {
174
             this.$message.error(response.data.msg)
178
             this.$message.error(response.data.msg)
189
       },
193
       },
190
       submit: function() {
194
       submit: function() {
191
         this.loading = true
195
         this.loading = true
192
-        finishDialysis(this.patient_id, parseTime(this.schedule_date, '{y}-{m}-{d}'), this.end_time, this.form.nurse_id).then(rs => {
196
+        let mode = "1"
197
+        finishDialysis(this.patient_id, parseTime(this.schedule_date, '{y}-{m}-{d}'), this.end_time, this.form.nurse_id,mode).then(rs => {
193
           this.loading = false
198
           this.loading = false
194
           var resp = rs.data
199
           var resp = rs.data
195
           if (resp.state == 1) {
200
           if (resp.state == 1) {

+ 9 - 2
src/xt_pages/dialysis/details/dialog/monitor_dialog.vue Datei anzeigen

961
         parseFloat(this.form.ktv) == NaN ? 0 : parseFloat(this.form.ktv);
961
         parseFloat(this.form.ktv) == NaN ? 0 : parseFloat(this.form.ktv);
962
       this.form.monitoring_date = parseInt(this.form.monitoring_date);
962
       this.form.monitoring_date = parseInt(this.form.monitoring_date);
963
 
963
 
964
-      editMonitor(this.patient_id, this.schedule_date, this.form).then(rs => {
964
+
965
+      let mode = "1"
966
+       if(this.form.id > 0){
967
+         mode = "2"
968
+         if(this.form.creator > 0 && this.form.creator != this.$store.getters.xt_user.user.id){
969
+          mode = "3"
970
+         }
971
+      }
972
+      editMonitor(this.patient_id, this.schedule_date, this.form,mode).then(rs => {
965
         var resp = rs.data;
973
         var resp = rs.data;
966
         if (resp.state == 1) {
974
         if (resp.state == 1) {
967
           var monitor = resp.data.monitor;
975
           var monitor = resp.data.monitor;
968
-          console.log("monitor-----", monitor);
969
           if (this.isAdd) {
976
           if (this.isAdd) {
970
             this.monitors.unshift(monitor);
977
             this.monitors.unshift(monitor);
971
             this.monitors.sort((a, b) => b.operate_time - a.operate_time);
978
             this.monitors.sort((a, b) => b.operate_time - a.operate_time);

+ 7 - 0
src/xt_pages/dialysis/details/dialog/treatmentSummaryDialog.vue Datei anzeigen

118
         const ParamsQuery = this.treatmentSummary
118
         const ParamsQuery = this.treatmentSummary
119
         ParamsQuery['patient'] = this.patient.id
119
         ParamsQuery['patient'] = this.patient.id
120
         ParamsQuery['record_date'] = this.record_date
120
         ParamsQuery['record_date'] = this.record_date
121
+        ParamsQuery['mode'] = "1"
122
+        if(this.treatment_summary.id > 0){
123
+          ParamsQuery['mode'] = "2"
124
+          if(this.treatment_summary.creater != this.$store.getters.xt_user.user.id){
125
+            ParamsQuery['mode'] = "3"
126
+          }
127
+        }
121
         postTreatmentsummary(ParamsQuery).then(response => {
128
         postTreatmentsummary(ParamsQuery).then(response => {
122
           if (response.data.state == 0) {
129
           if (response.data.state == 0) {
123
             this.$message.error(response.data.msg)
130
             this.$message.error(response.data.msg)

+ 56 - 4
src/xt_pages/role/admin.vue Datei anzeigen

104
                 type="danger"
104
                 type="danger"
105
                 size="small"
105
                 size="small"
106
                 icon="el-icon-delete"
106
                 icon="el-icon-delete"
107
-                v-if="scope.row.status == 1"
107
+                v-if="scope.row.status == 1 && org.creator != scope.row.user_id && (scope.row.user_id != local_user_id )"
108
                 @click="disableAdminAction(scope.row)"
108
                 @click="disableAdminAction(scope.row)"
109
               ></el-button>
109
               ></el-button>
110
             </el-tooltip>
110
             </el-tooltip>
118
                 size="small"
118
                 size="small"
119
                 type="info"
119
                 type="info"
120
                 icon="el-icon-refresh"
120
                 icon="el-icon-refresh"
121
-                v-if="scope.row.status == 0"
121
+                v-if="scope.row.status == 0 && org.creator != scope.row.user_id  && (scope.row.user_id != local_user_id )"
122
                 @click="recoverAdminAction(scope.row)"
122
                 @click="recoverAdminAction(scope.row)"
123
               ></el-button>
123
               ></el-button>
124
             </el-tooltip>
124
             </el-tooltip>
144
 
144
 
145
 <script>
145
 <script>
146
 import { adminMainView, getAdmins, setAdminStatus } from "@/api/role/admin";
146
 import { adminMainView, getAdmins, setAdminStatus } from "@/api/role/admin";
147
+import { getRoles } from "@/api/role/role";
148
+
147
 import { parseTime } from "@/utils";
149
 import { parseTime } from "@/utils";
148
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
150
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
149
 import AdminInfoForm from "./components/AdminInfoForm";
151
 import AdminInfoForm from "./components/AdminInfoForm";
160
       admins: [], // [{user_id, user_name, role_name, title_name, ip, last_login_time, status}]
162
       admins: [], // [{user_id, user_name, role_name, title_name, ip, last_login_time, status}]
161
       admin_total_count: 0,
163
       admin_total_count: 0,
162
       current_page: 1,
164
       current_page: 1,
163
-      is_exist_role: false
165
+      roles:[],
166
+      is_exist_role: false,
167
+      org: null,
168
+      isSubSuperAdmin:false,
169
+
170
+      local_user_id: 0,
164
     };
171
     };
165
   },
172
   },
166
   components: {
173
   components: {
168
     AdminInfoForm
175
     AdminInfoForm
169
   },
176
   },
170
   created: function() {
177
   created: function() {
178
+    this.local_user_id = this.$store.getters.xt_user.user.id
179
+    this.local_user_id = 597
180
+    let page = 1
181
+    this.getRoles(page)
171
     adminMainView()
182
     adminMainView()
172
       .then(rs => {
183
       .then(rs => {
173
         this.is_loading_admins = false;
184
         this.is_loading_admins = false;
174
         var resp = rs.data;
185
         var resp = rs.data;
175
         if (resp.state === 1) {
186
         if (resp.state === 1) {
187
+
176
           this.admins.push(...resp.data.admins);
188
           this.admins.push(...resp.data.admins);
177
           this.admin_total_count = resp.data.total_count;
189
           this.admin_total_count = resp.data.total_count;
178
           this.is_exist_role = resp.data.is_exist_role;
190
           this.is_exist_role = resp.data.is_exist_role;
179
           this.current_page = 1;
191
           this.current_page = 1;
192
+          this.org = resp.data.org
193
+          this.isSubSuperAdmin = resp.data.isSubSuperAdmin
194
+
195
+          //能进入当前页面的角色只有超级管理员和子管理员,如果当前角色是子管理员,需要把超级管理员和其他子管理员的信息去除,子管理员不能编辑超级管理员和其他子管理员信息,
196
+          if(this.isSubSuperAdmin) {
197
+            //去除管理员信息
198
+            for (let i = 0; i < this.admins.length; i++){
199
+              if (this.admins[i].user_id == this.org.creator) {
200
+                this.admins.splice(i, 1)
201
+                i--
202
+              }
203
+            }
204
+
205
+            //去除其他子管理员信息
206
+            for (let i = 0; i < this.admins.length; i++){
207
+              if (this.admins[i].user_id  != this.local_user_id && this.admins[i].is_sub_super_admin) { //将自己排除在外
208
+                console.log(this.admins[i])
209
+
210
+                this.admins.splice(i, 1)
211
+                i--
212
+              }
213
+            }
214
+
215
+          }
180
         } else {
216
         } else {
181
           this.$message.error(resp.msg);
217
           this.$message.error(resp.msg);
182
         }
218
         }
192
     }
228
     }
193
   },
229
   },
194
   methods: {
230
   methods: {
231
+    getRoles(page){
232
+      getRoles(page)
233
+        .then(rs => {
234
+          this.loading_roles = false;
235
+          const resp = rs.data;
236
+          if (resp.state === 1) {
237
+            this.roles.push(...resp.data.roles);
238
+          } else {
239
+            this.$message.error(resp.msg);
240
+          }
241
+        })
242
+        .catch(err => {
243
+          this.loading_roles = false;
244
+          this.$message.error(err);
245
+        });
246
+    },
195
     openForm(adminId) {
247
     openForm(adminId) {
196
-      this.$refs["admininfoform"].open(adminId);
248
+      this.$refs["admininfoform"].open(adminId,this.roles);
197
     },
249
     },
198
     _parseTime(time, format) {
250
     _parseTime(time, format) {
199
       return parseTime(time, format);
251
       return parseTime(time, format);

+ 265 - 213
src/xt_pages/role/components/AdminInfoForm.vue Datei anzeigen

2
   <el-dialog :title="formTitle" :visible.sync="dialogFormVisible">
2
   <el-dialog :title="formTitle" :visible.sync="dialogFormVisible">
3
     <el-form :model="form" ref="form" :rules="rules" label-width="60px">
3
     <el-form :model="form" ref="form" :rules="rules" label-width="60px">
4
       <el-form-item label="账号 : " prop="mobile">
4
       <el-form-item label="账号 : " prop="mobile">
5
-        <el-input v-model="form.mobile" placeholder="用户手机号" :disabled="form.id !==  0"></el-input>
5
+        <el-input v-model="form.mobile" placeholder="用户手机号"         maxlength="11"
6
+                  :disabled="form.id !==  0"></el-input>
6
       </el-form-item>
7
       </el-form-item>
7
 
8
 
8
       <el-form-item label="姓名 : " prop="name">
9
       <el-form-item label="姓名 : " prop="name">
9
         <el-input v-model="form.name" placeholder="用户姓名"></el-input>
10
         <el-input v-model="form.name" placeholder="用户姓名"></el-input>
10
       </el-form-item>
11
       </el-form-item>
11
 
12
 
12
-      <el-form-item label="角色 : " prop="role">
13
-        <el-checkbox-group v-model="checkList">
14
-          <el-checkbox label="复选框 A"></el-checkbox>
15
-          <el-checkbox label="复选框 B"></el-checkbox>
16
-          <el-checkbox label="复选框 C"></el-checkbox>
17
-          <el-checkbox label="复选框 C"></el-checkbox>
18
-          <el-checkbox label="复选框 C"></el-checkbox>
19
-          <el-checkbox label="禁用"></el-checkbox>
20
-          <el-checkbox label="选中且禁用"></el-checkbox>
13
+      <el-form-item label="角色 : " prop="role_ids">
14
+        <el-checkbox-group v-model="form.role_ids">
15
+          <el-checkbox v-for="( item,index) in roles" :key="index" :label="item.id" :value="item.id">{{item.name}}
16
+          </el-checkbox>
21
         </el-checkbox-group>
17
         </el-checkbox-group>
22
       </el-form-item>
18
       </el-form-item>
23
 
19
 
41
         </el-select>
37
         </el-select>
42
       </el-form-item>
38
       </el-form-item>
43
 
39
 
44
-      <el-form-item label="职位 : " prop="name">
45
-        <el-input v-model="form.name" placeholder="输入职位"></el-input>
40
+      <el-form-item label="职位 : ">
41
+        <el-input v-model="form.user_title_name" placeholder="输入职位"></el-input>
46
       </el-form-item>
42
       </el-form-item>
47
 
43
 
48
       <el-form-item label="介绍 : ">
44
       <el-form-item label="介绍 : ">
49
-        <Tinymce :height="400" menubar ref="editor" v-model="form.intro" :show_upload_img="false" />
45
+        <Tinymce :height="400" menubar ref="editor" v-model="form.intro" :show_upload_img="false"/>
50
       </el-form-item>
46
       </el-form-item>
51
     </el-form>
47
     </el-form>
52
     <div slot="footer" class="dialog-footer">
48
     <div slot="footer" class="dialog-footer">
57
 </template>
53
 </template>
58
 
54
 
59
 <script>
55
 <script>
60
-import Tinymce from "@/components/Tinymce";
61
-import {
62
-  getAddAdminInitData,
63
-  addAdmin,
64
-  getModifyAdminInitData,
65
-  modifyAdmin
66
-} from "@/api/role/admin";
67
-export default {
68
-  name: "AdminInfoForm",
69
-  components: {
70
-    Tinymce
71
-  },
72
-  // props: {
73
-  //     admin_id: {
74
-  //         type: Number,
75
-  //         require: true
76
-  //     }
77
-  // },
78
-  data() {
79
-    var checkMobile = (rule, value, callback) => {
80
-      if (!value || value.length == 0) {
81
-        return callback(new Error("手机号不能为空"));
82
-      }
83
-      if (/^1\d{10}$/.test(value) == false) {
84
-        return callback(new Error("手机号格式错误"));
85
-      } else {
86
-        callback();
56
+  import Tinymce from '@/components/Tinymce'
57
+  import { addAdmin, getAddAdminInitData, getModifyAdminInitData, modifyAdmin } from '@/api/role/admin'
58
+
59
+  export default {
60
+    name: 'AdminInfoForm',
61
+    components: {
62
+      Tinymce
63
+    },
64
+    data() {
65
+      var checkMobile = (rule, value, callback) => {
66
+        if (!value || value.length == 0) {
67
+          return callback(new Error('手机号不能为空'))
68
+        }
69
+        if (/^1\d{10}$/.test(value) == false) {
70
+          return callback(new Error('手机号格式错误'))
71
+        } else {
72
+          callback()
73
+        }
87
       }
74
       }
88
-    };
89
-    var checkName = (rule, value, callback) => {
90
-      if (!value || value.length == 0) {
91
-        return callback(new Error("姓名不能为空"));
92
-      } else {
93
-        callback();
75
+      var checkName = (rule, value, callback) => {
76
+        if (!value || value.length == 0) {
77
+          return callback(new Error('姓名不能为空'))
78
+        } else {
79
+          callback()
80
+        }
94
       }
81
       }
95
-    };
96
-    return {
97
-      checkList: [],
98
-      admin_id: 0,
99
-      dialogFormVisible: false,
82
+      return {
83
+        admin_id: 0,
84
+        dialogFormVisible: false,
100
 
85
 
101
-      user_types: [
102
-        { index: 2, name: "医生" },
103
-        { index: 3, name: "护士" }
104
-      ],
105
-      user_titles: [
106
-        { index: 1, name: "医士" },
107
-        { index: 2, name: "医师" },
108
-        { index: 3, name: "住院医师" },
109
-        { index: 4, name: "主治医师" },
110
-        { index: 5, name: "副主任医师" },
111
-        { index: 6, name: "主任医师" },
112
-        { index: 7, name: "护士" },
113
-        { index: 8, name: "护师" },
114
-        { index: 9, name: "主管护师" },
115
-        { index: 10, name: "副主任护师" },
116
-        { index: 11, name: "主任护师" },
117
-        { index: 12, name: "运营专员" },
118
-        { index: 13, name: "运营主管" }
119
-      ],
120
-      roles: [], // [{id, name, intro, status}]
121
-      loading: true,
122
-      qntoken: "",
123
-      formTitle: "",
124
-      form: {
125
-        id: 0,
126
-        mobile: "",
127
-        name: "",
128
-        user_type: "",
129
-        user_title: "",
130
-        role: "", // 其实应该是 int 类型
131
-        intro: ""
132
-      },
133
-      rules: {
134
-        mobile: [{ required: true, validator: checkMobile, trigger: "blur" }],
135
-        name: [{ required: true, validator: checkName, trigger: "blur" }],
136
-        role: [{ required: true, message: "请选择角色", trigger: "change" }]
137
-      }
138
-    };
139
-  },
140
-  methods: {
141
-    open: function(adminId) {
142
-      this.admin_id = adminId;
143
-      if (this.admin_id < 0) {
144
-        this.$message.error("参数错误");
145
-        this.loading = false;
146
-        return;
86
+        user_types: [
87
+          { index: 2, name: '医生' },
88
+          { index: 3, name: '护士' }
89
+        ],
90
+        user_titles: [
91
+          { index: 1, name: '医士' },
92
+          { index: 2, name: '医师' },
93
+          { index: 3, name: '住院医师' },
94
+          { index: 4, name: '主治医师' },
95
+          { index: 5, name: '副主任医师' },
96
+          { index: 6, name: '主任医师' },
97
+          { index: 7, name: '护士' },
98
+          { index: 8, name: '护师' },
99
+          { index: 9, name: '主管护师' },
100
+          { index: 10, name: '副主任护师' },
101
+          { index: 11, name: '主任护师' },
102
+          { index: 12, name: '运营专员' },
103
+          { index: 13, name: '运营主管' }
104
+        ],
105
+        roles: [], // [{id, name, intro, status}]
106
+        loading: true,
107
+        qntoken: '',
108
+        formTitle: '',
109
+        isSubSuperAdmin:false,
110
+        org:null,
111
+        form: {
112
+          role_ids: [],
113
+          user_title_name: '',
114
+          id: 0,
115
+          mobile: '',
116
+          name: '',
117
+          user_type: '',
118
+          user_title: '',
119
+          role: '', // 其实应该是 int 类型
120
+          intro: ''
121
+        },
122
+        rules: {
123
+          mobile: [{ required: true, validator: checkMobile, trigger: 'blur' }],
124
+          name: [{ required: true, validator: checkName, trigger: 'blur' }],
125
+          role_ids: [
126
+            { type: 'array', required: true, message: '请至少选择一个角色', trigger: 'change' }
127
+          ]
128
+        }
147
       }
129
       }
130
+    },
131
+    methods: {
132
+      open: function(adminId) {
133
+        this.admin_id = adminId
134
+        if (this.admin_id < 0) {
135
+          this.$message.error('参数错误')
136
+          this.loading = false
137
+          return
138
+        }
139
+         // let localthis.$store.getters.xt_user.user.id
140
+        let local_user_id = this.$store.getters.xt_user.user.id
141
+        local_user_id = 597
142
+        this.form.id = this.admin_id
143
+        if (this.admin_id === 0) {
144
+          let tempForm = {
145
+            role_ids: [],
146
+            user_title_name: '',
147
+            id: 0,
148
+            mobile: '',
149
+            name: '',
150
+            user_type: '',
151
+            user_title: '',
152
+            role: '', // 其实应该是 int 类型
153
+            intro: ''
154
+          }
155
+          this.form = tempForm
156
+          this.formTitle = '新增员工'
157
+          this.form.user_type = this.user_types[0].index
158
+          this.form.user_title = this.user_titles[0].index
159
+          getAddAdminInitData()
160
+            .then(rs => {
161
+              this.loading = false
162
+              var resp = rs.data
163
+              if (resp.state === 1) {
164
+                // this.roles.push(...resp.data.roles)
165
+                this.roles = resp.data.roles
166
+                this.qntoken = resp.data.qntoken
148
 
167
 
149
-      this.form.id = this.admin_id;
150
-      if (this.admin_id === 0) {
151
-        this.formTitle = "新增员工";
152
-        this.form.user_type = this.user_types[0].index;
153
-        this.form.user_title = this.user_titles[0].index;
154
-        getAddAdminInitData()
155
-          .then(rs => {
156
-            this.loading = false;
157
-            var resp = rs.data;
158
-            if (resp.state === 1) {
159
-              // this.roles.push(...resp.data.roles)
160
-              this.roles = resp.data.roles;
161
-              this.qntoken = resp.data.qntoken;
162
-              // if (this.roles.length > 0) {
163
-              //   this.form.role = this.roles[0].id;
164
-              //   console.log("国庆快乐",this.form.role)
165
-              // }
166
-            } else {
167
-              this.$message.error(resp.msg);
168
-            }
169
-          })
170
-          .catch(err => {
171
-            this.loading = false;
172
-            this.$message.error(err);
173
-          });
174
-      } else {
175
-        this.formTitle = "编辑用户";
176
-        getModifyAdminInitData(this.form.id)
177
-          .then(rs => {
178
-            this.loading = false;
179
-            var resp = rs.data;
180
-            if (resp.state === 1) {
181
-              this.roles.push(...resp.data.roles);
182
-              this.qntoken = resp.data.qntoken;
168
+                this.isSubSuperAdmin = resp.data.isSubSuperAdmin
169
+                this.org = resp.data.org
183
 
170
 
184
-              var admin = resp.data.admin;
185
-              this.form.name = admin.user_name;
186
-              this.form.mobile = admin.mobile;
187
-              this.form.user_type = admin.user_type;
188
-              this.form.user_title = admin.user_title;
189
-              this.form.role = admin.role_id;
190
-              this.form.intro = admin.intro;
191
-            } else {
192
-              this.$message.error("该用户不存在");
193
-            }
194
-          })
195
-          .catch(err => {
196
-            this.loading = false;
197
-            this.$message.error("该用户不存在");
198
-          });
199
-      }
171
+                //如果当前用户是子管理员则,则需要将子管理员角色去除,因为子管理员不能添加子管理员
172
+                if(this.isSubSuperAdmin){
173
+                  for (let i =0 ; i < this.roles.length; i++){
174
+                    if(this.roles[i].is_system == 1 && this.roles[i].role_name != "子管理员"){
175
+                      this.roles.splice(i, 1)
176
+                      i--
177
+                    }
178
+                  }
179
+                }
200
 
180
 
201
-      this.dialogFormVisible = true;
202
-    },
203
-    submitAction: function() {
204
-      if (this.admin_id < 0) {
205
-        return;
206
-      }
207
-      this.$refs.form.validate(valid => {
208
-        if (valid) {
209
-          this.loading = true;
210
-          if (this.form.id === 0) {
211
-            addAdmin(
212
-              this.form.mobile,
213
-              this.form.name,
214
-              this.form.user_type,
215
-              this.form.user_title,
216
-              this.form.role,
217
-              this.form.intro
218
-            )
219
-              .then(rs => {
220
-                this.loading = false;
221
-                var resp = rs.data;
222
-                if (resp.state === 1) {
223
-                  this.$store.dispatch("DidChangeAdmins");
224
-                  var _this = this;
225
-                  setTimeout(() => {
226
-                    _this.$store.dispatch("RecoverAdminsChangeState");
227
-                  }, 500);
228
-                  this.dialogFormVisible = false;
229
-                } else {
230
-                  this.$message.error(resp.msg);
181
+
182
+
183
+
184
+                // if (this.roles.length > 0) {
185
+                //   this.form.role = this.roles[0].id;
186
+                //   console.log("国庆快乐",this.form.role)
187
+                // }
188
+              } else {
189
+                this.$message.error(resp.msg)
190
+              }
191
+            })
192
+            .catch(err => {
193
+              this.loading = false
194
+              this.$message.error(err)
195
+            })
196
+        } else {
197
+          this.formTitle = '编辑用户'
198
+          getModifyAdminInitData(this.form.id)
199
+            .then(rs => {
200
+              this.loading = false
201
+              var resp = rs.data
202
+              if (resp.state === 1) {
203
+                this.roles = []
204
+                this.roles.push(...resp.data.roles)
205
+                this.qntoken = resp.data.qntoken
206
+
207
+                var admin = resp.data.admin
208
+                this.form.name = admin.user_name
209
+                this.form.mobile = admin.admin.mobile
210
+                this.form.user_type = admin.user_type
211
+                this.form.user_title = admin.user_title
212
+                this.form.role = admin.role_ids
213
+                this.form.role_ids = []
214
+                for (let i = 0; i < this.form.role.split(",").length; i++) {
215
+                  if (this.form.role.split(',')[i].length > 0) {
216
+                    this.form.role_ids.push(parseInt(this.form.role.split(',')[i]))
217
+                  }
231
                 }
218
                 }
232
-              })
233
-              .catch(err => {
234
-                this.loading = false;
235
-                this.$message.error(err);
236
-              });
237
-          } else {
238
-            modifyAdmin(
239
-              this.form.id,
240
-              this.form.name,
241
-              this.form.user_type,
242
-              this.form.user_title,
243
-              this.form.role,
244
-              this.form.intro
245
-            )
246
-              .then(rs => {
247
-                this.loading = false;
248
-                var resp = rs.data;
249
-                if (resp.state === 1) {
250
-                  this.$store.dispatch("DidChangeAdmins");
251
-                  var _this = this;
252
-                  setTimeout(() => {
253
-                    _this.$store.dispatch("RecoverAdminsChangeState");
254
-                  }, 500);
255
 
219
 
256
-                  this.dialogFormVisible = false;
257
-                } else {
258
-                  this.$message.error(resp.msg);
220
+                this.form.intro = admin.intro
221
+                this.form.user_title_name = admin.user_title_name
222
+
223
+
224
+
225
+                //如果当前用户是超级管理员而且编辑自己的信息
226
+                if(!this.isSubSuperAdmin && local_user_id == this.form.id){
227
+                  for (let i =0 ; i < this.roles.length; i++){
228
+                    if(this.roles[i].is_system == 1 && this.roles[i].role_name != "子管理员"){
229
+                      this.roles.splice(i, 1)
230
+                      i--
231
+                    }
232
+                  }
259
                 }
233
                 }
260
-              })
261
-              .catch(err => {
262
-                this.loading = false;
263
-                this.$message.error(err);
264
-              });
265
-          }
266
-        } else {
267
-          return false;
234
+
235
+
236
+
237
+
238
+              } else {
239
+                this.$message.error('该用户不存在')
240
+              }
241
+            })
242
+            .catch(err => {
243
+              this.loading = false
244
+              this.$message.error('该用户不存在')
245
+            })
246
+        }
247
+
248
+        this.dialogFormVisible = true
249
+      },
250
+      submitAction: function() {
251
+        if (this.admin_id < 0) {
252
+          return
268
         }
253
         }
269
-      });
254
+        this.$refs.form.validate(valid => {
255
+          if (valid) {
256
+            this.loading = true
257
+            if (this.form.id === 0) {
258
+              this.form.role = this.form.role_ids.join(',')
259
+              addAdmin(
260
+                this.form.mobile,
261
+                this.form.name,
262
+                this.form.user_type,
263
+                this.form.user_title,
264
+                this.form.role,
265
+                this.form.intro,
266
+                this.form.user_title_name
267
+              )
268
+                .then(rs => {
269
+                  this.loading = false
270
+                  var resp = rs.data
271
+                  if (resp.state === 1) {
272
+                    this.$store.dispatch('DidChangeAdmins')
273
+                    var _this = this
274
+                    setTimeout(() => {
275
+                      _this.$store.dispatch('RecoverAdminsChangeState')
276
+                    }, 500)
277
+                    this.dialogFormVisible = false
278
+                  } else {
279
+                    this.$message.error(resp.msg)
280
+                  }
281
+                })
282
+                .catch(err => {
283
+                  this.loading = false
284
+                  this.$message.error(err)
285
+                })
286
+            } else {
287
+              this.form.role = this.form.role_ids.join(',')
288
+
289
+              modifyAdmin(
290
+                this.form.id,
291
+                this.form.name,
292
+                this.form.user_type,
293
+                this.form.user_title,
294
+                this.form.role,
295
+                this.form.intro,
296
+                this.form.user_title_name
297
+              )
298
+                .then(rs => {
299
+                  this.loading = false
300
+                  var resp = rs.data
301
+                  if (resp.state === 1) {
302
+                    this.$store.dispatch('DidChangeAdmins')
303
+                    var _this = this
304
+                    setTimeout(() => {
305
+                      _this.$store.dispatch('RecoverAdminsChangeState')
306
+                    }, 500)
307
+
308
+                    this.dialogFormVisible = false
309
+                  } else {
310
+                    this.$message.error(resp.msg)
311
+                  }
312
+                })
313
+                .catch(err => {
314
+                  this.loading = false
315
+                  this.$message.error(err)
316
+                })
317
+            }
318
+          } else {
319
+            return false
320
+          }
321
+        })
322
+      }
270
     }
323
     }
271
   }
324
   }
272
-};
273
 </script>
325
 </script>

+ 469 - 201
src/xt_pages/role/components/EditRole.vue Datei anzeigen

27
               :indeterminate="isIndeterminate"
27
               :indeterminate="isIndeterminate"
28
               v-model="checkAll"
28
               v-model="checkAll"
29
               @change="handleCheckAllChange"
29
               @change="handleCheckAllChange"
30
-              >全选</el-checkbox
30
+            >全选
31
+            </el-checkbox
31
             >
32
             >
32
           </div>
33
           </div>
33
           <el-checkbox-group
34
           <el-checkbox-group
34
             v-model="checkedCities"
35
             v-model="checkedCities"
35
-            @change="handleCheckedCitiesChange"
36
           >
36
           >
37
-            <!-- <el-checkbox v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox> -->
38
-            <div class="checkone" v-for="city in cities" :key="city">
39
-              <el-checkbox :label="city">
40
-                <img src="https://kuyi.shengws.com/S1.png" alt />
41
-                <span>名字</span>
37
+            <div class="checkone" v-for="(item,index) in admin_user" :key="index">
38
+              <el-checkbox :label="item.id" :value="item.id" @change="change">
39
+                <img v-if="item.avatar.length > 0" :src="item.avatar" alt=""/>
40
+                <img
41
+                  v-if="item.avatar.length == 0"
42
+                  src="https://kuyi.shengws.com/S1.png"
43
+                  alt=""
44
+                />
45
+                <span>{{item.user_name}}</span>
42
               </el-checkbox>
46
               </el-checkbox>
43
             </div>
47
             </div>
44
           </el-checkbox-group>
48
           </el-checkbox-group>
45
         </div>
49
         </div>
46
       </div>
50
       </div>
51
+
47
       <div class="roleContentRight">
52
       <div class="roleContentRight">
48
         <p style="color:#303133">已选:</p>
53
         <p style="color:#303133">已选:</p>
49
         <div class="chooseBox">
54
         <div class="chooseBox">
50
-          <div class="hasChoosedOne">
51
-            <img src="https://kuyi.shengws.com/S1.png" alt />
52
-            <span>名字</span>
55
+          <div class="hasChoosedOne" v-for="(item,index) in is_check_admin_user" :key="index">
56
+            <img v-if="item.avatar.length > 0" :src="item.avatar" alt=""/>
57
+            <img
58
+              v-if="item.avatar.length == 0"
59
+              src="https://kuyi.shengws.com/S1.png"
60
+              alt=""
61
+            />
62
+            <span>{{item.user_name}}</span>
53
           </div>
63
           </div>
54
         </div>
64
         </div>
55
       </div>
65
       </div>
58
       <el-form
68
       <el-form
59
         :model="ruleForm"
69
         :model="ruleForm"
60
         :rules="newrules"
70
         :rules="newrules"
61
-        label-position="right"
62
-        label-width="80px"
63
-        style="width:40%"
71
+        ref="form"
72
+        label-position="left"
64
       >
73
       >
65
-        <el-form-item label="姓名" prop="name">
74
+        <el-form-item label="姓名" prop="name" label-width="50px">
66
           <el-input v-model="ruleForm.name"></el-input>
75
           <el-input v-model="ruleForm.name"></el-input>
67
         </el-form-item>
76
         </el-form-item>
68
-        <el-form-item label="手机号" prop="phone">
69
-          <el-input v-model="ruleForm.phone"></el-input>
77
+        <el-form-item label="手机号" prop="phone" label-width="70px">
78
+
79
+          <el-input  v-model="ruleForm.phone"  maxlength="11"></el-input>
80
+        </el-form-item>
81
+
82
+        <el-form-item label="职称 : " label-width="50px">
83
+          <el-select v-model="ruleForm.user_type" placeholder="用户类型">
84
+            <el-option
85
+              v-for="item in user_types"
86
+              :label="item.name"
87
+              :value="item.index"
88
+              :key="item.index"
89
+            ></el-option>
90
+          </el-select>
91
+
92
+          <el-select v-model="ruleForm.user_title" placeholder="用户职称">
93
+            <el-option
94
+              v-for="item in user_titles"
95
+              :label="item.name"
96
+              :value="item.index"
97
+              :key="item.index"
98
+            ></el-option>
99
+          </el-select>
70
         </el-form-item>
100
         </el-form-item>
71
-        <el-form-item label="职位">
72
-          <el-input></el-input>
101
+
102
+        <el-form-item label="职位" label-width="50px">
103
+          <el-input v-model="ruleForm.position"></el-input>
73
         </el-form-item>
104
         </el-form-item>
74
       </el-form>
105
       </el-form>
75
       <div class="newItem">
106
       <div class="newItem">
79
             style="font-size:20px;color:#338AFB"
110
             style="font-size:20px;color:#338AFB"
80
           ></i>
111
           ></i>
81
         </p>
112
         </p>
82
-        <p style="color:#409FFF">继续新增员工</p>
113
+        <p style="color:#409FFF" @click="continueAddStaff()">继续新增员工</p>
83
       </div>
114
       </div>
84
     </div>
115
     </div>
85
     <div slot="footer" class="dialog-footer">
116
     <div slot="footer" class="dialog-footer">
90
 </template>
121
 </template>
91
 
122
 
92
 <script>
123
 <script>
93
-import { addRole, modifyRole } from "@/api/role/role";
94
-
95
-export default {
96
-  name: "EditRole",
97
-  data() {
98
-    return {
99
-      form: {
100
-        id: 0,
101
-        name: "",
102
-        intro: ""
103
-      },
104
-      visible: false,
105
-      rules: {
106
-        name: [
107
-          { required: true, message: "请输入角色名称", trigger: "blur" },
108
-          { max: 10, message: "10个字以内", trigger: "blur" }
109
-        ],
110
-        intro: [{ required: true, message: "请输入角色说明", trigger: "blur" }]
111
-      },
124
+  import { addRole, AddUserRole, getStaffsList, modifyRole } from '@/api/role/role'
125
+  import { addAdmin, getAddAdminInitData, getModifyAdminInitData, modifyAdmin } from '@/api/role/admin'
112
 
126
 
113
-      //
114
-      checked: "1",
115
-      checkAll: false,
116
-      checkedCities: [],
117
-      cities: ["上海", "北京", "广州", "深圳"],
118
-      isIndeterminate: true,
119
-      ruleForm: {
120
-        name: "",
121
-        phone: "",
122
-        position: ""
123
-      },
124
-      newrules: {
125
-        name: [
126
-          { required: true, message: "请输入角色名称", trigger: "blur" },
127
-          { max: 10, message: "10个字以内", trigger: "blur" }
127
+  export default {
128
+    name: 'EditRole',
129
+    data() {
130
+      var checkMobile = (rule, value, callback) => {
131
+        if (!value || value.length == 0) {
132
+          return callback(new Error('手机号不能为空'))
133
+        }
134
+        if (/^1\d{10}$/.test(value) == false) {
135
+          return callback(new Error('手机号格式错误'))
136
+        } else {
137
+          callback()
138
+        }
139
+      }
140
+      var checkName = (rule, value, callback) => {
141
+        if (!value || value.length == 0) {
142
+          return callback(new Error('姓名不能为空'))
143
+        } else {
144
+          callback()
145
+        }
146
+      }
147
+
148
+      return {
149
+        form: {
150
+          id: 0,
151
+          name: '',
152
+          intro: ''
153
+        },
154
+        role_id: 0,
155
+        visible: false,
156
+        rules: {
157
+          phone: [{ required: true, validator: checkMobile, trigger: 'blur' }],
158
+          name: [{ required: true, validator: checkName, trigger: 'blur' }],
159
+          intro: [{ required: true, message: '请输入角色说明', trigger: 'blur' }]
160
+        },
161
+        admin_user: [],
162
+        is_check_admin_user: [],
163
+        user_types: [
164
+          { index: 2, name: '医生' },
165
+          { index: 3, name: '护士' }
166
+        ],
167
+        user_titles: [
168
+          { index: 1, name: '医士' },
169
+          { index: 2, name: '医师' },
170
+          { index: 3, name: '住院医师' },
171
+          { index: 4, name: '主治医师' },
172
+          { index: 5, name: '副主任医师' },
173
+          { index: 6, name: '主任医师' },
174
+          { index: 7, name: '护士' },
175
+          { index: 8, name: '护师' },
176
+          { index: 9, name: '主管护师' },
177
+          { index: 10, name: '副主任护师' },
178
+          { index: 11, name: '主任护师' },
179
+          { index: 12, name: '运营专员' },
180
+          { index: 13, name: '运营主管' }
128
         ],
181
         ],
129
-        phone: [{ required: true, message: "请输入手机号", trigger: "blur" }]
182
+        //
183
+        checked: '1',
184
+        checkAll: false,
185
+        checkedCities: [],
186
+        isIndeterminate: true,
187
+        ruleForm: {
188
+          name: '',
189
+          phone: '',
190
+          position: '',
191
+          user_type: 2,
192
+          user_title: 1,
193
+          role: ''
194
+        },
195
+        newrules: {
196
+          phone: [{ required: true, validator: checkMobile, trigger: 'blur' }],
197
+
198
+          name: [
199
+            { required: true, message: '请输入用户名字', trigger: 'blur' },
200
+            { max: 10, message: '10个字以内', trigger: 'blur' }
201
+          ]
202
+        }
130
       }
203
       }
131
-    };
132
-  },
133
-  methods: {
134
-    _close: function(done) {
135
-      this.clear();
136
-      done();
137
-    },
138
-    clear: function() {
139
-      this.form.id = 0;
140
-      this.form.name = "";
141
-      this.form.intro = "";
142
-    },
143
-    show() {
144
-      this.clear();
145
-      this.visible = true;
146
     },
204
     },
147
-    hide() {
148
-      this.clear();
149
-      this.visible = false;
150
-    },
151
-    modify(id, name, intro) {
152
-      this.form.id = id;
153
-      this.form.name = name;
154
-      this.form.intro = intro;
155
-      this.visible = true;
156
-    },
157
-    submitAction() {
158
-      this.$refs.form.validate(valid => {
159
-        if (valid) {
160
-          // 验证通过
161
-          if (this.form.id === 0) {
162
-            // 新增 role
163
-            addRole(this.form.name, this.form.intro)
164
-              .then(rs => {
165
-                var resp = rs.data;
166
-                if (resp.state === 1) {
167
-                  var new_id = resp.data.id;
168
-                  var new_name = resp.data.name;
169
-                  var new_intro = resp.data.intro;
170
-                  var new_status = resp.data.status;
171
-                  this.$emit(
172
-                    "did-add-role",
173
-                    new_id,
174
-                    new_name,
175
-                    new_intro,
176
-                    new_status
177
-                  );
178
-
179
-                  this.hide();
180
-                } else {
181
-                  this.$message.error(resp.msg);
182
-                }
183
-              })
184
-              .catch(err => {
185
-                this.$message.error(err);
186
-              });
205
+    methods: {
206
+      continueAddStaff(){
207
+        this.$refs.form.validate(valid => {
208
+          if (valid) {
209
+            if (this.form.id === 0) {
210
+              this.ruleForm.role = this.role_id
211
+              addAdmin(
212
+                this.ruleForm.phone,
213
+                this.ruleForm.name,
214
+                this.ruleForm.user_type,
215
+                this.ruleForm.user_title,
216
+                this.ruleForm.role,
217
+                '',
218
+                this.ruleForm.position
219
+              )
220
+                .then(rs => {
221
+                  var resp = rs.data
222
+                  if (resp.state === 1) {
223
+                    this.$store.dispatch('DidChangeAdmins')
224
+                    var _this = this
225
+                    setTimeout(() => {
226
+                      _this.$store.dispatch('RecoverAdminsChangeState')
227
+                    }, 500)
228
+                    this.$emit('did-edit-role')
229
+                    this.ruleForm.phone = ''
230
+
231
+                    this.ruleForm.name = ''
232
+                    this.ruleForm.user_type = 2
233
+                    this.ruleForm.user_title = 1
234
+                    this.ruleForm.role = ''
235
+                    this.ruleForm.position = ''
236
+                  } else {
237
+                    this.$message.error(resp.msg)
238
+                  }
239
+                })
240
+                .catch(err => {
241
+                  this.loading = false
242
+                  this.$message.error(err)
243
+                })
244
+            }
187
           } else {
245
           } else {
188
-            // 修改 role
189
-            modifyRole(this.form.id, this.form.name, this.form.intro)
190
-              .then(rs => {
191
-                var resp = rs.data;
192
-                if (resp.state === 1) {
193
-                  this.$emit(
194
-                    "did-edit-role",
195
-                    this.form.id,
196
-                    this.form.name,
197
-                    this.form.intro
198
-                  );
199
-                  this.hide();
200
-                } else {
201
-                  this.$message.error(resp.msg);
246
+            return false
247
+          }
248
+        })
249
+
250
+
251
+
252
+      },
253
+      change(val) {
254
+
255
+        if (this.checkedCities.length == this.admin_user.length) {
256
+
257
+          this.checkAll = true
258
+        } else {
259
+          this.checkAll = false
260
+
261
+        }
262
+
263
+      }
264
+
265
+      ,
266
+      GetAllStaff: function() {
267
+        getStaffsList()
268
+          .then(rs => {
269
+            var resp = rs.data
270
+            if (resp.state === 1) {
271
+
272
+              this.admin_user = resp.data.admins
273
+
274
+              for (let i = 0; i < this.admin_user.length; i++) {
275
+                if (this.admin_user[i].role_ids.length > 0) {
276
+                  let isExist = -1
277
+                  let ids = this.admin_user[i].role_ids.split(',')
278
+                  isExist = ids.indexOf(this.role_id.toString())
279
+                  if (isExist >= 0) {
280
+                    this.is_check_admin_user.push(this.admin_user[i])
281
+                    this.admin_user.splice(i, 1)
282
+
283
+                    i = i - 1
284
+                  }
285
+                }
286
+              }
287
+
288
+              for (let i = 0; i < this.admin_user.length; i++) {
289
+                if (this.admin_user[i].user_id == resp.data.org.creator) {
290
+
291
+                  this.admin_user.splice(i, 1)
292
+                  i = i - 1
202
                 }
293
                 }
203
-              })
204
-              .catch(err => {
205
-                this.$message.error(err);
206
-              });
294
+              }
295
+            } else {
296
+              this.$message.error(resp.msg)
297
+            }
298
+          })
299
+          .catch(err => {
300
+            this.$message.error(err)
301
+          })
302
+
303
+      },
304
+      _close: function(done) {
305
+        this.clear()
306
+        done()
307
+      },
308
+      clear: function() {
309
+        this.form.id = 0
310
+        this.form.name = ''
311
+        this.form.intro = ''
312
+      },
313
+      show(role_id) {
314
+        this.clear()
315
+        this.checked = '1'
316
+        this.visible = true
317
+        this.role_id = role_id
318
+        this.admin_user = []
319
+        this.is_check_admin_user = []
320
+        this.checkedCities = []
321
+        this.GetAllStaff()
322
+      },
323
+      hide() {
324
+        this.clear()
325
+        this.visible = false
326
+      },
327
+      modify(id, name, intro) {
328
+        this.form.id = id
329
+        this.form.name = name
330
+        this.form.intro = intro
331
+        this.visible = true
332
+      },
333
+      submitAction() {
334
+        if (this.checked == '1') {
335
+          if (this.checkedCities.length == 0) {
336
+            this.$message.error('至少选择一个用户')
337
+            return
207
           }
338
           }
339
+          let params = {
340
+            id: this.role_id,
341
+            ids: this.checkedCities.join(',')
342
+          }
343
+          AddUserRole(params).then(response => {
344
+            if (response.data.state === 1) {
345
+              this.$message.success('添加成功')
346
+              this.$emit('did-edit-role')
347
+              this.hide()
348
+
349
+            } else {
350
+              this.$message.error(response.data.msg)
351
+
352
+            }
353
+          })
208
         } else {
354
         } else {
209
-          // 验证失败
210
-          return false;
355
+          this.$refs.form.validate(valid => {
356
+            if (valid) {
357
+              if (this.form.id === 0) {
358
+                this.ruleForm.role = this.role_id
359
+                addAdmin(
360
+                  this.ruleForm.phone,
361
+                  this.ruleForm.name,
362
+                  this.ruleForm.user_type,
363
+                  this.ruleForm.user_title,
364
+                  this.ruleForm.role,
365
+                  '',
366
+                  this.ruleForm.position
367
+                )
368
+                  .then(rs => {
369
+                    var resp = rs.data
370
+                    if (resp.state === 1) {
371
+                      this.$store.dispatch('DidChangeAdmins')
372
+                      var _this = this
373
+                      setTimeout(() => {
374
+                        _this.$store.dispatch('RecoverAdminsChangeState')
375
+                      }, 500)
376
+                      this.$emit('did-edit-role')
377
+                      this.hide()
378
+
379
+                      this.ruleForm.phone = ''
380
+                      this.ruleForm.name = ''
381
+                      this.ruleForm.user_type = 2
382
+                      this.ruleForm.user_title = 1
383
+                      this.ruleForm.role = ''
384
+                      this.ruleForm.position = ''
385
+                    } else {
386
+                      this.$message.error(resp.msg)
387
+                    }
388
+                  })
389
+                  .catch(err => {
390
+                    this.loading = false
391
+                    this.$message.error(err)
392
+                  })
393
+              }
394
+            } else {
395
+              return false
396
+            }
397
+          })
398
+
211
         }
399
         }
212
-      });
213
-    },
214
-    handleCheckAllChange(val) {
215
-      this.checkedCities = val ? this.cities : [];
216
-      this.isIndeterminate = false;
217
-    },
218
-    handleCheckedCitiesChange(value) {
219
-      let checkedCount = value.length;
220
-      this.checkAll = checkedCount === this.cities.length;
221
-      this.isIndeterminate =
222
-        checkedCount > 0 && checkedCount < this.cities.length;
400
+
401
+        // this.$refs.form.validate(valid => {
402
+        //   if (valid) {
403
+        //     // 验证通过
404
+        //     if (this.form.id === 0) {
405
+        //       // 新增 role
406
+        //       addRole(this.form.name, this.form.intro)
407
+        //         .then(rs => {
408
+        //           var resp = rs.data;
409
+        //           if (resp.state === 1) {
410
+        //             var new_id = resp.data.id;
411
+        //             var new_name = resp.data.name;
412
+        //             var new_intro = resp.data.intro;
413
+        //             var new_status = resp.data.status;
414
+        //             this.$emit(
415
+        //               "did-add-role",
416
+        //               new_id,
417
+        //               new_name,
418
+        //               new_intro,
419
+        //               new_status
420
+        //             );
421
+        //
422
+        //             this.hide();
423
+        //           } else {
424
+        //             this.$message.error(resp.msg);
425
+        //           }
426
+        //         })
427
+        //         .catch(err => {
428
+        //           this.$message.error(err);
429
+        //         });
430
+        //     } else {
431
+        //       // 修改 role
432
+        //       modifyRole(this.form.id, this.form.name, this.form.intro)
433
+        //         .then(rs => {
434
+        //           var resp = rs.data;
435
+        //           if (resp.state === 1) {
436
+        //             this.$emit(
437
+        //               "did-edit-role",
438
+        //               this.form.id,
439
+        //               this.form.name,
440
+        //               this.form.intro
441
+        //             );
442
+        //             this.hide();
443
+        //           } else {
444
+        //             this.$message.error(resp.msg);
445
+        //           }
446
+        //         })
447
+        //         .catch(err => {
448
+        //           this.$message.error(err);
449
+        //         });
450
+        //     }
451
+        //   } else {
452
+        //     // 验证失败
453
+        //     return false;
454
+        //   }
455
+        // });
456
+      },
457
+      handleCheckAllChange(val) {
458
+        this.checkedCities = []
459
+        if (val) {
460
+          for (let i = 0; i < this.admin_user.length; i++) {
461
+            this.checkedCities.push(this.admin_user[i].id)
462
+          }
463
+        } else {
464
+          this.checkedCities = []
465
+        }
466
+
467
+        this.isIndeterminate = false
468
+      },
469
+      handleCheckedCitiesChange(value) {
470
+        let checkedCount = value.length
471
+        this.checkAll = checkedCount === this.cities.length
472
+        this.isIndeterminate =
473
+          checkedCount > 0 && checkedCount < this.cities.length
474
+      }
223
     }
475
     }
224
   }
476
   }
225
-};
226
 </script>
477
 </script>
227
 
478
 
228
 <style lang="scss" scoped>
479
 <style lang="scss" scoped>
229
-.roleContent {
230
-  margin-top: 20px;
231
-  display: flex;
232
-  justify-content: space-between;
480
+  .roleContent {
481
+    margin-top: 20px;
482
+    display: flex;
483
+    justify-content: space-between;
484
+
233
   .roleContentLeft {
485
   .roleContentLeft {
234
-    .chooseBox {
235
-      width: 280px;
236
-      height: 320px;
237
-      overflow-y: auto;
238
-      border: 1px solid rgba(235, 238, 240, 1);
239
-      margin-top: 26px;
240
-      padding: 20px;
241
-      .checkone {
242
-        display: flex;
243
-        align-items: center;
244
-        height: 50px;
245
-      }
246
-      .el-checkbox__label {
247
-        display: flex;
248
-        align-items: center;
249
-        img {
250
-          width: 30px;
251
-          height: 30px;
252
-          margin-right: 10px;
253
-        }
254
-      }
255
-    }
486
+
487
+  .chooseBox {
488
+    width: 280px;
489
+    height: 320px;
490
+    overflow-y: auto;
491
+    border: 1px solid rgba(235, 238, 240, 1);
492
+    margin-top: 26px;
493
+    padding: 20px;
494
+
495
+  .checkone {
496
+    display: flex;
497
+    align-items: center;
498
+    height: 50px;
499
+  }
500
+
501
+  .el-checkbox__label {
502
+    display: flex;
503
+    align-items: center;
504
+
505
+  img {
506
+    width: 30px;
507
+    height: 30px;
508
+    margin-right: 10px;
509
+  }
510
+
511
+  }
512
+  }
256
   }
513
   }
257
   .roleContentRight {
514
   .roleContentRight {
258
-    .chooseBox {
259
-      width: 280px;
260
-      height: 320px;
261
-      overflow-y: auto;
262
-      border: 1px solid rgba(235, 238, 240, 1);
263
-      margin-top: 26px;
264
-      padding: 20px;
265
-      .hasChoosedOne {
266
-        display: flex;
267
-        align-items: center;
268
-        height: 50px;
269
-        img {
270
-          width: 30px;
271
-          height: 30px;
272
-          margin-right: 10px;
273
-        }
274
-      }
275
-    }
515
+
516
+  .chooseBox {
517
+    width: 280px;
518
+    height: 320px;
519
+    overflow-y: auto;
520
+    border: 1px solid rgba(235, 238, 240, 1);
521
+    margin-top: 26px;
522
+    padding: 20px;
523
+
524
+  .hasChoosedOne {
525
+    display: flex;
526
+    align-items: center;
527
+    height: 50px;
528
+
529
+  img {
530
+    width: 30px;
531
+    height: 30px;
532
+    margin-right: 10px;
533
+  }
534
+
535
+  }
276
   }
536
   }
277
-}
278
-.newStaff {
279
-  margin-top: 26px;
537
+  }
538
+  }
539
+  .newStaff {
540
+    margin-top: 26px;
541
+
280
   .newItem {
542
   .newItem {
281
     display: flex;
543
     display: flex;
282
     align-items: center;
544
     align-items: center;
283
   }
545
   }
284
-}
546
+
547
+  }
285
 </style>
548
 </style>
286
 
549
 
287
 <style lang="scss">
550
 <style lang="scss">
288
-.roleContent {
551
+  .roleContent {
552
+
289
   .roleContentLeft {
553
   .roleContentLeft {
290
-    .chooseBox {
291
-      .el-checkbox {
292
-        display: flex;
293
-        align-items: center;
294
-      }
295
-      .el-checkbox__label {
296
-        display: flex;
297
-        align-items: center;
298
-      }
299
-    }
554
+
555
+  .chooseBox {
556
+
557
+  .el-checkbox {
558
+    display: flex;
559
+    align-items: center;
560
+  }
561
+
562
+  .el-checkbox__label {
563
+    display: flex;
564
+    align-items: center;
565
+  }
566
+
567
+  }
568
+  }
300
   }
569
   }
301
-}
302
 </style>
570
 </style>

+ 44 - 148
src/xt_pages/role/role.vue Datei anzeigen

87
 
87
 
88
       <edit-role
88
       <edit-role
89
         ref="edit_role"
89
         ref="edit_role"
90
-        @did-add-role="didAddRole"
91
         @did-edit-role="didModifyRole"
90
         @did-edit-role="didModifyRole"
92
       ></edit-role>
91
       ></edit-role>
92
+
93
+      <add-role
94
+        ref="add_role"
95
+        @did-add-role="didAddRole"
96
+      ></add-role>
97
+
93
       <permission-settings ref="permission_settings"></permission-settings>
98
       <permission-settings ref="permission_settings"></permission-settings>
94
 
99
 
95
       <div class="roleTitle">
100
       <div class="roleTitle">
99
         </p>
104
         </p>
100
       </div>
105
       </div>
101
       <div class="roleBox">
106
       <div class="roleBox">
102
-        <div class="roleOne">
107
+        <div class="roleOne" v-for="item in this.roles">
103
           <div class="setting">
108
           <div class="setting">
104
             <i class="el-icon-setting"></i>
109
             <i class="el-icon-setting"></i>
105
             <span style="margin-right:20px" @click="onClick">权限配置</span>
110
             <span style="margin-right:20px" @click="onClick">权限配置</span>
106
           </div>
111
           </div>
107
           <div class="avatar">
112
           <div class="avatar">
108
-            <img src="../../assets/img/pc1.png" alt />
109
-            <p class="avatarname">子管理员</p>
110
-          </div>
111
-          <div class="roleTip">
112
-            子管理员角色具备平台全部功能的使用权限,请谨慎配置...
113
-          </div>
114
-          <div class="roleTxt">
115
-            该角色目前已配置
116
-            <span style="color:#4A8AF3">0</span> 个员工
117
-          </div>
118
-          <div class="btnBox">
119
-            <el-button>新增用户</el-button>
120
-            <el-button>用户管理</el-button>
121
-          </div>
122
-        </div>
123
-        <div class="roleOne">
124
-          <div class="setting">
125
-            <i class="el-icon-setting"></i>
126
-            <span style="margin-right:20px">权限配置</span>
127
-          </div>
128
-          <div class="avatar">
129
-            <img src="../../assets/img/pc2.png" alt />
130
-            <p class="avatarname">医生</p>
131
-          </div>
132
-          <div class="roleTip">
133
-            医生角色能够进行建立患者档案,制定和调整患者透析治疗方案,定期评价病人的透析质量等...
134
-          </div>
135
-          <div class="roleTxt">
136
-            该角色目前已配置
137
-            <span style="color:#4A8AF3">0</span> 个员工
138
-          </div>
139
-          <div class="btnBox">
140
-            <el-button>新增用户</el-button>
141
-            <el-button>用户管理</el-button>
142
-          </div>
143
-        </div>
144
-        <div class="roleOne">
145
-          <div class="setting">
146
-            <i class="el-icon-setting"></i>
147
-            <span style="margin-right:20px">权限配置</span>
148
-          </div>
149
-          <div class="avatar">
150
-            <img src="../../assets/img/pc3.png" alt />
151
-            <p class="avatarname">护士</p>
152
-          </div>
153
-          <div class="roleTip">
154
-            护士角色能够进行病人透析管理,以及医院的感染控制与消毒记录等...
155
-          </div>
156
-          <div class="roleTxt">
157
-            该角色目前已配置
158
-            <span style="color:#4A8AF3">0</span> 个员工
159
-          </div>
160
-          <div class="btnBox">
161
-            <el-button>新增用户</el-button>
162
-            <el-button>用户管理</el-button>
163
-          </div>
164
-        </div>
165
-        <div class="roleOne">
166
-          <div class="setting">
167
-            <i class="el-icon-setting"></i>
168
-            <span style="margin-right:20px">权限配置</span>
169
-          </div>
170
-          <div class="avatar">
171
-            <img src="../../assets/img/pc7.png" alt />
172
-            <p class="avatarname">技师</p>
173
-          </div>
174
-          <div class="roleTip">
175
-            技师角色能够进行设备的管理,日常维护维修记录等...
176
-          </div>
177
-          <div class="roleTxt">
178
-            该角色目前已配置
179
-            <span style="color:#4A8AF3">0</span> 个员工
180
-          </div>
181
-          <div class="btnBox">
182
-            <el-button>新增用户</el-button>
183
-            <el-button>用户管理</el-button>
184
-          </div>
185
-        </div>
186
-        <div class="roleOne">
187
-          <div class="setting">
188
-            <i class="el-icon-setting"></i>
189
-            <span style="margin-right:20px">权限配置</span>
190
-          </div>
191
-          <div class="avatar">
192
-            <img src="../../assets/img/pc6.png" alt />
193
-            <p class="avatarname">运营</p>
194
-          </div>
195
-          <div class="roleTip">
196
-            运营角色能够在SCRM中管理微网站、使用营销工具、做会员管理和分销商品经营的操作...
197
-          </div>
198
-          <div class="roleTxt">
199
-            该角色目前已配置
200
-            <span style="color:#4A8AF3">0</span> 个员工
201
-          </div>
202
-          <div class="btnBox">
203
-            <el-button>新增用户</el-button>
204
-            <el-button>用户管理</el-button>
205
-          </div>
206
-        </div>
207
-        <div class="roleOne">
208
-          <div class="setting">
209
-            <i class="el-icon-setting"></i>
210
-            <span style="margin-right:20px">权限配置</span>
211
-          </div>
212
-          <div class="avatar">
213
-            <img src="../../assets/img/pc4.png" alt />
214
-            <p class="avatarname">库存</p>
215
-          </div>
216
-          <div class="roleTip">
217
-            库存角色负责透析耗材的日常管理,对耗材的入库、出库、退库的登记操作...
218
-          </div>
219
-          <div class="roleTxt">
220
-            该角色目前已配置
221
-            <span style="color:#4A8AF3">0</span> 个员工
222
-          </div>
223
-          <div class="btnBox">
224
-            <el-button>新增用户</el-button>
225
-            <el-button>用户管理</el-button>
226
-          </div>
227
-        </div>
228
-        <div class="roleOne">
229
-          <div class="setting">
230
-            <i class="el-icon-setting"></i>
231
-            <span style="margin-right:20px">权限配置</span>
232
-          </div>
233
-          <div class="avatar">
234
-            <img src="../../assets/img/pc5.png" alt />
235
-            <p class="avatarname">院长</p>
113
+            <img v-if="item.name == '子管理员'" src="../../assets/img/pc1.png" alt=""/>
114
+            <img v-else-if="item.name == '医生'" src="../../assets/img/pc2.png" alt=""/>
115
+            <img v-else-if="item.name == '护士'" src="../../assets/img/pc3.png" alt=""/>
116
+            <img v-else-if="item.name == '库存'" src="../../assets/img/pc4.png" alt=""/>
117
+            <img v-else-if="item.name == '院长'" src="../../assets/img/pc5.png" alt=""/>
118
+            <img v-else-if="item.name == '运营'"  src="../../assets/img/pc6.png" alt=""/>
119
+            <img v-else-if="item.name == '技师'"  src="../../assets/img/pc7.png" alt=""/>
120
+            <img v-else  src="../../assets/img/pc1.png" alt=""/>
121
+
122
+
123
+
124
+            <p class="avatarname">{{item.name}}</p>
236
           </div>
125
           </div>
237
           <div class="roleTip">
126
           <div class="roleTip">
238
-            院长角色了解血透患者血液透析质量和相关的大数据,以及掌握透析中心整体运营情况
127
+           {{item.intro}}
239
           </div>
128
           </div>
240
           <div class="roleTxt">
129
           <div class="roleTxt">
241
             该角色目前已配置
130
             该角色目前已配置
242
-            <span style="color:#4A8AF3">0</span> 个员工
131
+            <span style="color:#4A8AF3">{{item.staff_number}}</span> 个员工
243
           </div>
132
           </div>
244
           <div class="btnBox">
133
           <div class="btnBox">
245
-            <el-button>新增用户</el-button>
134
+            <el-button @click="addStaff(item.id)">新增用户</el-button>
246
             <el-button>用户管理</el-button>
135
             <el-button>用户管理</el-button>
247
           </div>
136
           </div>
248
         </div>
137
         </div>
138
+
249
       </div>
139
       </div>
250
     </div>
140
     </div>
251
   </div>
141
   </div>
254
 <script>
144
 <script>
255
 import EditRole from "./components/EditRole.vue";
145
 import EditRole from "./components/EditRole.vue";
256
 import PermissionSettings from "./components/PermissionSettings.vue";
146
 import PermissionSettings from "./components/PermissionSettings.vue";
257
-import { getRoles, setRoleStatus } from "@/api/role/role";
147
+import { getRoles, setRoleStatus,getRolesList } from "@/api/role/role";
258
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
148
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
149
+import AddRole from './components/AddRole'
259
 
150
 
260
 export default {
151
 export default {
261
   components: {
152
   components: {
153
+    AddRole,
262
     EditRole,
154
     EditRole,
263
     BreadCrumb,
155
     BreadCrumb,
264
     PermissionSettings
156
     PermissionSettings
279
     this.requestRoleWithPage(1);
171
     this.requestRoleWithPage(1);
280
   },
172
   },
281
   methods: {
173
   methods: {
174
+    addStaff(role_id){
175
+      this.$refs.edit_role.show(role_id);
176
+
177
+    },
282
     requestRoleWithPage: function(page) {
178
     requestRoleWithPage: function(page) {
283
       this.roles.splice(0, this.roles.length);
179
       this.roles.splice(0, this.roles.length);
284
       this.loading_roles = true;
180
       this.loading_roles = true;
285
-      getRoles(page)
181
+      getRolesList(page)
286
         .then(rs => {
182
         .then(rs => {
287
           this.loading_roles = false;
183
           this.loading_roles = false;
288
           const resp = rs.data;
184
           const resp = rs.data;
289
           if (resp.state === 1) {
185
           if (resp.state === 1) {
290
-            this.roles.push(...resp.data.roles);
291
-            this.role_total_count = resp.data.total_count;
186
+
187
+            for (let i = 0; i < resp.data.roles.length; i++) {
188
+              if (!resp.data.roles[i].is_super_admin) {
189
+                this.roles.push(resp.data.roles[i])
190
+              }
191
+            }
192
+            // this.roles.push(...resp.data.roles);
292
           } else {
193
           } else {
293
             this.$message.error(resp.msg);
194
             this.$message.error(resp.msg);
294
           }
195
           }
300
     },
201
     },
301
     addRoleAction: function() {
202
     addRoleAction: function() {
302
       // 父组件调用子组件方法 https://segmentfault.com/a/1190000009525355
203
       // 父组件调用子组件方法 https://segmentfault.com/a/1190000009525355
303
-      this.$refs.edit_role.show();
204
+      this.$refs.add_role.show();
304
     },
205
     },
305
     modifyRoleAction: function(row) {
206
     modifyRoleAction: function(row) {
306
       this.$refs.edit_role.modify(row.id, row.name, row.intro);
207
       this.$refs.edit_role.modify(row.id, row.name, row.intro);
365
           this.$message.error(err);
266
           this.$message.error(err);
366
         });
267
         });
367
     },
268
     },
368
-    didAddRole: function(id, name, intro, status) {
369
-      this.roles.push({ id: id, name: name, intro: intro, status: status });
269
+    didAddRole: function(id, name, intro, status,staff_number) {
270
+      this.roles.push({ id: id, name: name, intro: intro, status: status ,staff_number: staff_number});
370
     },
271
     },
371
-    didModifyRole: function(id, name, intro) {
372
-      this.roles.forEach(role => {
373
-        if (role.id === id) {
374
-          role.name = name;
375
-          role.intro = intro;
376
-          return false;
377
-        }
378
-      });
272
+    didModifyRole: function() {
273
+      this.requestRoleWithPage(1);
274
+
379
     },
275
     },
380
     pageChange: function(nextPage) {
276
     pageChange: function(nextPage) {
381
       this.requestRoleWithPage(nextPage);
277
       this.requestRoleWithPage(nextPage);

+ 13 - 13
src/xt_permission.js Datei anzeigen

10
 
10
 
11
 router.beforeEach((to, from, next) => {
11
 router.beforeEach((to, from, next) => {
12
   // 线上注释
12
   // 线上注释
13
-  // if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
14
-  //   store.dispatch('VerifyConfigList', []).then(() => {
15
-  //     next()
16
-  //   })
17
-  // }
18
-  // if (store.getters.permission_routers === undefined) {
19
-  //   store.dispatch('xt_GenerateRoutes', []).then(() => {
20
-  //     next()
21
-  //   })
22
-  // } else {
23
-  //   next()
24
-  // }
25
-  // return
13
+  if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
14
+    store.dispatch('VerifyConfigList', []).then(() => {
15
+      next()
16
+    })
17
+  }
18
+  if (store.getters.permission_routers === undefined) {
19
+    store.dispatch('xt_GenerateRoutes', []).then(() => {
20
+      next()
21
+    })
22
+  } else {
23
+    next()
24
+  }
25
+  return
26
   // 线上注释
26
   // 线上注释
27
 
27
 
28
   NProgress.start();
28
   NProgress.start();