浏览代码

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

seimin 1 年之前
父节点
当前提交
c872849a40

+ 1 - 1
proxy.conf.json

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

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

@@ -125,6 +125,12 @@ export class ToolService {
125
         case "print":
125
         case "print":
126
           coopBtns.print = true; //打印
126
           coopBtns.print = true; //打印
127
           break;
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
     console.log(coopBtns);
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
   getUserTypes() {
144
   getUserTypes() {
145
     this.mainService.getDictionary("list", "usertype").subscribe((data) => {
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
       this.getAllHospital();
147
       this.getAllHospital();
149
     });
148
     });
150
   }
149
   }
@@ -275,7 +274,7 @@ export class ClinicalUsersManagementComponent implements OnInit {
275
     this.validateForm = this.fb.group({
274
     this.validateForm = this.fb.group({
276
       name: [null, [Validators.required]],
275
       name: [null, [Validators.required]],
277
       account: [null, [Validators.required]],
276
       account: [null, [Validators.required]],
278
-      usertype: [this.userType + '', [Validators.required]],
277
+      usertype: [null, [Validators.required]],
279
       dept: [null, [Validators.required]],
278
       dept: [null, [Validators.required]],
280
       deptPhone: [null, [Validators.required]],
279
       deptPhone: [null, [Validators.required]],
281
       gender: [null, [Validators.required]],
280
       gender: [null, [Validators.required]],

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

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

@@ -93,12 +93,15 @@ export class OrderManagementComponent implements OnInit {
93
   reset() {
93
   reset() {
94
     this.pageIndex = 1;
94
     this.pageIndex = 1;
95
     this.association = null;
95
     this.association = null;
96
-    this.worker = null;
97
     this.tasktype = null;
96
     this.tasktype = null;
98
-    if (this.loginUser.usertype.value != 1) {
99
-      // 人员类型不是护士
97
+    if (!this.coopBtns.currentDept) {
98
+      // 权限没有当前科室
100
       this.department = null;
99
       this.department = null;
101
     }
100
     }
101
+    if (!this.coopBtns.currentUser) {
102
+      // 权限没有当前人员
103
+      this.worker = null;
104
+    }
102
     this.gdcode = "";
105
     this.gdcode = "";
103
     this.gdState = null;
106
     this.gdState = null;
104
     this.specialCloseFlag = null;
107
     this.specialCloseFlag = null;
@@ -278,14 +281,17 @@ export class OrderManagementComponent implements OnInit {
278
       .subscribe((data) => {
281
       .subscribe((data) => {
279
         this.alldepart = data.list;
282
         this.alldepart = data.list;
280
         this.isLoading = false;
283
         this.isLoading = false;
281
-        if (dept === undefined && this.loginUser.usertype.value == 1) {
282
-          // 初次渲染,人员类型是护士,则回显申请科室,并禁用
284
+        if (dept === undefined && this.coopBtns.currentDept) {
285
+          // 初次渲染,权限有当前科室,则回显申请科室,并禁用
283
           this.alldepart = [this.loginUser.dept];
286
           this.alldepart = [this.loginUser.dept];
284
           this.department = this.loginUser.dept.id;
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
   getUserTypes() {
133
   getUserTypes() {
134
     this.mainService.getDictionary("list", "usertype").subscribe((data) => {
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
       this.getAllHospital();
136
       this.getAllHospital();
137
     });
137
     });
138
   }
138
   }