Parcourir la source

拉取最新代码

maotao il y a 10 mois
Parent
commit
cc092a192e

+ 13 - 0
src/app/views/acc-examine-set/acc-examine-set-routing.module.ts

@@ -0,0 +1,13 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { AccExamineSetComponent } from './acc-examine-set.component';
4
+
5
+const routes: Routes = [
6
+  { path: '', component: AccExamineSetComponent }
7
+];
8
+
9
+@NgModule({
10
+  imports: [RouterModule.forChild(routes)],
11
+  exports: [RouterModule]
12
+})
13
+export class AccExamineSetRoutingModule { }

+ 110 - 0
src/app/views/acc-examine-set/acc-examine-set.component.html

@@ -0,0 +1,110 @@
1
+<div class="TaskTypeManagement">
2
+  <div class="taskTypeInfo">
3
+    <div class="top">
4
+      <div class="item" (click)="tabModal('characteristics')" [ngClass]="{'items':tabModalName=='characteristics'}">
5
+        特性配置
6
+      </div>
7
+      <div class="item" (click)="tabModal('automaticOrderCreation')" [ngClass]="{'items':tabModalName=='automaticOrderCreation'}">
8
+        自动建单配置
9
+      </div>
10
+    </div>
11
+    <div class="list" *ngIf="!loading">
12
+      <!-- 特性配置 -->
13
+      <div *ngIf="tabModalName=='characteristics'">
14
+        <!-- 接手术关联任务类型 -->
15
+        <div class="display_flex align-items_center mb8">
16
+          <nz-form-label class="label" nzRequired>接手术关联任务类型</nz-form-label>
17
+          <nz-select class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
18
+            (nzOnSearch)="changeTasktype($event, 1)" nzPlaceHolder="请选择接手术关联任务类型" [(ngModel)]="tasktypeId">
19
+            <ng-container *ngFor="let option of taskTypes1">
20
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [nzValue]="option.id"></nz-option>
21
+            </ng-container>
22
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
23
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
24
+            </nz-option>
25
+          </nz-select>
26
+        </div>
27
+        <!-- 苏醒室科室 -->
28
+        <div class="display_flex align-items_center mb8">
29
+          <nz-form-label class="label" nzRequired>苏醒室科室</nz-form-label>
30
+          <nz-select class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
31
+            (nzOnSearch)="changeRecoveryDepts($event)" nzPlaceHolder="请选择接苏醒室科室" [(ngModel)]="recoveryDeptId">
32
+            <ng-container *ngFor="let option of recoveryDepts">
33
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
34
+            </ng-container>
35
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
36
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
37
+            </nz-option>
38
+          </nz-select>
39
+        </div>
40
+        <!-- 送回病房科室 -->
41
+        <div class="display_flex align-items_center mb8">
42
+          <nz-form-label class="label">是否开通送回病房</nz-form-label>
43
+          <nz-checkbox-group [(ngModel)]="autoSendWard" (ngModelChange)="changeAutoSendWard($event)"></nz-checkbox-group>
44
+          <nz-select *ngIf="autoSendWard[0].checked" class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
45
+            (nzOnSearch)="changeTasktype($event, 1)" nzPlaceHolder="请选择送回病房任务类型" [(ngModel)]="tasktype1Id">
46
+            <ng-container *ngFor="let option of taskTypes1">
47
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [nzValue]="option.id"></nz-option>
48
+            </ng-container>
49
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
50
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
51
+            </nz-option>
52
+          </nz-select>
53
+        </div>
54
+        <!-- 送回苏醒室科室 -->
55
+        <div class="display_flex align-items_center mb8">
56
+          <nz-form-label class="label">是否开通送回苏醒室</nz-form-label>
57
+          <nz-checkbox-group [(ngModel)]="autoSendAwakeningRoom" (ngModelChange)="changeAutoSendAwakeningRoom($event)"></nz-checkbox-group>
58
+          <nz-select *ngIf="autoSendAwakeningRoom[0].checked" class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
59
+            (nzOnSearch)="changeTasktype($event, 1)" nzPlaceHolder="请选择送回苏醒室任务类型" [(ngModel)]="tasktype2Id">
60
+            <ng-container *ngFor="let option of taskTypes1">
61
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [nzValue]="option.id"></nz-option>
62
+            </ng-container>
63
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
64
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
65
+            </nz-option>
66
+          </nz-select>
67
+        </div>
68
+        <!-- 关联手术清洁 -->
69
+        <div class="display_flex align-items_center mb8">
70
+          <nz-form-label class="label">是否开通关联手术清洁建单</nz-form-label>
71
+          <nz-checkbox-group [(ngModel)]="autoRemandClean" (ngModelChange)="changeAutoRemandClean($event)"></nz-checkbox-group>
72
+          <nz-select *ngIf="autoRemandClean[0].checked" class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
73
+            (nzOnSearch)="changeTasktype($event, 2)" nzPlaceHolder="请选择送回苏醒室任务类型" [(ngModel)]="cleanTypeId">
74
+            <ng-container *ngFor="let option of taskTypes2">
75
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [nzValue]="option.id"></nz-option>
76
+            </ng-container>
77
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
78
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
79
+            </nz-option>
80
+          </nz-select>
81
+        </div>
82
+        <!-- 是否开启手术即将开始通知 -->
83
+        <div class="display_flex align-items_center mb8">
84
+          <nz-form-label class="label">是否开启手术即将开始通知</nz-form-label>
85
+          <nz-checkbox-group [(ngModel)]="surgeryBegin"></nz-checkbox-group>
86
+        </div>
87
+      </div>
88
+      <!-- 自动建单配置 -->
89
+      <div *ngIf="tabModalName=='automaticOrderCreation'">
90
+        <!-- 自动建单 -->
91
+        <div class="display_flex align-items_center mb8">
92
+          <nz-form-label class="label">自动建单</nz-form-label>
93
+          <nz-checkbox-group [(ngModel)]="autoCreateOrders" (ngModelChange)="changeAutoCreateOrders($event)"></nz-checkbox-group>
94
+          <nz-time-picker [(ngModel)]="autoTime" nzFormat="HH:mm" *ngIf="autoCreateOrders[0].checked"></nz-time-picker>
95
+        </div>
96
+      </div>
97
+      <div class="bottom">
98
+        <button class="login-form-button" nzType="primary" [nzLoading]="btnLoading" nz-button (click)="submitForm()">保存</button>
99
+      </div>
100
+    </div>
101
+    <div class="list" *ngIf="loading">
102
+      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
103
+        <div class="loadingFullInner">
104
+          <img src="../../../assets/images/loading.gif" alt="">
105
+          <div>加载中...</div>
106
+        </div>
107
+      </div>
108
+    </div>
109
+  </div>
110
+</div>

Fichier diff supprimé car celui-ci est trop grand
+ 1251 - 0
src/app/views/acc-examine-set/acc-examine-set.component.less


+ 343 - 0
src/app/views/acc-examine-set/acc-examine-set.component.ts

@@ -0,0 +1,343 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { MainService } from 'src/app/services/main.service';
3
+import { ToolService } from 'src/app/services/tool.service';
4
+import { NzMessageService } from 'ng-zorro-antd';
5
+import { Subject } from 'rxjs';
6
+import { debounceTime } from 'rxjs/operators';
7
+import { format, startOfMinute } from 'date-fns';
8
+
9
+@Component({
10
+  selector: "app-acc-examine-set",
11
+  templateUrl: "./acc-examine-set.component.html",
12
+  styleUrls: ["./acc-examine-set.component.less"],
13
+})
14
+export class AccExamineSetComponent implements OnInit {
15
+  loading:boolean = false; //页面加载的loading
16
+  btnLoading:boolean = false; //提交按钮的loading
17
+  tabModalName:string = 'characteristics'; //当前选中的tab
18
+  surgeryField = null; //手术关联业务
19
+  hosId = this.tool.getCurrentHospital().id; //当前院区
20
+  // 接手术关联任务类型
21
+  tasktypeId:any;
22
+  taskTypes1:any[] = [];
23
+  taskTypes2:any[] = [];
24
+  // 苏醒室科室
25
+  recoveryDeptId:any;
26
+  recoveryDepts:any[] = [];
27
+  // 自动建单
28
+  autoCreateOrders:any[] = [
29
+    {label:'是否开启',value: 0}
30
+  ];
31
+  // 是否开通送回病房
32
+  autoSendWard:any[] = [
33
+    {label:'是否开启',value: 0}
34
+  ];
35
+  // 是否开通送回苏醒室
36
+  autoSendAwakeningRoom:any[] = [
37
+    {label:'是否开启',value: 0}
38
+  ];
39
+  // 是否开通关联手术清洁建单
40
+  autoRemandClean:any[] = [
41
+    {label:'是否开启',value: 0}
42
+  ];
43
+  // 是否开启手术即将开始通知
44
+  surgeryBegin:any[] = [
45
+    {label:'是否开启',value: 0}
46
+  ];
47
+  // 建单时间
48
+  autoTime:Date | null = null;
49
+  tasktype1Id:any;
50
+  tasktype2Id:any;
51
+  cleanTypeId:any;
52
+  // 配置
53
+  configs:any = {};
54
+  searchTimerSubject = new Subject();
55
+  constructor(private mainService: MainService,private tool: ToolService,private msg: NzMessageService) {}
56
+
57
+  ngOnInit():void {
58
+    // todo
59
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
60
+      let fun = v[0];
61
+      fun.call(this, v[1], v[2], v[3]);
62
+    });
63
+    this.getTaskTypes('', true, 1);
64
+    this.getTaskTypes('', false, 2);
65
+  }
66
+
67
+  // 切换tab
68
+  tabModal(tabModalName:string){
69
+    this.tabModalName = tabModalName;
70
+  }
71
+  // 修改是否自动建单
72
+  changeAutoCreateOrders(e){
73
+    console.log(e);
74
+    if(!e[0].checked){
75
+      // todo
76
+      this.autoTime = null;
77
+    }
78
+  }
79
+
80
+  // 修改是否开通送回病房
81
+  changeAutoSendWard(e){
82
+    console.log(e);
83
+    if(!e[0].checked){
84
+      // todo
85
+      this.tasktype1Id = null;
86
+    }
87
+  }
88
+
89
+  // 修改是否开通送回苏醒室
90
+  changeAutoSendAwakeningRoom(e){
91
+    console.log(e);
92
+    if(!e[0].checked){
93
+      // todo
94
+      this.tasktype2Id = null;
95
+    }
96
+  }
97
+
98
+  // 修改是否开通关联手术清洁建单
99
+  changeAutoRemandClean(e){
100
+    console.log(e);
101
+    if(!e[0].checked){
102
+      // todo
103
+      this.cleanTypeId = null;
104
+    }
105
+  }
106
+
107
+  // 保存
108
+  submitForm() {
109
+    if(!this.tasktypeId){
110
+      this.msg.create("warning", "请选择接手术关联任务类型!");
111
+      return;
112
+    }
113
+    if(!this.recoveryDeptId){
114
+      this.msg.create("warning", "请选择苏醒室科室!");
115
+      return;
116
+    }
117
+    if(this.autoCreateOrders[0].checked && !this.autoTime){
118
+      this.msg.create("warning", "请选择建单时间!");
119
+      return;
120
+    }
121
+    if(this.autoSendWard[0].checked && !this.tasktype1Id){
122
+      this.msg.create("warning", "请选择送回病房任务类型!");
123
+      return;
124
+    }
125
+    if(this.autoSendAwakeningRoom[0].checked && !this.tasktype2Id){
126
+      this.msg.create("warning", "请选择送回苏醒室任务类型!");
127
+      return;
128
+    }
129
+    if(this.autoRemandClean[0].checked && !this.cleanTypeId){
130
+      this.msg.create("warning", "请选择手术清洁任务类型!");
131
+      return;
132
+    }
133
+    let editData:any = {
134
+      hosId: this.hosId,
135
+      taskType: this.tasktypeId || undefined,
136
+      recoveryDeptId: this.recoveryDeptId || undefined,
137
+      ordinaryField: this.surgeryField,
138
+      autoCreate: this.autoCreateOrders[0].checked ? 1 : 0,
139
+      createTime: this.autoTime ? format(startOfMinute(this.autoTime), "yyyy-MM-dd HH:mm:ss") : undefined,
140
+      remandClinical: this.autoSendWard[0].checked ? 1 : 0,
141
+      clinicalTypeId: this.tasktype1Id || undefined,
142
+      remandRecovery: this.autoSendAwakeningRoom[0].checked ? 1 : 0,
143
+      recoveryTypeId: this.tasktype2Id || undefined,
144
+      remandClean: this.autoRemandClean[0].checked ? 1 : 0,
145
+      surgeryBegin: this.surgeryBegin[0].checked ? 1 : 0,
146
+      cleanTypeId: this.cleanTypeId || undefined,
147
+    };
148
+    let postData = Object.assign({}, this.configs, editData);
149
+    console.log(postData);
150
+    this.btnLoading = true;
151
+    this.mainService
152
+      .simplePost("addData", "taskTypeConfig", postData)
153
+      .subscribe((result) => {
154
+        this.btnLoading = false;
155
+        if (result.status == 200) {
156
+          this.getConfig();
157
+        }
158
+      });
159
+  }
160
+
161
+  // 用户输入搜索任务类型
162
+  isLoading: boolean = false;
163
+  changeTasktype(e, type) {
164
+    this.searchTimer(this.getTaskTypes, e, false, type);
165
+  }
166
+
167
+  changeRecoveryDepts(e) {
168
+    this.searchTimer(this.getRecoveryDepts, e, false);
169
+  }
170
+
171
+  // 边输入边搜索节流阀
172
+  searchTimer(fun, e, isFirst, type?) {
173
+    this.isLoading = true;
174
+    this.searchTimerSubject.next([fun, e, isFirst, type]);
175
+  }
176
+
177
+  //获取接手术关联任务类型
178
+  // 1 患者其他服务
179
+  // 2 其他临床服务
180
+  getTaskTypes(e:string = '', isFirst:boolean = false, type:number = 1) {
181
+    isFirst && (this.loading = true);
182
+    let postData:any = {
183
+      idx: 0,
184
+      sum: 10,
185
+      taskType: {
186
+        taskName: e,
187
+        simpleQuery: true,
188
+        hosId: {
189
+          id: this.hosId
190
+        }
191
+      }
192
+    };
193
+    if(type === 1){
194
+      postData.taskType.associationType = {
195
+        key: 'association_types',
196
+        value: 'patientTransport'
197
+      }
198
+    }else if(type === 2){
199
+      postData.taskType.associationType = {
200
+        key: 'association_types',
201
+        value: 'other'
202
+      }
203
+    }
204
+    this.isLoading = true;
205
+    this.mainService
206
+      .getFetchDataList("simple/data", "taskType", postData)
207
+      .subscribe((result) => {
208
+        this.isLoading = false;
209
+        if (result.status == 200) {
210
+          if(type === 1){
211
+            this.taskTypes1 = result.list || [];
212
+          }else if(type === 2){
213
+            this.taskTypes2 = result.list || [];
214
+          }
215
+          isFirst && this.getDeptType(true);
216
+        }
217
+      });
218
+  }
219
+
220
+  //获取所有科室类型
221
+  allDeptTypes:any[] = [];
222
+  getDeptType(isFirst:boolean = false) {
223
+    isFirst && (this.loading = true);
224
+    this.mainService
225
+      .getDictionary("list", "dept_type")
226
+      .subscribe((result) => {
227
+        this.allDeptTypes = result;
228
+        isFirst && this.getRecoveryDepts('', true);
229
+      });
230
+  }
231
+
232
+  //获取所有科室
233
+  getRecoveryDepts(e:string = '', isFirst:boolean = false) {
234
+    isFirst && (this.loading = true);
235
+    let recovery = this.allDeptTypes.find(v => v.value === 'recovery');
236
+    let postData = {
237
+      idx: 0,
238
+      sum: 10,
239
+      department: {
240
+        dept: e,
241
+        hospital: {
242
+          id: this.hosId
243
+        },
244
+        type: recovery || undefined
245
+      }
246
+    };
247
+    this.isLoading = true;
248
+    this.mainService
249
+      .getFetchDataList("data", "department", postData)
250
+      .subscribe((result) => {
251
+        this.isLoading = false;
252
+        if (result.status == 200) {
253
+          this.recoveryDepts = result.list || [];
254
+          isFirst && this.getConfig();
255
+        }
256
+      });
257
+  }
258
+  // 获取配置
259
+  getConfig() {
260
+    this.loading = true;
261
+    this.mainService
262
+      .getDictionary("list", "ordinary_field")
263
+      .subscribe((data) => {
264
+        this.surgeryField = data.find(v => v.value == 'surgery');
265
+        if(this.surgeryField){
266
+          let postData = {
267
+            idx: 0,
268
+            sum: 10,
269
+            taskTypeConfig: {
270
+              hosId: this.hosId,
271
+              ordinaryField: this.surgeryField
272
+            }
273
+          };
274
+          this.mainService
275
+            .getFetchDataList("simple/data", "taskTypeConfig", postData)
276
+            .subscribe((result) => {
277
+              this.loading = false;
278
+              if (result.status == 200) {
279
+                this.configs = result.list[0] || {};
280
+
281
+                // 接手术关联任务类型
282
+                this.tasktypeId = this.configs.taskTypeDTO ? this.configs.taskTypeDTO.id : null;
283
+                if(this.tasktypeId && this.configs.taskTypeDTO){
284
+                  let isInArr = this.taskTypes1.some(v => v.id == this.tasktypeId);
285
+                  if(!isInArr){
286
+                    this.taskTypes1.unshift(this.configs.taskTypeDTO);
287
+                  }
288
+                }
289
+
290
+                // 苏醒室科室
291
+                this.recoveryDeptId = this.configs.recoveryDeptId || null;
292
+                if(this.recoveryDeptId && this.configs.recoveryDeptDTO){
293
+                  let isInArr = this.recoveryDepts.some(v => v.id == this.recoveryDeptId);
294
+                  if(!isInArr){
295
+                    this.recoveryDepts.unshift(this.configs.recoveryDeptDTO);
296
+                  }
297
+                }
298
+
299
+                this.autoCreateOrders[0].checked = this.configs.autoCreate == 1;
300
+                this.autoTime = this.configs.createTime ? new Date(this.configs.createTime) : null;
301
+                this.autoSendWard[0].checked = this.configs.remandClinical == 1;
302
+
303
+                // 送回病房科室
304
+                this.tasktype1Id = this.configs.clinicalTypeId || null;
305
+                if(this.tasktype1Id && this.configs.clinicalTypeDTO){
306
+                  let isInArr = this.taskTypes1.some(v => v.id == this.tasktype1Id);
307
+                  if(!isInArr){
308
+                    this.taskTypes1.unshift(this.configs.clinicalTypeDTO);
309
+                  }
310
+                }
311
+                this.autoSendAwakeningRoom[0].checked = this.configs.remandRecovery == 1;
312
+
313
+                // 送回苏醒室科室
314
+                this.tasktype2Id = this.configs.recoveryTypeId || null;
315
+                if(this.tasktype2Id && this.configs.recoveryType){
316
+                  let isInArr = this.taskTypes1.some(v => v.id == this.tasktype2Id);
317
+                  if(!isInArr){
318
+                    this.taskTypes1.unshift(this.configs.recoveryType);
319
+                  }
320
+                }
321
+
322
+                this.autoRemandClean[0].checked = this.configs.remandClean == 1;
323
+
324
+                // 关联手术清洁
325
+                this.cleanTypeId = this.configs.cleanTypeId || null;
326
+                if(this.cleanTypeId && this.configs.cleanType){
327
+                  let isInArr = this.taskTypes2.some(v => v.id == this.cleanTypeId);
328
+                  if(!isInArr){
329
+                    this.taskTypes2.unshift(this.configs.cleanType);
330
+                  }
331
+                }
332
+
333
+                this.surgeryBegin[0].checked = this.configs.surgeryBegin == 1;
334
+              }
335
+            });
336
+        }else{
337
+          this.loading = false;
338
+        }
339
+      });
340
+  }
341
+}
342
+
343
+

+ 17 - 0
src/app/views/acc-examine-set/acc-examine-set.module.ts

@@ -0,0 +1,17 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { AccExamineSetRoutingModule } from './acc-examine-set-routing.module';
5
+import { AccExamineSetComponent } from './acc-examine-set.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [AccExamineSetComponent],
11
+  imports: [
12
+    CommonModule,
13
+    AccExamineSetRoutingModule,
14
+    ShareModule
15
+  ]
16
+})
17
+export class AccExamineSetModule { }

+ 5 - 0
src/app/views/main/main-routing.module.ts

@@ -413,6 +413,11 @@ const routes: Routes = [
413 413
         path: "questionnaireAnswer",
414 414
         loadChildren: () => import("../questionnaire-answer/questionnaire-answer.module").then((m) => m.QuestionnaireAnswerModule),
415 415
       },
416
+			// 陪检问卷配置
417
+			{
418
+			  path: "accExamineSet",
419
+			  loadChildren: () => import("../acc-examine-set/acc-examine-set.module").then((m) => m.AccExamineSetModule),
420
+			},
416 421
       // 条码预制
417 422
       {
418 423
         path: "barcodePrefabrication",