浏览代码

护士端tab页根据权限控制

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

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

@@ -852,99 +852,31 @@
852
                   </div>
852
                   </div>
853
                 </ng-template>
853
                 </ng-template>
854
                 <div class="tab borderB" nz-row style="padding: 4px 0">
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
                     <div class="text">其他任务建单</div>
856
                     <div class="text">其他任务建单</div>
866
                   </div>
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
                     <div class="text">意见箱</div>
859
                     <div class="text">意见箱</div>
878
                   </div>
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
                     <div class="text">历史标本查询</div>
862
                     <div class="text">历史标本查询</div>
890
                   </div>
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
                     <div class="text">历史药单查询</div>
865
                     <div class="text">历史药单查询</div>
902
                   </div>
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
                     <div class="text">快捷报修</div>
868
                     <div class="text">快捷报修</div>
915
                   </div>
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
                     <div class="text">
871
                     <div class="text">
928
                       报修列表<strong class="red">&nbsp;({{processing}})</strong>
872
                       报修列表<strong class="red">&nbsp;({{processing}})</strong>
929
                     </div>
873
                     </div>
930
                   </div>
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
                     </div>
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
                     </div>
881
                     </div>
950
                   </div>
882
                   </div>
@@ -1887,7 +1819,7 @@
1887
               </div>
1819
               </div>
1888
               <!-- 快捷报修 -->
1820
               <!-- 快捷报修 -->
1889
               <div
1821
               <div
1890
-                *ngIf="checkedTableType == 'kjbx' && isShowBx"
1822
+                *ngIf="checkedTableType == 'kjbx' && isShowBx && coopBtns.quickReportForRepair"
1891
                 style="flex: 1; height: 100%; display: flex"
1823
                 style="flex: 1; height: 100%; display: flex"
1892
               >
1824
               >
1893
                 <div class="otherBox">
1825
                 <div class="otherBox">
@@ -2075,7 +2007,7 @@
2075
               </div>
2007
               </div>
2076
               <!-- 报修列表 -->
2008
               <!-- 报修列表 -->
2077
               <div
2009
               <div
2078
-                *ngIf="checkedTableType == 'bxlb' && isShowBx"
2010
+                *ngIf="checkedTableType == 'bxlb' && isShowBx && coopBtns.repairList"
2079
                 style="flex: 1; height: 100%"
2011
                 style="flex: 1; height: 100%"
2080
               >
2012
               >
2081
                 <div
2013
                 <div

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

@@ -11,7 +11,7 @@ import {
11
   FormGroup,
11
   FormGroup,
12
   FormControl,
12
   FormControl,
13
 } from "@angular/forms";
13
 } from "@angular/forms";
14
-import { Router } from "@angular/router";
14
+import { Router, ActivatedRoute } from "@angular/router";
15
 
15
 
16
 import http from "../../../assets/js/http";
16
 import http from "../../../assets/js/http";
17
 import { MainService } from "../../services/main.service";
17
 import { MainService } from "../../services/main.service";
@@ -108,6 +108,7 @@ export class HushijiandanComponent implements OnInit {
108
     private message: NzMessageService,
108
     private message: NzMessageService,
109
     private fb: FormBuilder,
109
     private fb: FormBuilder,
110
     public router: Router,
110
     public router: Router,
111
+    private route: ActivatedRoute,
111
     private mainService: MainService,
112
     private mainService: MainService,
112
     private notification: NzNotificationService,
113
     private notification: NzNotificationService,
113
     private webs: WebsocketNurseService,
114
     private webs: WebsocketNurseService,
@@ -149,7 +150,11 @@ export class HushijiandanComponent implements OnInit {
149
   orderListTimeConst = 60; //工单列表自动刷新秒数
150
   orderListTimeConst = 60; //工单列表自动刷新秒数
150
   deptDisplay; //护士端是否显示可以别名,1是显示科室名称,2是显示科室别名
151
   deptDisplay; //护士端是否显示可以别名,1是显示科室名称,2是显示科室别名
151
 
152
 
153
+  // 初始化权限按钮
154
+  coopBtns: any = {};
155
+
152
   ngOnInit() {
156
   ngOnInit() {
157
+    this.getCoopBtns();
153
     this.currentHospital = this.tool.getCurrentHospital();
158
     this.currentHospital = this.tool.getCurrentHospital();
154
     this.tool.getDeptDisplay().subscribe((result) => {
159
     this.tool.getDeptDisplay().subscribe((result) => {
155
       if (result.status == 200) {
160
       if (result.status == 200) {
@@ -260,6 +265,38 @@ export class HushijiandanComponent implements OnInit {
260
   jpDrugsWKOMsg: any = {}; //药品静配提示信息
265
   jpDrugsWKOMsg: any = {}; //药品静配提示信息
261
   surgeryWKOMsg: any = {}; //手术提示信息
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
   smallTabs = [];
301
   smallTabs = [];
265
   smallTabId = 2; //默认显示一键报修
302
   smallTabId = 2; //默认显示一键报修
@@ -418,7 +455,7 @@ export class HushijiandanComponent implements OnInit {
418
     this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe((result) => {
455
     this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe((result) => {
419
         if (result.status == 200) {
456
         if (result.status == 200) {
420
           this.isShowBx = result.list.find(v => v.key == 'hos_itsmIncident').value == 1;
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
             this.smallTabs = [
459
             this.smallTabs = [
423
               { id: 1, name: "综合日志" },
460
               { id: 1, name: "综合日志" },
424
               { id: 2, name: "一键报修" },
461
               { id: 2, name: "一键报修" },
@@ -3101,11 +3138,11 @@ export class HushijiandanComponent implements OnInit {
3101
       this.getHistorySpecimen();
3138
       this.getHistorySpecimen();
3102
     } else if (type === "historyDrugsbag") {
3139
     } else if (type === "historyDrugsbag") {
3103
       this.getHistoryDrugsbag();
3140
       this.getHistoryDrugsbag();
3104
-    } else if (type === "bxlb" && this.isShowBx) {
3141
+    } else if (type === "bxlb" && this.isShowBx && this.coopBtns.repairList) {
3105
       this.getBxlb();
3142
       this.getBxlb();
3106
       this.getIncidentState();
3143
       this.getIncidentState();
3107
       this.getDegrees();
3144
       this.getDegrees();
3108
-    } else if (type === "kjbx" && this.isShowBx) {
3145
+    } else if (type === "kjbx" && this.isShowBx && this.coopBtns.quickReportForRepair) {
3109
       // this.getQuickBxlb();
3146
       // this.getQuickBxlb();
3110
       this.getIncidentcategory();
3147
       this.getIncidentcategory();
3111
       // 获取报修的区域(所属院区)
3148
       // 获取报修的区域(所属院区)
@@ -3180,6 +3217,9 @@ export class HushijiandanComponent implements OnInit {
3180
   adviceSearchInp: string = ""; //意见箱搜索
3217
   adviceSearchInp: string = ""; //意见箱搜索
3181
   adviceLoading = false;
3218
   adviceLoading = false;
3182
   getAdvice() {
3219
   getAdvice() {
3220
+    if(!this.coopBtns.suggestionBox){
3221
+      return;
3222
+    }
3183
     let that = this;
3223
     let that = this;
3184
     let postData = {
3224
     let postData = {
3185
       advice: {
3225
       advice: {