Browse Source

修改权限

See999 5 years ago
parent
commit
b055e0a95f

+ 44 - 4
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue View File

@@ -9,29 +9,30 @@
9 9
     >
10 10
       <div class="txsj" v-show="showAdvicePanel">
11 11
         <el-button round @click="openGroupFrom" :loading="deleLoading"
12
+        :disabled="!is_has_create"
12 13
                    >
13 14
           新增医嘱
14 15
         </el-button>
15 16
 
16
-        <el-button v-if="currentRow != null" round
17
+        <el-button v-if="currentRow != null" round :disabled="!is_has_exce"
17 18
                    @click="execAdvice" :loading="deleLoading">执行医嘱
18 19
         </el-button>
19 20
         <el-button v-else disabled round @click="execAdvice" :loading="deleLoading">执行医嘱</el-button>
20 21
 
21
-        <el-button v-if="currentRow != null" round
22
+        <el-button v-if="currentRow != null" round :disabled="!is_has_check"
22 23
                    @click="checkAdvice" :loading="deleLoading">医嘱核对
23 24
         </el-button>
24 25
         <el-button v-else disabled round @click="checkAdvice" :loading="deleLoading">医嘱核对</el-button>
25 26
 
26 27
         <el-button
27
-          v-if="groupSelectRow != null"
28
+          v-if="groupSelectRow != null" :disabled="!is_has_modify && !is_has_modify_other"
28 29
           round @click="openEditGroupAdvice" :loading="deleLoading">修改医嘱
29 30
         </el-button>
30 31
         <el-button v-else disabled round @click="openEditGroupAdvice" :loading="deleLoading">修改医嘱</el-button>
31 32
 
32 33
 
33 34
         <el-button
34
-          v-if="groupSelectRow != null"
35
+          v-if="groupSelectRow != null" :disabled="!is_has_del && !is_has_del_other"
35 36
           round @click="openDeleteGroupAdvice" :loading="deleLoading">删除医嘱
36 37
         </el-button>
37 38
         <el-button v-else disabled round @click="openDeleteGroupAdvice" :loading="deleLoading">删除医嘱</el-button>
@@ -275,6 +276,8 @@
275 276
   } from '@/api/advice'
276 277
   import { getDataConfig } from '@/utils/data'
277 278
 
279
+  import request from '@/utils/request'
280
+
278 281
   export default {
279 282
     name: 'DoctorAdviceDialog',
280 283
     props: {
@@ -304,6 +307,14 @@
304 307
     },
305 308
     data() {
306 309
       return {
310
+        is_has_create:true,
311
+        is_has_exce:true,
312
+        is_has_check:true,
313
+        is_has_modify_exce:true,
314
+        is_has_modify:true,
315
+        is_has_modify_other:true,
316
+        is_has_del:true,
317
+        is_has_del_other:true,
307 318
         tempArr: [],
308 319
         execTimeDialogVisible: false,
309 320
         currentBoxClass: 'current-box-class',
@@ -1228,6 +1239,7 @@
1228 1239
       },
1229 1240
       show() {
1230 1241
         this.isVisibility = true
1242
+        this.getPermission()
1231 1243
       },
1232 1244
       hide() {
1233 1245
         this.isVisibility = false
@@ -1363,6 +1375,34 @@
1363 1375
         } else { // 是子药
1364 1376
           return row.advice_name + tempDrugSpecDesc + ' ' + tempPrescribingNumberDesc + tempSingleDoseDesc
1365 1377
         }
1378
+      },
1379
+      getPermission() {
1380
+        request.get("/api/func_per/get", {
1381
+          params: {
1382
+            create_url: "/api/patients/advice/creategroup?mode=1",
1383
+            modify_url: "/api/patients/advice/edit?mode=2",
1384
+            modify_other_url: "/api/patients/advice/edit?mode=3",
1385
+            del_url: "/api/patients/advice/delete?mode=4",
1386
+            del_other_url: "/api/patients/advice/delete?mode=5",
1387
+            exce_url: "/api/patients/advice/exec?mode=6",
1388
+            check_url: "/api/patients/advice/check?mode=7",
1389
+            module: 4
1390
+          }
1391
+        }).then(res => {
1392
+          console.log(res)
1393
+          if (res.data.state == 0) {
1394
+            this.hasPermission = false
1395
+          } else if (res.data.state == 1) {
1396
+            this.is_has_create = res.data.data.is_has_create
1397
+            this.is_has_exce = res.data.data.is_has_exce
1398
+            this.is_has_check = res.data.data.is_has_check
1399
+            this.is_has_modify = res.data.data.is_has_modify
1400
+            this.is_has_modify_other = res.data.data.is_has_modify_other
1401
+            this.is_has_modify_exce = res.data.data.is_has_modify_exce
1402
+            this.is_has_del = res.data.data.is_has_del
1403
+            this.is_has_del_other = res.data.data.is_has_del_other
1404
+          }
1405
+        })
1366 1406
       }
1367 1407
 
1368 1408
     },

+ 38 - 4
src/xt_pages/dialysis/details/dialog/monitor_dialog.vue View File

@@ -9,9 +9,9 @@
9 9
     >
10 10
       <div v-show="edit == false">
11 11
         <div class="txsj">
12
-          <el-button round @click="newRecordAction">新增监测</el-button>
13
-          <el-button round @click="modifyRecordAction">修改监测</el-button>
14
-          <el-button round @click="deleteRecordAction">删除监测</el-button>
12
+          <el-button round :disabled="!is_has_create" @click="newRecordAction">新增监测</el-button>
13
+          <el-button round :disabled="!is_has_modify && !is_has_modify_other" @click="modifyRecordAction">修改监测</el-button>
14
+          <el-button round :disabled="!is_has_del && !is_has_del_other" @click="deleteRecordAction">删除监测</el-button>
15 15
         </div>
16 16
         <el-table
17 17
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
@@ -593,10 +593,17 @@ import {
593 593
 } from "@/api/dialysis_record";
594 594
 import store from "@/store";
595 595
 
596
+import request from '@/utils/request'
597
+
596 598
 export default {
597 599
   name: "MonitorDialog",
598 600
   data() {
599 601
     return {
602
+      is_has_create:true,
603
+      is_has_modify:true,
604
+      is_has_modify_other:true,
605
+      is_has_del:true,
606
+      is_has_del_other:true,
600 607
       visible: false,
601 608
       edit: false,
602 609
       current_row_class: "current-box-class",
@@ -701,6 +708,7 @@ export default {
701 708
       this.cancelEditAction();
702 709
     },
703 710
     show() {
711
+      this.getPermission()
704 712
       this.visible = true;
705 713
     },
706 714
     hide() {
@@ -1159,7 +1167,33 @@ export default {
1159 1167
           });
1160 1168
         })
1161 1169
         .catch(() => {});
1162
-    }
1170
+    },
1171
+    getPermission() {
1172
+        request.get("/api/func_per/get", {
1173
+          params: {
1174
+            create_url: "/api/dislysis/monitor/edit?mode=1",
1175
+            modify_url: "/api/dislysis/monitor/edit?mode=2",
1176
+            modify_other_url: "/api/dislysis/monitor/edit?mode=3",
1177
+            del_url: "/api/dialysis/monitor/del?mode=4",
1178
+            del_other_url: "/api/dialysis/monitor/del?mode=5",
1179
+            module: 7
1180
+          }
1181
+        }).then(res => {
1182
+          console.log(res)
1183
+          if (res.data.state == 0) {
1184
+            this.hasPermission = false
1185
+          } else if (res.data.state == 1) {
1186
+            this.is_has_create = res.data.data.is_has_create
1187
+            this.is_has_exce = res.data.data.is_has_exce
1188
+            this.is_has_check = res.data.data.is_has_check
1189
+            this.is_has_modify = res.data.data.is_has_modify
1190
+            this.is_has_modify_other = res.data.data.is_has_modify_other
1191
+            this.is_has_modify_exce = res.data.data.is_has_modify_exce
1192
+            this.is_has_del = res.data.data.is_has_del
1193
+            this.is_has_del_other = res.data.data.is_has_del_other
1194
+          }
1195
+        })
1196
+      }
1163 1197
   }
1164 1198
 };
1165 1199
 </script>