瀏覽代碼

系统配置增加护士默认角色

seimin 3 年之前
父節點
當前提交
c16e79ae72
共有 2 個文件被更改,包括 41 次插入2 次删除
  1. 15 2
      src/app/views/sys-config/sys-config.component.html
  2. 26 0
      src/app/views/sys-config/sys-config.component.ts

+ 15 - 2
src/app/views/sys-config/sys-config.component.html

@@ -1,4 +1,4 @@
1
-<div class="sysConfig" *ngIf="!loading1">
1
+<div class="sysConfig" *ngIf="!loading1&&!loading4">
2 2
   <div class="main">
3 3
     <h2>系统配置</h2>
4 4
     <form nz-form [formGroup]="validateForm" class="forms">
@@ -79,6 +79,19 @@
79 79
               [nzFormatter]="formatterPercent" [nzParser]="parserPercent"></nz-input-number>
80 80
           </nz-form-control>
81 81
         </nz-form-item>
82
+        <nz-form-item class="formItem">
83
+          <nz-form-label [nzSpan]="6" nzFor="defaultRoleOfNurse" nzRequired class="label">护士默认角色</nz-form-label>
84
+          <nz-form-control [nzSpan]="12" nzErrorTip="护士默认角色是必填项!">
85
+            <nz-select formControlName="defaultRoleOfNurse" nzPlaceHolder="请输入护士默认角色">
86
+              <ng-container *ngFor="let role of roleList">
87
+                <nz-option *ngIf="!loading4" [nzValue]="role.id" [nzLabel]="role.role"></nz-option>
88
+              </ng-container>
89
+              <nz-option *ngIf="loading4" nzDisabled nzCustomContent>
90
+                <i nz-icon nzType="loading" class="loading-icon"></i> 加载中...
91
+              </nz-option>
92
+            </nz-select>
93
+          </nz-form-control>
94
+        </nz-form-item>
82 95
       </div>
83 96
     </form>
84 97
   </div>
@@ -89,7 +102,7 @@
89 102
       [nzLoading]="loading3">刷新字典缓存</button>
90 103
   </div>
91 104
 </div>
92
-<div class="sysConfig" *ngIf="loading1">
105
+<div class="sysConfig" *ngIf="loading1||loading4">
93 106
   <div class="loadingFull display_flex justify-content_flex-center align-items_center">
94 107
     <div class="loadingFullInner">
95 108
       <img src="../../assets/images/loading.gif" alt="">

+ 26 - 0
src/app/views/sys-config/sys-config.component.ts

@@ -14,6 +14,7 @@ export class SysConfigComponent implements OnInit {
14 14
   loading1 = false; //查询信息的loading
15 15
   loading2 = false; //保存信息的loading
16 16
   loading3 = false; //刷新字典缓存信息的loading
17
+  loading4 = false; //护士默认角色
17 18
   initConfig = []; //接口配置列表
18 19
   config = []; //配置列表[key,value,id]
19 20
   promptContent: string; //操作提示框提示信息
@@ -36,6 +37,7 @@ export class SysConfigComponent implements OnInit {
36 37
       orderClearUserSwitch: [null, [Validators.required]],
37 38
       deptQRCode: [null, [Validators.required]],
38 39
       workOrderSettings: [5, [Validators.required]],
40
+      defaultRoleOfNurse: [null, [Validators.required]],
39 41
       formUrl: [{ value: null, disabled: true }, [Validators.required]],
40 42
       serviceUrl: [{ value: null, disabled: true }, [Validators.required]],
41 43
       cachePath: [{ value: null, disabled: true }, [Validators.required]],
@@ -44,6 +46,22 @@ export class SysConfigComponent implements OnInit {
44 46
     });
45 47
     this.getDeptType();
46 48
     this.coopBtns = this.tool.initCoopBtns(this.route);
49
+    this.getRoleList();
50
+  }
51
+  // 角色列表
52
+  roleList = [];
53
+  getRoleList() {
54
+    let postData = {
55
+      idx: 0,
56
+      sum: 10,
57
+    };
58
+    this.loading4 = true;
59
+    this.mainService
60
+      .getFetchDataList("user/data", "role", postData)
61
+      .subscribe((result) => {
62
+        this.loading4 = false;
63
+        this.roleList = result.list;
64
+      });
47 65
   }
48 66
   // 刷新字典缓存
49 67
   refresh() {
@@ -76,6 +94,7 @@ export class SysConfigComponent implements OnInit {
76 94
         item.keyconfig === "orderClearUserSwitch" ||
77 95
         item.keyconfig === "deptQRCode" ||
78 96
         item.keyconfig === "workOrderSettings" ||
97
+        item.keyconfig === "defaultRoleOfNurse" ||
79 98
         item.keyconfig === "busiViewDeptId"
80 99
     );
81 100
     filterData.forEach((item) => {
@@ -90,6 +109,8 @@ export class SysConfigComponent implements OnInit {
90 109
         item.valueconfig = this.validateForm.controls.deptQRCode.value;
91 110
       } else if (item.keyconfig === "workOrderSettings") {
92 111
         item.valueconfig = this.validateForm.controls.workOrderSettings.value;
112
+      } else if (item.keyconfig === "defaultRoleOfNurse") {
113
+        item.valueconfig = this.validateForm.controls.defaultRoleOfNurse.value;
93 114
       } else if (item.keyconfig === "busiViewDeptId") {
94 115
         item.valueconfig = this.validateForm.controls.busiViewDeptId.value;
95 116
       }
@@ -155,6 +176,11 @@ export class SysConfigComponent implements OnInit {
155 176
                 case "workOrderSettings":
156 177
                   this.validateForm.controls.workOrderSettings.setValue(c[1]);
157 178
                   break;
179
+                case "defaultRoleOfNurse":
180
+                  this.validateForm.controls.defaultRoleOfNurse.setValue(
181
+                    c[1] - 0
182
+                  );
183
+                  break;
158 184
                 case "formUri":
159 185
                   this.validateForm.controls.formUrl.setValue(c[1]);
160 186
                   break;