Browse Source

检查自动建单列表

seimin 3 years ago
parent
commit
cf067f0078

+ 1 - 1
proxy.conf.json

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

+ 1 - 1
src/app/services/main.service.ts

@@ -406,7 +406,7 @@ export class MainService {
406 406
       { headers: this.headers }
407 407
     );
408 408
   }
409
-  //simple增删改查,addData新增
409
+  //simple增删改查,addData新增,addListData批量新增
410 410
   simplePost(coop, type, data): any {
411 411
     return this.http.post(
412 412
       host.host + "/simple/data/" + coop + "/" + type,

+ 14 - 0
src/app/views/inspect-auto/inspect-auto-routing.module.ts

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

+ 111 - 0
src/app/views/inspect-auto/inspect-auto.component.html

@@ -0,0 +1,111 @@
1
+<div class="inspectAutoManagement">
2
+  <div class="inspectAutoInfo">
3
+    <div class="title">班次信息<span class="taskTypeName">{{taskTypeName}}</span></div>
4
+    <div class="inspectAutos" [ngStyle]="{display:!loading1?'block':'none'}">
5
+      <overlay-scrollbars #osComponentRef1 [ngStyle]="{ height:'100%' }">
6
+        <div [ngClass]="{'item':true,'checked':data.id==checkedInspectAuto.id}" *ngFor="let data of inspectAutoList"
7
+          (click)="checkInspectAuto(data)" [title]="data.name">{{data.name}}
8
+        </div>
9
+      </overlay-scrollbars>
10
+    </div>
11
+    <div class="inspectAutos" *ngIf="loading1">
12
+      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
13
+        <div class="loadingFullInner">
14
+          <img src="../../../assets/images/loading.gif" alt="">
15
+          <div>加载中...</div>
16
+        </div>
17
+      </div>
18
+    </div>
19
+  </div>
20
+  <div class="userInfo">
21
+    <div class="top display_flex justify-content_flex-end align-items_center">
22
+      <div class="display_flex align-items_center">
23
+        <button class="btn default" *ngIf="coopBtns.edit&&inspectAutoList.length" nzType="primary" nz-button
24
+          [nzLoading]="saveLoading" (click)="save()">保存</button>
25
+      </div>
26
+    </div>
27
+    <div class="table" *ngIf="!loading2">
28
+      <div class="inspectAutoManagementTable">
29
+        <overlay-scrollbars #osComponentRef2 [ngStyle]="{ height:'100%' }">
30
+          <div class="inspectAutoGroup">
31
+            <div class="urgencyOrOrdinary mt8">
32
+              <div><label nz-checkbox [(ngModel)]="urgencyInspect"
33
+                  (ngModelChange)="changeInspect($event,'urgencyInspect')">急查</label></div>
34
+              <div *ngIf="urgencyInspect">
35
+                <div class="mt8">检查类型:</div>
36
+                <nz-checkbox-wrapper (nzOnChange)="selectInspectType($event,'urgencyInspect')">
37
+                  <div class="clearfixer mt8 ml16">
38
+                    <label class="fl mr8" style="margin-left:0;" nz-checkbox [nzValue]="item.id"
39
+                      *ngFor="let item of inspectTypeList_u" [ngModel]="item.checked">{{item.name}}</label>
40
+                  </div>
41
+                </nz-checkbox-wrapper>
42
+              </div>
43
+              <div *ngIf="inspectType_u">
44
+                <div class="mt8">护理等级:</div>
45
+                <nz-checkbox-wrapper (nzOnChange)="selectLevelOfCare($event,'urgencyInspect')">
46
+                  <div class="clearfixer mt8 ml16">
47
+                    <label class="fl mr8" style="margin-left:0;" nz-checkbox [nzValue]="item.id"
48
+                      *ngFor="let item of levelOfCareList_u" [ngModel]="item.checked">{{item.name}}</label>
49
+                  </div>
50
+                </nz-checkbox-wrapper>
51
+              </div>
52
+              <div *ngIf="inspectType_u">
53
+                <div class="mt8">病情级别:</div>
54
+                <nz-checkbox-wrapper (nzOnChange)="selectStateOfAnIllness($event,'urgencyInspect')">
55
+                  <div class="clearfixer mt8 ml16">
56
+                    <label class="fl mr8" style="margin-left:0;" nz-checkbox [nzValue]="item.id"
57
+                      *ngFor="let item of stateOfAnIllnessList_u" [ngModel]="item.checked">{{item.name}}</label>
58
+                  </div>
59
+                </nz-checkbox-wrapper>
60
+              </div>
61
+            </div>
62
+            <div class="urgencyOrOrdinary mt8">
63
+              <div><label nz-checkbox [(ngModel)]="ordinaryInspect"
64
+                  (ngModelChange)="changeInspect($event,'ordinaryInspect')">普查</label></div>
65
+              <div *ngIf="ordinaryInspect">
66
+                <div class="mt8">检查类型:</div>
67
+                <nz-checkbox-wrapper (nzOnChange)="selectInspectType($event,'ordinaryInspect')">
68
+                  <div class="clearfixer mt8 ml16">
69
+                    <label class="fl mr8" style="margin-left:0;" nz-checkbox [nzValue]="item.id"
70
+                      *ngFor="let item of inspectTypeList_o" [ngModel]="item.checked">{{item.name}}</label>
71
+                  </div>
72
+                </nz-checkbox-wrapper>
73
+              </div>
74
+              <div *ngIf="inspectType_o">
75
+                <div class="mt8">护理等级:</div>
76
+                <nz-checkbox-wrapper (nzOnChange)="selectLevelOfCare($event,'ordinaryInspect')">
77
+                  <div class="clearfixer mt8 ml16">
78
+                    <label class="fl mr8" style="margin-left:0;" nz-checkbox [nzValue]="item.id"
79
+                      *ngFor="let item of levelOfCareList_o" [ngModel]="item.checked">{{item.name}}</label>
80
+                  </div>
81
+                </nz-checkbox-wrapper>
82
+              </div>
83
+              <div *ngIf="inspectType_o">
84
+                <div class="mt8">病情级别:</div>
85
+                <nz-checkbox-wrapper (nzOnChange)="selectStateOfAnIllness($event,'ordinaryInspect')">
86
+                  <div class="clearfixer mt8 ml16">
87
+                    <label class="fl mr8" style="margin-left:0;" nz-checkbox [nzValue]="item.id"
88
+                      *ngFor="let item of stateOfAnIllnessList_o" [ngModel]="item.checked">{{item.name}}</label>
89
+                  </div>
90
+                </nz-checkbox-wrapper>
91
+              </div>
92
+            </div>
93
+          </div>
94
+        </overlay-scrollbars>
95
+      </div>
96
+    </div>
97
+    <div class="table" *ngIf="loading2">
98
+      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
99
+        <div class="loadingFullInner">
100
+          <img src="../../../assets/images/loading.gif" alt="">
101
+          <div>加载中...</div>
102
+        </div>
103
+      </div>
104
+    </div>
105
+  </div>
106
+</div>
107
+
108
+<!-- 操作成功/失败提示框 -->
109
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
110
+  [info]="promptInfo">
111
+</app-prompt-modal>

+ 257 - 0
src/app/views/inspect-auto/inspect-auto.component.less

@@ -0,0 +1,257 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  width: 100%;
4
+  height: 100%;
5
+}
6
+
7
+.inspectAutoManagement {
8
+  width: 100%;
9
+  height: 100%;
10
+  background: #f9fafb;
11
+  padding: 16px 20px;
12
+  min-height: 532px;
13
+  overflow: hidden;
14
+
15
+  .inspectAutoInfo {
16
+    float: left;
17
+    width: 24%;
18
+    height: 100%;
19
+    min-height: calc(100vh - 120px);
20
+    border: 1px solid #e5e9ed;
21
+    background: #fff;
22
+    color: #333;
23
+    font-size: 14px;
24
+    position: relative;
25
+    overflow: hidden;
26
+
27
+    .title {
28
+      width: 100%;
29
+      height: 40px;
30
+      padding-left: 16px;
31
+      padding-right: 16px;
32
+      border-bottom: 1px solid #e5e9ed;
33
+      position: relative;
34
+      background: #fff;
35
+      z-index: 2;
36
+      display: flex;
37
+      justify-content: space-between;
38
+      align-items: center;
39
+      .taskTypeName {
40
+        color: @primary-color;
41
+        font-weight: bold;
42
+      }
43
+    }
44
+
45
+    .inspectAutos {
46
+      width: 100%;
47
+      height: 100%;
48
+      position: absolute;
49
+      top: 0;
50
+      padding-top: 40px;
51
+      overflow-y: auto;
52
+      z-index: 1;
53
+
54
+      .item {
55
+        width: 100%;
56
+        height: 34px;
57
+        line-height: 34px;
58
+        text-align: center;
59
+        cursor: pointer;
60
+        overflow: hidden;
61
+        text-overflow: ellipsis;
62
+        white-space: nowrap;
63
+
64
+        &:hover {
65
+          color: @primary-color;
66
+          background: #f0f6ed;
67
+        }
68
+
69
+        &.checked {
70
+          color: @primary-color;
71
+          background: #f0f6ed;
72
+        }
73
+      }
74
+    }
75
+  }
76
+
77
+  .userInfo {
78
+    float: right;
79
+    width: 74%;
80
+    height: 100%;
81
+    min-height: calc(100vh - 120px);
82
+    border: 1px solid #e5e9ed;
83
+    background: #fff;
84
+    color: #333;
85
+    position: relative;
86
+
87
+    .top {
88
+      height: 74px;
89
+      padding: 0 16px;
90
+      line-height: 74px;
91
+      border-bottom: 1px solid #e5e9ed;
92
+      position: relative;
93
+      z-index: 2;
94
+
95
+      & > div {
96
+        input {
97
+          width: 224px;
98
+        }
99
+
100
+        button {
101
+          margin-left: 24px;
102
+        }
103
+      }
104
+    }
105
+
106
+    .table {
107
+      width: 100%;
108
+      height: 100%;
109
+      padding: 15px;
110
+      position: absolute;
111
+      top: 0;
112
+      padding-top: 90px;
113
+
114
+      .inspectAutoManagementTable {
115
+        height: 100%;
116
+        border-radius: 5px;
117
+        padding: 16px;
118
+        background: #f9fafb;
119
+        border: 1px solid #e5e9ed;
120
+        .inspectAutoGroup {
121
+          .urgencyOrOrdinary {
122
+            padding-bottom: 16px;
123
+            border-bottom: 1px solid #ccc;
124
+          }
125
+        }
126
+      }
127
+    }
128
+  }
129
+
130
+  .save {
131
+    position: fixed;
132
+    left: 0;
133
+    top: 0;
134
+    width: 100%;
135
+    height: 100%;
136
+    background: rgba(0, 0, 0, 0.4);
137
+    z-index: 99;
138
+
139
+    .modalBody {
140
+      width: 350px;
141
+      height: 220px;
142
+      background: #fff;
143
+      border-radius: 5px;
144
+      padding: 10px 20px;
145
+      color: #333;
146
+
147
+      .title {
148
+        width: 100%;
149
+        text-align: center;
150
+        font-size: 18px;
151
+        position: relative;
152
+
153
+        i {
154
+          position: absolute;
155
+          right: 0;
156
+          top: 0;
157
+          font-size: 20px;
158
+          color: #666;
159
+          cursor: pointer;
160
+          padding: 0 5px;
161
+        }
162
+      }
163
+
164
+      .content {
165
+        width: 310px;
166
+        height: 117px;
167
+        background: #f9fafb;
168
+        border: 1px solid #e5e9ed;
169
+        border-radius: 5px;
170
+        overflow: hidden;
171
+        margin-top: 12px;
172
+
173
+        div {
174
+          text-align: center;
175
+          margin: 0;
176
+
177
+          &.icon {
178
+            margin-top: 17px;
179
+
180
+            i {
181
+              color: #34b349;
182
+              font-size: 30px !important;
183
+
184
+              &.transport-wenhao {
185
+                color: #f5a523;
186
+              }
187
+
188
+              &.transport-shibai {
189
+                color: #ff3a52;
190
+              }
191
+            }
192
+          }
193
+
194
+          &.defeat {
195
+            color: #333;
196
+            font-size: 18px;
197
+          }
198
+
199
+          &:nth-child(3) {
200
+            font-size: 14px;
201
+            color: #666;
202
+          }
203
+        }
204
+      }
205
+
206
+      button {
207
+        margin-top: 10px;
208
+
209
+        &.btn {
210
+          margin-left: 8px;
211
+        }
212
+      }
213
+    }
214
+
215
+    // 新增
216
+    &.add {
217
+      .modalBody {
218
+        width: 480px;
219
+        height: auto;
220
+
221
+        .content {
222
+          width: 100%;
223
+          height: auto;
224
+          padding: 18px 14px 0 14px;
225
+
226
+          .addForm {
227
+            .ant-form-item {
228
+              margin-bottom: 15px;
229
+
230
+              .ant-form-item-label {
231
+                line-height: 0;
232
+                text-align: left;
233
+              }
234
+            }
235
+          }
236
+
237
+          .editForm {
238
+            .ant-form-item {
239
+              margin-bottom: 15px;
240
+
241
+              .ant-form-item-label {
242
+                line-height: 0;
243
+                text-align: left;
244
+              }
245
+            }
246
+          }
247
+        }
248
+
249
+        button {
250
+          &:nth-child(1) {
251
+            margin-right: 20px;
252
+          }
253
+        }
254
+      }
255
+    }
256
+  }
257
+}

+ 536 - 0
src/app/views/inspect-auto/inspect-auto.component.ts

@@ -0,0 +1,536 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { NzMessageService } from "ng-zorro-antd/message";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
7
+import { ToolService } from "../../services/tool.service";
8
+
9
+@Component({
10
+  selector: "app-inspect-auto",
11
+  templateUrl: "./inspect-auto.component.html",
12
+  styleUrls: ["./inspect-auto.component.less"],
13
+})
14
+export class InspectAutoComponent implements OnInit {
15
+  constructor(
16
+    private route: ActivatedRoute,
17
+    private mainService: MainService,
18
+    private msg: NzMessageService,
19
+    private tool: ToolService
20
+  ) {}
21
+  @ViewChild("osComponentRef1", {
22
+    read: OverlayScrollbarsComponent,
23
+    static: false,
24
+  })
25
+  osComponentRef1: OverlayScrollbarsComponent;
26
+  @ViewChild("osComponentRef2", {
27
+    read: OverlayScrollbarsComponent,
28
+    static: false,
29
+  })
30
+  osComponentRef2: OverlayScrollbarsComponent;
31
+  ngOnInit() {
32
+    this.hosId = this.tool.getCurrentHospital().id;
33
+    this.coopBtns = this.tool.initCoopBtns(this.route);
34
+    this.getInspectAutoList();
35
+    this.getInspectType();
36
+    this.getLevelOfCare();
37
+    this.getStateOfAnIllness();
38
+  }
39
+  checkedInspectAuto: any = {}; //选中班次
40
+  inspectAutoList: Array<any> = []; //检查自动建单的班次信息
41
+  hosId: any; //当前选择的院区id
42
+
43
+  promptContent: string; //操作提示框提示信息
44
+  ifSuccess: boolean; //操作成功/失败
45
+  promptInfo: string; //操作结果提示信息
46
+  promptModalShow: boolean; //是否展示提示框
47
+
48
+  saveLoading: boolean = false; //批量打印按钮loading状态
49
+
50
+  // 初始化增删改按钮
51
+  coopBtns: any = {};
52
+  // 取消选中状态
53
+  cancelStatus(arr: any[]) {
54
+    arr.forEach((item) => (item.checked = false));
55
+    return arr;
56
+  }
57
+  // 选择急查或者普查
58
+  changeInspect(flag, type) {
59
+    if (!flag) {
60
+      if (type === "urgencyInspect") {
61
+        //急查
62
+        this.inspectTypeList_u = this.cancelStatus(this.inspectTypeList_u);
63
+        this.levelOfCareList_u = this.cancelStatus(this.levelOfCareList_u);
64
+        this.stateOfAnIllnessList_u = this.cancelStatus(
65
+          this.stateOfAnIllnessList_u
66
+        );
67
+        this.inspectType_u = false;
68
+        this.levelOfCare_u = false;
69
+        this.stateOfAnIllness_u = false;
70
+      } else if (type === "ordinaryInspect") {
71
+        //普查
72
+        this.inspectTypeList_o = this.cancelStatus(this.inspectTypeList_o);
73
+        this.levelOfCareList_o = this.cancelStatus(this.levelOfCareList_o);
74
+        this.stateOfAnIllnessList_o = this.cancelStatus(
75
+          this.stateOfAnIllnessList_o
76
+        );
77
+        this.inspectType_o = false;
78
+        this.levelOfCare_o = false;
79
+        this.stateOfAnIllness_o = false;
80
+      }
81
+    }
82
+  }
83
+  /**
84
+   *
85
+   * @param classId 班次Id
86
+   */
87
+  loading2 = false;
88
+  getRules() {
89
+    let postData = {
90
+      idx: 0,
91
+      sum: 9999,
92
+      autoCreateOrderRule: {
93
+        hosId: this.hosId,
94
+        classesId: this.checkedInspectAuto.id, //班次id
95
+        taskTypeId: this.taskTypeId, //任务类型id
96
+        deleted: 0,
97
+      },
98
+    };
99
+    this.loading2 = true;
100
+    this.mainService
101
+      .getFetchDataList("simple/data", "autoCreateOrderRule", postData)
102
+      .subscribe((result) => {
103
+        this.loading2 = false;
104
+        if (result.status == 200) {
105
+          result.list.forEach((item) => {
106
+            if (item.extra1 === "1") {
107
+              //急查
108
+              this.urgencyInspect = true;
109
+              this.inspectType_u = this.inspectTypeList_u.some((v) => {
110
+                if (v.id == item.typeId) {
111
+                  v.checked = true;
112
+                }
113
+                return v.id == item.typeId;
114
+              });
115
+              this.levelOfCare_u = this.levelOfCareList_u.some((v) => {
116
+                if (v.id == item.typeId2) {
117
+                  v.checked = true;
118
+                }
119
+                return v.id == item.typeId2;
120
+              });
121
+              this.stateOfAnIllness_u = this.stateOfAnIllnessList_u.some(
122
+                (v) => {
123
+                  if (v.id == item.typeId3) {
124
+                    v.checked = true;
125
+                  }
126
+                  return v.id == item.typeId3;
127
+                }
128
+              );
129
+            }
130
+            if (item.extra1 === "0") {
131
+              //普查
132
+              this.ordinaryInspect = true;
133
+              this.inspectType_o = this.inspectTypeList_o.some((v) => {
134
+                if (v.id == item.typeId) {
135
+                  v.checked = true;
136
+                }
137
+                return v.id == item.typeId;
138
+              });
139
+              this.levelOfCare_o = this.levelOfCareList_o.some((v) => {
140
+                if (v.id == item.typeId2) {
141
+                  v.checked = true;
142
+                }
143
+                return v.id == item.typeId2;
144
+              });
145
+              this.stateOfAnIllness_o = this.stateOfAnIllnessList_o.some(
146
+                (v) => {
147
+                  if (v.id == item.typeId3) {
148
+                    v.checked = true;
149
+                  }
150
+                  return v.id == item.typeId3;
151
+                }
152
+              );
153
+            }
154
+          });
155
+        }
156
+      });
157
+  }
158
+
159
+  // 任务类型下班次列表
160
+  loading1 = false;
161
+  taskTypeId; //当前选中班次的任务类型ID
162
+  taskTypeName; //当前选中班次的任务类型名称
163
+  getInspectAutoList() {
164
+    let data = {
165
+      idx: 0,
166
+      sum: 1,
167
+      taskType: {
168
+        hosIds: this.hosId,
169
+        associationType: { id: 260 },
170
+      },
171
+    };
172
+    this.loading1 = true;
173
+    this.mainService
174
+      .getFetchDataList("configuration", "taskType", data)
175
+      .subscribe((data1) => {
176
+        this.loading1 = false;
177
+        if (data1.list.length) {
178
+          this.inspectAutoList = data1.list[0].classesIds; //班次信息
179
+          this.taskTypeId = data1.list[0].id;
180
+          this.taskTypeName = data1.list[0].taskName;
181
+          if (Object.keys(this.checkedInspectAuto).length) {
182
+            this.inspectAutoList.forEach((item) => {
183
+              if (item.id == this.checkedInspectAuto.id) {
184
+                this.checkInspectAuto(item);
185
+              }
186
+            });
187
+          } else {
188
+            this.checkInspectAuto(this.inspectAutoList[0]);
189
+          }
190
+        } else {
191
+          this.msg.warning("请配置患者配件业务的任务类型!");
192
+        }
193
+      });
194
+  }
195
+  // 检查类型列表
196
+  inspectTypeList_u = []; //检查类型列表(急查)
197
+  inspectTypeList_o = []; //检查类型列表(普查)
198
+  getInspectType() {
199
+    this.mainService
200
+      .getDictionary("list", "inspect_check_type")
201
+      .subscribe((result) => {
202
+        this.inspectTypeList_u = JSON.parse(JSON.stringify(result));
203
+        this.inspectTypeList_o = JSON.parse(JSON.stringify(result));
204
+      });
205
+  }
206
+  // 护理等级列表
207
+  levelOfCareList_u = []; //班次列表(急查)
208
+  levelOfCareList_o = []; //班次列表(普查)
209
+  getLevelOfCare() {
210
+    this.mainService
211
+      .getDictionary("list", "levelOfCare")
212
+      .subscribe((result) => {
213
+        this.levelOfCareList_u = JSON.parse(JSON.stringify(result));
214
+        this.levelOfCareList_o = JSON.parse(JSON.stringify(result));
215
+      });
216
+  }
217
+  // 病情级别列表
218
+  stateOfAnIllnessList_u = []; //病情级别列表(急查)
219
+  stateOfAnIllnessList_o = []; //病情级别列表(普查)
220
+  getStateOfAnIllness() {
221
+    this.mainService
222
+      .getDictionary("list", "stateOfAnIllness")
223
+      .subscribe((result) => {
224
+        this.stateOfAnIllnessList_u = JSON.parse(JSON.stringify(result));
225
+        this.stateOfAnIllnessList_o = JSON.parse(JSON.stringify(result));
226
+      });
227
+  }
228
+  //选择检查类型
229
+  inspectType_u = false; //是否选择检查类型(急查)
230
+  inspectType_o = false; //是否选择检查类型(普查)
231
+  selectInspectType(ids, type) {
232
+    switch (type) {
233
+      case "urgencyInspect": //急查
234
+        this.inspectType_u = ids.length > 0;
235
+        if (this.inspectType_u) {
236
+          this.inspectTypeList_u = this.cancelStatus(this.inspectTypeList_u);
237
+          ids.forEach((item) => {
238
+            this.inspectTypeList_u.forEach((v) => {
239
+              if (v.id == item) {
240
+                v.checked = true;
241
+              }
242
+            });
243
+          });
244
+        } else {
245
+          this.levelOfCareList_u = this.cancelStatus(this.levelOfCareList_u);
246
+          this.stateOfAnIllnessList_u = this.cancelStatus(
247
+            this.stateOfAnIllnessList_u
248
+          );
249
+          this.inspectType_u = false;
250
+          this.levelOfCare_u = false;
251
+          this.stateOfAnIllness_u = false;
252
+        }
253
+        break;
254
+      case "ordinaryInspect": //普查
255
+        this.inspectType_o = ids.length > 0;
256
+        if (this.inspectType_o) {
257
+          this.inspectTypeList_o = this.cancelStatus(this.inspectTypeList_o);
258
+          ids.forEach((item) => {
259
+            this.inspectTypeList_o.forEach((v) => {
260
+              if (v.id == item) {
261
+                v.checked = true;
262
+              }
263
+            });
264
+          });
265
+        } else {
266
+          this.levelOfCareList_o = this.cancelStatus(this.levelOfCareList_o);
267
+          this.stateOfAnIllnessList_o = this.cancelStatus(
268
+            this.stateOfAnIllnessList_o
269
+          );
270
+          this.inspectType_o = false;
271
+          this.levelOfCare_o = false;
272
+          this.stateOfAnIllness_o = false;
273
+        }
274
+        break;
275
+    }
276
+  }
277
+  //选择护理等级
278
+  levelOfCare_u = false; //是否选择护理等级(急查)
279
+  levelOfCare_o = false; //是否选择护理等级(普查)
280
+  selectLevelOfCare(ids, type) {
281
+    switch (type) {
282
+      case "urgencyInspect": //急查
283
+        this.levelOfCareList_u.forEach((item) => {
284
+          item.checked = false;
285
+        });
286
+        ids.forEach((item) => {
287
+          this.levelOfCareList_u.forEach((v) => {
288
+            if (v.id == item) {
289
+              v.checked = true;
290
+            }
291
+          });
292
+        });
293
+        this.levelOfCare_u = ids.length > 0;
294
+        break;
295
+      case "ordinaryInspect": //普查
296
+        this.levelOfCareList_o.forEach((item) => {
297
+          item.checked = false;
298
+        });
299
+        ids.forEach((item) => {
300
+          this.levelOfCareList_o.forEach((v) => {
301
+            if (v.id == item) {
302
+              v.checked = true;
303
+            }
304
+          });
305
+        });
306
+        this.levelOfCare_o = ids.length > 0;
307
+        break;
308
+    }
309
+  }
310
+  //选择病情级别
311
+  stateOfAnIllness_u = false; //是否选择病情级别(急查)
312
+  stateOfAnIllness_o = false; //是否选择病情级别(普查)
313
+  selectStateOfAnIllness(ids, type) {
314
+    switch (type) {
315
+      case "urgencyInspect": //急查
316
+        this.stateOfAnIllnessList_u.forEach((item) => {
317
+          item.checked = false;
318
+        });
319
+        ids.forEach((item) => {
320
+          this.stateOfAnIllnessList_u.forEach((v) => {
321
+            if (v.id == item) {
322
+              v.checked = true;
323
+            }
324
+          });
325
+        });
326
+        this.stateOfAnIllness_u = ids.length > 0;
327
+        break;
328
+      case "ordinaryInspect": //普查
329
+        this.stateOfAnIllnessList_o.forEach((item) => {
330
+          item.checked = false;
331
+        });
332
+        ids.forEach((item) => {
333
+          this.stateOfAnIllnessList_o.forEach((v) => {
334
+            if (v.id == item) {
335
+              v.checked = true;
336
+            }
337
+          });
338
+        });
339
+        this.stateOfAnIllness_o = ids.length > 0;
340
+        break;
341
+    }
342
+  }
343
+  // 选中班次
344
+  checkInspectAuto(data) {
345
+    this.checkedInspectAuto = data ? data : {};
346
+    this.urgencyInspect = false;
347
+    this.ordinaryInspect = false;
348
+    this.changeInspect(false, "urgencyInspect");
349
+    this.changeInspect(false, "ordinaryInspect");
350
+    this.getRules();
351
+  }
352
+  // 保存
353
+  urgencyInspect = false; //是否选择急查
354
+  ordinaryInspect = false; //是否选择普查
355
+  save() {
356
+    // 规则验证 start
357
+    //没有选择急查或普查
358
+    // if (!this.urgencyInspect && !this.ordinaryInspect) {
359
+    //   this.msg.info("没有选择急查或普查,无法保存!");
360
+    //   return;
361
+    // }
362
+    // 选择了急查,没有选择普查
363
+    if (this.urgencyInspect && !this.ordinaryInspect) {
364
+      if (!this.inspectType_u) {
365
+        //没有选择检查类型
366
+        this.msg.info("没有选择急查里的检查类型,无法保存!");
367
+        return;
368
+      } else {
369
+        // 选择了检查类型,没有选择护理等级
370
+        if (!this.levelOfCare_u) {
371
+          this.msg.info("没有选择急查里的护理等级,无法保存!");
372
+          return;
373
+        }
374
+        // 选择了检查类型,没有选择病情级别
375
+        if (!this.stateOfAnIllness_u) {
376
+          this.msg.info("没有选择急查里的病情级别,无法保存!");
377
+          return;
378
+        }
379
+      }
380
+    }
381
+    // 选择了普查,没有选择急查
382
+    if (!this.urgencyInspect && this.ordinaryInspect) {
383
+      if (!this.inspectType_o) {
384
+        //没有选择检查类型
385
+        this.msg.info("没有选择普查里的检查类型,无法保存!");
386
+        return;
387
+      } else {
388
+        // 选择了检查类型,没有选择护理等级
389
+        if (!this.levelOfCare_o) {
390
+          this.msg.info("没有选择普查里的护理等级,无法保存!");
391
+          return;
392
+        }
393
+        // 选择了检查类型,没有选择病情级别
394
+        if (!this.stateOfAnIllness_o) {
395
+          this.msg.info("没有选择普查里的病情级别,无法保存!");
396
+          return;
397
+        }
398
+      }
399
+    }
400
+    // 选择了急查和普查
401
+    if (this.urgencyInspect && this.ordinaryInspect) {
402
+      if (this.urgencyInspect) {
403
+        //选择了急查,没有选择检查类型
404
+        if (!this.inspectType_u) {
405
+          this.msg.info("没有选择急查里的检查类型,无法保存!");
406
+          return;
407
+        } else {
408
+          // 选择了检查类型,没有选择护理等级
409
+          if (!this.levelOfCare_u) {
410
+            this.msg.info("没有选择急查里的护理等级,无法保存!");
411
+            return;
412
+          }
413
+          // 选择了检查类型,没有选择病情级别
414
+          if (!this.stateOfAnIllness_u) {
415
+            this.msg.info("没有选择急查里的病情级别,无法保存!");
416
+            return;
417
+          }
418
+        }
419
+      }
420
+      if (this.ordinaryInspect) {
421
+        //选择了普查,没有选择检查类型
422
+        if (!this.inspectType_o) {
423
+          this.msg.info("没有选择普查里的检查类型,无法保存!");
424
+          return;
425
+        } else {
426
+          // 选择了检查类型,没有选择护理等级
427
+          if (!this.levelOfCare_o) {
428
+            this.msg.info("没有选择普查里的护理等级,无法保存!");
429
+            return;
430
+          }
431
+          // 选择了检查类型,没有选择病情级别
432
+          if (!this.stateOfAnIllness_o) {
433
+            this.msg.info("没有选择普查里的病情级别,无法保存!");
434
+            return;
435
+          }
436
+        }
437
+      }
438
+    }
439
+    // 规则验证 end
440
+    let postData = [];
441
+    // 组装数据 start
442
+    if (!this.urgencyInspect && !this.ordinaryInspect) {
443
+      postData = [
444
+        {
445
+          hosId: this.hosId,
446
+          taskTypeId: this.taskTypeId,
447
+          classesId: this.checkedInspectAuto.id,
448
+          deleted: true,
449
+        },
450
+      ];
451
+    } else {
452
+      // 急查数据
453
+      if (this.urgencyInspect) {
454
+        let inspectTypeList_u = this.inspectTypeList_u
455
+          .filter((item) => item.checked)
456
+          .map((item) => item.id);
457
+        let levelOfCareList_u = this.levelOfCareList_u
458
+          .filter((item) => item.checked)
459
+          .map((item) => item.id);
460
+        let stateOfAnIllnessList_u = this.stateOfAnIllnessList_u
461
+          .filter((item) => item.checked)
462
+          .map((item) => item.id);
463
+        // 三层循环,感觉有些傻,无奈后端非要这么传-后端陈肖让我记录的
464
+        inspectTypeList_u.forEach((item) => {
465
+          levelOfCareList_u.forEach((value) => {
466
+            stateOfAnIllnessList_u.forEach((v) => {
467
+              postData.push({
468
+                classesId: this.checkedInspectAuto.id, //班次id
469
+                taskTypeId: this.taskTypeId, //任务类型id
470
+                extra1: 1, //急查1,普查0
471
+                typeId: item, //检查类型id
472
+                typeId2: value, //护理等级id
473
+                typeId3: v, //病情级别id
474
+                hosId: this.hosId, //院区id
475
+                deleted: false, //删除true,显示false
476
+              });
477
+            });
478
+          });
479
+        });
480
+      }
481
+      // 普查数据
482
+      if (this.ordinaryInspect) {
483
+        let inspectTypeList_o = this.inspectTypeList_o
484
+          .filter((item) => item.checked)
485
+          .map((item) => item.id);
486
+        let levelOfCareList_o = this.levelOfCareList_o
487
+          .filter((item) => item.checked)
488
+          .map((item) => item.id);
489
+        let stateOfAnIllnessList_o = this.stateOfAnIllnessList_o
490
+          .filter((item) => item.checked)
491
+          .map((item) => item.id);
492
+        // 三层循环,感觉有些傻,无奈后端非要这么传-后端陈肖让我记录的
493
+        inspectTypeList_o.forEach((item) => {
494
+          levelOfCareList_o.forEach((value) => {
495
+            stateOfAnIllnessList_o.forEach((v) => {
496
+              postData.push({
497
+                classesId: this.checkedInspectAuto.id, //班次id
498
+                taskTypeId: this.taskTypeId, //任务类型id
499
+                extra1: 0, //急查1,普查0
500
+                typeId: item, //检查类型id
501
+                typeId2: value, //护理等级id
502
+                typeId3: v, //病情级别id
503
+                hosId: this.hosId, //院区id
504
+                deleted: false, //删除true,显示false
505
+              });
506
+            });
507
+          });
508
+        });
509
+      }
510
+    }
511
+    // 组装数据 end
512
+    this.saveLoading = true;
513
+    this.mainService
514
+      .simplePost("addListData", "autoCreateOrderRule", postData)
515
+      .subscribe((data) => {
516
+        this.saveLoading = false;
517
+        if (data.status == 200) {
518
+          this.showPromptModal("保存", true, "");
519
+        } else {
520
+          this.showPromptModal("保存", false, data.msg);
521
+        }
522
+      });
523
+  }
524
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
525
+  showPromptModal(con, success, promptInfo?) {
526
+    this.promptModalShow = false;
527
+    this.promptContent = con;
528
+    this.ifSuccess = success;
529
+    this.promptInfo = promptInfo;
530
+    setTimeout(() => {
531
+      this.promptModalShow = true;
532
+      this.getInspectAutoList();
533
+      this.getRules();
534
+    }, 100);
535
+  }
536
+}

+ 12 - 0
src/app/views/inspect-auto/inspect-auto.module.ts

@@ -0,0 +1,12 @@
1
+import { NgModule } from "@angular/core";
2
+import { CommonModule } from "@angular/common";
3
+
4
+import { InspectAutoRoutingModule } from "./inspect-auto-routing.module";
5
+import { ShareModule } from "src/app/share/share.module";
6
+import { InspectAutoComponent } from "./inspect-auto.component";
7
+
8
+@NgModule({
9
+  declarations: [InspectAutoComponent],
10
+  imports: [CommonModule, InspectAutoRoutingModule, ShareModule],
11
+})
12
+export class InspectAutoModule {}

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

@@ -295,6 +295,14 @@ const routes: Routes = [
295 295
             (m) => m.BuildingFloorModule
296 296
           ),
297 297
       },
298
+      {
299
+        // 检查自动建单
300
+        path: "inspectAuto",
301
+        loadChildren: () =>
302
+          import("../inspect-auto/inspect-auto.module").then(
303
+            (m) => m.InspectAutoModule
304
+          ),
305
+      },
298 306
     ],
299 307
   },
300 308
 ];

+ 11 - 2
src/common.less

@@ -10,13 +10,16 @@
10 10
 .mt8 {
11 11
   margin-top: 8px !important;
12 12
 }
13
+.ml16 {
14
+  margin-left: 16px !important;
15
+}
13 16
 .w100 {
14 17
   width: 100% !important;
15 18
 }
16
-.dib{
19
+.dib {
17 20
   display: inline-block !important;
18 21
 }
19
-.red{
22
+.red {
20 23
   color: #d81e06 !important;
21 24
 }
22 25
 // 加载中
@@ -189,6 +192,12 @@
189 192
   .fr {
190 193
     float: right !important;
191 194
   }
195
+  .clearfixer :after {
196
+    content: "";
197
+    display: block;
198
+    clear: both;
199
+    height: 0;
200
+  }
192 201
 }
193 202
 
194 203
 // list模板样式 start