Browse Source

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

XMLWAN 4 years ago
parent
commit
5bbe1811e7
47 changed files with 4211 additions and 1453 deletions
  1. 2 2
      config/dev.env.js
  2. 1 1
      config/index.js
  3. 1 1
      config/sit.env.js
  4. 11 30
      package-lock.json
  5. 6 4
      src/api/advice.js
  6. 20 0
      src/api/config.js
  7. 25 8
      src/api/dialysis.js
  8. 23 8
      src/api/dialysis_record.js
  9. 11 6
      src/api/patient.js
  10. 14 11
      src/api/role/admin.js
  11. 86 55
      src/api/role/role.js
  12. BIN
      src/assets/img/pc1.png
  13. BIN
      src/assets/img/pc2.png
  14. BIN
      src/assets/img/pc3.png
  15. BIN
      src/assets/img/pc4.png
  16. BIN
      src/assets/img/pc5.png
  17. BIN
      src/assets/img/pc6.png
  18. BIN
      src/assets/img/pc7.png
  19. BIN
      src/assets/logo/logo1.png
  20. 253 245
      src/lang/zh.js
  21. 246 130
      src/router/modules/stock.js
  22. 8 8
      src/router/modules/systems.js
  23. 45 44
      src/styles/sidebar.scss
  24. 61 36
      src/views/layout/Layout.vue
  25. 6 7
      src/views/layout/components/AppMain.vue
  26. 370 170
      src/views/layout/components/Navbar.vue
  27. 168 30
      src/views/layout/components/Sidebar/SidebarItem.vue
  28. 162 42
      src/views/layout/components/Sidebar/index.vue
  29. 231 105
      src/views/layout/components/TagsView.vue
  30. 7 0
      src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue
  31. 68 67
      src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue
  32. 9 0
      src/xt_pages/dialysis/details/dialog/acceptsTreatmentDialog.vue
  33. 9 0
      src/xt_pages/dialysis/details/dialog/assessmentBeforeDislysisDialog.vue
  34. 55 73
      src/xt_pages/dialysis/details/dialog/computer_dialog.vue
  35. 101 1
      src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue
  36. 6 1
      src/xt_pages/dialysis/details/dialog/finish_dialog.vue
  37. 9 2
      src/xt_pages/dialysis/details/dialog/monitor_dialog.vue
  38. 7 0
      src/xt_pages/dialysis/details/dialog/treatmentSummaryDialog.vue
  39. 2 3
      src/xt_pages/home/index.vue
  40. 56 4
      src/xt_pages/role/admin.vue
  41. 252 0
      src/xt_pages/role/components/AddRole.vue
  42. 306 201
      src/xt_pages/role/components/AdminInfoForm.vue
  43. 257 0
      src/xt_pages/role/components/AdminRoleInfoForm.vue
  44. 566 90
      src/xt_pages/role/components/EditRole.vue
  45. 346 0
      src/xt_pages/role/components/PermissionSettings.vue
  46. 242 0
      src/xt_pages/role/components/UserManagement.vue
  47. 163 68
      src/xt_pages/role/role.vue

+ 2 - 2
config/dev.env.js View File

@@ -6,8 +6,8 @@
6 6
 module.exports = {
7 7
   NODE_ENV: '"development"',
8 8
   ENV_CONFIG: '"dev"',
9
-  BASE_API:  '"http://api.xt.test.sgjyun.com"',// //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
10
-  //BASE_API:'"http://localhost:9529"',
9
+  BASE_API:  '"http://new_mobile.xt.api.sgjyun.com"',// //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
10
+  // BASE_API:'"http://localhost:9531"',
11 11
   SSO_HOST: '"http://testsso.sgjyun.com"',
12 12
   SRCM_HOST: '"http://test1.sgjyun.com"',
13 13
   XT_HOST: '"http://xt.test.sgjyun.com"',

+ 1 - 1
config/index.js View File

@@ -20,7 +20,7 @@ module.exports = {
20 20
     // host: 'xt.test.sgjyun.com',
21 21
     // host: 'xt.kuyicloud.com',
22 22
     host: 'xt.test.sgjyun.com',
23
-    //host:'localhost',
23
+    // host:'localhost',
24 24
     port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
25 25
     autoOpenBrowser: true,
26 26
     errorOverlay: true,

+ 1 - 1
config/sit.env.js View File

@@ -1,7 +1,7 @@
1 1
 module.exports = {
2 2
   NODE_ENV: '"production"',
3 3
   ENV_CONFIG: '"sit"',
4
-  BASE_API: '"http://api.xt.test.sgjyun.com"',
4
+  BASE_API: '"http://new_mobile.xt.api.sgjyun.com"',
5 5
 
6 6
   SSO_HOST: '"https://testsso.sgjyun.com"',
7 7
   SRCM_HOST: '"https://test1.sgjyun.com"',

+ 11 - 30
package-lock.json View File

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

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

+ 20 - 0
src/api/config.js View File

@@ -90,5 +90,25 @@ export function updateSystemPrescription(id,params) {
90 90
 }
91 91
 
92 92
 
93
+export function getOrgs() {
94
+  return request({
95
+    url: '/api/public/orgs',
96
+    method: 'get',
97
+  })
98
+}
99
+
100
+
101
+
102
+export function changeOrg(params) {
103
+  return request({
104
+    url: '/api/org/change',
105
+    method: 'post',
106
+    params:params,
107
+  })
108
+}
109
+
110
+
111
+
112
+
93 113
 
94 114
 

+ 25 - 8
src/api/dialysis.js View File

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

@@ -30,20 +30,23 @@ export function getDialysisScheduleDetail(patient_id, ymd) {
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 34
   var params = {
35 35
     patient_id: patient_id,
36
-    schedule_date: schedule_date
36
+    schedule_date: schedule_date,
37
+    mode:mode
37 38
   }
38 39
   return request({
39 40
     url: '/api/dislysis/monitor/edit',
40 41
     method: 'post',
41 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 50
   var params = {
48 51
     patient_id: patient_id,
49 52
     date: schedule_date,
@@ -53,25 +56,31 @@ export function startDialysis(patient_id, schedule_date, nurse_id, bed_id, lood_
53 56
     start_time: start_time,
54 57
     lood_drawing: lood_drawing,
55 58
     schedual_type:schedual_type,
59
+    mode:mode,
56 60
   }
57 61
   return request({
58 62
     url: '/api/dialysis/start_record',
59 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 71
   var params = {
66 72
     patient_id: patient_id,
67 73
     date: schedule_date,
68 74
     nurse: nurse_id,
69 75
     end_time:end_time,
76
+    mode:mode,
70 77
   }
71 78
   return request({
72 79
     url: '/api/dialysis/finish',
73 80
     method: 'post',
74
-    params: params
81
+    params: params,
82
+    headers:{"Permission":2},
83
+
75 84
   })
76 85
 }
77 86
 
@@ -79,7 +88,9 @@ export function postDelMonitorInfo(params) {
79 88
   return request({
80 89
     url: '/api/dialysis/monitor/del',
81 90
     method: 'post',
82
-    params: params
91
+    params: params,
92
+    headers:{"Permission":2},
93
+
83 94
   })
84 95
 }
85 96
 
@@ -111,6 +122,8 @@ export function PostModifyStartDialysis(params) {
111 122
     url:'/api/start_dialysis/modify',
112 123
     method:'Post',
113 124
     params:params,
125
+    headers:{"Permission":2},
126
+
114 127
   })
115 128
 }
116 129
 
@@ -125,6 +138,8 @@ export function PostModifyFinishDialysis(params) {
125 138
     url:'/api/finish_dialysis/modify',
126 139
     method:'Post',
127 140
     params:params,
141
+    headers:{"Permission":2},
142
+
128 143
   })
129 144
 }
130 145
 

+ 11 - 6
src/api/patient.js View File

@@ -57,19 +57,24 @@ export function fetchPatientDialysisSolutions(params) {
57 57
   })
58 58
 }
59 59
 
60
-export function createPatientDialysisSolution(id, solution) {
60
+export function createPatientDialysisSolution(id, solution,mode) {
61 61
   return request({
62
-    url: '/api/patients/dialysissolution/create?patient=' + id,
62
+    url: '/api/patients/dialysissolution/create?patient=' + id +"&mode="+mode,
63 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 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 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 View File

@@ -25,14 +25,15 @@ export function getAddAdminInitData() {
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 29
     const params = {
30 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 35
         intro: intro,
36
+        user_title_name: user_title_name
36 37
     }
37 38
     return request({
38 39
         url: '/api/admin/add',
@@ -52,14 +53,16 @@ export function getModifyAdminInitData(uid) {
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 57
     const params = {
57 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 63
         intro: intro,
64
+      user_title_name: user_title_name
65
+
63 66
     }
64 67
     return request({
65 68
         url: '/api/admin/edit',
@@ -96,4 +99,4 @@ export function submitDialysisRecordPermissionUsers(ids_str) {
96 99
         method: 'post',
97 100
         params: params,
98 101
     })
99
-}
102
+}

+ 86 - 55
src/api/role/role.js View File

@@ -1,72 +1,103 @@
1 1
 import request from '@/utils/request'
2 2
 
3 3
 export function getRoles(page) {
4
-    const params = {
5
-        page: page,
6
-    }
7
-    return request({
8
-        url: '/api/roles',
9
-        method: 'get',
10
-        params: params,
11
-    })
4
+  const params = {
5
+    page: page
6
+  }
7
+  return request({
8
+    url: '/api/roles',
9
+    method: 'get',
10
+    params: params
11
+  })
12 12
 }
13 13
 
14 14
 export function addRole(name, intro) {
15
-    const params = {
16
-        name: name,
17
-        intro: intro
18
-    }
19
-    return request({
20
-        url: '/api/role/create',
21
-        method: 'post',
22
-        params: params,
23
-    })
15
+  const params = {
16
+    name: name,
17
+    intro: intro
18
+  }
19
+  return request({
20
+    url: '/api/role/create',
21
+    method: 'post',
22
+    params: params
23
+  })
24 24
 }
25 25
 
26 26
 export function modifyRole(role_id, name, intro) {
27
-    const params = {
28
-        role_id: role_id,
29
-        name: name,
30
-        intro: intro
31
-    }
32
-    return request({
33
-        url: '/api/role/modify',
34
-        method: 'post',
35
-        params: params,
36
-    })
27
+  const params = {
28
+    role_id: role_id,
29
+    name: name,
30
+    intro: intro
31
+  }
32
+  return request({
33
+    url: '/api/role/modify',
34
+    method: 'post',
35
+    params: params
36
+  })
37 37
 }
38 38
 
39 39
 export function setRoleStatus(role_id, enable) {
40
-    const params = {
41
-        role_id: role_id,
42
-        enable: enable,
43
-    }
44
-    return request({
45
-        url: '/api/role/setstatus',
46
-        method: 'post',
47
-        params: params,
48
-    })
40
+  const params = {
41
+    role_id: role_id,
42
+    enable: enable
43
+  }
44
+  return request({
45
+    url: '/api/role/setstatus',
46
+    method: 'post',
47
+    params: params
48
+  })
49 49
 }
50 50
 
51 51
 export function getEditPurviewInitData(role_id) {
52
-    const params = {
53
-        role_id: role_id,
54
-    }
55
-    return request({
56
-        url: '/role/purview/editinit',
57
-        method: 'get',
58
-        params: params,
59
-    })
52
+  const params = {
53
+    role_id: role_id
54
+  }
55
+  return request({
56
+    url: '/role/purview/editinit',
57
+    method: 'get',
58
+    params: params
59
+  })
60
+}
61
+
62
+export function editPurview(role_id, purview_ids, func_purview_ids) {
63
+  const params = {
64
+    role_id: role_id,
65
+    purview_ids: purview_ids,
66
+    func_purview_ids: func_purview_ids
67
+  }
68
+  return request({
69
+    url: '/role/purview/edit',
70
+    method: 'post',
71
+    params: params
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
+export function AddUserRole(params) {
90
+  return request({
91
+    url: '/api/role/addStaff',
92
+    method: 'post',
93
+    params: params
94
+  })
95
+}
96
+
97
+export function getRoleStaff() {
98
+  return request({
99
+    url: '/api/role/staff',
100
+    method: 'get'
101
+  })
60 102
 }
61 103
 
62
-export function editPurview(role_id, purview_ids) {
63
-    const params = {
64
-        role_id: role_id,
65
-        purview_ids: purview_ids,
66
-    }
67
-    return request({
68
-        url: '/role/purview/edit',
69
-        method: 'post',
70
-        params: params,
71
-    })
72
-}

BIN
src/assets/img/pc1.png View File


BIN
src/assets/img/pc2.png View File


BIN
src/assets/img/pc3.png View File


BIN
src/assets/img/pc4.png View File


BIN
src/assets/img/pc5.png View File


BIN
src/assets/img/pc6.png View File


BIN
src/assets/img/pc7.png View File


BIN
src/assets/logo/logo1.png View File


+ 253 - 245
src/lang/zh.js View File

@@ -1,277 +1,285 @@
1 1
 export default {
2 2
   route: {
3
-    dashboard: '首页',
4
-    introduction: '简述',
5
-    documentation: '文档',
6
-    guide: '引导页',
7
-    permission: '权限测试页',
8
-    pagePermission: '页面权限',
9
-    directivePermission: '指令权限',
10
-    icons: '图标',
11
-    components: '组件',
12
-    componentIndex: '介绍',
13
-    tinymce: '富文本编辑器',
14
-    markdown: 'Markdown',
15
-    jsonEditor: 'JSON编辑器',
16
-    dndList: '列表拖拽',
17
-    splitPane: 'Splitpane',
18
-    avatarUpload: '头像上传',
19
-    dropzone: 'Dropzone',
20
-    sticky: 'Sticky',
21
-    countTo: 'CountTo',
22
-    componentMixin: '小组件',
23
-    backToTop: '返回顶部',
24
-    dragDialog: '拖拽 Dialog',
25
-    dragKanban: '可拖拽看板',
26
-    charts: '图表',
27
-    keyboardChart: '键盘图表',
28
-    lineChart: '折线图',
29
-    mixChart: '混合图表',
30
-    example: '综合实例',
31
-    nested: '路由嵌套',
32
-    menu1: '菜单1',
33
-    'menu1-1': '菜单1-1',
34
-    'menu1-2': '菜单1-2',
35
-    'menu1-2-1': '菜单1-2-1',
36
-    'menu1-2-2': '菜单1-2-2',
37
-    'menu1-3': '菜单1-3',
38
-    menu2: '菜单2',
39
-    Table: 'Table',
40
-    dynamicTable: '动态Table',
41
-    dragTable: '拖拽Table',
42
-    inlineEditTable: 'Table内编辑',
43
-    complexTable: '综合Table',
44
-    treeTable: '树形表格',
45
-    customTreeTable: '自定义树表',
46
-    tab: 'Tab',
47
-    form: '表单',
48
-    createArticle: '创建文章',
49
-    editArticle: '编辑文章',
50
-    articleList: '文章列表',
51
-    errorPages: '错误页面',
52
-    page401: '401',
53
-    page404: '404',
54
-    errorLog: '错误日志',
55
-    excel: 'Excel',
56
-    exportExcel: 'Export Excel',
57
-    selectExcel: 'Export Selected',
58
-    uploadExcel: 'Upload Excel',
59
-    zip: 'Zip',
60
-    exportZip: 'Export Zip',
61
-    theme: '换肤',
62
-    clipboardDemo: 'Clipboard',
63
-    i18n: '国际化',
64
-    permissionManage: '权限管理',
65
-    adminManage: '用户管理',
66
-    roleManage: '角色管理',
67
-    dialysis: '透析管理',
68
-    paper: '透析管理',
69
-    advice: '今日医嘱',
70
-    prepare: '透析准备',
71
-    dialysisPrintOrder: '打印透析单',
72
-    details: '透析',
73
-    data_dictionary: '数据字典',
74
-    field_config: '字段配置',
75
-    template: '模版配置',
76
-    druguse: '医嘱模版',
77
-    watch: '透析监测',
78
-    addAdmin: '新增用户',
79
-    editAdmin: '编辑用户信息',
80
-    setupPerview: '设置权限',
81
-    user: '病人管理',
82
-    createPatient: '新增病人',
83
-    patientPage: '病人信息',
84
-    editPatient: '修改病人信息',
85
-    patient: '病人管理',
86
-    dialysisSolution: '透析处方',
87
-    inspection: '检验检查',
88
-    home: '首页',
89
-    weight: '干体重',
90
-    dialysisRecord: '透析记录',
91
-    scheduling: '排班信息',
92
-    proeducation: '宣教信息',
93
-    doctorAdvice: '医嘱信息',
94
-    dryWeight: '干体重',
95
-    device: '设备',
96
-    deviceManage: '设备管理',
97
-    modemanagement:'型号管理',
98
-    dialysisMachineManage: '设备管理',
99
-    workforce: '排班管理',
100
-    appointment: '排班管理',
101
-    sign: '治疗签到',
102
-    remind: '排班提醒',
103
-    signWeight: '签到称重',
104
-    deviceZoneManage: '分区管理',
105
-    deviceGroupManage: '分组管理',
106
-    deviceNumberManage: '床位管理',
107
-    service: '我的服务',
108
-    invoice: '发票管理',
109
-    invoiceApply: '申请发票',
110
-    servicePay: '立即支付',
111
-    serviceOrder: '购买服务',
112
-    payType: '选择支付方式',
113
-    weChatPay: '确认支付',
114
-    completeOrder: '购买结果',
115
-    orderRecord: '订单详情',
116
-    recordList: '订单记录',
117
-    stockManage: '库存管理',
118
-    goodType: '商品类型',
119
-    stockIn: '入库管理',
120
-    stockOut: '出库管理',
121
-    manufacturer: '厂家',
122
-    dealer: '经销商',
123
-    salesReturn: '退货',
124
-    salesReutrnRecord: '退货记录',
125
-    warehouseRecord: '入库记录',
126
-    addStockOut: '出库',
127
-    cancelStock: '出库退库',
128
-    cancelStockRecord: '退库记录',
129
-    stockOutRecord: '出库记录',
130
-    addStockIn: '入库',
131
-    stockQuery: '库存查询',
132
-    workforce_template: '排班模板设置',
133
-    statistics: '统计分析',
134
-    config: '库存配置',
135
-    goodInfo: '商品信息',
136
-    CourseOfDiseaseManage: '病程管理',
137
-    RescueRecord: '抢救记录',
138
-    special_permission_manage: '特殊权限管理',
139
-    schedule_print: '排班打印',
3
+    dashboard: "首页",
4
+    introduction: "简述",
5
+    documentation: "文档",
6
+    guide: "引导页",
7
+    permission: "权限测试页",
8
+    pagePermission: "页面权限",
9
+    directivePermission: "指令权限",
10
+    icons: "图标",
11
+    components: "组件",
12
+    componentIndex: "介绍",
13
+    tinymce: "富文本编辑器",
14
+    markdown: "Markdown",
15
+    jsonEditor: "JSON编辑器",
16
+    dndList: "列表拖拽",
17
+    splitPane: "Splitpane",
18
+    avatarUpload: "头像上传",
19
+    dropzone: "Dropzone",
20
+    sticky: "Sticky",
21
+    countTo: "CountTo",
22
+    componentMixin: "小组件",
23
+    backToTop: "返回顶部",
24
+    dragDialog: "拖拽 Dialog",
25
+    dragKanban: "可拖拽看板",
26
+    charts: "图表",
27
+    keyboardChart: "键盘图表",
28
+    lineChart: "折线图",
29
+    mixChart: "混合图表",
30
+    example: "综合实例",
31
+    nested: "路由嵌套",
32
+    menu1: "菜单1",
33
+    "menu1-1": "菜单1-1",
34
+    "menu1-2": "菜单1-2",
35
+    "menu1-2-1": "菜单1-2-1",
36
+    "menu1-2-2": "菜单1-2-2",
37
+    "menu1-3": "菜单1-3",
38
+    menu2: "菜单2",
39
+    Table: "Table",
40
+    dynamicTable: "动态Table",
41
+    dragTable: "拖拽Table",
42
+    inlineEditTable: "Table内编辑",
43
+    complexTable: "综合Table",
44
+    treeTable: "树形表格",
45
+    customTreeTable: "自定义树表",
46
+    tab: "Tab",
47
+    form: "表单",
48
+    createArticle: "创建文章",
49
+    editArticle: "编辑文章",
50
+    articleList: "文章列表",
51
+    errorPages: "错误页面",
52
+    page401: "401",
53
+    page404: "404",
54
+    errorLog: "错误日志",
55
+    excel: "Excel",
56
+    exportExcel: "Export Excel",
57
+    selectExcel: "Export Selected",
58
+    uploadExcel: "Upload Excel",
59
+    zip: "Zip",
60
+    exportZip: "Export Zip",
61
+    theme: "换肤",
62
+    clipboardDemo: "Clipboard",
63
+    i18n: "国际化",
64
+    permissionManage: "权限管理",
65
+    adminManage: "用户管理",
66
+    roleManage: "角色管理",
67
+    dialysis: "透析管理",
68
+    paper: "透析管理",
69
+    advice: "今日医嘱",
70
+    prepare: "透析准备",
71
+    dialysisPrintOrder: "打印透析单",
72
+    details: "透析",
73
+    data_dictionary: "数据字典",
74
+    field_config: "字段配置",
75
+    template: "模版配置",
76
+    druguse: "医嘱模版",
77
+    watch: "透析监测",
78
+    addAdmin: "新增用户",
79
+    editAdmin: "编辑用户信息",
80
+    setupPerview: "设置权限",
81
+    user: "病人管理",
82
+    createPatient: "新增病人",
83
+    patientPage: "病人信息",
84
+    editPatient: "修改病人信息",
85
+    patient: "病人管理",
86
+    dialysisSolution: "透析处方",
87
+    inspection: "检验检查",
88
+    home: "首页",
89
+    weight: "干体重",
90
+    dialysisRecord: "透析记录",
91
+    scheduling: "排班信息",
92
+    proeducation: "宣教信息",
93
+    doctorAdvice: "医嘱信息",
94
+    dryWeight: "干体重",
95
+    device: "设备",
96
+    deviceManage: "设备管理",
97
+    modemanagement: "型号管理",
98
+    dialysisMachineManage: "设备管理",
99
+    workforce: "排班管理",
100
+    appointment: "排班管理",
101
+    sign: "治疗签到",
102
+    remind: "排班提醒",
103
+    signWeight: "签到称重",
104
+    deviceZoneManage: "分区管理",
105
+    deviceGroupManage: "分组管理",
106
+    deviceNumberManage: "床位管理",
107
+    service: "我的服务",
108
+    invoice: "发票管理",
109
+    invoiceApply: "申请发票",
110
+    servicePay: "立即支付",
111
+    serviceOrder: "购买服务",
112
+    payType: "选择支付方式",
113
+    weChatPay: "确认支付",
114
+    completeOrder: "购买结果",
115
+    orderRecord: "订单详情",
116
+    recordList: "订单记录",
117
+    stockManage: "库存管理",
118
+    goodType: "商品类型",
119
+    stockIn: "入库管理",
120
+    stockOut: "出库管理",
121
+    manufacturer: "厂家",
122
+    dealer: "经销商",
123
+    salesReturn: "退货",
124
+    salesReutrnRecord: "退货记录",
125
+    warehouseRecord: "入库记录",
126
+    addStockOut: "出库",
127
+    cancelStock: "出库退库",
128
+    cancelStockRecord: "退库记录",
129
+    stockOutRecord: "出库记录",
130
+    addStockIn: "入库",
131
+    stockQuery: "库存查询",
132
+    workforce_template: "排班模板设置",
133
+    statistics: "统计分析",
134
+    config: "库存配置",
135
+    goodInfo: "商品信息",
136
+    CourseOfDiseaseManage: "病程管理",
137
+    RescueRecord: "抢救记录",
138
+    special_permission_manage: "特殊权限管理",
139
+    schedule_print: "排班打印",
140 140
 
141
-    stockInOrder: '耗材入库单',
142
-    salesReturnOrder: '耗材退货单',
143
-    stockOutOrder: '耗材出库单',
144
-    cancelStockOrder: '耗材退库单',
145
-    otherStockInOrder: '其他入库单',
146
-    otherSalesReturnOrder: '其他退货单',
147
-    otherStockOutOrder: '其他出库单',
148
-    otherCancelStockOrder: '其他退库单',
149
-    stockInOrderAdd: '新增入库单',
150
-    salesReturnOrderAdd: '新增退货单',
151
-    stockOutOrderAdd: '新增出库单',
152
-    cancelStockOrderAdd: '新增退库单',
153
-    stockInDetail: '入库单详情',
154
-    salesReturnDetail: '退货单详情',
155
-    stockOutDetail: '出库单详情',
156
-    cancelStockDetail: '退库单详情',
157
-    stockDetail: '出入库明细查询',
141
+    warehouseReceipt: "出入库",
142
+    warehouseReceiptOther: "其他出入库",
143
+    stockInOrder: "耗材入库单",
144
+    salesReturnOrder: "耗材退货单",
145
+    stockOutOrder: "耗材出库单",
146
+    cancelStockOrder: "耗材退库单",
147
+    otherStockInOrder: "其他入库单",
148
+    otherSalesReturnOrder: "其他退货单",
149
+    otherStockOutOrder: "其他出库单",
150
+    otherCancelStockOrder: "其他退库单",
151
+    stockInOrderAdd: "新增入库单",
152
+    salesReturnOrderAdd: "新增退货单",
153
+    stockOutOrderAdd: "新增出库单",
154
+    cancelStockOrderAdd: "新增退库单",
155
+    stockInDetail: "入库单详情",
156
+    salesReturnDetail: "退货单详情",
157
+    stockOutDetail: "出库单详情",
158
+    cancelStockDetail: "退库单详情",
159
+    stockDetail: "明细查询",
158 160
 
159
-    showconfig: '显示配置',
160
-    user_detail: '使用明细',
161
-    systemManage: '系统管理',
162
-    printTemplate: '打印模版',
163
-    data_upload: '一键上报',
164
-    fast_upload: '快捷上报',
165
-    export: '一键导出',
166
-    upload_config: '质控上报配置',
167
-    quality_control: '质控上报',
168
-    remind_print: '排版提醒打印',
169
-    system_prescription:"透析方案",
161
+    showconfig: "显示配置",
162
+    user_detail: "使用明细",
163
+    systemManage: "系统管理",
164
+    printTemplate: "打印模版",
165
+    data_upload: "一键上报",
166
+    fast_upload: "快捷上报",
167
+    export: "一键导出",
168
+    upload_config: "质控上报配置",
169
+    quality_control: "质控上报",
170
+    remind_print: "排版提醒打印",
171
+    system_prescription: "透析方案",
170 172
     integration_config: "集成配置",
171
-    his_config:"HIS集成配置",
172
-
173
+    his_config: "HIS集成配置"
173 174
   },
174 175
   navbar: {
175
-    logOut: '退出登录',
176
-    dashboard: '首页',
177
-    github: '项目地址',
178
-    screenfull: '全屏',
179
-    theme: '换肤'
176
+    logOut: "退出登录",
177
+    dashboard: "首页",
178
+    github: "项目地址",
179
+    screenfull: "全屏",
180
+    theme: "换肤"
180 181
   },
181 182
   login: {
182
-    title: '系统登录',
183
-    logIn: '登录',
184
-    username: '账号',
185
-    password: '密码',
186
-    any: '随便填',
187
-    thirdparty: '第三方登录',
188
-    thirdpartyTips: '本地不能模拟,请结合自己业务进行模拟!!!'
183
+    title: "系统登录",
184
+    logIn: "登录",
185
+    username: "账号",
186
+    password: "密码",
187
+    any: "随便填",
188
+    thirdparty: "第三方登录",
189
+    thirdpartyTips: "本地不能模拟,请结合自己业务进行模拟!!!"
189 190
   },
190 191
   documentation: {
191
-    documentation: '文档',
192
-    github: 'Github 地址'
192
+    documentation: "文档",
193
+    github: "Github 地址"
193 194
   },
194 195
   permission: {
195
-    roles: '你的权限',
196
-    switchRoles: '切换权限'
196
+    roles: "你的权限",
197
+    switchRoles: "切换权限"
197 198
   },
198 199
   guide: {
199
-    description: '引导页对于一些第一次进入项目的人很有用,你可以简单介绍下项目的功能。本 Demo 是基于',
200
-    button: '打开引导'
200
+    description:
201
+      "引导页对于一些第一次进入项目的人很有用,你可以简单介绍下项目的功能。本 Demo 是基于",
202
+    button: "打开引导"
201 203
   },
202 204
   components: {
203
-    documentation: '文档',
204
-    tinymceTips: '富文本是管理后台一个核心的功能,但同时又是一个有很多坑的地方。在选择富文本的过程中我也走了不少的弯路,市面上常见的富文本都基本用过了,最终权衡了一下选择了Tinymce。更详细的富文本比较和介绍见',
205
-    dropzoneTips: '由于我司业务有特殊需求,而且要传七牛 所以没用第三方,选择了自己封装。代码非常的简单,具体代码你可以在这里看到 @/components/Dropzone',
206
-    stickyTips: '当页面滚动到预设的位置会吸附在顶部',
207
-    backToTopTips1: '页面滚动到指定位置会在右下角出现返回顶部按钮',
208
-    backToTopTips2: '可自定义按钮的样式、show/hide、出现的高度、返回的位置 如需文字提示,可在外部使用Element的el-tooltip元素',
209
-    imageUploadTips: '由于我在使用时它只有vue@1版本,而且和mockjs不兼容,所以自己改造了一下,如果大家要使用的话,优先还是使用官方版本。'
205
+    documentation: "文档",
206
+    tinymceTips:
207
+      "富文本是管理后台一个核心的功能,但同时又是一个有很多坑的地方。在选择富文本的过程中我也走了不少的弯路,市面上常见的富文本都基本用过了,最终权衡了一下选择了Tinymce。更详细的富文本比较和介绍见",
208
+    dropzoneTips:
209
+      "由于我司业务有特殊需求,而且要传七牛 所以没用第三方,选择了自己封装。代码非常的简单,具体代码你可以在这里看到 @/components/Dropzone",
210
+    stickyTips: "当页面滚动到预设的位置会吸附在顶部",
211
+    backToTopTips1: "页面滚动到指定位置会在右下角出现返回顶部按钮",
212
+    backToTopTips2:
213
+      "可自定义按钮的样式、show/hide、出现的高度、返回的位置 如需文字提示,可在外部使用Element的el-tooltip元素",
214
+    imageUploadTips:
215
+      "由于我在使用时它只有vue@1版本,而且和mockjs不兼容,所以自己改造了一下,如果大家要使用的话,优先还是使用官方版本。"
210 216
   },
211 217
   table: {
212
-    dynamicTips1: '固定表头, 按照表头顺序排序',
213
-    dynamicTips2: '不固定表头, 按照点击顺序排序',
214
-    dragTips1: '默认顺序',
215
-    dragTips2: '拖拽后顺序',
216
-    title: '标题',
217
-    importance: '重要性',
218
-    type: '类型',
219
-    remark: '点评',
220
-    search: '搜索',
221
-    add: '新增',
222
-    export: '导出',
223
-    reviewer: '审核人',
224
-    id: '序号',
225
-    date: '时间',
226
-    author: '作者',
227
-    readings: '阅读数',
228
-    status: '状态',
229
-    actions: '操作',
230
-    edit: '编辑',
231
-    publish: '发布',
232
-    draft: '草稿',
233
-    delete: '删除',
234
-    cancel: '取 消',
235
-    confirm: '保 存'
218
+    dynamicTips1: "固定表头, 按照表头顺序排序",
219
+    dynamicTips2: "不固定表头, 按照点击顺序排序",
220
+    dragTips1: "默认顺序",
221
+    dragTips2: "拖拽后顺序",
222
+    title: "标题",
223
+    importance: "重要性",
224
+    type: "类型",
225
+    remark: "点评",
226
+    search: "搜索",
227
+    add: "新增",
228
+    export: "导出",
229
+    reviewer: "审核人",
230
+    id: "序号",
231
+    date: "时间",
232
+    author: "作者",
233
+    readings: "阅读数",
234
+    status: "状态",
235
+    actions: "操作",
236
+    edit: "编辑",
237
+    publish: "发布",
238
+    draft: "草稿",
239
+    delete: "删除",
240
+    cancel: "取 消",
241
+    confirm: "保 存"
236 242
   },
237 243
   errorLog: {
238
-    tips: '请点击右上角bug小图标',
239
-    description: '现在的管理后台基本都是spa的形式了,它增强了用户体验,但同时也会增加页面出问题的可能性,可能一个小小的疏忽就导致整个页面的死锁。好在 Vue 官网提供了一个方法来捕获处理异常,你可以在其中进行错误处理或者异常上报。',
240
-    documentation: '文档介绍'
244
+    tips: "请点击右上角bug小图标",
245
+    description:
246
+      "现在的管理后台基本都是spa的形式了,它增强了用户体验,但同时也会增加页面出问题的可能性,可能一个小小的疏忽就导致整个页面的死锁。好在 Vue 官网提供了一个方法来捕获处理异常,你可以在其中进行错误处理或者异常上报。",
247
+    documentation: "文档介绍"
241 248
   },
242 249
   excel: {
243
-    export: '导出',
244
-    selectedExport: '导出已选择项',
245
-    placeholder: '请输入文件名(默认excel-list)'
250
+    export: "导出",
251
+    selectedExport: "导出已选择项",
252
+    placeholder: "请输入文件名(默认excel-list)"
246 253
   },
247 254
   zip: {
248
-    export: '导出',
249
-    placeholder: '请输入文件名(默认file)'
255
+    export: "导出",
256
+    placeholder: "请输入文件名(默认file)"
250 257
   },
251 258
   theme: {
252
-    change: '换肤',
253
-    documentation: '换肤文档',
254
-    tips: 'Tips: 它区别于 navbar 上的 theme-pick, 是两种不同的换肤方法,各自有不同的应用场景,具体请参考文档。'
259
+    change: "换肤",
260
+    documentation: "换肤文档",
261
+    tips:
262
+      "Tips: 它区别于 navbar 上的 theme-pick, 是两种不同的换肤方法,各自有不同的应用场景,具体请参考文档。"
255 263
   },
256 264
   tagsView: {
257
-    close: '关闭',
258
-    closeOthers: '关闭其它',
259
-    closeAll: '关闭所有'
265
+    close: "关闭",
266
+    closeOthers: "关闭其它",
267
+    closeAll: "关闭所有"
260 268
   },
261 269
   data_config: {
262
-    patient: '病人管理',
263
-    scheduling: '排班管理',
264
-    device: '设备管理',
265
-    hemodialysis: '血透管理',
266
-    system: '系统配置',
267
-    education: '透后宣教',
268
-    summary: '透析小结',
269
-    config_name: '名称',
270
-    config_field: '字段名',
271
-    config_value: '字段值',
272
-    remark: '备注',
273
-    course_disease: '病程',
274
-    rescue_record: '抢救记录',
275
-    manage_ment: '设备管理'
270
+    patient: "病人管理",
271
+    scheduling: "排班管理",
272
+    device: "设备管理",
273
+    hemodialysis: "血透管理",
274
+    system: "系统配置",
275
+    education: "透后宣教",
276
+    summary: "透析小结",
277
+    config_name: "名称",
278
+    config_field: "字段名",
279
+    config_value: "字段值",
280
+    remark: "备注",
281
+    course_disease: "病程",
282
+    rescue_record: "抢救记录",
283
+    manage_ment: "设备管理"
276 284
   }
277
-}
285
+};

+ 246 - 130
src/router/modules/stock.js View File

@@ -1,145 +1,261 @@
1
-import Layout from '@/views/layout/Layout'
1
+import Layout from "@/views/layout/Layout";
2 2
 
3 3
 export default {
4
-  path: '/stock/',
4
+  path: "/stock",
5 5
   component: Layout,
6
-  redirect: 'noredirect',
7
-  name: 'stockManage',
6
+  redirect: "noredirect",
7
+  name: "stockManage",
8 8
   alwaysShow: true,
9 9
   meta: {
10
-    title: 'stockManage',
11
-    icon: 'stock'
10
+    title: "stockManage",
11
+    icon: "stock",
12
+    isChild: true
12 13
   },
13 14
   children: [
14 15
     {
15
-      path: '/stock/in',
16
-      component: () => import('@/xt_pages/stock/stockInOrder'),
17
-      name: 'stockInOrder',
18
-      meta: { title: 'stockInOrder', noCache: true }
19
-    }, {
20
-      path: '/stock/return',
21
-      component: () => import('@/xt_pages/stock/salesReturnOrder'),
22
-      name: 'salesReturnOrder',
23
-      meta: { title: 'salesReturnOrder', noCache: true }
24
-    },
25
-    {
26
-      path: '/stock/out',
27
-      component: () => import('@/xt_pages/stock/stockOutOrder'),
28
-      name: 'stockOutOrder',
29
-      meta: { title: 'stockOutOrder', noCache: true }
30
-    }, {
31
-      path: '/stock/cancel',
32
-      component: () => import('@/xt_pages/stock/cancelStockOrder'),
33
-      name: 'cancelStockOrder',
34
-      meta: { title: 'cancelStockOrder', noCache: true }
35
-    }, {
36
-      path: '/stock/in/other',
37
-      component: () => import('@/xt_pages/stock/otherStockInOrder'),
38
-      name: 'otherStockInOrder',
39
-      meta: { title: 'otherStockInOrder', noCache: true }
40
-    }, {
41
-      path: '/stock/return/other',
42
-      component: () => import('@/xt_pages/stock/otherSalesReturnOrder'),
43
-      name: 'otherSalesReturnOrder',
44
-      meta: { title: 'otherSalesReturnOrder', noCache: true }
45
-    }, {
46
-      path: '/stock/out/other',
47
-      component: () => import('@/xt_pages/stock/otherStockOutOrder'),
48
-      name: 'otherStockOutOrder',
49
-      meta: { title: 'otherStockOutOrder', noCache: true }
50
-    }, {
51
-      path: '/stock/cancel/other',
52
-      component: () => import('@/xt_pages/stock/otherCancelStockOrder'),
53
-      name: 'otherCancelStockOrder',
54
-      meta: { title: 'otherCancelStockOrder', noCache: true }
55
-    }, {
56
-      path: '/stock/query',
57
-      component: () => import('@/xt_pages/stock/stockQuery'),
58
-      name: 'stockQuery',
59
-      meta: { title: 'stockQuery', noCache: true  }
60
-    }, {
61
-      path: '/stock/detail',
62
-      component: () => import('@/xt_pages/stock/stockDetailIndex'),
63
-      name: 'stockDetail',
64
-      meta: { title: 'stockDetail', noCache: true  }
65
-    }, {
66
-      path: '/stock/in/add',
67
-      component: () => import('@/xt_pages/stock/stockInOrderAdd'),
68
-      name: 'stockInOrderAdd',
69
-      hidden: true,
70
-      is_menu: false,
71
-      meta: { title: 'stockInOrderAdd', noCache: true }
72
-    }, {
73
-      path: '/stock/in/detail',
74
-      component: () => import('@/xt_pages/stock/stockInDetail'),
75
-      name: 'stockInDetail',
76
-      hidden: true,
77
-      is_menu: false,
78
-      meta: { title: 'stockInDetail', noCache: true  }
79
-    }, {
80
-      path: '/stock/return/detail',
81
-      component: () => import('@/xt_pages/stock/salesReturnDetail'),
82
-      name: 'salesReturnDetail',
83
-      hidden: true,
84
-      is_menu: false,
85
-      meta: { title: 'salesReturnDetail', noCache: true  }
86
-    }, {
87
-      path: '/stock/return/add',
88
-      component: () => import('@/xt_pages/stock/salesReturnOrderAdd'),
89
-      name: 'salesReturnOrderAdd',
90
-      hidden: true,
91
-      is_menu: false,
92
-      meta: { title: 'salesReturnOrderAdd', noCache: true }
93
-    }, {
94
-      path: '/stock/out/add',
95
-      component: () => import('@/xt_pages/stock/stockOutOrderAdd'),
96
-      name: 'stockOutOrderAdd',
97
-      hidden: true,
98
-      is_menu: false,
99
-      meta: { title: 'stockOutOrderAdd', noCache: true }
100
-    }, {
101
-      path: '/stock/out/detail',
102
-      component: () => import('@/xt_pages/stock/stockOutDetail'),
103
-      name: 'stockOutDetail',
104
-      hidden: true,
105
-      is_menu: false,
106
-      meta: { title: 'stockOutDetail', noCache: true }
107
-    }, {
108
-      path: '/stock/cancel/add',
109
-      component: () => import('@/xt_pages/stock/cancelStockOrderAdd'),
110
-      name: 'cancelStockOrderAdd',
111
-      hidden: true,
112
-      is_menu: false,
113
-      meta: { title: 'cancelStockOrderAdd', noCache: true }
114
-    }, {
115
-      path: '/stock/cancel/detail',
116
-      component: () => import('@/xt_pages/stock/cancelStockDetail'),
117
-      name: 'cancelStockDetail',
118
-      hidden: true,
119
-      is_menu: false,
120
-      meta: { title: 'cancelStockDetail', noCache: true }
121
-    }, {
122
-      path: '/stock/config',
123
-      component: () => import('@/xt_pages/stock/index'),
124
-      name: 'config',
125
-      meta: { title: 'config', noCache: true  }
126
-    }, {
127
-      path: '/stock/print',
128
-      component: () => import('@/xt_pages/stock/detail/print'),
129
-      hidden: true,
130
-      is_menu: false,
131
-      name: 'stock_print',
16
+      path: "/warehouseReceipt/",
17
+      component: Layout,
18
+      redirect: "/stock/in",
19
+      name: "warehouseReceipt",
20
+      parentNum: 1,
132 21
       meta: {
133
-        title: '库存打印',
22
+        isChild: true,
23
+        title: "warehouseReceipt"
24
+      }
25
+    },
26
+    {
27
+      path: "/warehouseReceiptOther/",
28
+      component: Layout,
29
+      redirect: "/stock/in/other",
30
+      name: "warehouseReceiptOther",
31
+      parentNum: 2,
32
+      meta: {
33
+        isChild: true,
34
+        title: "warehouseReceiptOther"
35
+      }
36
+    },
37
+    {
38
+      path: "/stock/in",
39
+      component: () => import("@/xt_pages/stock/stockInOrder"),
40
+      name: "stockInOrder",
41
+      hidden: true,
42
+      is_menu: false,
43
+      num: 1,
44
+      meta: { title: "stockInOrder", noCache: true }
45
+    },
46
+    {
47
+      path: "/stock/return",
48
+      component: () => import("@/xt_pages/stock/salesReturnOrder"),
49
+      name: "salesReturnOrder",
50
+      hidden: true,
51
+      is_menu: false,
52
+      num: 1,
53
+      meta: { title: "salesReturnOrder", noCache: true }
54
+    },
55
+    {
56
+      path: "/stock/out",
57
+      component: () => import("@/xt_pages/stock/stockOutOrder"),
58
+      name: "stockOutOrder",
59
+      hidden: true,
60
+      is_menu: false,
61
+      num: 1,
62
+      meta: { title: "stockOutOrder", noCache: true }
63
+    },
64
+    {
65
+      path: "/stock/cancel",
66
+      component: () => import("@/xt_pages/stock/cancelStockOrder"),
67
+      name: "cancelStockOrder",
68
+      hidden: true,
69
+      is_menu: false,
70
+      num: 1,
71
+      meta: { title: "cancelStockOrder", noCache: true }
72
+    },
73
+    {
74
+      path: "/stock/in/other",
75
+      component: () => import("@/xt_pages/stock/otherStockInOrder"),
76
+      name: "otherStockInOrder",
77
+      hidden: true,
78
+      is_menu: false,
79
+      num: 2,
80
+      meta: { title: "otherStockInOrder", noCache: true }
81
+    },
82
+    {
83
+      path: "/stock/return/other",
84
+      component: () => import("@/xt_pages/stock/otherSalesReturnOrder"),
85
+      name: "otherSalesReturnOrder",
86
+      hidden: true,
87
+      is_menu: false,
88
+      num: 2,
89
+      meta: { title: "otherSalesReturnOrder", noCache: true }
90
+    },
91
+    {
92
+      path: "/stock/out/other",
93
+      component: () => import("@/xt_pages/stock/otherStockOutOrder"),
94
+      name: "otherStockOutOrder",
95
+      hidden: true,
96
+      is_menu: false,
97
+      num: 2,
98
+      meta: { title: "otherStockOutOrder", noCache: true }
99
+    },
100
+    {
101
+      path: "/stock/cancel/other",
102
+      component: () => import("@/xt_pages/stock/otherCancelStockOrder"),
103
+      name: "otherCancelStockOrder",
104
+      hidden: true,
105
+      is_menu: false,
106
+      num: 2,
107
+      meta: { title: "otherCancelStockOrder", noCache: true }
108
+    },
109
+    // {
110
+    //   path: "/stock/",
111
+    //   component: Layout,
112
+    //   redirect: "noredirect",
113
+    //   name: "warehouseReceipt",
114
+    //   meta: {
115
+    //     isChild: true,
116
+    //     title: "warehouseReceipt"
117
+    //   },
118
+    //   children: [
119
+
120
+    //   ]
121
+    // },
122
+
123
+    // {
124
+    //   path: "stock/",
125
+    //   component: Layout,
126
+    //   redirect: "noredirect",
127
+    //   name: "warehouseReceiptOther",
128
+    //   meta: {
129
+    //     isChild: true,
130
+    //     title: "warehouseReceiptOther"
131
+    //   },
132
+    //   children: [
133
+    //     {
134
+    //       path: "/stock/in/other",
135
+    //       component: () => import("@/xt_pages/stock/otherStockInOrder"),
136
+    //       name: "otherStockInOrder",
137
+    //       meta: { title: "otherStockInOrder", noCache: true }
138
+    //     },
139
+    //     {
140
+    //       path: "/stock/return/other",
141
+    //       component: () => import("@/xt_pages/stock/otherSalesReturnOrder"),
142
+    //       name: "otherSalesReturnOrder",
143
+    //       meta: { title: "otherSalesReturnOrder", noCache: true }
144
+    //     },
145
+    //     {
146
+    //       path: "/stock/out/other",
147
+    //       component: () => import("@/xt_pages/stock/otherStockOutOrder"),
148
+    //       name: "otherStockOutOrder",
149
+    //       meta: { title: "otherStockOutOrder", noCache: true }
150
+    //     },
151
+    //     {
152
+    //       path: "/stock/cancel/other",
153
+    //       component: () => import("@/xt_pages/stock/otherCancelStockOrder"),
154
+    //       name: "otherCancelStockOrder",
155
+    //       meta: { title: "otherCancelStockOrder", noCache: true }
156
+    //     }
157
+    //   ]
158
+    // },
159
+    {
160
+      path: "/stock/query",
161
+      component: () => import("@/xt_pages/stock/stockQuery"),
162
+      name: "stockQuery",
163
+      meta: { title: "stockQuery", noCache: true }
164
+    },
165
+    {
166
+      path: "/stock/detail",
167
+      component: () => import("@/xt_pages/stock/stockDetailIndex"),
168
+      name: "stockDetail",
169
+      meta: { title: "stockDetail", noCache: true }
170
+    },
171
+    {
172
+      path: "/stock/in/add",
173
+      component: () => import("@/xt_pages/stock/stockInOrderAdd"),
174
+      name: "stockInOrderAdd",
175
+      hidden: true,
176
+      is_menu: false,
177
+      meta: { title: "stockInOrderAdd", noCache: true }
178
+    },
179
+    {
180
+      path: "/stock/in/detail",
181
+      component: () => import("@/xt_pages/stock/stockInDetail"),
182
+      name: "stockInDetail",
183
+      hidden: true,
184
+      is_menu: false,
185
+      meta: { title: "stockInDetail", noCache: true }
186
+    },
187
+    {
188
+      path: "/stock/return/detail",
189
+      component: () => import("@/xt_pages/stock/salesReturnDetail"),
190
+      name: "salesReturnDetail",
191
+      hidden: true,
192
+      is_menu: false,
193
+      meta: { title: "salesReturnDetail", noCache: true }
194
+    },
195
+    {
196
+      path: "/stock/return/add",
197
+      component: () => import("@/xt_pages/stock/salesReturnOrderAdd"),
198
+      name: "salesReturnOrderAdd",
199
+      hidden: true,
200
+      is_menu: false,
201
+      meta: { title: "salesReturnOrderAdd", noCache: true }
202
+    },
203
+    {
204
+      path: "/stock/out/add",
205
+      component: () => import("@/xt_pages/stock/stockOutOrderAdd"),
206
+      name: "stockOutOrderAdd",
207
+      hidden: true,
208
+      is_menu: false,
209
+      meta: { title: "stockOutOrderAdd", noCache: true }
210
+    },
211
+    {
212
+      path: "/stock/out/detail",
213
+      component: () => import("@/xt_pages/stock/stockOutDetail"),
214
+      name: "stockOutDetail",
215
+      hidden: true,
216
+      is_menu: false,
217
+      meta: { title: "stockOutDetail", noCache: true }
218
+    },
219
+    {
220
+      path: "/stock/cancel/add",
221
+      component: () => import("@/xt_pages/stock/cancelStockOrderAdd"),
222
+      name: "cancelStockOrderAdd",
223
+      hidden: true,
224
+      is_menu: false,
225
+      meta: { title: "cancelStockOrderAdd", noCache: true }
226
+    },
227
+    {
228
+      path: "/stock/cancel/detail",
229
+      component: () => import("@/xt_pages/stock/cancelStockDetail"),
230
+      name: "cancelStockDetail",
231
+      hidden: true,
232
+      is_menu: false,
233
+      meta: { title: "cancelStockDetail", noCache: true }
234
+    },
235
+    {
236
+      path: "/stock/config",
237
+      component: () => import("@/xt_pages/stock/index"),
238
+      name: "config",
239
+      meta: { title: "config", noCache: true }
240
+    },
241
+    {
242
+      path: "/stock/print",
243
+      component: () => import("@/xt_pages/stock/detail/print"),
244
+      hidden: true,
245
+      is_menu: false,
246
+      name: "stock_print",
247
+      meta: {
248
+        title: "库存打印",
134 249
         noCache: true
135 250
       }
136
-    },{
137
-      path: '/stock/user/detail',
138
-      component: () => import('@/xt_pages/stock/stockUserDetail'),
139
-      name: 'user_detail',
251
+    },
252
+    {
253
+      path: "/stock/user/detail",
254
+      component: () => import("@/xt_pages/stock/stockUserDetail"),
255
+      name: "user_detail",
140 256
       hidden: true,
141 257
       is_menu: false,
142
-      meta: { title: 'user_detail', noCache: true  }
258
+      meta: { title: "user_detail", noCache: true }
143 259
     }
144 260
   ]
145
-}
261
+};

+ 8 - 8
src/router/modules/systems.js View File

@@ -59,14 +59,14 @@ export default {
59 59
     hidden: true,
60 60
     is_menu: false
61 61
   },
62
-  {
63
-    path: '/role/admin/specialpermission',
64
-    component: () => import('@/xt_pages/role/special_permission'),
65
-    name: 'special_permission_manage',
66
-    meta: {
67
-      title: 'special_permission_manage'
68
-    }
69
-  },
62
+  // {
63
+  //   path: '/role/admin/specialpermission',
64
+  //   component: () => import('@/xt_pages/role/special_permission'),
65
+  //   name: 'special_permission_manage',
66
+  //   meta: {
67
+  //     title: 'special_permission_manage'
68
+  //   }
69
+  // },
70 70
   {
71 71
     path: '/data/dictionary',
72 72
     component: () => import('@/xt_pages/data/index'),

+ 45 - 44
src/styles/sidebar.scss View File

@@ -2,7 +2,7 @@
2 2
   // 主体区域
3 3
   .main-container {
4 4
     min-height: 100%;
5
-    transition: margin-left .28s;
5
+    transition: margin-left 0.28s;
6 6
     margin-left: 150px;
7 7
     position: relative;
8 8
   }
@@ -13,17 +13,18 @@
13 13
     height: 100%;
14 14
     position: fixed;
15 15
     font-size: 0px;
16
-    top: 60px;
16
+    // top: 60px;
17 17
     bottom: 0;
18 18
     left: 0;
19 19
     z-index: 1001;
20 20
     overflow: hidden;
21 21
     //reset element-ui css
22 22
     .horizontal-collapse-transition {
23
-      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
23
+      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
24
+        0s padding-right ease-in-out;
24 25
     }
25 26
     .scrollbar-wrapper {
26
-      overflow-x: hidden!important;
27
+      overflow-x: hidden !important;
27 28
       .el-scrollbar__view {
28 29
         height: 100%;
29 30
         .hamburger-container {
@@ -51,45 +52,45 @@
51 52
       width: 100% !important;
52 53
     }
53 54
   }
54
-  .hideSidebar {
55
-    .sidebar-container {
56
-      width: 36px !important;
57
-    }
58
-    .main-container {
59
-      margin-left: 36px;
60
-    }
61
-    .submenu-title-noDropdown {
62
-      padding-left: 10px !important;
63
-      position: relative;
64
-      .el-tooltip {
65
-        padding: 0 10px !important;
66
-      }
67
-    }
68
-    .el-submenu {
69
-      overflow: hidden;
70
-      &>.el-submenu__title {
71
-        padding-left: 10px !important;
72
-        
73
-        .el-submenu__icon-arrow {
74
-          display: none;
75
-        }
76
-      }
77
-    }
78
-    .el-menu--collapse {
79
-      .el-submenu {
80
-        &>.el-submenu__title {
81
-          &>span {
82
-            height: 0;
83
-            width: 0;
84
-            overflow: hidden;
85
-            visibility: hidden;
86
-            display: inline-block;
87
-          }
88
-        }
89
-      }
90
-    }
91
-  }
92
-  .sidebar-container .nest-menu .el-submenu>.el-submenu__title,
55
+  // .hideSidebar {
56
+  //   .sidebar-container {
57
+  //     width: 36px !important;
58
+  //   }
59
+  //   // .main-container {
60
+  //   //   margin-left: 36px;
61
+  //   // }
62
+  //   .submenu-title-noDropdown {
63
+  //     padding-left: 10px !important;
64
+  //     position: relative;
65
+  //     .el-tooltip {
66
+  //       padding: 0 10px !important;
67
+  //     }
68
+  //   }
69
+  //   .el-submenu {
70
+  //     overflow: hidden;
71
+  //     & > .el-submenu__title {
72
+  //       padding-left: 10px !important;
73
+
74
+  //       .el-submenu__icon-arrow {
75
+  //         display: none;
76
+  //       }
77
+  //     }
78
+  //   }
79
+  //   .el-menu--collapse {
80
+  //     .el-submenu {
81
+  //       & > .el-submenu__title {
82
+  //         & > span {
83
+  //           height: 0;
84
+  //           width: 0;
85
+  //           overflow: hidden;
86
+  //           visibility: hidden;
87
+  //           display: inline-block;
88
+  //         }
89
+  //       }
90
+  //     }
91
+  //   }
92
+  // }
93
+  .sidebar-container .nest-menu .el-submenu > .el-submenu__title,
93 94
   .sidebar-container .el-submenu .el-menu-item {
94 95
     // min-width: 180px !important;
95 96
     background-color: $subMenuBg !important;
@@ -107,7 +108,7 @@
107 108
       margin-left: 0px;
108 109
     }
109 110
     .sidebar-container {
110
-      transition: transform .28s;
111
+      transition: transform 0.28s;
111 112
       width: 180px !important;
112 113
     }
113 114
     &.hideSidebar {

+ 61 - 36
src/views/layout/Layout.vue View File

@@ -1,24 +1,25 @@
1 1
 <template>
2 2
   <div class="app-wrapper" :class="classObj">
3
-    <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"></div>
4
-      <navbar></navbar>
3
+    <div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside"></div>
4
+    <navbar></navbar>
5 5
 
6 6
     <div class="Header-container">
7
-    <sidebar class="sidebar-container"></sidebar>
8
-    <div class="main-container">
9
-      <tags-view></tags-view>
10
-      <app-main></app-main>
7
+      <sidebar class="sidebar-container" @callBackIndex="handleIndex"></sidebar>
8
+      <!-- <sidebar class="newSide" @callBackIndex="handleIndex"></sidebar> -->
9
+      <div class="main-container">
10
+        <tags-view :index="index" :num="num"></tags-view>
11
+        <app-main></app-main>
12
+      </div>
11 13
     </div>
12
-   </div>
13 14
   </div>
14 15
 </template>
15 16
 
16 17
 <script>
17
-import { Navbar, Sidebar, AppMain, TagsView } from './components'
18
-import ResizeMixin from './mixin/ResizeHandler'
18
+import { Navbar, Sidebar, AppMain, TagsView } from "./components";
19
+import ResizeMixin from "./mixin/ResizeHandler";
19 20
 
20 21
 export default {
21
-  name: 'layout',
22
+  name: "layout",
22 23
   components: {
23 24
     Navbar,
24 25
     Sidebar,
@@ -28,47 +29,71 @@ export default {
28 29
   mixins: [ResizeMixin],
29 30
   computed: {
30 31
     sidebar() {
31
-      return this.$store.state.app.sidebar
32
+      return this.$store.state.app.sidebar;
32 33
     },
33 34
     device() {
34
-      return this.$store.state.app.device
35
+      return this.$store.state.app.device;
35 36
     },
36 37
     classObj() {
37 38
       return {
38 39
         hideSidebar: !this.sidebar.opened,
39 40
         openSidebar: this.sidebar.opened,
40 41
         withoutAnimation: this.sidebar.withoutAnimation,
41
-        mobile: this.device === 'mobile'
42
-      }
42
+        mobile: this.device === "mobile"
43
+      };
43 44
     }
44 45
   },
46
+  data() {
47
+    return {
48
+      index: 0,
49
+      num: 1
50
+    };
51
+  },
45 52
   methods: {
46 53
     handleClickOutside() {
47
-      this.$store.dispatch('closeSideBar', { withoutAnimation: false })
54
+      this.$store.dispatch("closeSideBar", { withoutAnimation: false });
55
+    },
56
+    handleIndex(data, num) {
57
+      // console.log({ prop: data });
58
+      this.index = data;
59
+      this.num = num;
48 60
     }
49 61
   }
50
-}
62
+};
51 63
 </script>
52 64
 
53 65
 <style rel="stylesheet/scss" lang="scss" scoped>
54
-  @import "src/styles/mixin.scss";
55
-  .app-wrapper {
56
-    @include clearfix;
57
-    // position: relative;
58
-    height: 100%;
59
-    width: 100%;
60
-    // &.mobile.openSidebar{
61
-    //   position: fixed;
62
-    //   top: 0;
63
-    // }
64
-  }
65
-  .drawer-bg {
66
-    background: #000;
67
-    opacity: 0.3;
68
-    width: 100%;
69
-    top: 0;
70
-    height: 100%;
71
-    position: absolute;
72
-    z-index: 999;
73
-  }
66
+@import "src/styles/mixin.scss";
67
+.app-wrapper {
68
+  @include clearfix;
69
+  // position: relative;
70
+  height: 100%;
71
+  width: 100%;
72
+  // &.mobile.openSidebar{
73
+  //   position: fixed;
74
+  //   top: 0;
75
+  // }
76
+}
77
+.drawer-bg {
78
+  background: #000;
79
+  opacity: 0.3;
80
+  width: 100%;
81
+  top: 0;
82
+  height: 100%;
83
+  position: absolute;
84
+  z-index: 999;
85
+}
86
+.newSide {
87
+  width: 150px !important;
88
+  height: 100%;
89
+  position: fixed;
90
+  top: 60px;
91
+  bottom: 0;
92
+  left: 0;
93
+  z-index: 1001;
94
+  overflow: hidden;
95
+}
96
+</style>
97
+<style lang="scss">
98
+
74 99
 </style>

+ 6 - 7
src/views/layout/components/AppMain.vue View File

@@ -10,16 +10,16 @@
10 10
 
11 11
 <script>
12 12
 export default {
13
-  name: 'AppMain',
13
+  name: "AppMain",
14 14
   computed: {
15 15
     cachedViews() {
16
-      return this.$store.state.tagsView.cachedViews
16
+      return this.$store.state.tagsView.cachedViews;
17 17
     },
18 18
     key() {
19
-      return this.$route.fullPath
19
+      return this.$route.fullPath;
20 20
     }
21 21
   }
22
-}
22
+};
23 23
 </script>
24 24
 
25 25
 <style scoped>
@@ -28,9 +28,8 @@ export default {
28 28
   min-height: calc(100vh - 120px);
29 29
   position: relative;
30 30
   overflow: hidden;
31
-  margin-top: 50px;
32
-   background: #f6f8f9;
33
-  
31
+  margin-top: 40px;
32
+  background: #f6f8f9;
34 33
 }
35 34
 </style>
36 35
 

+ 370 - 170
src/views/layout/components/Navbar.vue View File

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="top-nav">
3
-    <div class="nav-logo">
3
+    <!-- <div class="nav-logo">
4 4
       <img :src="require(`../../../assets/logo/logo.png`)" alt="">
5 5
     </div>
6 6
     <el-menu class="navbar" mode="horizontal">
@@ -47,109 +47,223 @@
47 47
           <el-dropdown-menu slot="dropdown">
48 48
             <el-dropdown-item command="modifyUserInfoAction">
49 49
               修改个人信息
50
-              <!-- <span @click="modifyUserInfoAction">修改个人信息</span> -->
51 50
             </el-dropdown-item>
52 51
             <el-dropdown-item command="modifyOrgInfoAction">
53 52
               机构信息
54 53
             </el-dropdown-item>
55
-            <!-- <el-dropdown-item divided>
56
-              <span @click="myServe">我的服务</span>
57
-            </el-dropdown-item> -->
58 54
             <el-dropdown-item divided command="logout">
59 55
               {{$t('navbar.logOut')}}
60
-              <!-- <span @click="logout" style="display:block;">{{$t('navbar.logOut')}}</span> -->
56
+
61 57
             </el-dropdown-item>
62 58
           </el-dropdown-menu>
63 59
         </el-dropdown>
64 60
 
65
-        <!-- <screenfull class="screenfull right-menu-item"></screenfull> -->
66 61
         <modify-user-info-dialog ref="modify_user_info_dialog"></modify-user-info-dialog>
67 62
         <modify-org-info-dialog ref="modify_org_info_dialog"></modify-org-info-dialog>
68 63
 
69 64
       </div>
70
-    </el-menu>
65
+    </el-menu>-->
66
+    <div class="dropdownBox">
67
+      <el-dropdown trigger="click" @command="handleOrgCommand">
68
+        <span class="el-dropdown-link">
69
+          {{ org_name }}
70
+          <i class="el-icon-arrow-down el-icon--right"></i>
71
+        </span>
72
+        <el-dropdown-menu slot="dropdown">
73
+          <el-dropdown-item   icon="el-icon-plus" v-for="(item,index) in orgs" :key="index"  :command="item.id">{{item.org_name}}</el-dropdown-item>
74
+        </el-dropdown-menu>
75
+      </el-dropdown>
76
+    </div>
77
+    <div class="navRight">
78
+      <!-- <el-input placeholder="搜索患者透析号/姓名/首拼" prefix-icon="el-icon-search" v-model="input2"></el-input>
79
+      <div style="color: #b2b2b3;">通知中心</div> -->
80
+      <div class="right-menu">
81
+        <el-dropdown
82
+          class="avatar-container right-menu-item"
83
+          trigger="click"
84
+          @command="handleCommand"
85
+        >
86
+          <div class="avatar-wrapper">
87
+            <img class="user-avatar" :src="avater" />
88
+            <span class="user-title">{{
89
+              this.$store.getters.xt_user.user.user_name
90
+            }}</span>
91
+            <i class="el-icon-caret-bottom"></i>
92
+          </div>
93
+          <el-dropdown-menu slot="dropdown">
94
+            <el-dropdown-item command="modifyUserInfoAction"
95
+              >修改个人信息</el-dropdown-item
96
+            >
97
+            <el-dropdown-item command="modifyOrgInfoAction"
98
+              >机构信息</el-dropdown-item
99
+            >
100
+            <el-dropdown-item divided command="logout">{{
101
+              $t("navbar.logOut")
102
+            }}</el-dropdown-item>
103
+          </el-dropdown-menu>
104
+        </el-dropdown>
105
+
106
+        <modify-user-info-dialog
107
+          ref="modify_user_info_dialog"
108
+        ></modify-user-info-dialog>
109
+        <modify-org-info-dialog
110
+          ref="modify_org_info_dialog"
111
+        ></modify-org-info-dialog>
112
+      </div>
113
+      <div>
114
+        <i class="el-icon-question"></i>
115
+        <span>帮助中心</span>
116
+      </div>
117
+    </div>
71 118
   </div>
72 119
 </template>
73 120
 
74 121
 <script>
75
-  import { mapGetters } from 'vuex'
76
-  // import Breadcrumb from "@/components/Breadcrumb";
77
-  // import Hamburger from "@/components/Hamburger";
78
-  import Screenfull from '@/components/Screenfull'
79
-  import ModifyUserInfoDialog from '@/xt_pages/home/modify_user_info_dialog'
80
-  import ModifyOrgInfoDialog from '@/xt_pages/home/modifyOrgInfoDialog'
81
-
82
-  export default {
83
-    data() {
84
-      return {
85
-        // scrm_role_exist: $store.getters.xt_user.scrm_role_exist
122
+import { mapGetters } from "vuex";
123
+// import Breadcrumb from "@/components/Breadcrumb";
124
+// import Hamburger from "@/components/Hamburger";
125
+import Screenfull from "@/components/Screenfull";
126
+import ModifyUserInfoDialog from "@/xt_pages/home/modify_user_info_dialog";
127
+import ModifyOrgInfoDialog from "@/xt_pages/home/modifyOrgInfoDialog";
128
+import { getFiledConfigList, setFiledConfigList } from '@/utils/data_config' // getConfigList from sessionStorage
129
+import {
130
+  getAdminUserInfoCache,
131
+  cacheAdminUserInfo,
132
+  removeAdminUserInfoCache
133
+} from '@/utils/admin_info_cache'
134
+import {
135
+  getOrgs,changeOrg
136
+} from '@/api/config'
137
+export default {
138
+  data() {
139
+    return {
140
+      orgs:[],
141
+      org_id:this.$store.getters.xt_user.org.id,
142
+      org_name:this.$store.getters.xt_user.org.org_name,
143
+
144
+      // scrm_role_exist: $store.getters.xt_user.scrm_role_exist
145
+    };
146
+  },
147
+  components: {
148
+    Screenfull,
149
+    ModifyUserInfoDialog,
150
+    ModifyOrgInfoDialog
151
+  },
152
+  computed: {
153
+    ...mapGetters(["sidebar"]),
154
+    avater: function() {
155
+      var avatar = this.$store.getters.xt_user.user.avatar;
156
+      return avatar.length > 0
157
+        ? avatar
158
+        : require("../../../assets/home/userData.png");
159
+    }
160
+  },
161
+  methods: {
162
+    handleOrgCommand(org_id){
163
+      let params = {
164
+        org_id: org_id
86 165
       }
166
+      changeOrg(params).then(response => {
167
+        if (response.data.state === 1) {
168
+          window.location.reload()
169
+
170
+          this.$message.success('切换成功')
171
+          let data = response.data.data
172
+          this.org_id = data.org.id
173
+          this.org_name = data.org.org_name
174
+
175
+          this.commit('SET_CURRENT_INFO', {
176
+            user: data.user,
177
+            cur_org_id: data.current_org_id,
178
+            cur_app_id: data.current_app_id,
179
+            org: data.org,
180
+            subscibe: data.subscibe,
181
+            template_info:data.template_info,
182
+          })
183
+
184
+          this.commit('SET_URLFORS', {
185
+            urlfors: data.urlfors
186
+          })
187
+
188
+          this.commit('SET_FILEDS', {
189
+            fileds: data.fileds
190
+          })
191
+          setFiledConfigList(JSON.stringify(data.fileds))
192
+          cacheAdminUserInfo(JSON.stringify(data))
193
+
194
+
195
+        }else{
196
+          this.$message.success(response.data.msg)
197
+        }
198
+      }).catch(e => {
199
+        // this.$message.success("网络异常")
200
+      });
87 201
     },
88
-    components: {
89
-      // Breadcrumb,
90
-      // Hamburger,
91
-      Screenfull,
92
-      ModifyUserInfoDialog,
93
-      ModifyOrgInfoDialog,
94
-    },
95
-    computed: {
96
-      ...mapGetters(['sidebar']),
97
-      avater: function() {
98
-        var avatar = this.$store.getters.xt_user.user.avatar
99
-        return avatar.length > 0
100
-          ? avatar
101
-          : require('../../../assets/home/userData.png')
202
+
203
+    handleCommand(command) {
204
+      switch (command) {
205
+        case "modifyUserInfoAction":
206
+          this.modifyUserInfoAction();
207
+          break;
208
+        case "modifyOrgInfoAction":
209
+          this.modifyOrgInfoAction();
210
+          break;
211
+        case "logout":
212
+          this.logout();
213
+          break;
102 214
       }
103 215
     },
104
-    methods: {
105
-      // toggleSideBar() {
106
-      //   this.$store.dispatch("toggleSideBar");
107
-      // },
108
-      handleCommand(command){
109
-        switch (command) {
110
-          case 'modifyUserInfoAction':
111
-            this.modifyUserInfoAction();
112
-            break;
113
-          case 'modifyOrgInfoAction':
114
-            this.modifyOrgInfoAction();
115
-            break;
116
-          case 'logout':
117
-            this.logout();
118
-            break;
119
-        }
120
-      },
121
-      logout() {
122
-        this.$store.dispatch('FrontendLogout')
123
-        window.location.href = process.env.BASE_API + '/logout'
124
-      },
125
-      modifyOrgInfoAction() {
126
-        // this.$refs.modify_org_info_dialog.show()
127
-        this.$router.push('/orginfo')
128
-        return false
129
-      },
130
-      modifyUserInfoAction() {
131
-        this.$refs.modify_user_info_dialog.show()
132
-      },
133
-      myServe() {
134
-        this.$router.push('/service')
135
-        return false
136
-      },
137
-      SCRMWebsit() {
138
-        return process.env.SRCM_HOST
139
-      },
140
-      MircoMallWebsit() {
141
-        return process.env.MIRCO_MALL_HOST
142
-      },
143
-      CDMWebsit() {
144
-        return process.env.CDM_HOST
145
-      },
146
-      APPManageWebsit() {
147
-        return process.env.SSO_HOST + '/org/admin/apps?org=' + this.$store.getters.xt_user.org_id
148
-      }
216
+    logout() {
217
+      this.$store.dispatch("FrontendLogout");
218
+      window.location.href = process.env.BASE_API + "/logout";
219
+    },
220
+    modifyOrgInfoAction() {
221
+      // this.$refs.modify_org_info_dialog.show()
222
+      this.$router.push("/orginfo");
223
+      return false;
224
+    },
225
+    modifyUserInfoAction() {
226
+      this.$refs.modify_user_info_dialog.show();
149 227
     },
150
-    created() {
228
+    myServe() {
229
+      this.$router.push("/service");
230
+      return false;
231
+    },
232
+    SCRMWebsit() {
233
+      return process.env.SRCM_HOST;
234
+    },
235
+    MircoMallWebsit() {
236
+      return process.env.MIRCO_MALL_HOST;
237
+    },
238
+    CDMWebsit() {
239
+      return process.env.CDM_HOST;
240
+    },
241
+    APPManageWebsit() {
242
+      return (
243
+        process.env.SSO_HOST +
244
+        "/org/admin/apps?org=" +
245
+        this.$store.getters.xt_user.org_id
246
+      );
151 247
     }
248
+  },
249
+  created() {
250
+    this.org_id = 12
251
+
252
+    getOrgs().then(response => {
253
+      if (response.data.state === 1) {
254
+          this.orgs = response.data.data.orgs;
255
+          for (let i =0; i < this.orgs.length; i++){
256
+            if (this.orgs[i].id == this.org_id){
257
+              this.org_name = this.orgs[i].org_name
258
+            }
259
+          }
260
+      }
261
+    });
262
+
263
+
264
+
152 265
   }
266
+};
153 267
 </script>
154 268
 
155 269
 <style rel="stylesheet/scss" lang="scss" scoped>
@@ -157,9 +271,85 @@
157 271
   background: #409eff;
158 272
   position: fixed;
159 273
   top: 0;
160
-  left: 0;
274
+  left: 150px;
161 275
   right: 0;
162 276
   z-index: 1000;
277
+  height: 50px;
278
+  display: flex;
279
+  align-items: center;
280
+  justify-content: space-between;
281
+  color:#fff;
282
+  .dropdownBox {
283
+    margin-left: 10px;
284
+  }
285
+  .navRight {
286
+    display: flex;
287
+    align-items: center;
288
+    justify-content: space-between;
289
+    min-width: 200px;
290
+    margin-right: 10px;
291
+    .right-menu {
292
+      float: right;
293
+      height: 100%;
294
+      z-index: 99999;
295
+      color: #fff;
296
+      & :focus {
297
+        outline: none;
298
+      }
299
+
300
+      .right-menu-item {
301
+        display: inline-block;
302
+        margin: 0 8px;
303
+
304
+        .iconfont {
305
+          font-size: 18px;
306
+        }
307
+      }
308
+      .screenfull {
309
+        height: 20px;
310
+      }
311
+
312
+      .international {
313
+        vertical-align: top;
314
+      }
315
+
316
+      .theme-switch {
317
+        vertical-align: 15px;
318
+      }
319
+
320
+      .avatar-container {
321
+        margin-right: 10px;
322
+
323
+        .avatar-wrapper {
324
+          cursor: pointer;
325
+          margin-top: 3px;
326
+          display: flex;
327
+          align-items: center;
328
+          justify-content: center;
329
+
330
+          .user-avatar {
331
+            width: 40px;
332
+            height: 40px;
333
+            border-radius: 50%;
334
+            object-fit: cover;
335
+            object-position: center;
336
+          }
337
+
338
+          .user-title {
339
+            margin: 0 8px;
340
+            font-size: 14px;
341
+            color: #fff;
342
+          }
343
+
344
+          .el-icon-caret-bottom {
345
+            font-size: 12px;
346
+            color: #fff;
347
+          }
348
+        }
349
+      }
350
+    }
351
+  }
352
+
163 353
   .nav-logo {
164 354
     width: 162px;
165 355
     display: flex;
@@ -171,11 +361,10 @@
171 361
     box-sizing: border-box;
172 362
     float: left;
173 363
 
174
-  img {
175
-    display: inline-block;
176
-    width: 100px;
177
-  }
178
-
364
+    img {
365
+      display: inline-block;
366
+      width: 100px;
367
+    }
179 368
   }
180 369
   .navbar {
181 370
     border-radius: 0px !important;
@@ -188,102 +377,96 @@
188 377
     background: #409eff;
189 378
     float: left;
190 379
 
191
-  .breadcrumb-container {
192
-    float: left;
193
-  }
380
+    .breadcrumb-container {
381
+      float: left;
382
+    }
194 383
 
195
-  .errLog-container {
196
-    display: inline-block;
197
-    vertical-align: top;
198
-  }
384
+    .errLog-container {
385
+      display: inline-block;
386
+      vertical-align: top;
387
+    }
199 388
 
200
-  .right-menu {
201
-    float: right;
202
-    height: 100%;
203
-    z-index: 99999;
389
+    .right-menu {
390
+      float: right;
391
+      height: 100%;
392
+      z-index: 99999;
204 393
 
205
-  &
206
-  :focus {
207
-    outline: none;
208
-  }
394
+      & :focus {
395
+        outline: none;
396
+      }
209 397
 
210
-  .right-menu-item {
211
-    display: inline-block;
212
-    margin: 0 8px;
398
+      .right-menu-item {
399
+        display: inline-block;
400
+        margin: 0 8px;
213 401
 
214
-  .iconfont {
215
-    font-size: 18px;
216
-  }
402
+        .iconfont {
403
+          font-size: 18px;
404
+        }
405
+      }
406
+      .screenfull {
407
+        height: 20px;
408
+      }
217 409
 
218
-  }
219
-  .screenfull {
220
-    height: 20px;
221
-  }
410
+      .international {
411
+        vertical-align: top;
412
+      }
222 413
 
223
-  .international {
224
-    vertical-align: top;
225
-  }
414
+      .theme-switch {
415
+        vertical-align: 15px;
416
+      }
226 417
 
227
-  .theme-switch {
228
-    vertical-align: 15px;
229
-  }
418
+      .avatar-container {
419
+        margin-right: 10px;
230 420
 
231
-  .avatar-container {
232
-    margin-right: 10px;
421
+        .avatar-wrapper {
422
+          cursor: pointer;
423
+          margin-top: 3px;
424
+          display: flex;
425
+          align-items: center;
426
+          justify-content: center;
233 427
 
234
-  .avatar-wrapper {
235
-    cursor: pointer;
236
-    margin-top: 3px;
237
-    display: flex;
238
-    align-items: center;
239
-    justify-content: center;
428
+          .user-avatar {
429
+            width: 40px;
430
+            height: 40px;
431
+            border-radius: 50%;
432
+            object-fit: cover;
433
+            object-position: center;
434
+          }
240 435
 
241
-  .user-avatar {
242
-    width: 40px;
243
-    height: 40px;
244
-    border-radius: 50%;
245
-    object-fit: cover;
246
-    object-position: center;
247
-  }
436
+          .user-title {
437
+            margin: 0 8px;
438
+            font-size: 14px;
439
+            color: #fff;
440
+          }
248 441
 
249
-  .user-title {
250
-    margin: 0 8px;
251
-    font-size: 14px;
252
-    color: #fff;
253
-  }
254
-
255
-  .el-icon-caret-bottom {
256
-    font-size: 12px;
257
-    color: #fff;
258
-  }
259
-
260
-  }
261
-  }
262
-  }
442
+          .el-icon-caret-bottom {
443
+            font-size: 12px;
444
+            color: #fff;
445
+          }
446
+        }
447
+      }
448
+    }
263 449
   }
264 450
   .system-nav {
451
+    .system-nav-menu {
452
+      float: left;
453
+      height: 60px;
454
+      line-height: 60px;
455
+      padding: 0 25px;
265 456
 
266
-  .system-nav-menu {
267
-    float: left;
268
-    height: 60px;
269
-    line-height: 60px;
270
-    padding: 0 25px;
271
-
272
-  a {
273
-    font-size: 15px;
274
-
275
-  .iconfont {
276
-    font-size: 18px;
277
-  }
278
-
279
-  }
280
-  }
281
-  .active {
282
-    background: #3090eb;
283
-    border-left: 1px #5fabf7 solid;
284
-    border-right: 1px #5fabf7 solid;
285
-  }
457
+      a {
458
+        font-size: 15px;
286 459
 
460
+        .iconfont {
461
+          font-size: 18px;
462
+        }
463
+      }
464
+    }
465
+    .active {
466
+      background: #3090eb;
467
+      border-left: 1px #5fabf7 solid;
468
+      border-right: 1px #5fabf7 solid;
469
+    }
287 470
   }
288 471
   .el-menu::after,
289 472
   .el-menu::before {
@@ -293,13 +476,30 @@
293 476
     top: 0;
294 477
     left: 0;
295 478
   }
479
+}
480
+.el-dropdown-menu {
481
+  z-index: 9999 !important;
482
+}
296 483
 
484
+.v-modal {
485
+  z-index: 9999 !important;
486
+}
487
+</style>
488
+
489
+<style lang="scss">
490
+.navRight {
491
+  .el-input {
492
+    width: 250px;
297 493
   }
298
-  .el-dropdown-menu {
299
-    z-index: 9999 !important;
494
+  .el-input__inner {
495
+    border-radius: 30px;
496
+    background: #f5f7fa;
300 497
   }
301
-
302
-  .v-modal {
303
-    z-index: 9999 !important;
498
+}
499
+.dropdownBox {
500
+    .el-dropdown-link{
501
+      font-size: 18px;
502
+      color:#fff;
503
+    }
304 504
   }
305 505
 </style>

+ 168 - 30
src/views/layout/components/Sidebar/SidebarItem.vue View File

@@ -1,40 +1,116 @@
1 1
 <template>
2
-  <div v-if="!item.hidden&&item.children" class="menu-wrapper">
3
-
4
-      <router-link v-if="hasOneShowingChild(item.children) && !onlyOneChild.children&&!item.alwaysShow" :to="resolvePath(onlyOneChild.path)">
5
-        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
6
-          <svg-icon v-if="onlyOneChild.meta&&onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
7
-          <span v-if="onlyOneChild.meta&&onlyOneChild.meta.title" slot="title">{{generateTitle(onlyOneChild.meta.title)}}</span>
2
+  <div v-if="!item.hidden && item.children" class="menu-wrapper">
3
+    <div
4
+      v-if="
5
+        hasOneShowingChild(item.children) &&
6
+          !onlyOneChild.children &&
7
+          !item.alwaysShow
8
+      "
9
+      @click="onClick(item)"
10
+    >
11
+      <router-link :to="resolvePath(onlyOneChild.path)">
12
+        <el-menu-item
13
+          :index="resolvePath(onlyOneChild.path)"
14
+          :class="{ 'submenu-title-noDropdown': !isNest }"
15
+        >
16
+          <svg-icon
17
+            v-if="onlyOneChild.meta && onlyOneChild.meta.icon"
18
+            :icon-class="onlyOneChild.meta.icon"
19
+          ></svg-icon>
20
+          <span
21
+            v-if="onlyOneChild.meta && onlyOneChild.meta.title"
22
+            slot="title"
23
+          >{{ generateTitle(onlyOneChild.meta.title) }}</span>
8 24
         </el-menu-item>
9 25
       </router-link>
26
+    </div>
10 27
 
11
-      <el-submenu v-else :index="item.name||item.path">
28
+    <div v-else>
29
+      <el-submenu v-if="item.meta.isChild" id="mySubmenu" :index="item.name || item.path">
12 30
         <template slot="title">
13
-          <svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
14
-          <span v-if="item.meta&&item.meta.title" slot="title">{{generateTitle(item.meta.title)}}</span>
31
+          <svg-icon v-if="item.meta && item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
32
+          <span v-if="item.meta && item.meta.title" slot="title">
33
+            {{
34
+            generateTitle(item.meta.title)
35
+            }}
36
+          </span>
15 37
         </template>
16
-
17 38
         <template v-for="child in item.children" v-if="!child.hidden">
18
-          <sidebar-item :is-nest="true" class="nest-menu" v-if="child.children&&child.children.length>0" :item="child" :key="child.path" :base-path="resolvePath(child.path)"></sidebar-item>
39
+          <router-link
40
+            :to="resolvePath(child.path)"
41
+            v-if="child.meta.isChild != true"
42
+            :key="child.name"
43
+          >
44
+            <el-menu-item @click="onClick(item)" :index="resolvePath(child.path)">
45
+              <svg-icon v-if="child.meta && child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
46
+              <span v-if="child.meta && child.meta.title" slot="title">
47
+                {{
48
+                generateTitle(child.meta.title)
49
+                }}
50
+              </span>
51
+            </el-menu-item>
52
+          </router-link>
19 53
 
20
-          <router-link v-else :to="resolvePath(child.path)" :key="child.name">
21
-            <el-menu-item :index="resolvePath(child.path)">
22
-              <svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
23
-              <span v-if="child.meta&&child.meta.title" slot="title">{{generateTitle(child.meta.title)}}</span>
54
+          <router-link v-else :to="child.path" :key="child.name">
55
+            <el-menu-item @click="onClick(item,child.parentNum)" :index="resolvePath(child.path)">
56
+              <svg-icon v-if="child.meta && child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
57
+              <span v-if="child.meta && child.meta.title" slot="title">
58
+                {{
59
+                generateTitle(child.meta.title)
60
+                }}
61
+              </span>
24 62
             </el-menu-item>
25 63
           </router-link>
26 64
         </template>
27 65
       </el-submenu>
66
+      <div v-else @click="onClick(item)">
67
+        <router-link :to="resolvePath(item.children[0].path)">
68
+          <el-menu-item :index="item.name || item.path">
69
+            <template slot="title">
70
+              <svg-icon v-if="item.meta && item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
71
+              <span v-if="item.meta && item.meta.title" slot="title">
72
+                {{
73
+                generateTitle(item.meta.title)
74
+                }}
75
+              </span>
76
+            </template>
28 77
 
78
+            <!-- <template v-for="child in item.children" v-if="!child.hidden">
79
+        <sidebar-item
80
+          :is-nest="true"
81
+          class="nest-menu"
82
+          v-if="child.children && child.children.length > 0"
83
+          :item="child"
84
+          :key="child.path"
85
+          :base-path="resolvePath(child.path)"
86
+        ></sidebar-item>
87
+
88
+        <router-link v-else :to="resolvePath(child.path)" :key="child.name">
89
+          <el-menu-item :index="resolvePath(child.path)">
90
+            <svg-icon
91
+              v-if="child.meta && child.meta.icon"
92
+              :icon-class="child.meta.icon"
93
+            ></svg-icon>
94
+            <span v-if="child.meta && child.meta.title" slot="title">{{
95
+              generateTitle(child.meta.title)
96
+            }}</span>
97
+          </el-menu-item>
98
+        </router-link>
99
+            </template>-->
100
+          </el-menu-item>
101
+        </router-link>
102
+      </div>
103
+    </div>
29 104
   </div>
30 105
 </template>
31 106
 
32 107
 <script>
33
-import path from 'path'
34
-import { generateTitle } from '@/utils/i18n'
108
+import path from "path";
109
+import { generateTitle } from "@/utils/i18n";
110
+import { mapGetters } from "vuex";
35 111
 
36 112
 export default {
37
-  name: 'SidebarItem',
113
+  name: "SidebarItem",
38 114
   props: {
39 115
     // route object
40 116
     item: {
@@ -47,35 +123,97 @@ export default {
47 123
     },
48 124
     basePath: {
49 125
       type: String,
50
-      default: ''
126
+      default: ""
127
+    },
128
+    index: {
129
+      type: Number
51 130
     }
52 131
   },
132
+  computed: {
133
+    ...mapGetters(["permission_routers"])
134
+  },
53 135
   data() {
54 136
     return {
55 137
       onlyOneChild: null
56
-    }
138
+    };
57 139
   },
58 140
   methods: {
59 141
     hasOneShowingChild(children) {
60 142
       const showingChildren = children.filter(item => {
61 143
         if (item.hidden) {
62
-          return false
144
+          return false;
63 145
         } else {
64 146
           // temp set(will be used if only has one showing child )
65
-          this.onlyOneChild = item
66
-          return true
147
+          this.onlyOneChild = item;
148
+          return true;
67 149
         }
68
-      })
150
+      });
69 151
       if (showingChildren.length === 1) {
70
-        return true
152
+        return true;
71 153
       }
72
-      return false
154
+      return false;
73 155
     },
74 156
     resolvePath(...paths) {
75
-      return path.resolve(this.basePath, ...paths)
157
+      return path.resolve(this.basePath, ...paths);
76 158
     },
77
-    generateTitle
78
-  }
79
-}
159
+    generateTitle,
160
+    onClick(index, num) {
161
+      this.permission_routers.map((item, i) => {
162
+        if (this.isObjectValueEqual(item, index)) {
163
+          if (num) {
164
+            this.$emit("a", i, num);
165
+          } else {
166
+            this.$emit("a", i, 999);
167
+          }
168
+        }
169
+      });
170
+    },
171
+    isObjectValueEqual(a, b) {
172
+      var aProps = Object.getOwnPropertyNames(a);
173
+      var bProps = Object.getOwnPropertyNames(b);
174
+
175
+      if (aProps.length != bProps.length) {
176
+        return false;
177
+      }
178
+
179
+      for (var i = 0; i < aProps.length; i++) {
180
+        var propName = aProps[i];
181
+
182
+        if (a[propName] !== b[propName]) {
183
+          return false;
184
+        }
185
+      }
186
+
187
+      return true;
188
+    }
189
+  },
190
+  created() {}
191
+};
80 192
 </script>
81 193
 
194
+<style lang="scss">
195
+#mySubmenu {
196
+  .el-menu {
197
+    display: flex;
198
+    flex-wrap: wrap;
199
+    > a {
200
+      width: 50% !important;
201
+    }
202
+    .el-menu-item {
203
+      min-width: 0;
204
+      padding: 0 5px !important;
205
+      font-size: 12px;
206
+      background-color:#1F2D3D !important;
207
+    }
208
+  }
209
+}
210
+.el-menu-item{
211
+   background-color:#1F2D3D !important;
212
+}
213
+.el-menu{
214
+  background-color:#1F2D3D !important;
215
+}
216
+.el-submenu__title{
217
+  background-color:#1F2D3D !important;
218
+}
219
+</style>

+ 162 - 42
src/views/layout/components/Sidebar/index.vue View File

@@ -1,88 +1,208 @@
1 1
 <template>
2 2
   <el-scrollbar wrapClass="scrollbar-wrapper">
3
-    <div class="sideColumn">
4
-       <hamburger class="hamburger-container" :toggleClick="toggleSideBar" :isActive="sidebar.opened"></hamburger>      
3
+    <!-- <div class="sideColumn">
4
+      <hamburger
5
+        class="hamburger-container"
6
+        :toggleClick="toggleSideBar"
7
+        :isActive="sidebar.opened"
8
+      ></hamburger>
9
+    </div>-->
10
+    <!-- <el-menu
11
+      mode="vertical"
12
+      :unique-opened="uniqueOpened"
13
+      :show-timeout="200"
14
+      :default-active="$route.path"
15
+      :collapse="isCollapse"
16
+      background-color="#304156"
17
+      text-color="#bfcbd9"
18
+      active-text-color="#409EFF"
19
+    >-->
20
+    <div class="logo">
21
+      <img src="../../../../assets/logo/logo1.png" alt />
5 22
     </div>
6 23
     <el-menu
7 24
       mode="vertical"
8 25
       :unique-opened="uniqueOpened"
9 26
       :show-timeout="200"
10 27
       :default-active="$route.path"
11
-      :collapse="isCollapse"
12 28
       background-color="#304156"
13 29
       text-color="#bfcbd9"
14 30
       active-text-color="#409EFF"
15 31
     >
16
-      <sidebar-item v-for="route in permission_routers" :key="route.name" :item="route" :base-path="route.path"></sidebar-item>
32
+      <sidebar-item
33
+        v-for="(route, index) in permission_routers"
34
+        :key="route.name"
35
+        :item="route"
36
+        :base-path="route.path"
37
+        :index="index"
38
+        @a="b"
39
+      ></sidebar-item>
17 40
     </el-menu>
18 41
   </el-scrollbar>
42
+  <!-- <div class="mianLeft">
43
+    <div class="logo">
44
+      <img src="/static/img/logo.8dbb9fd.png" alt="" />
45
+    </div>
46
+    <div class="navBox">
47
+      <div
48
+        class="navOne"
49
+        :class="activeClass == index ? 'active' : ''"
50
+        v-for="(item, index) in permission_routers"
51
+        :key="item.name"
52
+        v-if="!item.hidden && item.children"
53
+      >
54
+        <div v-if="item.meta" @click="onClick(index)" class="one">
55
+          <router-link :to="item.children[0].path">
56
+          <svg-icon
57
+            v-if="item.meta && item.meta.icon"
58
+            :icon-class="item.meta.icon"
59
+          ></svg-icon>
60
+          <p v-if="item.meta && item.meta.title">
61
+            {{ generateTitle(item.meta.title) }}
62
+          </p>
63
+          </router-link>
64
+        </div>
65
+
66
+        <div v-else @click="onClick(index)">
67
+          <router-link :to="item.children[0].path" class="one">
68
+            <svg-icon :icon-class="item.children[0].meta.icon"></svg-icon>
69
+            <p>
70
+              {{ generateTitle(item.children[0].meta.title) }}
71
+            </p>
72
+          </router-link>
73
+        </div>
74
+      </div>
75
+    </div>
76
+  </div>-->
19 77
 </template>
20 78
 
21 79
 <script>
22 80
 import { mapGetters } from "vuex";
23 81
 import SidebarItem from "./SidebarItem";
24 82
 import Hamburger from "@/components/Hamburger";
25
-
83
+import { generateTitle } from "@/utils/i18n";
26 84
 
27 85
 export default {
28
-  components: { SidebarItem,Hamburger },
86
+  components: { SidebarItem, Hamburger },
29 87
   computed: {
30 88
     ...mapGetters(["permission_routers", "sidebar"]),
31 89
     isCollapse() {
32 90
       return !this.sidebar.opened;
33 91
     }
34 92
   },
35
-  data(){
36
-    return{
37
-      uniqueOpened:true,
38
-    }
93
+  data() {
94
+    return {
95
+      uniqueOpened: true,
96
+      activeClass: 0,
97
+      index: 0
98
+    };
39 99
   },
40
-  methods:{
100
+  methods: {
41 101
     toggleSideBar() {
42 102
       this.$store.dispatch("toggleSideBar");
43 103
     },
104
+    generateTitle,
105
+    resolvePath(...paths) {
106
+      return path.resolve(this.basePath, ...paths);
107
+    },
108
+    b(index, num) {
109
+      // this.index = index;
110
+      // this.activeClass = index;
111
+      this.$emit("callBackIndex", index, num);
112
+    }
113
+  },
114
+  created() {
115
+    console.log(1111111121121111111, this.permission_routers);
116
+    // this.permission_routers.map(item => {
117
+    //   console.log(item.children);
118
+    // });
44 119
   }
45 120
 };
46 121
 </script>
47 122
 
48
-<style  rel="stylesheet/scss" lang="scss" scoped>
49
-.sideColumn{
50
-  background-color: rgb(48, 65, 86);
51
-.head {
52
-  text-align: center;
53
-  padding: 20px 0 0 0;
54
-  .tx {
55
-    .img {
56
-      width: 45px;
57
-      height: 45px;
58
-      border-radius: 50%;
59
-      -o-object-fit: cover;
60
-    object-fit: cover;
61
-    -o-object-position: center;
62
-    object-position: center;
123
+<style rel="stylesheet/scss" lang="scss" scoped>
124
+.mianLeft {
125
+  width: 150px;
126
+  height: 100%;
127
+  overflow-y: auto;
128
+  background: #304155;
129
+
130
+  .navBox {
131
+    display: flex;
132
+    flex-wrap: wrap;
133
+    .navOne {
134
+      width: 50%;
135
+      height: 75px;
136
+      display: flex;
137
+      align-items: center;
138
+      justify-content: space-around;
139
+      color: #fff;
140
+      .one {
141
+        display: flex;
142
+        align-items: center;
143
+        flex-direction: column;
144
+        p {
145
+          margin-top: 10px;
146
+          font-size: 14px;
147
+        }
148
+      }
149
+    }
150
+    .active {
151
+      background: #409eff;
63 152
     }
64
-  } 
65
-  .title {
66
-    font-size: 14px;
67
-    color: #bfcbd9;
68
-    padding: 10px 10px 15px 10px;
69
-    line-height: 22px;
153
+  }
154
+}
70 155
 
156
+.logo {
157
+  width: 100px;
158
+  height: 32px;
159
+  margin: 20px auto;
160
+  img {
161
+    width: 100%;
162
+    height: 100%;
163
+    display: block;
71 164
   }
72 165
 }
73
-.headShrink{
74
-  .tx{
75
-    .img{
76
-      width: 30px;
77
-      height: 30px;
78
-    }
79 166
 
167
+.sideColumn {
168
+  background-color: rgb(48, 65, 86);
169
+  .head {
170
+    text-align: center;
171
+    padding: 20px 0 0 0;
172
+    .tx {
173
+      .img {
174
+        width: 45px;
175
+        height: 45px;
176
+        border-radius: 50%;
177
+        -o-object-fit: cover;
178
+        object-fit: cover;
179
+        -o-object-position: center;
180
+        object-position: center;
181
+      }
182
+    }
183
+    .title {
184
+      font-size: 14px;
185
+      color: #bfcbd9;
186
+      padding: 10px 10px 15px 10px;
187
+      line-height: 22px;
188
+    }
80 189
   }
81
-  .title{
82
-    display: none;
190
+  .headShrink {
191
+    .tx {
192
+      .img {
193
+        width: 30px;
194
+        height: 30px;
195
+      }
196
+    }
197
+    .title {
198
+      display: none;
199
+    }
83 200
   }
84 201
 }
85
-}
86
-
87 202
 </style>
88 203
 
204
+<style lang="scss">
205
+.scrollbar-wrapper {
206
+  background-color: #1F2D3D;
207
+}
208
+</style>

+ 231 - 105
src/views/layout/components/TagsView.vue View File

@@ -1,124 +1,230 @@
1 1
 <template>
2 2
   <div class="tags-view-container">
3
-    <scroll-pane class='tags-view-wrapper' ref='scrollPane'>
4
-      <router-link 
5
-        ref='tag' 
6
-        class="tags-view-item" 
7
-        :class="isActive(tag)?'active':''" 
3
+    <!-- <scroll-pane class="tags-view-wrapper" ref="scrollPane">
4
+      <router-link
5
+        ref="tag"
6
+        class="tags-view-item"
7
+        :class="isActive(tag) ? 'active' : ''"
8 8
         v-for="tag in Array.from(visitedViews)"
9
-        :to="tag" 
10
-        :key="tag.path" 
11
-        @contextmenu.prevent.native="openMenu(tag,$event)">
12
-        {{generateTitle(tag.title)}}
13
-        <span class='el-icon-close' @click.prevent.stop='closeSelectedTag(tag)'></span>
9
+        :to="tag"
10
+        :key="tag.path"
11
+        @contextmenu.prevent.native="openMenu(tag, $event)"
12
+      >
13
+        {{ generateTitle(tag.title) }}
14
+        <span
15
+          class="el-icon-close"
16
+          @click.prevent.stop="closeSelectedTag(tag)"
17
+        ></span>
14 18
       </router-link>
15 19
     </scroll-pane>
16
-    <ul class='contextmenu' v-show="visible" :style="{left:left+'px',top:top+'px'}">
17
-      <li @click="closeSelectedTag(selectedTag)">{{$t('tagsView.close')}}</li>
18
-      <li @click="closeOthersTags">{{$t('tagsView.closeOthers')}}</li>
19
-      <li @click="closeAllTags">{{$t('tagsView.closeAll')}}</li>
20
-    </ul>
20
+    <ul
21
+      class="contextmenu"
22
+      v-show="visible"
23
+      :style="{ left: left + 'px', top: top + 'px' }"
24
+    >
25
+      <li @click="closeSelectedTag(selectedTag)">{{ $t("tagsView.close") }}</li>
26
+      <li @click="closeOthersTags">{{ $t("tagsView.closeOthers") }}</li>
27
+      <li @click="closeAllTags">{{ $t("tagsView.closeAll") }}</li>
28
+    </ul>-->
29
+    <div class="tags-view-wrapper">
30
+      <div style="height:100%">
31
+        <div style="height:100%" v-if="newIndex == 9">
32
+          <div class="tagsBox" v-if="routerList.length > 0 && newNum != 999">
33
+            <div
34
+              class="tagsOne"
35
+              v-if="routerList[newIndex].meta"
36
+              v-for="(item, i) in routerList[newIndex].children"
37
+              :key="i"
38
+            >
39
+              <router-link :to="item.path" v-if="item.num ? item.num == newNum : false">
40
+                <p
41
+                  class="newTags"
42
+                  :class="activeClass == i ? 'active' : ''"
43
+                  @click="onClick(i)"
44
+                >{{ generateTitle(item.meta.title) }}</p>
45
+              </router-link>
46
+            </div>
47
+          </div>
48
+          <div class="tagsBox" v-if="newNum == 999">
49
+            <div
50
+              class="tagsOne"
51
+              v-if="permission_routers[newIndex].meta"
52
+              v-for="(item, i) in permission_routers[newIndex].children"
53
+              :key="i"
54
+            >
55
+              <router-link :to="item.path" v-if="item.num ? item.num == newNum : false">
56
+                <p
57
+                  class="newTags"
58
+                  :class="activeClass == i ? 'active' : ''"
59
+                  @click="onClick(i)"
60
+                >{{ generateTitle(item.meta.title) }}</p>
61
+              </router-link>
62
+            </div>
63
+          </div>
64
+        </div>
65
+        <div class="tagsBox" v-if="newIndex != 9">
66
+          <div
67
+            class="tagsOne"
68
+            v-if="permission_routers[newIndex].meta"
69
+            v-for="(item, i) in permission_routers[newIndex].children"
70
+            :key="i"
71
+          >
72
+            <router-link :to="item.path" v-if="!item.hidden && !item.is_menu">
73
+              <p
74
+                class="newTags"
75
+                :class="activeClass == i ? 'active' : ''"
76
+                @click="onClick(i)"
77
+              >{{ generateTitle(item.meta.title) }}</p>
78
+            </router-link>
79
+          </div>
80
+          <div v-else class="tagsOne">
81
+            <p class="newTags" :class="activeClass == i ? 'active' : ''" @click="onClick(i)">
82
+              {{
83
+              generateTitle(permission_routers[newIndex].children[0].meta.title)
84
+              }}
85
+            </p>
86
+          </div>
87
+        </div>
88
+      </div>
89
+    </div>
21 90
   </div>
22 91
 </template>
23 92
 
24 93
 <script>
25
-import ScrollPane from '@/components/ScrollPane'
26
-import { generateTitle } from '@/utils/i18n'
27
-  
94
+import ScrollPane from "@/components/ScrollPane";
95
+import { generateTitle } from "@/utils/i18n";
96
+//
97
+import { mapGetters } from "vuex";
98
+
28 99
 export default {
100
+  props: {
101
+    index: Number,
102
+    num: Number
103
+  },
29 104
   components: { ScrollPane },
30 105
   data() {
31 106
     return {
32 107
       visible: false,
33 108
       top: 0,
34 109
       left: 0,
35
-      selectedTag: {}
36
-    }
110
+      selectedTag: {},
111
+      newIndex: 0,
112
+      activeClass: 0,
113
+      newNum: 1
114
+    };
37 115
   },
38 116
   computed: {
39
-    visitedViews() {
40
-      return this.$store.state.tagsView.visitedViews
41
-    }
117
+    // visitedViews() {
118
+    //   return this.$store.state.tagsView.visitedViews;
119
+    // },
120
+    ...mapGetters(["permission_routers"])
42 121
   },
43 122
   watch: {
44
-    $route() {
45
-      this.addViewTags()
46
-      this.moveToCurrentTag()
123
+    // $route() {
124
+    //   this.addViewTags();
125
+    //   this.moveToCurrentTag();
126
+    // },
127
+    // visible(value) {
128
+    //   if (value) {
129
+    //     document.body.addEventListener("click", this.closeMenu);
130
+    //   } else {
131
+    //     document.body.removeEventListener("click", this.closeMenu);
132
+    //   }
133
+    // },
134
+    index(newVal) {
135
+      if (this.newIndex != newVal) {
136
+        this.activeClass = 0;
137
+      }
138
+      this.newIndex = this.index;
47 139
     },
48
-    visible(value) {
49
-      if (value) {
50
-        document.body.addEventListener('click', this.closeMenu)
140
+    num(newVal) {
141
+      this.newNum = newVal;
142
+      if (newVal == 999) {
143
+        this.routerList = [];
51 144
       } else {
52
-        document.body.removeEventListener('click', this.closeMenu)
145
+        this.routerList = this.permission_routers;
146
+      }
147
+      if (newVal == 1) {
148
+        this.activeClass = 2;
149
+      }
150
+      if (newVal == 2) {
151
+        this.activeClass = 6;
53 152
       }
54 153
     }
55 154
   },
155
+  created() {
156
+    this.routerList = this.permission_routers;
157
+  },
56 158
   mounted() {
57
-    this.addViewTags()
159
+    // this.addViewTags();
58 160
   },
59 161
   methods: {
60 162
     generateTitle, // generateTitle by vue-i18n
61 163
     generateRoute() {
62 164
       if (this.$route.name) {
63
-        return this.$route
165
+        return this.$route;
64 166
       }
65
-      return false
167
+      return false;
66 168
     },
67 169
     isActive(route) {
68
-      return route.path === this.$route.path
170
+      return route.path === this.$route.path;
69 171
     },
70 172
     addViewTags() {
71
-      const route = this.generateRoute()
173
+      const route = this.generateRoute();
72 174
       if (!route) {
73
-        return false
175
+        return false;
74 176
       }
75
-      this.$store.dispatch('addVisitedViews', route)
177
+      this.$store.dispatch("addVisitedViews", route);
76 178
     },
77 179
     moveToCurrentTag() {
78
-      const tags = this.$refs.tag
180
+      const tags = this.$refs.tag;
79 181
       this.$nextTick(() => {
80 182
         for (const tag of tags) {
81 183
           if (tag.to.path === this.$route.path) {
82
-            this.$refs.scrollPane.moveToTarget(tag.$el)
83
-            break
184
+            this.$refs.scrollPane.moveToTarget(tag.$el);
185
+            break;
84 186
           }
85 187
         }
86
-      })
188
+      });
87 189
     },
88 190
     closeSelectedTag(view) {
89
-      this.$store.dispatch('delVisitedViews', view).then((views) => {
191
+      this.$store.dispatch("delVisitedViews", view).then(views => {
90 192
         if (this.isActive(view)) {
91
-          const latestView = views.slice(-1)[0]
193
+          const latestView = views.slice(-1)[0];
92 194
           if (latestView) {
93
-            this.$router.push(latestView)
195
+            this.$router.push(latestView);
94 196
           } else {
95
-            this.$router.push('/')
197
+            this.$router.push("/");
96 198
           }
97 199
         }
98
-      })
200
+      });
99 201
     },
100 202
     closeOthersTags() {
101
-      this.$router.push(this.selectedTag)
102
-      this.$store.dispatch('delOthersViews', this.selectedTag).then(() => {
103
-        this.moveToCurrentTag()
104
-      })
203
+      this.$router.push(this.selectedTag);
204
+      this.$store.dispatch("delOthersViews", this.selectedTag).then(() => {
205
+        this.moveToCurrentTag();
206
+      });
105 207
     },
106 208
     closeAllTags() {
107
-      this.$store.dispatch('delAllViews')
108
-      this.$router.push('/')
209
+      this.$store.dispatch("delAllViews");
210
+      this.$router.push("/");
109 211
     },
110 212
     openMenu(tag, e) {
111
-      this.visible = true
112
-      this.selectedTag = tag
113
-      const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
114
-      this.left = e.clientX - offsetLeft + 15 // 15: margin right
115
-      this.top = e.clientY
213
+      this.visible = true;
214
+      this.selectedTag = tag;
215
+      const offsetLeft = this.$el.getBoundingClientRect().left; // container margin left
216
+      this.left = e.clientX - offsetLeft + 15; // 15: margin right
217
+      this.top = e.clientY;
116 218
     },
117 219
     closeMenu() {
118
-      this.visible = false
220
+      this.visible = false;
221
+    },
222
+    onClick(index) {
223
+      console.log(index);
224
+      this.activeClass = index;
119 225
     }
120 226
   }
121
-}
227
+};
122 228
 </script>
123 229
 
124 230
 <style rel="stylesheet/scss" lang="scss" scoped>
@@ -128,51 +234,52 @@ export default {
128 234
     background: #fff;
129 235
     height: 50px;
130 236
     border-bottom: 1px solid #d8dce5;
131
-    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
237
+    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
132 238
     position: fixed;
133 239
     z-index: 1000;
134
-    top: 60px;
240
+    top: 50px;
135 241
     overflow-x: scroll;
136 242
     white-space: normal;
137 243
     // right: 0;
138 244
     // left: 150px;
139
-    
245
+    width: 100%;
246
+
140 247
     /* 针对缺省样式 (必须的) */
141
-      &::-webkit-scrollbar {
142
-        width: 6px;
143
-        height: 2px;
144
-      }
145
-      /* 滚动条的滑轨背景颜色 */
146
-      &::-webkit-scrollbar-track {
147
-        background-color: #fff;
148
-        border-radius: 3px;
149
-        -moz-border-radius: 3px;
150
-        -webkit-border-radius: 3px;
151
-      }
152
-      /* 滑块颜色 */
153
-      &::-webkit-scrollbar-thumb {
154
-        background: #fff;
155
-        border-radius: 3px;
156
-        -moz-border-radius: 3px;
157
-        -webkit-border-radius: 3px;
158
-      }
159
-      /*内层轨道的颜色*/
160
-      &::-webkit-scrollbar-track-piece {
161
-        background-color: #fff;
162
-        border-radius: 3px;
163
-        -moz-border-radius: 3px;
164
-        -webkit-border-radius: 3px;
165
-      }
166
-      /* 滑轨两头的监听按钮颜色 */
167
-      &::-webkit-scrollbar-button {
168
-        background-color: #fff;
169
-        width: 0;
170
-        height: 0;
171
-      }
172
-      /* 横向滚动条和纵向滚动条相交处尖角的颜色 */
173
-      &::-webkit-scrollbar-corner {
174
-        background-color: #fff;
175
-      }
248
+    &::-webkit-scrollbar {
249
+      width: 6px;
250
+      height: 2px;
251
+    }
252
+    /* 滚动条的滑轨背景颜色 */
253
+    &::-webkit-scrollbar-track {
254
+      background-color: #fff;
255
+      border-radius: 3px;
256
+      -moz-border-radius: 3px;
257
+      -webkit-border-radius: 3px;
258
+    }
259
+    /* 滑块颜色 */
260
+    &::-webkit-scrollbar-thumb {
261
+      background: #fff;
262
+      border-radius: 3px;
263
+      -moz-border-radius: 3px;
264
+      -webkit-border-radius: 3px;
265
+    }
266
+    /*内层轨道的颜色*/
267
+    &::-webkit-scrollbar-track-piece {
268
+      background-color: #fff;
269
+      border-radius: 3px;
270
+      -moz-border-radius: 3px;
271
+      -webkit-border-radius: 3px;
272
+    }
273
+    /* 滑轨两头的监听按钮颜色 */
274
+    &::-webkit-scrollbar-button {
275
+      background-color: #fff;
276
+      width: 0;
277
+      height: 0;
278
+    }
279
+    /* 横向滚动条和纵向滚动条相交处尖角的颜色 */
280
+    &::-webkit-scrollbar-corner {
281
+      background-color: #fff;
282
+    }
176 283
     .tags-view-item {
177 284
       display: inline-block;
178 285
       position: relative;
@@ -193,7 +300,7 @@ export default {
193 300
         color: #fff;
194 301
         border-color: #409efe;
195 302
         &::before {
196
-          content: '';
303
+          content: "";
197 304
           background: #fff;
198 305
           display: inline-block;
199 306
           width: 8px;
@@ -216,7 +323,7 @@ export default {
216 323
     font-size: 12px;
217 324
     font-weight: 400;
218 325
     color: #333;
219
-    box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
326
+    box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
220 327
     li {
221 328
       margin: 0;
222 329
       padding: 7px 16px;
@@ -226,11 +333,30 @@ export default {
226 333
       }
227 334
     }
228 335
   }
336
+  .tagsBox {
337
+    display: flex;
338
+    align-items: center;
339
+    height: 100%;
340
+    .tagsOne {
341
+      .newTags {
342
+        border: 1px solid rgba(235, 238, 240, 1);
343
+        border-radius: 2px;
344
+        padding: 8px 12px;
345
+        margin-left: 10px;
346
+        font-size: 14px;
347
+      }
348
+    }
349
+    .active {
350
+      border: 1px solid rgba(64, 158, 255, 1);
351
+      background: rgba(64, 158, 255, 1);
352
+      border-radius: 2px;
353
+      color: #fff;
354
+    }
355
+  }
229 356
 }
230
-.scroll-wrapper{
231
-      right: 0;
232
-      position: fixed!important;
233
-      
357
+.scroll-wrapper {
358
+  right: 0;
359
+  position: fixed !important;
234 360
 }
235 361
 </style>
236 362
 
@@ -244,10 +370,10 @@ export default {
244 370
       vertical-align: 2px;
245 371
       border-radius: 50%;
246 372
       text-align: center;
247
-      transition: all .3s cubic-bezier(.645, .045, .355, 1);
373
+      transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
248 374
       transform-origin: 100% 50%;
249 375
       &:before {
250
-        transform: scale(.6);
376
+        transform: scale(0.6);
251 377
         display: inline-block;
252 378
         vertical-align: -3px;
253 379
       }

+ 7 - 0
src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue View File

@@ -582,6 +582,13 @@ export default {
582 582
 
583 583
         ParamsQuery['patient'] = this.patient.id
584 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 593
         const data = {}
587 594
         data['weight_after'] = this.form.weight_after ? parseFloat(this.form.weight_after) : 0

+ 68 - 67
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue View File

@@ -271,7 +271,6 @@
271 271
   import {
272 272
     CheckDoctorAdvice,
273 273
     CreateDoctorAdvice,
274
-    CreateGroupAdvice,
275 274
     DeleteDoctorAdvice,
276 275
     DeleteGroupAdvice,
277 276
     EditDoctorAdvice,
@@ -471,71 +470,71 @@
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 538
       openAdviceTemplate() {
540 539
         this.templateForm = { id: '' }
541 540
         this.title = '选择医嘱模板'
@@ -952,7 +951,9 @@
952 951
           type: 'warning'
953 952
         }).then(() => {
954 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 957
             if (response.data.state == 0) {
957 958
               this.$message.error(response.data.msg)
958 959
 

+ 9 - 0
src/xt_pages/dialysis/details/dialog/acceptsTreatmentDialog.vue View File

@@ -235,6 +235,15 @@
235 235
         let ParamsQuery = this.receiveTreatmentAsses
236 236
         ParamsQuery['patient'] = this.patient.id
237 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 247
         postAccepts(ParamsQuery).then(response => {
239 248
           if (response.data.state == 0) {
240 249
             this.$message.error(response.data.msg)

+ 9 - 0
src/xt_pages/dialysis/details/dialog/assessmentBeforeDislysisDialog.vue View File

@@ -761,6 +761,15 @@
761 761
         const ParamsQuery = this.assessmentBeforeDislysis
762 762
         ParamsQuery['patient'] = this.patient.id
763 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 773
         postAssessmentBeforeDislysis(ParamsQuery).then(response => {
765 774
           if (response.data.state == 0) {
766 775
             this.$message.error(response.data.msg)

+ 55 - 73
src/xt_pages/dialysis/details/dialog/computer_dialog.vue View File

@@ -5,26 +5,27 @@
5 5
 
6 6
         <el-form-item label="班次">
7 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 10
           </el-select>
10 11
         </el-form-item>
11 12
 
12 13
         <el-form-item label="上机床位">
13
-          <el-select v-model="form.bed_id" placeholder="请选择上机床位" >
14
+          <el-select v-model="form.bed_id" placeholder="请选择上机床位">
14 15
             <el-option v-for="(bed, index) in zone_beds" :key="index" :value="bed.id" :label="bed.number"></el-option>
15 16
           </el-select>
16 17
         </el-form-item>
17 18
         <el-form-item label="上机护士">
18
-          <el-select v-model="form.nurse_id" placeholder="请选择上机护士" >
19
+          <el-select v-model="form.nurse_id" placeholder="请选择上机护士">
19 20
             <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
20 21
           </el-select>
21 22
         </el-form-item>
22 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 25
             <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
25 26
           </el-select>
26 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 29
           <el-input type="number" v-model="form.blood_drawing" style="width:200px;"></el-input>
29 30
         </el-form-item>
30 31
 
@@ -41,7 +42,10 @@
41 42
         <el-form-item>
42 43
           <el-button v-if="dialysis_order.id == 0" @click="submit" type="primary" :loading="loading">执行上机</el-button>
43 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 50
         </el-form-item>
47 51
       </el-form>
@@ -51,21 +55,21 @@
51 55
 </template>
52 56
 
53 57
 <script>
54
-  import { startDialysis,GetSchedualNumber,PostModifyStartDialysis } from '@/api/dialysis_record'
58
+  import { GetSchedualNumber, PostModifyStartDialysis, startDialysis } from '@/api/dialysis_record'
55 59
   import { parseTime } from '@/utils'
56 60
 
57 61
   export default {
58 62
     name: 'ComputerDialog',
59 63
     data() {
60 64
       return {
61
-        zone_beds:[],
65
+        zone_beds: [],
62 66
         visible: false,
63 67
         loading: false,
64 68
         template_id: 0,
65 69
         patient_id: 0,
66 70
         schedule_date: 0,
67 71
         start_time: 0,
68
-        creator:0,
72
+        creator: 0,
69 73
         form: {
70 74
           bed_id: '',
71 75
           nurse_id: '',
@@ -73,13 +77,13 @@
73 77
           puncture_nurse_id: '',
74 78
           blood_drawing: 100
75 79
         },
76
-        schedual_type:0,
80
+        schedual_type: 0,
77 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 89
     props: {
@@ -96,12 +100,9 @@
96 100
         type: Array
97 101
       },
98 102
       special_premission: {
99
-        type: Array,
100
-      },
101
-    },mounted(){
102
-
103
-
104
-
103
+        type: Array
104
+      }
105
+    }, mounted() {
105 106
 
106 107
     },
107 108
     created() {
@@ -115,20 +116,12 @@
115 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 120
     watch: {
126 121
       'schedule.id': function() {
127 122
       },
128 123
       'dialysis_order.id': function() {
129 124
 
130
-
131
-
132 125
         this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
133 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,28 +140,11 @@
147 140
           (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
148 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 146
     methods: {
171
-      changeSchedualType:function(schedual_type){
147
+      changeSchedualType: function(schedual_type) {
172 148
         let ParamsQuery = {}
173 149
         ParamsQuery['schedual_type'] = schedual_type
174 150
         GetSchedualNumber(ParamsQuery).then(response => {
@@ -178,7 +154,7 @@
178 154
             this.temp_device_numbers = response.data.data.number
179 155
             for (let index = 0; index < this.temp_device_numbers.length; index++) {
180 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 159
             this.zone_beds = this.temp_device_numbers
184 160
             this.form.bed_id = this.zone_beds[0].id
@@ -187,7 +163,7 @@
187 163
         })
188 164
 
189 165
       },
190
-      GetSchedualNumber:function(){
166
+      GetSchedualNumber: function() {
191 167
         let ParamsQuery = {}
192 168
         ParamsQuery['schedual_type'] = this.schedual_type
193 169
         GetSchedualNumber(ParamsQuery).then(response => {
@@ -198,32 +174,32 @@
198 174
             this.temp_device_numbers = response.data.data.number
199 175
             for (let index = 0; index < this.temp_device_numbers.length; index++) {
200 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 179
             this.zone_beds = this.temp_device_numbers
204 180
 
205 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 183
               let isFilter = true
208 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 186
                   isFilter = false
211 187
 
212 188
                 }
213 189
               }
214
-              if(isFilter){
190
+              if (isFilter) {
215 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 196
                   let obj = {}
221 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 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,15 +237,14 @@
261 237
         if (this.dialysis_order.id == 0) {
262 238
           let now = new Date()
263 239
           let hour = now.getHours()
264
-          if (hour >= 6 && hour < 12){
240
+          if (hour >= 6 && hour < 12) {
265 241
             this.schedual_type = 1
266 242
 
267
-          }else if(hour >= 12 && hour < 18){
243
+          } else if (hour >= 12 && hour < 18) {
268 244
 
269 245
             this.schedual_type = 2
270 246
 
271
-
272
-          }else if(hour >= 18){
247
+          } else if (hour >= 18) {
273 248
             this.schedual_type = 3
274 249
           }
275 250
         } else {
@@ -277,7 +252,6 @@
277 252
           this.schedual_type = this.dialysis_order.schedual_type
278 253
         }
279 254
 
280
-
281 255
         if (this.dialysis_order.id > 0) {
282 256
           for (let i = 0; i < this.special_premission.length; i++) {
283 257
             if (this.$store.getters.xt_user.user.id == this.special_premission[i].admin_user_id) {
@@ -300,12 +274,15 @@
300 274
         this.visible = false
301 275
       },
302 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 279
           return
306 280
         }
281
+        console.log(this.dialysis_order)
307 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 286
           this.loading = false
310 287
           var resp = rs.data
311 288
           if (resp.state == 1) {
@@ -315,24 +292,29 @@
315 292
               this.$set(this_order, key, resp_dialysis_order[key])
316 293
             }
317 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 297
           } else {
321 298
             this.$message.error(resp.msg)
322 299
           }
323 300
         })
324
-      }, editOrder(){
301
+      }, editOrder() {
325 302
         let ParamsQuery = {}
326 303
         ParamsQuery['schedual_type'] = this.schedual_type
327 304
         ParamsQuery['id'] = this.dialysis_order.id
328 305
         ParamsQuery['nurse'] = this.form.nurse_id
329 306
         ParamsQuery['bed'] = this.form.bed_id
330
-        ParamsQuery['start_time'] =  this.form.start_time
307
+        ParamsQuery['start_time'] = this.form.start_time
331 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 314
         PostModifyStartDialysis(ParamsQuery).then(rs => {
333 315
           var resp = rs.data
334 316
           if (resp.state == 1) {
335
-            this.$message.success("修改成功")
317
+            this.$message.success('修改成功')
336 318
 
337 319
             var resp_dialysis_order = resp.data.dialysis_order
338 320
             var this_order = this.dialysis_order
@@ -346,7 +328,7 @@
346 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 View File

@@ -836,7 +836,10 @@
836 836
 
837 837
           no_anticoagulant_shouji: '0',
838 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,6 +998,15 @@
995 998
             ParamsQuery['patient'] = this.patient.id
996 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 1010
             postPrescription(ParamsQuery).then(response => {
999 1011
               if (response.data.state == 0) {
1000 1012
                 this.$message.error(response.data.msg)
@@ -1105,6 +1117,14 @@
1105 1117
             const ParamsQuery = this.dialysisPrescription
1106 1118
             ParamsQuery['patient'] = this.patient.id
1107 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 1129
             postPrescription(ParamsQuery).then(response => {
1110 1130
               if (response.data.state == 0) {
@@ -1243,6 +1263,14 @@
1243 1263
             const ParamsQuery = this.dialysisPrescription
1244 1264
             ParamsQuery['patient'] = this.patient.id
1245 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 1275
             postPrescription(ParamsQuery).then(response => {
1248 1276
               if (response.data.state == 0) {
@@ -1280,6 +1308,14 @@
1280 1308
               const ParamsQuery = this.dialysisPrescription
1281 1309
               ParamsQuery['patient'] = this.patient.id
1282 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 1320
               postPrescription(ParamsQuery).then(response => {
1285 1321
                 if (response.data.state == 0) {
@@ -1333,6 +1369,14 @@
1333 1369
               const ParamsQuery = this.dialysisPrescription
1334 1370
               ParamsQuery['patient'] = this.patient.id
1335 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 1381
               postPrescription(ParamsQuery).then(response => {
1338 1382
                 if (response.data.state == 0) {
@@ -1365,6 +1409,14 @@
1365 1409
               const ParamsQuery = this.dialysisPrescription
1366 1410
               ParamsQuery['patient'] = this.patient.id
1367 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 1421
               postPrescription(ParamsQuery).then(response => {
1370 1422
                 if (response.data.state == 0) {
@@ -1401,6 +1453,14 @@
1401 1453
               const ParamsQuery = this.dialysisPrescription
1402 1454
               ParamsQuery['patient'] = this.patient.id
1403 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 1465
               postPrescription(ParamsQuery).then(response => {
1406 1466
                 if (response.data.state == 0) {
@@ -1438,6 +1498,14 @@
1438 1498
                 const ParamsQuery = this.dialysisPrescription
1439 1499
                 ParamsQuery['patient'] = this.patient.id
1440 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 1510
                 postPrescription(ParamsQuery).then(response => {
1443 1511
                   if (response.data.state == 0) {
@@ -1491,6 +1559,14 @@
1491 1559
                 const ParamsQuery = this.dialysisPrescription
1492 1560
                 ParamsQuery['patient'] = this.patient.id
1493 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 1571
                 postPrescription(ParamsQuery).then(response => {
1496 1572
                   if (response.data.state == 0) {
@@ -1523,6 +1599,14 @@
1523 1599
                 const ParamsQuery = this.dialysisPrescription
1524 1600
                 ParamsQuery['patient'] = this.patient.id
1525 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 1611
                 postPrescription(ParamsQuery).then(response => {
1528 1612
                   if (response.data.state == 0) {
@@ -1557,6 +1641,14 @@
1557 1641
             const ParamsQuery = this.dialysisPrescription
1558 1642
             ParamsQuery['patient'] = this.patient.id
1559 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 1653
             postPrescription(ParamsQuery).then(response => {
1562 1654
               if (response.data.state == 0) {
@@ -1708,6 +1800,14 @@
1708 1800
               const ParamsQuery = this.dialysisPrescription
1709 1801
               ParamsQuery['patient'] = this.patient.id
1710 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 1812
               postPrescription(ParamsQuery).then(response => {
1713 1813
                 if (response.data.state == 0) {

+ 6 - 1
src/xt_pages/dialysis/details/dialog/finish_dialog.vue View File

@@ -169,6 +169,10 @@
169 169
         ParamsQuery["id"] = this.dialysis_order.id;
170 170
         ParamsQuery["nurse"] = this.form.nurse_id;
171 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 176
         PostModifyFinishDialysis(ParamsQuery).then(response => {
173 177
           if (response.data.state == 0) {
174 178
             this.$message.error(response.data.msg)
@@ -189,7 +193,8 @@
189 193
       },
190 194
       submit: function() {
191 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 198
           this.loading = false
194 199
           var resp = rs.data
195 200
           if (resp.state == 1) {

+ 9 - 2
src/xt_pages/dialysis/details/dialog/monitor_dialog.vue View File

@@ -961,11 +961,18 @@ export default {
961 961
         parseFloat(this.form.ktv) == NaN ? 0 : parseFloat(this.form.ktv);
962 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 973
         var resp = rs.data;
966 974
         if (resp.state == 1) {
967 975
           var monitor = resp.data.monitor;
968
-          console.log("monitor-----", monitor);
969 976
           if (this.isAdd) {
970 977
             this.monitors.unshift(monitor);
971 978
             this.monitors.sort((a, b) => b.operate_time - a.operate_time);

+ 7 - 0
src/xt_pages/dialysis/details/dialog/treatmentSummaryDialog.vue View File

@@ -118,6 +118,13 @@ export default {
118 118
         const ParamsQuery = this.treatmentSummary
119 119
         ParamsQuery['patient'] = this.patient.id
120 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 128
         postTreatmentsummary(ParamsQuery).then(response => {
122 129
           if (response.data.state == 0) {
123 130
             this.$message.error(response.data.msg)

+ 2 - 3
src/xt_pages/home/index.vue View File

@@ -112,7 +112,6 @@
112 112
             :total="total"
113 113
           ></el-pagination>
114 114
         </div>
115
-
116 115
       </div>
117 116
     </section>
118 117
   </div>
@@ -193,8 +192,8 @@ export default {
193 192
   methods: {
194 193
     dateCompare(date) {
195 194
       var date1 = Date.parse(new Date()) / 1000;
196
-      console.log(date);
197
-      console.log(date1);
195
+      // console.log(date);
196
+      // console.log(date1);
198 197
       if (date > date1) {
199 198
         return 1;
200 199
       } else {

+ 56 - 4
src/xt_pages/role/admin.vue View File

@@ -104,7 +104,7 @@
104 104
                 type="danger"
105 105
                 size="small"
106 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 108
                 @click="disableAdminAction(scope.row)"
109 109
               ></el-button>
110 110
             </el-tooltip>
@@ -118,7 +118,7 @@
118 118
                 size="small"
119 119
                 type="info"
120 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 122
                 @click="recoverAdminAction(scope.row)"
123 123
               ></el-button>
124 124
             </el-tooltip>
@@ -144,6 +144,8 @@
144 144
 
145 145
 <script>
146 146
 import { adminMainView, getAdmins, setAdminStatus } from "@/api/role/admin";
147
+import { getRoles } from "@/api/role/role";
148
+
147 149
 import { parseTime } from "@/utils";
148 150
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
149 151
 import AdminInfoForm from "./components/AdminInfoForm";
@@ -160,7 +162,12 @@ export default {
160 162
       admins: [], // [{user_id, user_name, role_name, title_name, ip, last_login_time, status}]
161 163
       admin_total_count: 0,
162 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 173
   components: {
@@ -168,15 +175,44 @@ export default {
168 175
     AdminInfoForm
169 176
   },
170 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 182
     adminMainView()
172 183
       .then(rs => {
173 184
         this.is_loading_admins = false;
174 185
         var resp = rs.data;
175 186
         if (resp.state === 1) {
187
+
176 188
           this.admins.push(...resp.data.admins);
177 189
           this.admin_total_count = resp.data.total_count;
178 190
           this.is_exist_role = resp.data.is_exist_role;
179 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 216
         } else {
181 217
           this.$message.error(resp.msg);
182 218
         }
@@ -192,8 +228,24 @@ export default {
192 228
     }
193 229
   },
194 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 247
     openForm(adminId) {
196
-      this.$refs["admininfoform"].open(adminId);
248
+      this.$refs["admininfoform"].open(adminId,this.roles);
197 249
     },
198 250
     _parseTime(time, format) {
199 251
       return parseTime(time, format);

+ 252 - 0
src/xt_pages/role/components/AddRole.vue View File

@@ -0,0 +1,252 @@
1
+<template>
2
+  <el-dialog
3
+    title="新增用户"
4
+    width="660px"
5
+    :visible.sync="visible"
6
+    :before-close="_close"
7
+  >
8
+    <el-form :model="form" :rules="rules" ref="form" label-width="90px">
9
+      <el-form-item label="角色名称 : " prop="name">
10
+        <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
11
+      </el-form-item>
12
+      <el-form-item label="角色描述 : " >
13
+        <el-input type="textarea" v-model="form.intro" placeholder="" resize="none" rows="4"></el-input>
14
+      </el-form-item>
15
+    </el-form>
16
+    <div slot="footer" class="dialog-footer">
17
+      <el-button @click="hide">取 消</el-button>
18
+      <el-button type="primary" @click="submitAction()">保 存</el-button>
19
+    </div>
20
+  </el-dialog>
21
+</template>
22
+
23
+<script>
24
+  import { addRole, modifyRole } from '@/api/role/role'
25
+
26
+  export default {
27
+    name: 'AddRole',
28
+    data() {
29
+      return {
30
+        form: {
31
+          id: 0,
32
+          name: '',
33
+          intro: ''
34
+        },
35
+        visible: false,
36
+        rules: {
37
+          name: [
38
+            { required: true, message: '请输入角色名称', trigger: 'blur' },
39
+            { max: 10, message: '10个字以内', trigger: 'blur' }
40
+          ],
41
+          // intro: [{ required: true, message: '请输入角色说明', trigger: 'blur' }]
42
+        },
43
+
44
+        //
45
+        checked: '1',
46
+        checkAll: false,
47
+        checkedCities: [],
48
+        cities: ['上海', '北京', '广州', '深圳'],
49
+        isIndeterminate: true,
50
+        ruleForm: {
51
+          name: '',
52
+          phone: '',
53
+          position: ''
54
+        },
55
+        newrules: {
56
+          name: [
57
+            { required: true, message: '请输入角色名称', trigger: 'blur' },
58
+            { max: 10, message: '10个字以内', trigger: 'blur' }
59
+          ],
60
+          phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }]
61
+        }
62
+      }
63
+    },
64
+    methods: {
65
+      _close: function(done) {
66
+        this.clear()
67
+        done()
68
+      },
69
+      clear: function() {
70
+        this.form.id = 0
71
+        this.form.name = ''
72
+        this.form.intro = ''
73
+      },
74
+      show() {
75
+        this.clear()
76
+        this.visible = true
77
+      },
78
+      hide() {
79
+        this.clear()
80
+        this.visible = false
81
+      },
82
+      modify(id, name, intro) {
83
+        this.form.id = id
84
+        this.form.name = name
85
+        this.form.intro = intro
86
+        this.visible = true
87
+      },
88
+      submitAction() {
89
+        this.$refs.form.validate(valid => {
90
+          if (valid) {
91
+            // 验证通过
92
+            if (this.form.id === 0) {
93
+              // 新增 role
94
+              addRole(this.form.name, this.form.intro)
95
+                .then(rs => {
96
+                  var resp = rs.data
97
+                  if (resp.state === 1) {
98
+                    var new_id = resp.data.id
99
+                    var new_name = resp.data.name
100
+                    var new_intro = resp.data.intro
101
+                    var new_status = resp.data.status
102
+                    var staff_number = 0
103
+                    this.$emit(
104
+                      'did-add-role',
105
+                      new_id,
106
+                      new_name,
107
+                      new_intro,
108
+                      new_status,
109
+                      staff_number
110
+                    )
111
+
112
+                    this.hide()
113
+                  } else {
114
+                    this.$message.error(resp.msg)
115
+                  }
116
+                })
117
+                .catch(err => {
118
+                  this.$message.error(err)
119
+                })
120
+            } else {
121
+              // 修改 role
122
+              modifyRole(this.form.id, this.form.name, this.form.intro)
123
+                .then(rs => {
124
+                  var resp = rs.data
125
+                  if (resp.state === 1) {
126
+                    this.$emit(
127
+                      'did-edit-role',
128
+                      this.form.id,
129
+                      this.form.name,
130
+                      this.form.intro
131
+                    )
132
+                    this.hide()
133
+                  } else {
134
+                    this.$message.error(resp.msg)
135
+                  }
136
+                })
137
+                .catch(err => {
138
+                  this.$message.error(err)
139
+                })
140
+            }
141
+          } else {
142
+            // 验证失败
143
+            return false
144
+          }
145
+        })
146
+      },
147
+      handleCheckAllChange(val) {
148
+        this.checkedCities = val ? this.cities : []
149
+        this.isIndeterminate = false
150
+      },
151
+      handleCheckedCitiesChange(value) {
152
+        let checkedCount = value.length
153
+        this.checkAll = checkedCount === this.cities.length
154
+        this.isIndeterminate =
155
+          checkedCount > 0 && checkedCount < this.cities.length
156
+      }
157
+    }
158
+  }
159
+</script>
160
+
161
+<style lang="scss" scoped>
162
+  .roleContent {
163
+    margin-top: 20px;
164
+    display: flex;
165
+    justify-content: space-between;
166
+
167
+  .roleContentLeft {
168
+
169
+  .chooseBox {
170
+    width: 280px;
171
+    height: 320px;
172
+    overflow-y: auto;
173
+    border: 1px solid rgba(235, 238, 240, 1);
174
+    margin-top: 26px;
175
+    padding: 20px;
176
+
177
+  .checkone {
178
+    display: flex;
179
+    align-items: center;
180
+    height: 50px;
181
+  }
182
+
183
+  .el-checkbox__label {
184
+    display: flex;
185
+    align-items: center;
186
+
187
+  img {
188
+    width: 30px;
189
+    height: 30px;
190
+    margin-right: 10px;
191
+  }
192
+
193
+  }
194
+  }
195
+  }
196
+  .roleContentRight {
197
+
198
+  .chooseBox {
199
+    width: 280px;
200
+    height: 320px;
201
+    overflow-y: auto;
202
+    border: 1px solid rgba(235, 238, 240, 1);
203
+    margin-top: 26px;
204
+    padding: 20px;
205
+
206
+  .hasChoosedOne {
207
+    display: flex;
208
+    align-items: center;
209
+    height: 50px;
210
+
211
+  img {
212
+    width: 30px;
213
+    height: 30px;
214
+    margin-right: 10px;
215
+  }
216
+
217
+  }
218
+  }
219
+  }
220
+  }
221
+  .newStaff {
222
+    margin-top: 26px;
223
+
224
+  .newItem {
225
+    display: flex;
226
+    align-items: center;
227
+  }
228
+
229
+  }
230
+</style>
231
+
232
+<style lang="scss">
233
+  .roleContent {
234
+
235
+  .roleContentLeft {
236
+
237
+  .chooseBox {
238
+
239
+  .el-checkbox {
240
+    display: flex;
241
+    align-items: center;
242
+  }
243
+
244
+  .el-checkbox__label {
245
+    display: flex;
246
+    align-items: center;
247
+  }
248
+
249
+  }
250
+  }
251
+  }
252
+</style>

+ 306 - 201
src/xt_pages/role/components/AdminInfoForm.vue View File

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

+ 257 - 0
src/xt_pages/role/components/AdminRoleInfoForm.vue View File

@@ -0,0 +1,257 @@
1
+<template>
2
+  <el-dialog :title="formTitle" :visible.sync="dialogFormVisible">
3
+    <el-form :model="form" ref="form" :rules="rules" label-width="60px">
4
+      <el-form-item label="账号 : " prop="mobile">
5
+        <el-input v-model="form.mobile" placeholder="用户手机号" maxlength="11"
6
+                  :disabled="form.id !==  0"></el-input>
7
+      </el-form-item>
8
+
9
+      <el-form-item label="姓名 : " prop="name">
10
+        <el-input v-model="form.name" placeholder="用户姓名"></el-input>
11
+      </el-form-item>
12
+
13
+      <el-form-item label="职称 : ">
14
+        <el-select v-model="form.user_type" placeholder="用户类型">
15
+          <el-option
16
+            v-for="item in user_types"
17
+            :label="item.name"
18
+            :value="item.index"
19
+            :key="item.index"
20
+          ></el-option>
21
+        </el-select>
22
+
23
+        <el-select v-model="form.user_title" placeholder="用户职称">
24
+          <el-option
25
+            v-for="item in user_titles"
26
+            :label="item.name"
27
+            :value="item.index"
28
+            :key="item.index"
29
+          ></el-option>
30
+        </el-select>
31
+      </el-form-item>
32
+
33
+      <el-form-item label="职位 : ">
34
+        <el-input v-model="form.user_title_name" placeholder="输入职位"></el-input>
35
+      </el-form-item>
36
+
37
+      <el-form-item label="介绍 : ">
38
+        <Tinymce :height="400" menubar ref="editor" v-model="form.intro" :show_upload_img="false"/>
39
+      </el-form-item>
40
+    </el-form>
41
+    <div slot="footer" class="dialog-footer">
42
+      <el-button @click="dialogFormVisible = false">取 消</el-button>
43
+      <el-button type="primary" @click="submitAction">保 存</el-button>
44
+    </div>
45
+  </el-dialog>
46
+</template>
47
+
48
+<script>
49
+  import Tinymce from '@/components/Tinymce'
50
+  import { addAdmin, getAddAdminInitData, getModifyAdminInitData, modifyAdmin } from '@/api/role/admin'
51
+
52
+  export default {
53
+    name: 'AdminRoleInfoForm',
54
+    components: {
55
+      Tinymce
56
+    },
57
+    data() {
58
+      var checkMobile = (rule, value, callback) => {
59
+        if (!value || value.length == 0) {
60
+          return callback(new Error('手机号不能为空'))
61
+        }
62
+        if (/^1\d{10}$/.test(value) == false) {
63
+          return callback(new Error('手机号格式错误'))
64
+        } else {
65
+          callback()
66
+        }
67
+      }
68
+      var checkName = (rule, value, callback) => {
69
+        if (!value || value.length == 0) {
70
+          return callback(new Error('姓名不能为空'))
71
+        } else {
72
+          callback()
73
+        }
74
+      }
75
+      return {
76
+        admin_id: 0,
77
+        dialogFormVisible: false,
78
+
79
+        user_types: [
80
+          { index: 2, name: '医生' },
81
+          { index: 3, name: '护士' }
82
+        ],
83
+        user_titles: [
84
+          { index: 1, name: '医士' },
85
+          { index: 2, name: '医师' },
86
+          { index: 3, name: '住院医师' },
87
+          { index: 4, name: '主治医师' },
88
+          { index: 5, name: '副主任医师' },
89
+          { index: 6, name: '主任医师' },
90
+          { index: 7, name: '护士' },
91
+          { index: 8, name: '护师' },
92
+          { index: 9, name: '主管护师' },
93
+          { index: 10, name: '副主任护师' },
94
+          { index: 11, name: '主任护师' },
95
+          { index: 12, name: '运营专员' },
96
+          { index: 13, name: '运营主管' }
97
+        ],
98
+        roles: [], // [{id, name, intro, status}]
99
+        loading: true,
100
+        qntoken: '',
101
+        formTitle: '',
102
+        isSubSuperAdmin: false,
103
+        org: null,
104
+        form: {
105
+          role_ids: [],
106
+          user_title_name: '',
107
+          id: 0,
108
+          mobile: '',
109
+          name: '',
110
+          user_type: '',
111
+          user_title: '',
112
+          role: '', // 其实应该是 int 类型
113
+          intro: ''
114
+        },
115
+        rules: {
116
+          mobile: [{ required: true, validator: checkMobile, trigger: 'blur' }],
117
+          name: [{ required: true, validator: checkName, trigger: 'blur' }]
118
+
119
+        }
120
+      }
121
+    },
122
+    methods: {
123
+      open: function(adminId,role_id) {
124
+        this.admin_id = adminId
125
+        this.roles.push(role_id)
126
+        if (this.admin_id < 0) {
127
+          this.$message.error('参数错误')
128
+          this.loading = false
129
+          return
130
+        }
131
+        let local_user_id = this.$store.getters.xt_user.user.id
132
+        local_user_id = 597
133
+        this.form.id = this.admin_id
134
+        this.formTitle = '编辑用户'
135
+        getModifyAdminInitData(this.form.id)
136
+          .then(rs => {
137
+            this.loading = false
138
+            var resp = rs.data
139
+            if (resp.state === 1) {
140
+              this.roles = []
141
+              this.roles.push(...resp.data.roles)
142
+              this.qntoken = resp.data.qntoken
143
+              var admin = resp.data.admin
144
+              this.form.name = admin.user_name
145
+              this.form.mobile = admin.admin.mobile
146
+              this.form.user_type = admin.user_type
147
+              this.form.user_title = admin.user_title
148
+              this.form.role = admin.role_ids
149
+              this.form.role_ids = []
150
+              for (let i = 0; i < this.form.role.split(",").length; i++) {
151
+                if (this.form.role.split(',')[i].length > 0) {
152
+                  this.form.role_ids.push(parseInt(this.form.role.split(',')[i]))
153
+                }
154
+              }
155
+
156
+              this.form.intro = admin.intro
157
+              this.form.user_title_name = admin.user_title_name
158
+
159
+              //如果当前用户是超级管理员而且编辑自己的信息
160
+              if (!this.isSubSuperAdmin && local_user_id == this.form.id) {
161
+                for (let i = 0; i < this.roles.length; i++) {
162
+                  if (this.roles[i].is_system == 1 && this.roles[i].role_name != '子管理员') {
163
+                    this.roles.splice(i, 1)
164
+                    i--
165
+                  }
166
+                }
167
+              }
168
+
169
+            } else {
170
+              this.$message.error('该用户不存在')
171
+            }
172
+          })
173
+          .catch(err => {
174
+            this.loading = false
175
+            this.$message.error('该用户不存在')
176
+          })
177
+
178
+        this.dialogFormVisible = true
179
+      },
180
+      submitAction: function() {
181
+        if (this.admin_id < 0) {
182
+          return
183
+        }
184
+        this.$refs.form.validate(valid => {
185
+          if (valid) {
186
+            this.loading = true
187
+            if (this.form.id === 0) {
188
+              this.form.role = this.form.role_ids.join(',')
189
+              addAdmin(
190
+                this.form.mobile,
191
+                this.form.name,
192
+                this.form.user_type,
193
+                this.form.user_title,
194
+                this.form.role,
195
+                this.form.intro,
196
+                this.form.user_title_name
197
+              )
198
+                .then(rs => {
199
+                  this.loading = false
200
+                  var resp = rs.data
201
+                  if (resp.state === 1) {
202
+                    this.$store.dispatch('DidChangeAdmins')
203
+                    var _this = this
204
+                    setTimeout(() => {
205
+                      _this.$store.dispatch('RecoverAdminsChangeState')
206
+                    }, 500)
207
+
208
+                    this.$emit('did-edit-admin')
209
+
210
+                  } else {
211
+                    this.$message.error(resp.msg)
212
+                  }
213
+                })
214
+                .catch(err => {
215
+                  this.loading = false
216
+                  this.$message.error(err)
217
+                })
218
+            } else {
219
+              this.form.role = this.form.role_ids.join(',')
220
+
221
+              modifyAdmin(
222
+                this.form.id,
223
+                this.form.name,
224
+                this.form.user_type,
225
+                this.form.user_title,
226
+                this.form.role,
227
+                this.form.intro,
228
+                this.form.user_title_name
229
+              )
230
+                .then(rs => {
231
+                  this.loading = false
232
+                  var resp = rs.data
233
+                  if (resp.state === 1) {
234
+                   console.log("11111111")
235
+                    this.$emit('did-edit-admin')
236
+
237
+                  } else {
238
+                    this.$message.error(resp.msg)
239
+                  }
240
+                })
241
+                .catch(err => {
242
+                  this.loading = false
243
+                  this.$message.error(err)
244
+                })
245
+            }
246
+          } else {
247
+            return false
248
+          }
249
+        })
250
+      },
251
+      close:function() {
252
+        this.dialogFormVisible= false
253
+
254
+      }
255
+    }
256
+  }
257
+</script>

+ 566 - 90
src/xt_pages/role/components/EditRole.vue View File

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

+ 346 - 0
src/xt_pages/role/components/PermissionSettings.vue View File

@@ -0,0 +1,346 @@
1
+<template>
2
+  <el-dialog class="settingDialog" title="角色权限配置" width="750px" :visible.sync="visible">
3
+    <div class="roleSettings">
4
+      <div class="roleName">
5
+        <div class="roleNameLeft">
6
+          <p>角色名称</p>
7
+          <el-input placeholder="请输入内容" v-model="role.name" :disabled="true"></el-input>
8
+        </div>
9
+        <p style="color:#338AFB" v-if="role.is_system == 0" @click="disableRoleAction(role.id)">删除该角色</p>
10
+      </div>
11
+      <div class="roleMain" >
12
+        <div class="roleMainLeft" >
13
+          <p class="roletitle">选择权限</p>
14
+          <div class="roleMainLeftBox">
15
+            <!--<el-tree-->
16
+            <!--:props="defaultProps"-->
17
+            <!--:data="data"-->
18
+            <!--:default-checked-keys="data"-->
19
+            <!--node-key="id"-->
20
+            <!--ref="tree"-->
21
+            <!--default-expand-all-->
22
+            <!--show-checkbox-->
23
+            <!--&gt;-->
24
+            <!--&lt;!&ndash; <span class="custom-tree-node" slot-scope="{ node, data }">-->
25
+            <!--<span>{{ data.name }}</span>-->
26
+            <!--</span>&ndash;&gt;-->
27
+            <!--</el-tree>-->
28
+            <el-tree  v-loading="loading" :props="treeProps" :data="purviews" :default-checked-keys="default_checkeds" node-key="id"
29
+                     ref="tree" default-expand-all show-checkbox>
30
+                            <span class="custom-tree-node" slot-scope="{ node, data }">
31
+                                <span>{{ data.name }}</span>
32
+                            </span>
33
+            </el-tree>
34
+          </div>
35
+        </div>
36
+        <!--<div class="roleMainRight">-->
37
+        <!--<div class="hasChoose">已选择权限</div>-->
38
+        <!--<el-tree-->
39
+        <!--:props="treeProps" :data="check_purviews"   node-key="id" ref="tree" default-expand-all-->
40
+
41
+        <!--&gt;</el-tree>-->
42
+        <!--</div>-->
43
+      </div>
44
+    </div>
45
+    <div slot="footer" class="dialog-footer">
46
+      <el-button @click="hide">取 消</el-button>
47
+      <el-button type="primary" @click="submitAction" :loading="submitLoading">保 存</el-button>
48
+    </div>
49
+  </el-dialog>
50
+</template>
51
+
52
+<script>
53
+  import { editPurview, getEditPurviewInitData, setRoleStatus } from '@/api/role/role'
54
+
55
+  export default {
56
+    data() {
57
+      return {
58
+        visible: false,
59
+        loading: true,
60
+        submitLoading:false,
61
+        role_id: 0,
62
+        name: '',
63
+        role: {
64
+          name:"",
65
+        },
66
+        purviews: [],
67
+        treeProps: {
68
+          label: 'name',
69
+          children: 'childs'
70
+        },
71
+        default_checkeds: [],
72
+        check_purviews: [],
73
+        defaultProps: {
74
+          children: 'children',
75
+          label: 'label'
76
+        }
77
+      }
78
+    },
79
+    methods: {
80
+      disableRoleAction: function(id) {
81
+        this.$msgbox({
82
+          title: '提示',
83
+          message: '是否确定要移除该角色',
84
+          showCancelButton: true,
85
+          confirmButtonText: '确定',
86
+          cancelButtonText: '取消',
87
+          type: 'warning',
88
+          beforeClose: (action, instance, done) => {
89
+            if (action === "confirm") {
90
+
91
+              instance.confirmButtonLoading = true;
92
+              instance.confirmButtonText = "移除中...";
93
+              setRoleStatus(id, false)
94
+                .then(rs => {
95
+                  done();
96
+                  instance.confirmButtonLoading = false;
97
+                  const resp = rs.data
98
+                  if (resp.state === 1) {
99
+                    this.$emit('delete')
100
+                  } else {
101
+                    this.$message.error(resp.msg)
102
+                  }
103
+                })
104
+                .catch(err => {
105
+                  done();
106
+                  this.$message.error(err);
107
+                  instance.confirmButtonLoading = false;
108
+                })
109
+            }else{
110
+
111
+              done();
112
+            }
113
+          }
114
+        })
115
+      },
116
+
117
+      submitAction: function() {
118
+
119
+        if (this.role_id <= 0) {
120
+          return
121
+        }
122
+
123
+        var checkeds = this.$refs.tree.getCheckedKeys(true)
124
+
125
+        var ids = []
126
+        var func_ids = []
127
+
128
+        if (checkeds.length > 0) {
129
+          this.purviews.forEach(purview => {
130
+            if (purview.childs != null && purview.childs.length > 0) {
131
+              purview.childs.forEach(childs => {
132
+                if (childs.childs == null) {
133
+                  if (checkeds.indexOf(childs.id) != -1) {
134
+                    if (ids.indexOf(purview.id) == -1) {
135
+                      ids.push(purview.id)
136
+                    }
137
+                    ids.push(childs.id)
138
+
139
+                  }
140
+                } else {
141
+                  console.log(childs.name)
142
+                  if (childs.name == '透析记录') {
143
+
144
+                    childs.childs.forEach(child => {
145
+                      if (checkeds.indexOf(child.id) != -1) {
146
+                        if (func_ids.indexOf(childs.id) == -1) {
147
+                          func_ids.push(childs.id)
148
+                        }
149
+                        func_ids.push(child.id)
150
+                      }
151
+                    })
152
+                  } else {
153
+                    childs.childs.forEach(child => {
154
+                      if (checkeds.indexOf(child.id) != -1) {
155
+                        if (ids.indexOf(childs.id) == -1) {
156
+                          ids.push(childs.id)
157
+                        }
158
+                        ids.push(child.id)
159
+                      }
160
+                    })
161
+
162
+                  }
163
+
164
+                }
165
+              })
166
+
167
+            } else {
168
+              if (checkeds.indexOf(purview.id) != -1) {
169
+                ids.push(purview.id)
170
+              }
171
+            }
172
+          })
173
+        }
174
+        var idsStr = ''
175
+        if (ids.length > 0) {
176
+          idsStr = ids.join(',')
177
+        }
178
+
179
+        var funcIdsStr = ''
180
+        if (func_ids.length > 0) {
181
+          funcIdsStr = func_ids.join(',')
182
+        }
183
+        this.submitLoading = true
184
+        editPurview(this.role_id, idsStr, funcIdsStr).then(rs => {
185
+          var resp = rs.data
186
+          this.submitLoading = false
187
+
188
+          if (resp.state === 1) {
189
+            this.hide()
190
+          } else {
191
+            this.$message.error(resp.msg)
192
+          }
193
+        }).catch(err => {
194
+          this.submitLoading = false
195
+          this.$message.error(err)
196
+        })
197
+      },
198
+
199
+      show(role_id) {
200
+        this.loading = true
201
+        this.visible = true
202
+        this.default_checkeds = []
203
+        this.purviews = []
204
+
205
+
206
+
207
+        var id = parseInt(role_id)
208
+        if (id <= 0) {
209
+          this.$message.error('参数错误')
210
+          return
211
+        }
212
+        this.role_id = role_id
213
+        getEditPurviewInitData(this.role_id).then(rs => {
214
+          var resp = rs.data
215
+          if (resp.state === 1) {
216
+            this.role = resp.data.role
217
+            this.purviews.push(...resp.data.purviews)
218
+            // 初始化默认选中项
219
+            var role_purview_ids = resp.data.role_purview_ids
220
+            var checkeds = []
221
+            if (role_purview_ids.length > 0) {
222
+              var ids = role_purview_ids.split(',')
223
+              this.purviews.forEach(purview => {
224
+                if (purview.childs != null && purview.childs.length > 0) {
225
+                  purview.childs.forEach(childs => {
226
+
227
+                    if (childs.childs != null && childs.childs.length > 0) {
228
+                      childs.childs.forEach(child => {
229
+                        if (ids.indexOf(child.id + '') != -1) {
230
+                          checkeds.push(child.id)
231
+                        }
232
+                      })
233
+
234
+                      }else{
235
+                      if (ids.indexOf(childs.id + '') != -1) {
236
+                        checkeds.push(childs.id)
237
+                      }
238
+                    }
239
+                  })
240
+
241
+                } else {
242
+                  if (ids.indexOf(purview.id + '') != -1) {
243
+                    checkeds.push(purview.id)
244
+                  }
245
+                }
246
+              })
247
+            }
248
+
249
+
250
+
251
+            this.$nextTick(() => {
252
+              this.default_checkeds = checkeds
253
+            })
254
+
255
+            this.loading = false
256
+
257
+          } else {
258
+            this.loading = false
259
+
260
+            this.$message.error(resp.msg)
261
+          }
262
+        }).catch(err => {
263
+          this.loading = false
264
+
265
+          this.$message.error(err)
266
+        })
267
+      },
268
+      hide() {
269
+        this.visible =false
270
+
271
+      }
272
+
273
+    }, created() {
274
+
275
+    }
276
+  }
277
+</script>
278
+
279
+<style lang="scss" scoped>
280
+  .roleSettings {
281
+
282
+  .roleName {
283
+    display: flex;
284
+    align-items: center;
285
+    justify-content: space-between;
286
+  }
287
+
288
+  .roleNameLeft {
289
+    display: flex;
290
+    align-items: center;
291
+
292
+  p {
293
+    width: 100px;
294
+  }
295
+
296
+  }
297
+  .roleMain {
298
+    display: flex;
299
+    justify-content: space-between;
300
+    margin-top: 18px;
301
+
302
+  .roleMainLeft {
303
+    display: flex;
304
+
305
+  .roletitle {
306
+    width: 74px;
307
+  }
308
+
309
+  .roleMainLeftBox {
310
+    width: 500px;
311
+    height: 706px;
312
+    overflow-y: auto;
313
+    border: 1px solid rgba(234, 238, 240, 1);
314
+    border-radius: 4px;
315
+    padding: 20px 0 0 10px;
316
+  }
317
+
318
+  }
319
+  .roleMainRight {
320
+    width: 280px;
321
+    height: 706px;
322
+    overflow-y: auto;
323
+    border: 1px solid rgba(235, 238, 240, 1);
324
+    color: #303133;
325
+
326
+  .hasChoose {
327
+    height: 42px;
328
+    line-height: 42px;
329
+    padding-left: 20px;
330
+    background: #f6f8f9;
331
+  }
332
+
333
+  }
334
+  }
335
+  }
336
+</style>
337
+
338
+<style lang="scss">
339
+  .settingDialog {
340
+
341
+  .el-dialog__body {
342
+    max-height: 600px !important;
343
+  }
344
+
345
+  }
346
+</style>

+ 242 - 0
src/xt_pages/role/components/UserManagement.vue View File

@@ -0,0 +1,242 @@
1
+<template>
2
+  <div>
3
+  <el-dialog class="userDialog" title="用户管理" width="660px" :visible.sync="visible">
4
+    <div class="userManagement">
5
+      <el-table
6
+        v-loading="loading"
7
+        :row-style="{ color: '#303133' }"
8
+        :header-cell-style="{
9
+          backgroundColor: 'rgb(245, 247, 250)',
10
+          color: '#606266'
11
+        }"
12
+        style="width:100%;"
13
+        ref="table"
14
+        border
15
+        :data="admin_user"
16
+      >
17
+        <el-table-column prop="name" label="员工姓名" width="120">
18
+          <template slot-scope="scope">
19
+            {{scope.row.user_name}}
20
+          </template>
21
+        </el-table-column>
22
+        <!--<el-table-column prop="date" label="登录账号" width="120">-->
23
+          <!--<template slot-scope="scope">-->
24
+            <!--{{}}-->
25
+          <!--</template>-->
26
+        <!--</el-table-column>-->
27
+        <el-table-column prop="date" label="最后登录时间" width="180">
28
+          <template slot-scope="scope">
29
+             <span>{{
30
+              scope.row.last_login_time == 0
31
+                ? ""
32
+                : _parseTime(scope.row.last_login_time, "{y}-{m}-{d} {h}:{i}")
33
+            }}</span>
34
+          </template>
35
+
36
+        </el-table-column>
37
+        <el-table-column label="操作" >
38
+          <template slot-scope="scope" style="text-align: center">
39
+            <el-tooltip class="item" effect="dark" content="编辑" placement="top">
40
+              <el-button  type="primary" icon="el-icon-edit-outline" size="small"
41
+                         v-if="org.creator != scope.row.user_id && (scope.row.user_id != local_user_id) && !scope.row.is_sub_super_admin"
42
+                         @click="openForm(scope.row.user_id, role_id)" ></el-button>
43
+            </el-tooltip>
44
+
45
+            <el-tooltip
46
+              class="item"
47
+              effect="dark"
48
+              content="移除"
49
+              placement="top"
50
+            >
51
+              <el-button
52
+                type="danger"
53
+                size="small"
54
+                icon="el-icon-delete"
55
+                v-if="scope.row.status == 1 && org.creator != scope.row.user_id && (scope.row.user_id != local_user_id) && !scope.row.is_sub_super_admin"
56
+                @click="disableAdminAction(scope.row)"
57
+              ></el-button>
58
+            </el-tooltip>
59
+
60
+            <el-tooltip
61
+              class="item"
62
+              effect="dark"
63
+              content="恢复"
64
+              placement="top"
65
+            >
66
+              <el-button
67
+                size="small"
68
+                type="info"
69
+                icon="el-icon-refresh"
70
+                v-if="scope.row.status == 0 && org.creator != scope.row.user_id  && (scope.row.user_id != local_user_id ) && !scope.row.is_sub_super_admin"
71
+                @click="recoverAdminAction(scope.row)"
72
+              ></el-button>
73
+            </el-tooltip>
74
+
75
+          </template>
76
+        </el-table-column>
77
+      </el-table>
78
+    </div>
79
+  </el-dialog>
80
+  <!--<admin-info-form ref="admininfoform"></admin-info-form>-->
81
+    <admin-role-info-form ref="admininfoform"  @did-edit-admin="didModifyAdmin"></admin-role-info-form>
82
+  </div>
83
+</template>
84
+
85
+
86
+<script>
87
+  import { getRoleStaff } from '@/api/role/role'
88
+  import { parseTime } from "@/utils";
89
+  import { setAdminStatus } from "@/api/role/admin";
90
+  // import AdminInfoForm from './AdminInfoForm'
91
+  import AdminRoleInfoForm from './AdminRoleInfoForm'
92
+
93
+  export default {
94
+    components: { AdminRoleInfoForm },
95
+    data() {
96
+      return {
97
+        visible: false,
98
+        role_id: 0,
99
+        admin_user: [],
100
+        local_user_id: 0,
101
+        org:null,
102
+        loading:false,
103
+
104
+      }
105
+    },
106
+    methods: {
107
+      didModifyAdmin(){
108
+        this.GetAllStaff()
109
+        this.$refs["admininfoform"].close();
110
+
111
+      },
112
+      openForm(adminId,role_id) {
113
+        this.$refs["admininfoform"].open(adminId,role_id);
114
+      },
115
+      disableAdminAction: function(row) {
116
+        this.$msgbox({
117
+          title: "提示",
118
+          message: "是否确定要移除该用户",
119
+          showCancelButton: true,
120
+          confirmButtonText: "确定",
121
+          cancelButtonText: "取消",
122
+          type: "warning",
123
+          beforeClose: (action, instance, done) => {
124
+            if (action === "confirm") {
125
+              instance.confirmButtonLoading = true;
126
+              instance.confirmButtonText = "删除中...";
127
+
128
+              setAdminStatus(row.user_id, false)
129
+                .then(rs => {
130
+                  done();
131
+                  instance.confirmButtonLoading = false;
132
+
133
+                  const resp = rs.data;
134
+                  if (resp.state === 1) {
135
+                    row.status = 0;
136
+                  } else {
137
+                    this.$message.error(resp.msg);
138
+                  }
139
+                })
140
+                .catch(err => {
141
+                  done();
142
+                  instance.confirmButtonLoading = false;
143
+                  this.$message.error(err);
144
+                });
145
+            } else {
146
+              done();
147
+            }
148
+          }
149
+        });
150
+      },
151
+      recoverAdminAction: function(row) {
152
+        const loading = this.$loading({
153
+          lock: true,
154
+          text: "正在恢复管理员...",
155
+          spinner: "el-icon-loading",
156
+          background: "rgba(0, 0, 0, 0.7)"
157
+        });
158
+
159
+        setAdminStatus(row.user_id, true)
160
+          .then(rs => {
161
+            loading.close();
162
+
163
+            const resp = rs.data;
164
+            if (resp.state === 1) {
165
+              row.status = 1;
166
+            } else {
167
+              this.$message.error(resp.msg);
168
+            }
169
+          })
170
+          .catch(err => {
171
+            loading.close();
172
+            this.$message.error(err);
173
+          });
174
+      },
175
+      _parseTime(time, format) {
176
+        return parseTime(time, format);
177
+      },
178
+      GetAllStaff: function() {
179
+        this.loading = true
180
+
181
+        getRoleStaff().then(response => {
182
+          this.loading = false
183
+
184
+          if (response.data.state === 1) {
185
+            this.admin_user = response.data.data.admins
186
+            this.org = response.data.data.org
187
+
188
+            for (let i = 0; i < this.admin_user.length; i++) {
189
+              if (this.admin_user[i].role_ids.length > 0) {
190
+                let isExist = -1
191
+                let ids = this.admin_user[i].role_ids.split(',')
192
+                isExist = ids.indexOf(this.role_id.toString())
193
+                if (isExist < 0) {
194
+                  this.admin_user.splice(i, 1)
195
+                  i = i - 1
196
+                }
197
+              }
198
+            }
199
+          } else {
200
+
201
+            this.$toast({
202
+              message: response.data.msg
203
+            })
204
+          }
205
+        }).catch(err => {
206
+          this.loading = false
207
+          this.$message.error(err)
208
+        })
209
+      },
210
+
211
+      show(role_id) {
212
+        this.visible = true
213
+        this.role_id = role_id
214
+        this.admin_user = []
215
+        this.local_user_id = this.$store.getters.xt_user.user.id
216
+        this.local_user_id = 597
217
+        this.GetAllStaff()
218
+      }
219
+    }
220
+  }
221
+</script>
222
+
223
+<style lang="scss" scoped>
224
+  .userManagement {
225
+
226
+  .cell {
227
+    text-align: center;
228
+  }
229
+
230
+  }
231
+</style>
232
+
233
+
234
+<style lang="scss">
235
+  .userManagement {
236
+
237
+  .cell {
238
+    text-align: center;
239
+  }
240
+
241
+  }
242
+</style>

+ 163 - 68
src/xt_pages/role/role.vue View File

@@ -11,8 +11,8 @@
11 11
         >新增</el-button
12 12
       >
13 13
     </div>
14
-    <div class="app-container">
15
-      <el-table
14
+    <div class="app-container" v-loading="loading_roles">
15
+      <!-- <el-table
16 16
         :data="roles"
17 17
         v-loading="loading_roles"
18 18
         border
@@ -22,24 +22,11 @@
22 22
           color: '#606266'
23 23
         }"
24 24
       >
25
-        <el-table-column
26
-          label="角色名称"
27
-          prop="name"
28
-          min-width="20%"
29
-          align="center"
30
-        ></el-table-column>
31
-        <el-table-column
32
-          label="角色描述"
33
-          prop="intro"
34
-          min-width="25%"
35
-          align="center"
36
-        ></el-table-column>
25
+        <el-table-column label="角色名称" prop="name" min-width="20%" align="center"></el-table-column>
26
+        <el-table-column label="角色描述" prop="intro" min-width="25%" align="center"></el-table-column>
37 27
         <el-table-column label="状态" min-width="15%" align="center">
38 28
           <template slot-scope="scope">
39
-            <div
40
-              v-if="scope.row.status == 1"
41
-              style="color: #67C23A; font-size:20px;"
42
-            >
29
+            <div v-if="scope.row.status == 1" style="color: #67C23A; font-size:20px;">
43 30
               <li class="el-icon-success"></li>
44 31
             </div>
45 32
             <div v-else style="color: #F56C6C; font-size:20px;">
@@ -49,28 +36,12 @@
49 36
         </el-table-column>
50 37
         <el-table-column label="操作" width="180" align="center">
51 38
           <template slot-scope="scope">
52
-            <router-link
53
-              :to="{ path: '/role/perview', query: { id: scope.row.id } }"
54
-            >
55
-              <el-tooltip
56
-                class="item"
57
-                effect="dark"
58
-                content="权限设置"
59
-                placement="top"
60
-              >
61
-                <el-button
62
-                  type="warning"
63
-                  icon="el-icon-setting"
64
-                  size="small"
65
-                ></el-button>
39
+            <router-link :to="{ path: '/role/perview', query: { id: scope.row.id } }">
40
+              <el-tooltip class="item" effect="dark" content="权限设置" placement="top">
41
+                <el-button type="warning" icon="el-icon-setting" size="small"></el-button>
66 42
               </el-tooltip>
67 43
             </router-link>
68
-            <el-tooltip
69
-              class="item"
70
-              effect="dark"
71
-              content="编辑"
72
-              placement="top"
73
-            >
44
+            <el-tooltip class="item" effect="dark" content="编辑" placement="top">
74 45
               <el-button
75 46
                 type="primary"
76 47
                 size="small"
@@ -79,12 +50,7 @@
79 50
               ></el-button>
80 51
             </el-tooltip>
81 52
 
82
-            <el-tooltip
83
-              class="item"
84
-              effect="dark"
85
-              content="移除"
86
-              placement="top"
87
-            >
53
+            <el-tooltip class="item" effect="dark" content="移除" placement="top">
88 54
               <el-button
89 55
                 type="danger"
90 56
                 size="small"
@@ -94,12 +60,7 @@
94 60
               ></el-button>
95 61
             </el-tooltip>
96 62
 
97
-            <el-tooltip
98
-              class="item"
99
-              effect="dark"
100
-              content="恢复"
101
-              placement="top"
102
-            >
63
+            <el-tooltip class="item" effect="dark" content="恢复" placement="top">
103 64
               <el-button
104 65
                 type="info"
105 66
                 size="small"
@@ -122,26 +83,80 @@
122 83
             layout="total, prev, pager, next, jumper"
123 84
           ></el-pagination>
124 85
         </el-col>
125
-      </el-row>
86
+      </el-row>-->
126 87
 
127 88
       <edit-role
128 89
         ref="edit_role"
129
-        @did-add-role="didAddRole"
130 90
         @did-edit-role="didModifyRole"
131 91
       ></edit-role>
92
+
93
+      <add-role
94
+        ref="add_role"
95
+        @did-add-role="didAddRole"
96
+      ></add-role>
97
+
98
+      <permission-settings ref="permission_settings" @delete="deleteRole()"></permission-settings>
99
+      <user-management ref="user_management"></user-management>
100
+
101
+      <div class="roleTitle">
102
+        <i class="el-icon-warning warn"></i>
103
+        <p>
104
+          根据员工的职能选择角色,然后新增账号,可以自定义角色,进行权限配置
105
+        </p>
106
+      </div>
107
+      <div class="roleBox">
108
+        <div class="roleOne" v-for="item in this.roles">
109
+          <div class="setting">
110
+            <i class="el-icon-setting"></i>
111
+            <span style="margin-right:20px" @click="onClick(item.id)">权限配置</span>
112
+          </div>
113
+          <div class="avatar">
114
+            <img v-if="item.name == '子管理员'" src="../../assets/img/pc1.png" alt=""/>
115
+            <img v-else-if="item.name == '医生'" src="../../assets/img/pc2.png" alt=""/>
116
+            <img v-else-if="item.name == '护士'" src="../../assets/img/pc3.png" alt=""/>
117
+            <img v-else-if="item.name == '库存'" src="../../assets/img/pc4.png" alt=""/>
118
+            <img v-else-if="item.name == '院长'" src="../../assets/img/pc5.png" alt=""/>
119
+            <img v-else-if="item.name == '运营'"  src="../../assets/img/pc6.png" alt=""/>
120
+            <img v-else-if="item.name == '技师'"  src="../../assets/img/pc7.png" alt=""/>
121
+            <img v-else  src="../../assets/img/pc1.png" alt=""/>
122
+
123
+
124
+
125
+            <p class="avatarname">{{item.name}}</p>
126
+          </div>
127
+          <div class="roleTip">
128
+           {{item.intro}}
129
+          </div>
130
+          <div class="roleTxt">
131
+            该角色目前已配置
132
+            <span style="color:#4A8AF3">{{item.staff_number}}</span> 个员工
133
+          </div>
134
+          <div class="btnBox">
135
+            <el-button @click="addStaff(item.id)">新增用户</el-button>
136
+            <el-button @click="onClickManagement(item.id)">用户管理</el-button>
137
+          </div>
138
+        </div>
139
+
140
+      </div>
132 141
     </div>
133 142
   </div>
134 143
 </template>
135 144
 
136 145
 <script>
137 146
 import EditRole from "./components/EditRole.vue";
138
-import { getRoles, setRoleStatus } from "@/api/role/role";
147
+import PermissionSettings from "./components/PermissionSettings.vue";
148
+import { getRoles, setRoleStatus,getRolesList } from "@/api/role/role";
149
+import UserManagement from "./components/UserManagement.vue";
139 150
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
151
+import AddRole from './components/AddRole'
140 152
 
141 153
 export default {
142 154
   components: {
155
+    AddRole,
143 156
     EditRole,
144
-    BreadCrumb
157
+    BreadCrumb,
158
+    PermissionSettings,
159
+    UserManagement
145 160
   },
146 161
   data: function() {
147 162
     return {
@@ -159,16 +174,25 @@ export default {
159 174
     this.requestRoleWithPage(1);
160 175
   },
161 176
   methods: {
177
+    addStaff(role_id){
178
+      this.$refs.edit_role.show(role_id);
179
+
180
+    },
162 181
     requestRoleWithPage: function(page) {
163 182
       this.roles.splice(0, this.roles.length);
164 183
       this.loading_roles = true;
165
-      getRoles(page)
184
+      getRolesList(page)
166 185
         .then(rs => {
167 186
           this.loading_roles = false;
168 187
           const resp = rs.data;
169 188
           if (resp.state === 1) {
170
-            this.roles.push(...resp.data.roles);
171
-            this.role_total_count = resp.data.total_count;
189
+
190
+            for (let i = 0; i < resp.data.roles.length; i++) {
191
+              if (!resp.data.roles[i].is_super_admin) {
192
+                this.roles.push(resp.data.roles[i])
193
+              }
194
+            }
195
+            // this.roles.push(...resp.data.roles);
172 196
           } else {
173 197
             this.$message.error(resp.msg);
174 198
           }
@@ -180,7 +204,7 @@ export default {
180 204
     },
181 205
     addRoleAction: function() {
182 206
       // 父组件调用子组件方法 https://segmentfault.com/a/1190000009525355
183
-      this.$refs.edit_role.show();
207
+      this.$refs.add_role.show();
184 208
     },
185 209
     modifyRoleAction: function(row) {
186 210
       this.$refs.edit_role.modify(row.id, row.name, row.intro);
@@ -245,20 +269,26 @@ export default {
245 269
           this.$message.error(err);
246 270
         });
247 271
     },
248
-    didAddRole: function(id, name, intro, status) {
249
-      this.roles.push({ id: id, name: name, intro: intro, status: status });
272
+    didAddRole: function(id, name, intro, status,staff_number) {
273
+      this.roles.push({ id: id, name: name, intro: intro, status: status ,staff_number: staff_number});
250 274
     },
251
-    didModifyRole: function(id, name, intro) {
252
-      this.roles.forEach(role => {
253
-        if (role.id === id) {
254
-          role.name = name;
255
-          role.intro = intro;
256
-          return false;
257
-        }
258
-      });
275
+    didModifyRole: function() {
276
+      this.requestRoleWithPage(1);
277
+
259 278
     },
260 279
     pageChange: function(nextPage) {
261 280
       this.requestRoleWithPage(nextPage);
281
+    },
282
+    ///
283
+
284
+    onClick(role_id) {
285
+      this.$refs.permission_settings.show(role_id);
286
+    },
287
+    onClickManagement(role_id) {
288
+      this.$refs.user_management.show(role_id);
289
+    },deleteRole(){
290
+      this.$refs.permission_settings.hide();
291
+      this.requestRoleWithPage(1);
262 292
     }
263 293
   }
264 294
 };
@@ -267,6 +297,71 @@ export default {
267 297
 .el-button + .el-button {
268 298
   margin-left: 0 !important;
269 299
 }
300
+.roleTitle {
301
+  display: flex;
302
+  align-items: center;
303
+  font-size: 14px;
304
+  margin-bottom: 24px;
305
+  .warn {
306
+    font-size: 18px;
307
+    color: #409eff;
308
+    margin-right: 5px;
309
+  }
310
+}
311
+.roleBox {
312
+  display: flex;
313
+  flex-wrap: wrap;
314
+  .roleOne {
315
+    width: 280px;
316
+    height: 350px;
317
+    margin: 0 15px 20px;
318
+    border: 1px solid rgba(235, 238, 240, 1);
319
+    border-radius: 4px;
320
+    overflow: hidden;
321
+  }
322
+  .setting {
323
+    // float: right;
324
+    text-align: right;
325
+    margin-right: 20px;
326
+    margin-top: 20px;
327
+    width: 100%;
328
+    color: #313234;
329
+  }
330
+  .avatar {
331
+    width: 100%;
332
+    display: flex;
333
+    justify-content: space-around;
334
+    flex-direction: column;
335
+    align-items: center;
336
+    img {
337
+      width: 60px;
338
+      height: 60px;
339
+      margin: 10px 0;
340
+    }
341
+    .avatarname {
342
+      font-size: 18px;
343
+    }
344
+  }
345
+  .roleTip {
346
+    width: 82%;
347
+    margin: 20px auto 10px;
348
+    font-size: 14px;
349
+    color: #989898;
350
+  }
351
+  .roleTxt {
352
+    width: 82%;
353
+    margin: 0 auto;
354
+    font-size: 14px;
355
+    color: #666666;
356
+  }
357
+  .btnBox {
358
+    width: 82%;
359
+    margin: 0 auto;
360
+    display: flex;
361
+    justify-content: space-between;
362
+    margin-top: 50px;
363
+  }
364
+}
270 365
 </style>
271 366
 <style>
272 367
 .el-table td,