Browse Source

在院区系统配置中增加抢单通知班次

seimin 3 years ago
parent
commit
0ef5826851

+ 7 - 0
src/app/views/hospital-config/hospital-config.component.html

@@ -115,6 +115,13 @@
115
                 </nz-select>
115
                 </nz-select>
116
               </nz-form-control>
116
               </nz-form-control>
117
             </ng-container>
117
             </ng-container>
118
+            <ng-container *ngSwitchCase="'rushNoticeShift'">
119
+              <nz-form-label [nzSpan]="24" [nzFor]="config.key" class="label">{{config.desc}}</nz-form-label>
120
+              <nz-form-control [nzSpan]="24" [nzErrorTip]="'请选择'+config.desc+'!'">
121
+                <nz-checkbox-group [formControlName]="config.key">
122
+                </nz-checkbox-group>
123
+              </nz-form-control>
124
+            </ng-container>
118
             <ng-container *ngSwitchDefault>
125
             <ng-container *ngSwitchDefault>
119
               <nz-form-label [nzSpan]="24" [nzFor]="config.key" [nzRequired]="config.required" class="label">
126
               <nz-form-label [nzSpan]="24" [nzFor]="config.key" [nzRequired]="config.required" class="label">
120
                 {{config.desc}}</nz-form-label>
127
                 {{config.desc}}</nz-form-label>

+ 43 - 1
src/app/views/hospital-config/hospital-config.component.ts

@@ -58,6 +58,7 @@ export class HospitalConfigComponent implements OnInit {
58
       this.getDeptList(this.hosId),
58
       this.getDeptList(this.hosId),
59
       this.getGroupList(this.hosId),
59
       this.getGroupList(this.hosId),
60
       this.getTaskTypeList([255]),
60
       this.getTaskTypeList([255]),
61
+      this.getClassesList(),
61
     ])
62
     ])
62
       .then((result) => {
63
       .then((result) => {
63
         if (result[0].status == 200) {
64
         if (result[0].status == 200) {
@@ -72,6 +73,14 @@ export class HospitalConfigComponent implements OnInit {
72
         if (result[3].status == 200) {
73
         if (result[3].status == 200) {
73
           this.taskTypeList = result[3].list;
74
           this.taskTypeList = result[3].list;
74
         }
75
         }
76
+        if (result[4].status == 200) {
77
+          this.classesList = result[4].list;
78
+          this.classesList = this.classesList.map((item) => ({
79
+            label: item.name,
80
+            value: item.id,
81
+            checked: false,
82
+          }));
83
+        }
75
         this.getHospitalConfigList(this.hosId).subscribe((res) => {
84
         this.getHospitalConfigList(this.hosId).subscribe((res) => {
76
           if (res.status == 200) {
85
           if (res.status == 200) {
77
             this.hospitalConfigList = res.list;
86
             this.hospitalConfigList = res.list;
@@ -82,6 +91,10 @@ export class HospitalConfigComponent implements OnInit {
82
                 //坐席号码
91
                 //坐席号码
83
                 fbGroup[item.key] = [null];
92
                 fbGroup[item.key] = [null];
84
                 item.required = false;
93
                 item.required = false;
94
+              } else if (item.key === "rushNoticeShift") {
95
+                //抢单通知班次
96
+                fbGroup[item.key] = [];
97
+                item.required = false;
85
               } else {
98
               } else {
86
                 fbGroup[item.key] = [null, [Validators.required]];
99
                 fbGroup[item.key] = [null, [Validators.required]];
87
                 item.required = true;
100
                 item.required = true;
@@ -122,6 +135,14 @@ export class HospitalConfigComponent implements OnInit {
122
                 this.validateForm.controls[config.key].setValue(
135
                 this.validateForm.controls[config.key].setValue(
123
                   config.value - 0
136
                   config.value - 0
124
                 );
137
                 );
138
+              } else if (config.key === "rushNoticeShift") {
139
+                let arr = config.value ? config.value.split(",") : [];
140
+                this.classesList.forEach((item) => {
141
+                  item.checked = arr.includes(item.value + "");
142
+                });
143
+                this.validateForm.controls[config.key].setValue(
144
+                  this.classesList
145
+                );
125
               } else {
146
               } else {
126
                 this.validateForm.controls[config.key].setValue(config.value);
147
                 this.validateForm.controls[config.key].setValue(config.value);
127
               }
148
               }
@@ -135,6 +156,20 @@ export class HospitalConfigComponent implements OnInit {
135
         this.isLoading = false;
156
         this.isLoading = false;
136
       });
157
       });
137
   }
158
   }
159
+  // 获取当前院区的班次列表
160
+  classesList = [];
161
+  getClassesList() {
162
+    let postData = {
163
+      idx: 0,
164
+      sum: 9999,
165
+      scheduleClass: {
166
+        hospital: { id: this.hosId },
167
+      },
168
+    };
169
+    return this.mainService
170
+      .getFetchDataList("configuration", "scheduleClass", postData)
171
+      .toPromise();
172
+  }
138
   // 获取系统配置列表
173
   // 获取系统配置列表
139
   getHospitalConfigList(hosId) {
174
   getHospitalConfigList(hosId) {
140
     let postData = { idx: 0, sum: 100, hospitalConfig: { hosId } };
175
     let postData = { idx: 0, sum: 100, hospitalConfig: { hosId } };
@@ -215,7 +250,14 @@ export class HospitalConfigComponent implements OnInit {
215
       JSON.stringify(this.hospitalConfigList)
250
       JSON.stringify(this.hospitalConfigList)
216
     );
251
     );
217
     hospitalConfigList.forEach((config) => {
252
     hospitalConfigList.forEach((config) => {
218
-      config.value = this.validateForm.controls[config.key].value;
253
+      if (config.key === "rushNoticeShift") {
254
+        config.value = this.validateForm.controls[config.key].value
255
+          .filter((item) => item.checked)
256
+          .map((item) => item.value)
257
+          .toString();
258
+      } else {
259
+        config.value = this.validateForm.controls[config.key].value;
260
+      }
219
       delete config.required;
261
       delete config.required;
220
     });
262
     });
221
     this.saveLoading = true;
263
     this.saveLoading = true;