浏览代码

工单管理新增权限

seimin 1 年之前
父节点
当前提交
38d89b05c7

+ 5 - 2
src/app/services/tool.service.ts

@@ -126,10 +126,13 @@ export class ToolService {
126 126
           coopBtns.print = true; //打印
127 127
           break;
128 128
         case "currentDept":
129
-          coopBtns.currentDept = true; //当前科室
129
+          coopBtns.currentDept = true; //当前科室工单
130 130
           break;
131 131
         case "currentUser":
132
-          coopBtns.currentUser = true; //当前人员
132
+          coopBtns.currentUser = true; //当前人员工单
133
+          break;
134
+        case "allOrders":
135
+          coopBtns.allOrders = true; //全部工单
133 136
           break;
134 137
       }
135 138
     });

+ 2 - 2
src/app/views/order-management/order-management.component.html

@@ -28,7 +28,7 @@
28 28
         <div class="list-template__searchItem">
29 29
           <span class="label label--big">执行支助人员</span>:
30 30
           <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
31
-            (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择执行支助人员" [(ngModel)]="worker" [nzDisabled]="coopBtns.currentUser">
31
+            (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择执行支助人员" [(ngModel)]="worker" [nzDisabled]="coopBtns.currentUser && !coopBtns.allOrders">
32 32
             <ng-container *ngFor="let option of allWorker">
33 33
               <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
34 34
             </ng-container>
@@ -40,7 +40,7 @@
40 40
         <div class="list-template__searchItem">
41 41
           <span class="label">申请科室</span>:
42 42
           <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
43
-            (nzOnSearch)="changeInp($event)" nzAllowClear nzPlaceHolder="请选择申请科室" [(ngModel)]="department" [nzDisabled]="coopBtns.currentDept">
43
+            (nzOnSearch)="changeInp($event)" nzAllowClear nzPlaceHolder="请选择申请科室" [(ngModel)]="department" [nzDisabled]="coopBtns.currentDept && !coopBtns.allOrders">
44 44
             <ng-container *ngFor="let option of alldepart">
45 45
               <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
46 46
             </ng-container>

+ 10 - 6
src/app/views/order-management/order-management.component.ts

@@ -94,12 +94,10 @@ export class OrderManagementComponent implements OnInit {
94 94
     this.pageIndex = 1;
95 95
     this.association = null;
96 96
     this.tasktype = null;
97
-    if (!this.coopBtns.currentDept) {
98
-      // 权限没有当前科室
97
+    if (!(this.coopBtns.currentDept && !this.coopBtns.allOrders)) {
99 98
       this.department = null;
100 99
     }
101
-    if (!this.coopBtns.currentUser) {
102
-      // 权限没有当前人员
100
+    if (!(this.coopBtns.currentUser && !this.coopBtns.allOrders)) {
103 101
       this.worker = null;
104 102
     }
105 103
     this.gdcode = "";
@@ -190,6 +188,12 @@ export class OrderManagementComponent implements OnInit {
190 188
   // 表格数据
191 189
   loading1 = false;
192 190
   getList() {
191
+    // 三个权限都没有,则不展示
192
+    if(!this.coopBtns.currentDept && !this.coopBtns.currentUser && !this.coopBtns.allOrders){
193
+      this.listOfData = [];
194
+      this.listLength = 0;
195
+      return;
196
+    }
193 197
     var that = this;
194 198
     let data: any = {
195 199
       idx: that.pageIndex - 1,
@@ -282,12 +286,12 @@ export class OrderManagementComponent implements OnInit {
282 286
         this.alldepart = data.list;
283 287
         this.isLoading = false;
284 288
         if (dept === undefined && this.coopBtns.currentDept) {
285
-          // 初次渲染,权限有当前科室,则回显申请科室,并禁用
289
+          // 初次渲染,权限有当前科室工单,则回显申请科室
286 290
           this.alldepart = [this.loginUser.dept];
287 291
           this.department = this.loginUser.dept.id;
288 292
         }
289 293
         if (dept === undefined && this.coopBtns.currentUser) {
290
-          // 初次渲染,权限有当前人员,则回显执行支助人员,并禁用
294
+          // 初次渲染,权限有当前人员工单,则回显执行支助人员
291 295
           this.allWorker = [this.loginUser];
292 296
           this.worker = this.loginUser.id;
293 297
         }