Explorar o código

工单列表根据当前科室和当前人员权限

seimin hai 1 ano
pai
achega
c872849a40

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-    "target": "http://192.168.4.241",
3
+    "target": "http://192.168.3.108",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

+ 6 - 0
src/app/services/tool.service.ts

@@ -125,6 +125,12 @@ export class ToolService {
125 125
         case "print":
126 126
           coopBtns.print = true; //打印
127 127
           break;
128
+        case "currentDept":
129
+          coopBtns.currentDept = true; //当前科室
130
+          break;
131
+        case "currentUser":
132
+          coopBtns.currentUser = true; //当前人员
133
+          break;
128 134
       }
129 135
     });
130 136
     console.log(coopBtns);

+ 2 - 3
src/app/views/clinical-users-management/clinical-users-management.component.ts

@@ -143,8 +143,7 @@ export class ClinicalUsersManagementComponent implements OnInit {
143 143
   // 获取所有用户类型
144 144
   getUserTypes() {
145 145
     this.mainService.getDictionary("list", "usertype").subscribe((data) => {
146
-      this.userTypes = data.filter(v=>v.value == 1);
147
-      this.userType = this.userTypes.length ? this.userTypes[0].id : null;
146
+      this.userTypes = data;
148 147
       this.getAllHospital();
149 148
     });
150 149
   }
@@ -275,7 +274,7 @@ export class ClinicalUsersManagementComponent implements OnInit {
275 274
     this.validateForm = this.fb.group({
276 275
       name: [null, [Validators.required]],
277 276
       account: [null, [Validators.required]],
278
-      usertype: [this.userType + '', [Validators.required]],
277
+      usertype: [null, [Validators.required]],
279 278
       dept: [null, [Validators.required]],
280 279
       deptPhone: [null, [Validators.required]],
281 280
       gender: [null, [Validators.required]],

+ 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">
31
+            (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择执行支助人员" [(ngModel)]="worker" [nzDisabled]="coopBtns.currentUser">
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]="loginUser.usertype.value == 1">
43
+            (nzOnSearch)="changeInp($event)" nzAllowClear nzPlaceHolder="请选择申请科室" [(ngModel)]="department" [nzDisabled]="coopBtns.currentDept">
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>

+ 14 - 8
src/app/views/order-management/order-management.component.ts

@@ -93,12 +93,15 @@ export class OrderManagementComponent implements OnInit {
93 93
   reset() {
94 94
     this.pageIndex = 1;
95 95
     this.association = null;
96
-    this.worker = null;
97 96
     this.tasktype = null;
98
-    if (this.loginUser.usertype.value != 1) {
99
-      // 人员类型不是护士
97
+    if (!this.coopBtns.currentDept) {
98
+      // 权限没有当前科室
100 99
       this.department = null;
101 100
     }
101
+    if (!this.coopBtns.currentUser) {
102
+      // 权限没有当前人员
103
+      this.worker = null;
104
+    }
102 105
     this.gdcode = "";
103 106
     this.gdState = null;
104 107
     this.specialCloseFlag = null;
@@ -278,14 +281,17 @@ export class OrderManagementComponent implements OnInit {
278 281
       .subscribe((data) => {
279 282
         this.alldepart = data.list;
280 283
         this.isLoading = false;
281
-        if (dept === undefined && this.loginUser.usertype.value == 1) {
282
-          // 初次渲染,人员类型是护士,则回显申请科室,并禁用
284
+        if (dept === undefined && this.coopBtns.currentDept) {
285
+          // 初次渲染,权限有当前科室,则回显申请科室,并禁用
283 286
           this.alldepart = [this.loginUser.dept];
284 287
           this.department = this.loginUser.dept.id;
285
-          this.getList();
286
-        }else{
287
-          this.getList();
288 288
         }
289
+        if (dept === undefined && this.coopBtns.currentUser) {
290
+          // 初次渲染,权限有当前人员,则回显执行支助人员,并禁用
291
+          this.allWorker = [this.loginUser];
292
+          this.worker = this.loginUser.id;
293
+        }
294
+        this.getList();
289 295
       });
290 296
   }
291 297
 

+ 1 - 1
src/app/views/users-management/users-management.component.ts

@@ -132,7 +132,7 @@ export class UsersManagementComponent implements OnInit {
132 132
   // 获取所有用户类型
133 133
   getUserTypes() {
134 134
     this.mainService.getDictionary("list", "usertype").subscribe((data) => {
135
-      this.userTypes = data.filter(v => (v.value == 2 || v.value == 3));
135
+      this.userTypes = data;
136 136
       this.getAllHospital();
137 137
     });
138 138
   }