浏览代码

医费页面控制

seimin 1 年之前
父节点
当前提交
261c450818

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

@@ -108,6 +108,11 @@ const routes: Routes = [
108 108
         path: "quiltWashingSendPageControl",
109 109
         loadChildren: () => import("../quilt-washing-send-page-control/quilt-washing-send-page-control.module").then((m) => m.QuiltWashingSendPageControlModule),
110 110
       },
111
+      // 医废页面控制
112
+      {
113
+        path: "medicalWastePageControl",
114
+        loadChildren: () => import("../medical-waste-page-control/medical-waste-page-control.module").then((m) => m.MedicalWastePageControlModule),
115
+      },
111 116
       // 限制发起时间
112 117
       {
113 118
         path: "limitInitiationTime",

+ 14 - 0
src/app/views/medical-waste-page-control/medical-waste-page-control-routing.module.ts

@@ -0,0 +1,14 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { MedicalWastePageControlComponent } from './medical-waste-page-control.component';
4
+
5
+
6
+const routes: Routes = [
7
+  { path: '', component: MedicalWastePageControlComponent }
8
+];
9
+
10
+@NgModule({
11
+  imports: [RouterModule.forChild(routes)],
12
+  exports: [RouterModule]
13
+})
14
+export class MedicalWastePageControlRoutingModule { }

+ 68 - 0
src/app/views/medical-waste-page-control/medical-waste-page-control.component.html

@@ -0,0 +1,68 @@
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 nzAllowClear
18
+            (nzOnSearch)="changeTasktype($event)" nzPlaceHolder="请选择关联医废任务类型" [(ngModel)]="taskTypeId">
19
+            <ng-container *ngFor="let option of taskTypes">
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" nzPlaceHolder="请选择回收支持交接方式" [(ngModel)]="wasteHandoverType">
31
+            <ng-container *ngFor="let data of waste_handover_type">
32
+              <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
33
+            </ng-container>
34
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
35
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
36
+            </nz-option>
37
+          </nz-select>
38
+        </div>
39
+        <!-- 医废存储科室 -->
40
+        <div class="display_flex align-items_center mb8">
41
+          <nz-form-label class="label" nzRequired>医废存储科室</nz-form-label>
42
+          <nz-select class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear nzPlaceHolder="请选择医废存储科室" (nzOnSearch)="changeDept($event)" [(ngModel)]="wasteDept">
43
+            <ng-container *ngFor="let data of wasteDepts">
44
+              <nz-option *ngIf="!isLoading" [nzLabel]="data.dept" [nzValue]="data.id"></nz-option>
45
+            </ng-container>
46
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
47
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
48
+            </nz-option>
49
+          </nz-select>
50
+        </div>
51
+      </div>
52
+      <!-- 自动建单配置 -->
53
+      <div *ngIf="tabModalName=='automaticOrderCreation'">
54
+      </div>
55
+      <div class="bottom">
56
+        <button class="login-form-button" nzType="primary" [nzLoading]="btnLoading" nz-button (click)="submitForm()">保存</button>
57
+      </div>
58
+    </div>
59
+    <div class="list" *ngIf="loading">
60
+      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
61
+        <div class="loadingFullInner">
62
+          <img src="../../../assets/images/loading.gif" alt="">
63
+          <div>加载中...</div>
64
+        </div>
65
+      </div>
66
+    </div>
67
+  </div>
68
+</div>

文件差异内容过多而无法显示
+ 1251 - 0
src/app/views/medical-waste-page-control/medical-waste-page-control.component.less


+ 192 - 0
src/app/views/medical-waste-page-control/medical-waste-page-control.component.ts

@@ -0,0 +1,192 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ToolService } from 'src/app/services/tool.service';
3
+import { NzMessageService } from 'ng-zorro-antd';
4
+import { Subject } from 'rxjs';
5
+import { debounceTime } from 'rxjs/operators';
6
+import { MedicalWastePageControlService } from './medical-waste-page-control.service';
7
+
8
+@Component({
9
+  selector: "app-medical-waste-page-control",
10
+  templateUrl: "./medical-waste-page-control.component.html",
11
+  styleUrls: ["./medical-waste-page-control.component.less"],
12
+})
13
+export class MedicalWastePageControlComponent implements OnInit {
14
+  loading:boolean = false; //页面加载的loading
15
+  btnLoading:boolean = false; //提交按钮的loading
16
+  tabModalName:string = 'characteristics'; //当前选中的tab
17
+  hosId = this.tool.getCurrentHospital().id; //当前院区
18
+
19
+  // 医废存储科室
20
+  wasteDept:any = null;
21
+  // 回收支持交接方式
22
+  wasteHandoverType:any = null;
23
+  // 配置
24
+  configs:any = {};
25
+  searchTimerSubject = new Subject();
26
+  constructor(private otherPageControlService: MedicalWastePageControlService, private tool: ToolService, private msg: NzMessageService) {}
27
+
28
+  ngOnInit():void {
29
+    // todo
30
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
31
+      let fun = v[0];
32
+      fun.call(this, v[1]);
33
+    });
34
+    this.getTaskTypes();
35
+    this.getDepts();
36
+    this.getWasteHandoverType();
37
+    this.getConfig();
38
+  }
39
+
40
+  // 边输入边搜索节流阀
41
+  searchTimer(fun, e) {
42
+    this.isLoading = true;
43
+    this.searchTimerSubject.next([fun, e]);
44
+  }
45
+
46
+  // 用户输入搜索任务类型
47
+  isLoading: boolean = false;
48
+  taskTypeId:any = null;
49
+  taskTypes:any[] = [];
50
+  changeTasktype(e) {
51
+    this.searchTimer(this.getTaskTypes, e);
52
+  }
53
+
54
+  changeDept(e) {
55
+    this.searchTimer(this.getDepts, e);
56
+  }
57
+
58
+  //获取任务类型
59
+  getTaskTypes(e:string = '') {
60
+    let postData:any = {
61
+      idx: 0,
62
+      sum: 9999,
63
+      taskType: {
64
+        taskName: e,
65
+        simpleQuery: true,
66
+        hosId: {
67
+          id: this.hosId
68
+        },
69
+        ordinaryField: {
70
+          key: 'ordinary_field',
71
+          value: 'clinicalWaste'
72
+        }
73
+      }
74
+    };
75
+    this.isLoading = true;
76
+    this.otherPageControlService
77
+      .getTaskTypes(postData)
78
+      .subscribe((result) => {
79
+        this.isLoading = false;
80
+        if (result.status == 200) {
81
+          this.taskTypes = result.list || [];
82
+        }
83
+      });
84
+  }
85
+
86
+  //获取科室
87
+  wasteDepts:any = [];
88
+  getDepts(e:string = '') {
89
+    this.isLoading = true;
90
+    let postData = {
91
+      idx: 0,
92
+      sum: 9999,
93
+      department: {
94
+        searchType: 1,// 简单查询
95
+        dept: e,
96
+        cascadeHosId: this.hosId,
97
+      }
98
+    };
99
+    this.otherPageControlService
100
+      .getDepts(postData)
101
+      .subscribe((result) => {
102
+        this.isLoading = false;
103
+        if (result.status == 200) {
104
+          this.wasteDepts = result.list || [];
105
+        }
106
+      });
107
+  }
108
+  //获取批次号生成规则
109
+  waste_handover_type:any = [];
110
+  getWasteHandoverType() {
111
+    this.isLoading = true;
112
+    this.otherPageControlService
113
+      .getDictionary("waste_handover_type")
114
+      .subscribe((data) => {
115
+        this.isLoading = false;
116
+        this.waste_handover_type = data;
117
+      });
118
+  }
119
+  // 切换tab
120
+  tabModal(tabModalName:string){
121
+    this.tabModalName = tabModalName;
122
+  }
123
+
124
+  // 保存
125
+  submitForm() {
126
+    if(!this.taskTypeId){
127
+      this.msg.create("warning", "请先配置关联医废任务类型!");
128
+      return;
129
+    }
130
+
131
+    if(!this.wasteHandoverType){
132
+      this.msg.create("warning", "请先配置回收支持交接方式!");
133
+      return;
134
+    }
135
+
136
+    if(!this.wasteDept){
137
+      this.msg.create("warning", "请先配置医废存储科室!");
138
+      return;
139
+    }
140
+
141
+    let postData:any = {
142
+      id: this.configs.id,
143
+      taskType: this.taskTypeId,
144
+      hosId: this.hosId,
145
+      wasteDept: this.wasteDept,
146
+      wasteHandoverType: { id: this.wasteHandoverType },
147
+    };
148
+    this.btnLoading = true;
149
+    this.otherPageControlService
150
+      .simplePost("addData", "taskTypeConfig", postData)
151
+      .subscribe((result) => {
152
+        this.btnLoading = false;
153
+        if (result.status == 200) {
154
+          this.getConfig();
155
+        }
156
+      });
157
+  }
158
+
159
+  // 获取配置
160
+  getConfig() {
161
+    this.loading = true;
162
+    let postData = {
163
+      idx: 0,
164
+      sum: 10,
165
+      taskTypeConfig: {
166
+        taskTypeDTO: {
167
+          hosId: {
168
+            id: this.hosId
169
+          },
170
+          ordinaryField: {
171
+            key: 'ordinary_field',
172
+            value: 'clinicalWaste'
173
+          }
174
+        }
175
+      }
176
+    };
177
+    this.otherPageControlService
178
+      .getConfig(postData)
179
+      .subscribe((result) => {
180
+        this.loading = false;
181
+        if (result.status == 200) {
182
+          this.configs = result.list[0] || {};
183
+          this.wasteDept = this.configs.wasteDept;
184
+          this.wasteHandoverType = this.configs.wasteHandoverType ? this.configs.wasteHandoverType.id : null;
185
+          this.taskTypeId = this.configs.taskType || null;
186
+        }
187
+      });
188
+  }
189
+}
190
+
191
+
192
+

+ 19 - 0
src/app/views/medical-waste-page-control/medical-waste-page-control.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { MedicalWastePageControlRoutingModule } from './medical-waste-page-control-routing.module';
5
+import { MedicalWastePageControlComponent } from './medical-waste-page-control.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    MedicalWastePageControlComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    MedicalWastePageControlRoutingModule,
16
+    ShareModule,
17
+  ]
18
+})
19
+export class MedicalWastePageControlModule { }

+ 52 - 0
src/app/views/medical-waste-page-control/medical-waste-page-control.service.ts

@@ -0,0 +1,52 @@
1
+import { Injectable } from '@angular/core';
2
+import { MainService } from 'src/app/services/main.service';
3
+import { map } from 'rxjs/operators';
4
+
5
+@Injectable({
6
+  providedIn: 'root'
7
+})
8
+export class MedicalWastePageControlService {
9
+
10
+  constructor(
11
+    private mainService: MainService,
12
+  ) { }
13
+
14
+  // 字典
15
+  getDictionary(type) {
16
+    return this.mainService.getDictionary("list", type);
17
+  }
18
+
19
+  // 获取配置列表
20
+  getConfig(postData) {
21
+    return this.mainService.getFetchDataList("simple/data", "taskTypeConfig", postData);
22
+  }
23
+
24
+  // 获取其他临床服务任务类型列表
25
+  getTaskTypes(postData) {
26
+    return this.mainService.getFetchDataList("simple/data", "taskType", postData).pipe(map((v:any) => {
27
+      if(Array.isArray(v.list)){
28
+        v.list = v.list.map(vv => ({id: vv.id, taskName: vv.taskName}));
29
+      }else{
30
+        v.list = [];
31
+      }
32
+      return v;
33
+    }));
34
+  }
35
+
36
+  // 获取科室列表
37
+  getDepts(postData) {
38
+    return this.mainService.getFetchDataList("simple/data", "department", postData).pipe(map((v:any) => {
39
+      if(Array.isArray(v.list)){
40
+        v.list = v.list.map(vv => ({id: vv.id, dept: vv.dept}));
41
+      }else{
42
+        v.list = [];
43
+      }
44
+      return v;
45
+    }));
46
+  }
47
+
48
+  // simple增删改
49
+  simplePost(type, model, postData) {
50
+    return this.mainService.simplePost(type, model, postData);
51
+  }
52
+}