浏览代码

护士端tab页根据权限控制

seimin 1 年之前
父节点
当前提交
27a4278c9b

+ 11 - 79
src/app/views/hushijiandan/hushijiandan.component.html

@@ -852,99 +852,31 @@
852 852
                   </div>
853 853
                 </ng-template>
854 854
                 <div class="tab borderB" nz-row style="padding: 4px 0">
855
-                  <div
856
-                    nz-col
857
-                    nzSpan="3"
858
-                    [ngClass]="{
859
-                      txtC: true,
860
-                      cur: true,
861
-                      checked: checkedTableType == 'other'
862
-                    }"
863
-                    (click)="checkTable('other')"
864
-                  >
855
+                  <div *ngIf="coopBtns.buildOrdersForOtherTasks" nz-col nzSpan="3" [ngClass]="{txtC: true, cur: true, checked: checkedTableType == 'other'}" (click)="checkTable('other')">
865 856
                     <div class="text">其他任务建单</div>
866 857
                   </div>
867
-                  <div
868
-                    nz-col
869
-                    nzSpan="3"
870
-                    [ngClass]="{
871
-                      txtC: true,
872
-                      cur: true,
873
-                      checked: checkedTableType == 'advice'
874
-                    }"
875
-                    (click)="checkTable('advice')"
876
-                  >
858
+                  <div *ngIf="coopBtns.suggestionBox" nz-col nzSpan="3" [ngClass]="{txtC: true, cur: true, checked: checkedTableType == 'advice'}" (click)="checkTable('advice')">
877 859
                     <div class="text">意见箱</div>
878 860
                   </div>
879
-                  <div
880
-                    nz-col
881
-                    nzSpan="3"
882
-                    [ngClass]="{
883
-                      txtC: true,
884
-                      cur: true,
885
-                      checked: checkedTableType == 'historySpecimen'
886
-                    }"
887
-                    (click)="checkTable('historySpecimen')"
888
-                  >
861
+                  <div *ngIf="coopBtns.inquiryOfHistoricalSpecimens" nz-col nzSpan="3" [ngClass]="{txtC: true, cur: true, checked: checkedTableType == 'historySpecimen'}" (click)="checkTable('historySpecimen')">
889 862
                     <div class="text">历史标本查询</div>
890 863
                   </div>
891
-                  <div
892
-                    nz-col
893
-                    nzSpan="3"
894
-                    [ngClass]="{
895
-                      txtC: true,
896
-                      cur: true,
897
-                      checked: checkedTableType == 'historyDrugsbag'
898
-                    }"
899
-                    (click)="checkTable('historyDrugsbag')"
900
-                  >
864
+                  <div *ngIf="coopBtns.historicalMedicineListInquiry" nz-col nzSpan="3" [ngClass]="{txtC: true, cur: true, checked: checkedTableType == 'historyDrugsbag'}" (click)="checkTable('historyDrugsbag')">
901 865
                     <div class="text">历史药单查询</div>
902 866
                   </div>
903
-                  <div
904
-                    *ngIf="isShowBx"
905
-                    nz-col
906
-                    nzSpan="3"
907
-                    [ngClass]="{
908
-                      txtC: true,
909
-                      cur: true,
910
-                      checked: checkedTableType == 'kjbx'
911
-                    }"
912
-                    (click)="checkTable('kjbx')"
913
-                  >
867
+                  <div *ngIf="coopBtns.quickReportForRepair && isShowBx" nz-col nzSpan="3" [ngClass]="{txtC: true, cur: true, checked: checkedTableType == 'kjbx'}" (click)="checkTable('kjbx')">
914 868
                     <div class="text">快捷报修</div>
915 869
                   </div>
916
-                  <div
917
-                    *ngIf="isShowBx"
918
-                    nz-col
919
-                    nzSpan="3"
920
-                    [ngClass]="{
921
-                      txtC: true,
922
-                      cur: true,
923
-                      checked: checkedTableType == 'bxlb'
924
-                    }"
925
-                    (click)="checkTable('bxlb')"
926
-                  >
870
+                  <div *ngIf="coopBtns.repairList && isShowBx" nz-col nzSpan="3" [ngClass]="{txtC: true, cur: true, checked: checkedTableType == 'bxlb'}" (click)="checkTable('bxlb')">
927 871
                     <div class="text">
928 872
                       报修列表<strong class="red">&nbsp;({{processing}})</strong>
929 873
                     </div>
930 874
                   </div>
931
-                  <div
932
-                    nz-col
933
-                    nzSpan="{{ isShowBx ? 6 : 12 }}"
934
-                    class="txtC h100p alignR display_flex justify-content_flex-end align-items_center"
935
-                  >
936
-                    <div
937
-                      class="btn txtC"
938
-                      *ngIf="mainRole && loginUser.usertype.value != 1"
939
-                      (click)="toMain()"
940
-                    >
875
+                  <div nz-col nzSpan="6" style="float: right;" class="txtC h100p alignR display_flex justify-content_flex-end align-items_center">
876
+                    <div class="btn txtC" *ngIf="mainRole && loginUser.usertype.value != 1" (click)="toMain()">
941 877
                       回到系统管理
942 878
                     </div>
943
-                    <div
944
-                      class="btn txtC"
945
-                      *ngIf="mainRole && loginUser.usertype.value == 1"
946
-                      (click)="toOrder()"
947
-                    >
879
+                    <div class="btn txtC" *ngIf="mainRole && loginUser.usertype.value == 1" (click)="toOrder()">
948 880
                       查看工单
949 881
                     </div>
950 882
                   </div>
@@ -1887,7 +1819,7 @@
1887 1819
               </div>
1888 1820
               <!-- 快捷报修 -->
1889 1821
               <div
1890
-                *ngIf="checkedTableType == 'kjbx' && isShowBx"
1822
+                *ngIf="checkedTableType == 'kjbx' && isShowBx && coopBtns.quickReportForRepair"
1891 1823
                 style="flex: 1; height: 100%; display: flex"
1892 1824
               >
1893 1825
                 <div class="otherBox">
@@ -2075,7 +2007,7 @@
2075 2007
               </div>
2076 2008
               <!-- 报修列表 -->
2077 2009
               <div
2078
-                *ngIf="checkedTableType == 'bxlb' && isShowBx"
2010
+                *ngIf="checkedTableType == 'bxlb' && isShowBx && coopBtns.repairList"
2079 2011
                 style="flex: 1; height: 100%"
2080 2012
               >
2081 2013
                 <div

+ 44 - 4
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -11,7 +11,7 @@ import {
11 11
   FormGroup,
12 12
   FormControl,
13 13
 } from "@angular/forms";
14
-import { Router } from "@angular/router";
14
+import { Router, ActivatedRoute } from "@angular/router";
15 15
 
16 16
 import http from "../../../assets/js/http";
17 17
 import { MainService } from "../../services/main.service";
@@ -108,6 +108,7 @@ export class HushijiandanComponent implements OnInit {
108 108
     private message: NzMessageService,
109 109
     private fb: FormBuilder,
110 110
     public router: Router,
111
+    private route: ActivatedRoute,
111 112
     private mainService: MainService,
112 113
     private notification: NzNotificationService,
113 114
     private webs: WebsocketNurseService,
@@ -149,7 +150,11 @@ export class HushijiandanComponent implements OnInit {
149 150
   orderListTimeConst = 60; //工单列表自动刷新秒数
150 151
   deptDisplay; //护士端是否显示可以别名,1是显示科室名称,2是显示科室别名
151 152
 
153
+  // 初始化权限按钮
154
+  coopBtns: any = {};
155
+
152 156
   ngOnInit() {
157
+    this.getCoopBtns();
153 158
     this.currentHospital = this.tool.getCurrentHospital();
154 159
     this.tool.getDeptDisplay().subscribe((result) => {
155 160
       if (result.status == 200) {
@@ -260,6 +265,38 @@ export class HushijiandanComponent implements OnInit {
260 265
   jpDrugsWKOMsg: any = {}; //药品静配提示信息
261 266
   surgeryWKOMsg: any = {}; //手术提示信息
262 267
 
268
+
269
+  getCoopBtns(){
270
+    let menu: any = JSON.parse(localStorage.getItem("menu")) || []; //菜单
271
+    let coopBtns:any = {};
272
+    let nurseMenu = menu.find(v => v.link === 'nurse');
273
+    let nurseMenuChildren = nurseMenu.childrens || [];
274
+    nurseMenuChildren.forEach((e) => {
275
+      switch (e.link) {
276
+        case "suggestionBox":
277
+          coopBtns.suggestionBox = true; //意见箱
278
+          break;
279
+        case "inquiryOfHistoricalSpecimens":
280
+          coopBtns.inquiryOfHistoricalSpecimens = true; //历史标本查询
281
+          break;
282
+        case "historicalMedicineListInquiry":
283
+          coopBtns.historicalMedicineListInquiry = true; //历史药单查询
284
+          break;
285
+        case "quickReportForRepair":
286
+          coopBtns.quickReportForRepair = true; //快捷报修
287
+          break;
288
+        case "repairList":
289
+          coopBtns.repairList = true; //报修列表
290
+          break;
291
+        case "buildOrdersForOtherTasks":
292
+          coopBtns.buildOrdersForOtherTasks = true; //其他任务建单
293
+          break;
294
+      }
295
+    });
296
+    this.coopBtns = coopBtns;
297
+    console.log(this.coopBtns);
298
+  }
299
+
263 300
   // 切换综合日志和一键报修
264 301
   smallTabs = [];
265 302
   smallTabId = 2; //默认显示一键报修
@@ -418,7 +455,7 @@ export class HushijiandanComponent implements OnInit {
418 455
     this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe((result) => {
419 456
         if (result.status == 200) {
420 457
           this.isShowBx = result.list.find(v => v.key == 'hos_itsmIncident').value == 1;
421
-          if (this.isShowBx) {
458
+          if (this.isShowBx && (this.coopBtns.repairList || this.coopBtns.quickReportForRepair)) {
422 459
             this.smallTabs = [
423 460
               { id: 1, name: "综合日志" },
424 461
               { id: 2, name: "一键报修" },
@@ -3101,11 +3138,11 @@ export class HushijiandanComponent implements OnInit {
3101 3138
       this.getHistorySpecimen();
3102 3139
     } else if (type === "historyDrugsbag") {
3103 3140
       this.getHistoryDrugsbag();
3104
-    } else if (type === "bxlb" && this.isShowBx) {
3141
+    } else if (type === "bxlb" && this.isShowBx && this.coopBtns.repairList) {
3105 3142
       this.getBxlb();
3106 3143
       this.getIncidentState();
3107 3144
       this.getDegrees();
3108
-    } else if (type === "kjbx" && this.isShowBx) {
3145
+    } else if (type === "kjbx" && this.isShowBx && this.coopBtns.quickReportForRepair) {
3109 3146
       // this.getQuickBxlb();
3110 3147
       this.getIncidentcategory();
3111 3148
       // 获取报修的区域(所属院区)
@@ -3180,6 +3217,9 @@ export class HushijiandanComponent implements OnInit {
3180 3217
   adviceSearchInp: string = ""; //意见箱搜索
3181 3218
   adviceLoading = false;
3182 3219
   getAdvice() {
3220
+    if(!this.coopBtns.suggestionBox){
3221
+      return;
3222
+    }
3183 3223
     let that = this;
3184 3224
     let postData = {
3185 3225
       advice: {