瀏覽代碼

工单管理新增权限

seimin 1 年之前
父節點
當前提交
38d89b05c7

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

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

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

@@ -28,7 +28,7 @@
28
         <div class="list-template__searchItem">
28
         <div class="list-template__searchItem">
29
           <span class="label label--big">执行支助人员</span>:
29
           <span class="label label--big">执行支助人员</span>:
30
           <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
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
             <ng-container *ngFor="let option of allWorker">
32
             <ng-container *ngFor="let option of allWorker">
33
               <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
33
               <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
34
             </ng-container>
34
             </ng-container>
@@ -40,7 +40,7 @@
40
         <div class="list-template__searchItem">
40
         <div class="list-template__searchItem">
41
           <span class="label">申请科室</span>:
41
           <span class="label">申请科室</span>:
42
           <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
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
             <ng-container *ngFor="let option of alldepart">
44
             <ng-container *ngFor="let option of alldepart">
45
               <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
45
               <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
46
             </ng-container>
46
             </ng-container>

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

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