瀏覽代碼

Merge branch 'master' of http://git.dashitech.com/seimin/zy-pc

seimin 3 周之前
父節點
當前提交
a66d7f1773
共有 24 個文件被更改,包括 2862 次插入112 次删除
  1. 4 4
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.html
  2. 1 1
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.ts
  3. 133 0
      src/app/components/configurationCenter/configuration-specimen/configuration-checkout-project/configuration-checkout-project.component.html
  4. 303 0
      src/app/components/configurationCenter/configuration-specimen/configuration-checkout-project/configuration-checkout-project.component.less
  5. 226 0
      src/app/components/configurationCenter/configuration-specimen/configuration-checkout-project/configuration-checkout-project.component.ts
  6. 20 0
      src/app/components/configurationCenter/configuration-specimen/configuration-checkout-project/configuration-checkout-project.module.ts
  7. 4 0
      src/app/components/configurationCenter/configuration-specimen/configuration-specimen.component.html
  8. 4 1
      src/app/components/configurationCenter/configuration-specimen/configuration-specimen.component.ts
  9. 2 1
      src/app/components/configurationCenter/configuration-specimen/configuration-specimen.module.ts
  10. 5 0
      src/app/services/main.service.ts
  11. 7 3
      src/app/services/tool.service.ts
  12. 5 5
      src/app/share/businessData-detail-modal/businessData-detail-modal.component.html
  13. 1 1
      src/app/share/businessData-detail-modal/businessData-detail-modal.component.less
  14. 484 32
      src/app/views/blood-search/blood-search.component.html
  15. 205 0
      src/app/views/blood-search/blood-search.component.less
  16. 510 5
      src/app/views/blood-search/blood-search.component.ts
  17. 86 2
      src/app/views/drug-search/drug-search.component.html
  18. 4 0
      src/app/views/drug-search/drug-search.component.less
  19. 61 1
      src/app/views/drug-search/drug-search.component.ts
  20. 51 50
      src/app/views/main/main.component.ts
  21. 4 0
      src/app/views/page-config/page-config.component.ts
  22. 326 2
      src/app/views/specimen-search/specimen-search.component.html
  23. 35 2
      src/app/views/specimen-search/specimen-search.component.less
  24. 381 2
      src/app/views/specimen-search/specimen-search.component.ts

+ 4 - 4
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.html

@@ -42,8 +42,8 @@
42 42
                     </nz-input-group>
43 43
                   </nz-form-control>
44 44
                 </nz-form-item>
45
-                <i class="icon_transport transport-tag27fuben ml8" (click)="addField(i)" *ngIf="!(activeDictionaryKey.key === 'incident_status' || activeDictionaryKey.key === 'incident_degree') && activeDictionaryKey.key != 'alarm_urgency'"></i>
46
-                <i class="icon_transport transport-shanchu1 ml8" *ngIf="dictionaryList.length > 1 && !data.system && !(activeDictionaryKey.key === 'incident_status' || activeDictionaryKey.key === 'incident_degree') && activeDictionaryKey.key != 'alarm_urgency'" (click)="removeField(data, i)"></i>
45
+                <i class="icon_transport transport-tag27fuben ml8" (click)="addField(i)" *ngIf="!(activeDictionaryKey.key === 'incident_status' || activeDictionaryKey.key === 'incident_degree' || this.activeDictionaryKey.key === 'abo_type' || this.activeDictionaryKey.key === 'rh_type' || this.activeDictionaryKey.key === 'blood_unit' || this.activeDictionaryKey.key === 'blood_trans_type') && activeDictionaryKey.key != 'alarm_urgency'"></i>
46
+                <i class="icon_transport transport-shanchu1 ml8" *ngIf="dictionaryList.length > 1 && !data.system && !(activeDictionaryKey.key === 'incident_status' || activeDictionaryKey.key === 'incident_degree' || this.activeDictionaryKey.key === 'abo_type' || this.activeDictionaryKey.key === 'rh_type' || this.activeDictionaryKey.key === 'blood_unit' || this.activeDictionaryKey.key === 'blood_trans_type') && activeDictionaryKey.key != 'alarm_urgency'" (click)="removeField(data, i)"></i>
47 47
               </div>
48 48
 							<div class="value_2" *ngIf="activeDictionaryKey.key == 'alarm_urgency'">
49 49
 							  <nz-form-item>
@@ -53,8 +53,8 @@
53 53
 							      </nz-input-group>
54 54
 							    </nz-form-control>
55 55
 							  </nz-form-item>
56
-							  <i class="icon_transport transport-tag27fuben ml8" (click)="addField(i)" *ngIf="!(activeDictionaryKey.key === 'incident_status' || activeDictionaryKey.key === 'incident_degree') && activeDictionaryKey.key == 'alarm_urgency'"></i>
57
-							  <i class="icon_transport transport-shanchu1 ml8" *ngIf="dictionaryList.length > 1 && !data.system && !(activeDictionaryKey.key === 'incident_status' || activeDictionaryKey.key === 'incident_degree') && activeDictionaryKey.key == 'alarm_urgency'" (click)="removeField(data, i)"></i>
56
+							  <i class="icon_transport transport-tag27fuben ml8" (click)="addField(i)" *ngIf="!(activeDictionaryKey.key === 'incident_status' || activeDictionaryKey.key === 'incident_degree' || this.activeDictionaryKey.key === 'abo_type' || this.activeDictionaryKey.key === 'rh_type' || this.activeDictionaryKey.key === 'blood_unit' || this.activeDictionaryKey.key === 'blood_trans_type') && activeDictionaryKey.key == 'alarm_urgency'"></i>
57
+							  <i class="icon_transport transport-shanchu1 ml8" *ngIf="dictionaryList.length > 1 && !data.system && !(activeDictionaryKey.key === 'incident_status' || activeDictionaryKey.key === 'incident_degree' || this.activeDictionaryKey.key === 'abo_type' || this.activeDictionaryKey.key === 'rh_type' || this.activeDictionaryKey.key === 'blood_unit' || this.activeDictionaryKey.key === 'blood_trans_type') && activeDictionaryKey.key == 'alarm_urgency'" (click)="removeField(data, i)"></i>
58 58
 							</div>
59 59
             </div>
60 60
           </form>

+ 1 - 1
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.ts

@@ -209,7 +209,7 @@ export class ConfigurationDictionaryComponent implements OnInit {
209 209
       this.dictionaryList.forEach((obj, i) => {
210 210
         for (const key in obj) {
211 211
           if(key !== 'id' && key !== 'system'){
212
-            if(this.activeDictionaryKey.key === 'incident_status' || this.activeDictionaryKey.key === 'incident_degree'){
212
+            if(this.activeDictionaryKey.key === 'incident_status' || this.activeDictionaryKey.key === 'incident_degree' || this.activeDictionaryKey.key === 'abo_type' || this.activeDictionaryKey.key === 'rh_type' || this.activeDictionaryKey.key === 'blood_unit' || this.activeDictionaryKey.key === 'blood_trans_type'){
213 213
               this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: true}, [Validators.required]))
214 214
             }else if(this.activeDictionaryKey.key === 'alarm_urgency'){
215 215
               this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: key === 'value' ? obj.system : false}, []))

+ 133 - 0
src/app/components/configurationCenter/configuration-specimen/configuration-checkout-project/configuration-checkout-project.component.html

@@ -0,0 +1,133 @@
1
+<div class="content priority">
2
+  <div class="contentInner">
3
+    <div class="list-template" id="wechatTable">
4
+      <div class="list-template__content">
5
+        <div class="list-template__bottom">
6
+          <div class="list-template__top" nz-row>
7
+            <div nz-col nzXl='17' class="list-template__searchBox">
8
+            </div>
9
+            <div nz-col nzXl="7" class="list-template__btns">
10
+              <button nz-button class="btn default" (click)="addWechatModal()">新增</button>
11
+            </div>
12
+          </div>
13
+          <nz-table class="list-template__nzTable" [nzData]="dataList" nzSize="middle" [nzShowPagination]="false"
14
+            [nzLoading]="loading1" [nzScroll]="{ y: tableWechatHeight + 'px' }">
15
+            <thead>
16
+              <tr class="thead">
17
+                <th nzWidth="10%">排序号</th>
18
+                <th nzWidth="18%">项目名称</th>
19
+                <th nzWidth="18%">项目编码</th>
20
+                <th nzWidth="18%">标本类型</th>
21
+                <th nzWidth="18%">试管类型</th>
22
+                <th nzWidth="18%">检验科室</th>
23
+              </tr>
24
+            </thead>
25
+            <tbody>
26
+              <tr *ngFor="let data of dataList;let i = index">
27
+                <td>{{data.orders}}</td>
28
+                <td>{{data.name}}</td>
29
+                <td>{{data.value}}</td>
30
+                <td>{{data.dictionaryDTO?data.dictionaryDTO.name:''}}</td>
31
+                <td>{{data.extra5DTO?data.extra5DTO.name:''}}</td>
32
+                <td>{{data.dept.join(',')}}</td>
33
+              </tr>
34
+            </tbody>
35
+          </nz-table>
36
+        </div>
37
+      </div>
38
+    </div>
39
+  </div>
40
+</div>
41
+
42
+<!-- 操作成功/失败提示框 -->
43
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
44
+  [info]="promptInfo">
45
+</app-prompt-modal>
46
+
47
+<!-- 删除模态框 -->
48
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
49
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
50
+
51
+<!-- 新增/编辑模态框 -->
52
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalWechat">
53
+  <div class="modalBody">
54
+    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideWechatModal()"></i></div>
55
+    <div class="content">
56
+      <form nz-form [formGroup]="validateForm" class="addForm">
57
+        <nz-form-item>
58
+          <nz-form-label [nzSpan]="7" nzRequired nzFor="orders">排序号</nz-form-label>
59
+          <nz-form-control [nzSpan]="17" nzErrorTip="请输入排序号!">
60
+            <nz-input-group>
61
+              <nz-input-number class="w100" formControlName="orders" nzPlaceHolder="请输入排序号" [nzMin]="0" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
62
+            </nz-input-group>
63
+          </nz-form-control>
64
+        </nz-form-item>
65
+        <nz-form-item>
66
+          <nz-form-label [nzSpan]="7" nzRequired nzFor="name">项目名称</nz-form-label>
67
+          <nz-form-control [nzSpan]="17" nzErrorTip="请输入项目名称!">
68
+            <nz-input-group>
69
+              <input formControlName="name" nz-input placeholder="请输入项目名称">
70
+            </nz-input-group>
71
+          </nz-form-control>
72
+        </nz-form-item>
73
+				<nz-form-item>
74
+				  <nz-form-label [nzSpan]="7" nzRequired nzFor="value">项目编码</nz-form-label>
75
+				  <nz-form-control [nzSpan]="17" nzErrorTip="请输入项目编码!">
76
+				    <nz-input-group>
77
+				      <input formControlName="value" nz-input placeholder="请输入项目编码">
78
+				    </nz-input-group>
79
+				  </nz-form-control>
80
+				</nz-form-item>
81
+        <nz-form-item>
82
+          <nz-form-label [nzSpan]="7" nzRequired nzFor="extra4">标本类型</nz-form-label>
83
+          <nz-form-control [nzSpan]="17" nzErrorTip="请选择标本类型!">
84
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="extra4" nzPlaceHolder="请选择标本类型" nzServerSearch>
85
+              <ng-container *ngFor="let data of typeList">
86
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
87
+              </ng-container>
88
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
89
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
90
+              </nz-option>
91
+            </nz-select>
92
+          </nz-form-control>
93
+        </nz-form-item>
94
+				<nz-form-item>
95
+				  <nz-form-label [nzSpan]="7" nzRequired nzFor="extra5">试管类型</nz-form-label>
96
+				  <nz-form-control [nzSpan]="17" nzErrorTip="请选择试管类型!">
97
+				    <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="extra5" nzPlaceHolder="请选择试管类型" nzServerSearch>
98
+				      <ng-container *ngFor="let data of tubeTypeList">
99
+				        <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
100
+				      </ng-container>
101
+				      <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
102
+				        <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
103
+				      </nz-option>
104
+				    </nz-select>
105
+				  </nz-form-control>
106
+				</nz-form-item>
107
+        <nz-form-item>
108
+          <nz-form-label [nzSpan]="7" nzRequired nzFor="extra7">检验科室</nz-form-label>
109
+          <nz-form-control [nzSpan]="17" nzErrorTip="请选择检验科室!">
110
+            <nz-select nzMode="multiple" [nzDropdownMatchSelectWidth]="false" formControlName="extra7" nzPlaceHolder="请选择检验科室" nzServerSearch (nzOnSearch)="changeInp($event)">
111
+              <ng-container *ngFor="let data of deptList">
112
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.dept" [nzValue]="data.id"></nz-option>
113
+              </ng-container>
114
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
115
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
116
+              </nz-option>
117
+            </nz-select>
118
+          </nz-form-control>
119
+        </nz-form-item>
120
+				<nz-form-item>
121
+				  <nz-form-label [nzSpan]="7" nzRequired nzFor="desc">备注</nz-form-label>
122
+				  <nz-form-control [nzSpan]="17" nzErrorTip="请选择备注!">
123
+				     <textarea formControlName="desc" nz-input rows="3" placeholder="请输入备注"></textarea>
124
+				  </nz-form-control>
125
+				</nz-form-item>
126
+      </form>
127
+    </div>
128
+    <div class=" display_flex justify-content_flex-center">
129
+      <button nzType="primary" nz-button (click)="submitWechatForm()" [nzLoading]="btnLoading">确认</button>
130
+      <button class="btn cancel" nz-button nzType="default" (click)="hideWechatModal()">取消</button>
131
+    </div>
132
+  </div>
133
+</div>

+ 303 - 0
src/app/components/configurationCenter/configuration-specimen/configuration-checkout-project/configuration-checkout-project.component.less

@@ -0,0 +1,303 @@
1
+@import "../../../../../../src/theme.less";
2
+:host {
3
+  height: 100%;
4
+  display: flex;
5
+  flex-direction: column;
6
+  justify-content: space-between;
7
+  background-color: #F0F2F5;
8
+  .list-template__nzTable,
9
+  .list-template__bottom{
10
+    padding: 0!important;
11
+    border: none!important;
12
+    background: #fff!important;
13
+  }
14
+  .list-template{
15
+    width: 100%!important;
16
+    height: 100%!important;
17
+    padding: 0!important;
18
+  }
19
+  .circleWrap{
20
+    position: relative;
21
+    .circle{
22
+      width: 8px;
23
+      height: 8px;
24
+      border-radius: 50%;
25
+      position: absolute;
26
+      top: 50%;
27
+      left: -8px;
28
+      transform: translate(-50%,-50%);
29
+      &.red{
30
+        background-color: red;
31
+      }
32
+    }
33
+  }
34
+  .content{
35
+    flex: 1;
36
+    min-height: 0;
37
+    display: flex;
38
+    flex-direction: column;
39
+    justify-content: space-between;
40
+    border: 1px solid #EEF3F9;
41
+    &.priority{
42
+      background-color: #fff;
43
+      .contentInner{
44
+        padding: 0 16px 16px;
45
+        border: 1px solid #E8EBEF;
46
+      }
47
+    }
48
+    .contentItem{
49
+      padding: 4px 16px;
50
+      cursor: pointer;
51
+      overflow: hidden;
52
+      text-overflow: ellipsis;
53
+      white-space: nowrap;
54
+      &.active{
55
+        color: @primary-color;
56
+        background-color: #F0F6ED;
57
+        border-radius: 4px;
58
+      }
59
+    }
60
+    .contentInner{
61
+      flex: 1;
62
+      display: flex;
63
+      justify-content: space-between;
64
+      align-items: center;
65
+      padding: 0 16px;
66
+      gap: 16px;
67
+      .contentHead{
68
+        height: 45px;
69
+        display: flex;
70
+        justify-content: space-between;
71
+        align-items: center;
72
+        gap: 16px;
73
+        padding: 0 16px;
74
+        font-size: 16px;
75
+        font-weight: bold;
76
+        border-bottom: 1px solid #D9D9D9;
77
+        .title{
78
+          overflow: hidden;
79
+          text-overflow: ellipsis;
80
+          white-space: nowrap;
81
+        }
82
+        .btns{
83
+          flex-shrink: 0;
84
+        }
85
+      }
86
+      .contentBody{
87
+        padding: 0 8px;
88
+        margin: 4px 0;
89
+        flex: 1;
90
+      }
91
+      .address{
92
+        flex: 1;
93
+        height: 100%;
94
+        background: #FFFFFF;
95
+        border: 1px solid #E8EBEF;
96
+        display: flex;
97
+        flex-direction: column;
98
+        width: 0;
99
+      }
100
+      .addressAssign{
101
+        flex: 3;
102
+        height: 100%;
103
+        background: #FFFFFF;
104
+        border: 1px solid #E8EBEF;
105
+        display: flex;
106
+        flex-direction: column;
107
+        width: 0;
108
+      }
109
+      .list-template__searchItem {
110
+        .label {
111
+          color: #333;
112
+          display: inline-block;
113
+          width: 70px;
114
+          text-align-last: justify;
115
+          text-align: justify;
116
+          &.label--big {
117
+            width: 100px;
118
+          }
119
+        }
120
+        .formItem {
121
+          width: 135px;
122
+        }
123
+      }
124
+    }
125
+    .contentBtns{
126
+      margin-bottom: 16px;
127
+      display: flex;
128
+      justify-content: center;
129
+      align-items: center;
130
+    }
131
+  }
132
+
133
+  .save {
134
+    position: fixed;
135
+    left: 0;
136
+    top: 0;
137
+    width: 100%;
138
+    height: 100%;
139
+    background: rgba(0, 0, 0, 0.4);
140
+    z-index: 99;
141
+
142
+    .tips{
143
+      margin-bottom: 16px!important;
144
+    }
145
+
146
+    .modalBody {
147
+      width: 350px;
148
+      background: #fff;
149
+      border-radius: 5px;
150
+      padding: 10px 20px;
151
+      color: #333;
152
+
153
+      .title {
154
+        width: 100%;
155
+        text-align: center;
156
+        font-size: 18px;
157
+        position: relative;
158
+
159
+        i {
160
+          position: absolute;
161
+          right: 0;
162
+          top: 0;
163
+          font-size: 20px;
164
+          color: #666;
165
+          cursor: pointer;
166
+          padding: 0 5px;
167
+        }
168
+      }
169
+
170
+      .content {
171
+        width: 310px;
172
+        background: #f9fafb;
173
+        border: 1px solid #e5e9ed;
174
+        border-radius: 5px;
175
+        overflow: hidden;
176
+        margin-top: 12px;
177
+        padding: 16px 0;
178
+
179
+        .busyList{
180
+          display: flex;
181
+          margin-bottom: 8px;
182
+          .busyContent{
183
+            margin-right: 8px;
184
+            flex: 1;
185
+          }
186
+        }
187
+
188
+        & > div {
189
+          text-align: center;
190
+          margin: 0;
191
+
192
+          &.icon {
193
+            // margin-top: 17px;
194
+
195
+            i {
196
+              color: #34b349;
197
+              font-size: 30px !important;
198
+
199
+              &.transport-wenhao {
200
+                color: #f5a523;
201
+              }
202
+
203
+              &.transport-shibai {
204
+                color: #ff3a52;
205
+              }
206
+            }
207
+          }
208
+
209
+          &.defeat {
210
+            color: #333;
211
+            font-size: 14px;
212
+          }
213
+
214
+          &:nth-child(3) {
215
+            font-size: 14px;
216
+            color: #666;
217
+          }
218
+        }
219
+        .workAssignmentTips {
220
+          font-size: 12px;
221
+        }
222
+      }
223
+
224
+      button {
225
+        margin-top: 10px;
226
+
227
+        &.btn {
228
+          margin-left: 8px;
229
+        }
230
+      }
231
+    }
232
+
233
+    // 新增
234
+    &.add {
235
+      .modalBody {
236
+        width: 480px;
237
+        height: auto;
238
+
239
+        .content {
240
+          width: 100%;
241
+          height: auto;
242
+          padding: 16px;
243
+          max-height: 497px;
244
+          overflow-y: auto;
245
+
246
+          .addForm {
247
+            .ant-form-item {
248
+              margin-bottom: 0;
249
+
250
+              .ant-form-item-label {
251
+                text-align: left;
252
+              }
253
+
254
+              .desc {
255
+                margin-top: 5px;
256
+              }
257
+            }
258
+
259
+            .datesControl {
260
+              margin-top: -16px;
261
+
262
+              .ant-form-item-label {
263
+                line-height: 40px;
264
+              }
265
+            }
266
+
267
+            .timer {
268
+              .ant-form-item-label {
269
+                width: 100%;
270
+                text-align: left;
271
+              }
272
+
273
+              .numInp {
274
+                margin-right: 5px;
275
+              }
276
+
277
+              .line {
278
+                margin-right: 5px;
279
+              }
280
+            }
281
+
282
+            .timer2 {
283
+              .ant-form-item-label {
284
+                line-height: 20px;
285
+              }
286
+            }
287
+          }
288
+
289
+          .editForm {
290
+            .ant-form-item {
291
+              margin-bottom: 15px;
292
+
293
+              .ant-form-item-label {
294
+                line-height: 14px;
295
+                text-align: left;
296
+              }
297
+            }
298
+          }
299
+        }
300
+      }
301
+    }
302
+  }
303
+}

+ 226 - 0
src/app/components/configurationCenter/configuration-specimen/configuration-checkout-project/configuration-checkout-project.component.ts

@@ -0,0 +1,226 @@
1
+import { Component, OnInit, Input } from "@angular/core";
2
+import { Validators, FormGroup, FormBuilder } from '@angular/forms';
3
+import { ToolService } from 'src/app/services/tool.service';
4
+import { NzMessageService } from 'ng-zorro-antd';
5
+import { MainService } from 'src/app/services/main.service';
6
+import { forkJoin, Subject } from "rxjs";
7
+import { debounceTime, filter } from "rxjs/operators";
8
+
9
+@Component({
10
+  selector: "app-configuration-checkout-project",
11
+  templateUrl: "./configuration-checkout-project.component.html",
12
+  styleUrls: ["./configuration-checkout-project.component.less"],
13
+})
14
+export class ConfigurationCheckoutProjectComponent implements OnInit {
15
+  constructor(
16
+    private mainService: MainService,
17
+    private fb: FormBuilder,
18
+    private tool: ToolService,
19
+    private message: NzMessageService,
20
+  ) {}
21
+
22
+  coopData: any = {}; //当前操作列
23
+  hosId: any;
24
+	changeInpSubject = new Subject(); //防抖
25
+
26
+  ngOnInit() {
27
+		this.hosId = this.tool.getCurrentHospital().id;
28
+		this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
29
+		  this.getDept(v[0]);
30
+		});
31
+    setTimeout(() => {
32
+      this.tableWechatHeight = document.querySelector('#wechatTable').clientHeight - document.querySelector('#wechatTable .list-template__top').clientHeight - 8 - document.querySelector('#wechatTable .thead').clientHeight;
33
+    }, 0)
34
+    this.getTypes();
35
+		this.getTubeTypeList();
36
+		this.getDept();
37
+    this.getList();
38
+  }
39
+
40
+  // 新增弹框
41
+  modelName = ""; //模态框名称
42
+  modalWechat: boolean = false; //新增/编辑模态框
43
+  add: boolean; //true:新增;false:编辑
44
+  addWechatModal() {
45
+    this.modelName = "新增";
46
+    this.add = true; //新增
47
+    this.modalWechat = true;
48
+    this.initWechatForm();
49
+  }
50
+  //关闭新增/编辑弹框
51
+  hideWechatModal() {
52
+    this.modalWechat = false;
53
+  }
54
+
55
+  // 新增/编辑表单提交
56
+  btnLoading: boolean = false; //提交按钮loading状态
57
+  submitWechatForm(): void {
58
+    for (const i in this.validateForm.controls) {
59
+      this.validateForm.controls[i].markAsDirty();
60
+      this.validateForm.controls[i].updateValueAndValidity();
61
+    }
62
+    if (this.validateForm.invalid) {
63
+      return;
64
+    }
65
+    this.btnLoading = true;
66
+    let postData = {
67
+			orders: this.validateForm.value.orders,
68
+			name: this.validateForm.value.name,
69
+			value: this.validateForm.value.value,
70
+			extra4: this.validateForm.value.extra4,
71
+			extra5: this.validateForm.value.extra5,
72
+			extra7: this.validateForm.value.extra7.toString(),
73
+			desc: this.validateForm.value.desc,
74
+			key: "examination_items"
75
+    };
76
+
77
+    this.mainService
78
+      .simplePost("addData", "dictionary", postData)
79
+      .subscribe((result) => {
80
+        this.btnLoading = false;
81
+        this.hideWechatModal();
82
+        let msg = "新增";
83
+        if (result.status == 200) {
84
+          this.showPromptModal(msg, true, '');
85
+        } else {
86
+          this.showPromptModal(msg, false, result.msg);
87
+        }
88
+      });
89
+  }
90
+	
91
+	// 隐藏删除框
92
+	hideDelModal() {
93
+	  this.delModal = false;
94
+	}
95
+	// 确认删除
96
+	confirmDel() {
97
+
98
+	}
99
+	
100
+  // 初始化新增form表单
101
+  validateForm: FormGroup; //新增/编辑表单
102
+  initWechatForm() {
103
+    this.validateForm = this.fb.group({
104
+      orders: [null, [Validators.required]],
105
+      name: [null, [Validators.required]],
106
+      value: [null, [Validators.required]],
107
+			extra4: [null, [Validators.required]],
108
+      extra5: [null, [Validators.required]],
109
+      extra7: [null, [Validators.required]],
110
+      desc: [null, [Validators.required]],
111
+    });
112
+  }
113
+
114
+  // 获取列表
115
+  loading1:boolean = false;
116
+  dataList: any[] = []; //表格数据
117
+  tableWechatHeight:number = 0;
118
+  getList() {
119
+    let data = {
120
+      idx: 0,
121
+      sum: 9999,
122
+      dictionary: {
123
+        key: "examination_items",
124
+      },
125
+    };
126
+    this.loading1 = true;
127
+    this.mainService
128
+      .getFetchDataList("simple/data", "dictionary", data)
129
+      .subscribe((data) => {
130
+        this.loading1 = false;
131
+        if (data.status == 200) {
132
+					data.list.forEach(i=>{
133
+						i.dept = i.deptList.map(x=>{
134
+							return x.dept
135
+						})
136
+						
137
+					})
138
+          this.dataList = data.list || [];
139
+        }else{
140
+          this.message.error(data.msg || "请求数据失败");
141
+        }
142
+      });
143
+  }
144
+
145
+  isLoading = false;
146
+  extra7List: any = [
147
+    { name: '无', id: '0' },
148
+    { name: '科室码', id: '1' },
149
+    { name: '动态码', id: '2' },
150
+    { name: '填写工号', id: '3' },
151
+  ];
152
+	
153
+	// 获取试管类型
154
+	tubeTypeList: any = [];
155
+	getTubeTypeList() {
156
+	  this.mainService.getDictionary('list', 'specimen_tube_type').subscribe((data) => {
157
+	    this.tubeTypeList = data || [];
158
+	  });
159
+	}
160
+	
161
+	// 获取标本类型
162
+	typeList: any = [];
163
+	getTypes() {
164
+	  this.mainService.getDictionary('list', 'specimen_type').subscribe((data) => {
165
+	    this.typeList = data || [];
166
+	  });
167
+	}
168
+	
169
+	// 获取检验科室
170
+	deptList: any = [];
171
+	getDept(dept?) {
172
+	  let data = {
173
+	    idx: 0,
174
+	    sum: 10,
175
+	    department: {
176
+	      hospital: { id: this.hosId },
177
+	      dept: dept,
178
+	    },
179
+	  };
180
+	  
181
+	  this.mainService
182
+	    .getFetchDataList("data", "department", data)
183
+	    .subscribe((data) => {
184
+	      this.isLoading = false;
185
+	      this.deptList = data.list;
186
+	    });
187
+	}
188
+	
189
+	changeInp(e){
190
+		this.isLoading = true;
191
+		this.changeInpSubject.next([e]);
192
+	}
193
+	
194
+  delModal: boolean = false; //删除模态框
195
+  tipsMsg1: string; //提示框信息
196
+  tipsMsg2: string; //操作后信息
197
+  confirmDelType: string; //确认的类型(启用/停用,删除)
198
+  showDelModal(
199
+    data,
200
+    tipsMsg1: string,
201
+    tipsMsg2: string,
202
+    type: string,
203
+  ) {
204
+    this.confirmDelType = type;
205
+    this.delModal = true;
206
+    this.coopData = data;
207
+    this.tipsMsg1 = tipsMsg1;
208
+    this.tipsMsg2 = tipsMsg2;
209
+  }
210
+
211
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
212
+  promptContent: string; //操作提示框提示信息
213
+  ifSuccess: boolean; //操作成功/失败
214
+  promptInfo: string; //操作结果提示信息
215
+  promptModalShow: boolean; //操作提示框是否展示
216
+  showPromptModal(con, success, promptInfo?) {
217
+    this.promptModalShow = false;
218
+    this.promptContent = con;
219
+    this.ifSuccess = success;
220
+    this.promptInfo = promptInfo;
221
+    setTimeout(() => {
222
+      this.promptModalShow = true;
223
+    }, 100);
224
+    this.getList();
225
+  }
226
+}

+ 20 - 0
src/app/components/configurationCenter/configuration-specimen/configuration-checkout-project/configuration-checkout-project.module.ts

@@ -0,0 +1,20 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { ConfigurationCheckoutProjectComponent } from './configuration-checkout-project.component';
5
+import { ShareModule } from 'src/app/share/share.module';
6
+
7
+
8
+@NgModule({
9
+  declarations: [
10
+    ConfigurationCheckoutProjectComponent,
11
+  ],
12
+  imports: [
13
+    CommonModule,
14
+    ShareModule,
15
+  ],
16
+  exports: [
17
+    ConfigurationCheckoutProjectComponent,
18
+  ]
19
+})
20
+export class ConfigurationCheckoutProjectModule { }

+ 4 - 0
src/app/components/configurationCenter/configuration-specimen/configuration-specimen.component.html

@@ -473,6 +473,10 @@
473 473
         <div class="TaskTypeManagement" *ngIf="activeDictionaryKey=='specimenReturn'">
474 474
           <app-configuration-specimen-return></app-configuration-specimen-return>
475 475
         </div>
476
+				<!-- 检验项目 -->
477
+				<div class="TaskTypeManagement" *ngIf="activeDictionaryKey=='checkoutProject'">
478
+				  <app-configuration-checkout-project></app-configuration-checkout-project>
479
+				</div>
476 480
       </div>
477 481
     </div>
478 482
   </div>

+ 4 - 1
src/app/components/configurationCenter/configuration-specimen/configuration-specimen.component.ts

@@ -29,7 +29,10 @@ export class ConfigurationSpecimenComponent implements OnInit {
29 29
     },
30 30
     {
31 31
       name:'标本退回',key:'specimenReturn'
32
-    }
32
+    },
33
+		{
34
+		  name:'检验项目',key:'checkoutProject'
35
+		}
33 36
 	];
34 37
 
35 38
   spePackageUnionReceive:any = undefined;//是否联合标本收取

+ 2 - 1
src/app/components/configurationCenter/configuration-specimen/configuration-specimen.module.ts

@@ -6,7 +6,7 @@ import { ShareModule } from 'src/app/share/share.module';
6 6
 import { ConfigurationSpecimenComponent } from './configuration-specimen.component';
7 7
 import { ConfigurationSpecimenReturnModule } from './configuration-specimen-return/configuration-specimen-return.module';
8 8
 import { ConfigurationSpecialSpecimenMarkingModule } from './configuration-special-specimen-marking/configuration-special-specimen-marking.module';
9
-
9
+import { ConfigurationCheckoutProjectModule } from './configuration-checkout-project/configuration-checkout-project.module';
10 10
 
11 11
 @NgModule({
12 12
   declarations: [
@@ -17,6 +17,7 @@ import { ConfigurationSpecialSpecimenMarkingModule } from './configuration-speci
17 17
     ShareModule,
18 18
     ConfigurationSpecimenReturnModule,
19 19
     ConfigurationSpecialSpecimenMarkingModule,
20
+		ConfigurationCheckoutProjectModule
20 21
   ],
21 22
   exports: [
22 23
     ConfigurationSpecimenComponent,

+ 5 - 0
src/app/services/main.service.ts

@@ -1289,4 +1289,9 @@ export class MainService {
1289 1289
 	getInfoPack(packageId, data){
1290 1290
 		return this.http.post(host.host + `/nurse/specimen/getInfo/${packageId}`, data);
1291 1291
 	}
1292
+	
1293
+	// 业务信息自动生成
1294
+	autoMake(model, count, data){
1295
+		return this.http.post(host.host + `/testData/make/${model}/${count}`, data);
1296
+	}
1292 1297
 }

+ 7 - 3
src/app/services/tool.service.ts

@@ -376,9 +376,13 @@ export class ToolService {
376 376
 				case "unlock":
377 377
 				  coopBtns.unlock = true; //解锁
378 378
 				  break;
379
-					case "lock":
380
-					  coopBtns.lock = true; //锁定
381
-					  break;
379
+				case "lock":
380
+					coopBtns.lock = true; //锁定
381
+					break;
382
+				case "collect":
383
+					coopBtns.collect = true; //设置核收
384
+					break;
385
+				
382 386
       }
383 387
     });
384 388
     console.log(coopBtns);

+ 5 - 5
src/app/share/businessData-detail-modal/businessData-detail-modal.component.html

@@ -12,7 +12,7 @@
12 12
     <div class="content">
13 13
       <!-- 血制品 -->
14 14
       <nz-table *ngIf="type === 'blood'" class="hospitalTable" [nzData]="bloodList" nzSize="middle" [nzShowPagination]="false"
15
-        [nzLoading]="hsLoading" [nzScroll]="{ y: '500px' }">
15
+        [nzLoading]="hsLoading" >
16 16
         <thead>
17 17
           <tr class="thead">
18 18
             <th nzWidth="5%">序号</th>
@@ -42,7 +42,7 @@
42 42
       </nz-table>
43 43
       <!-- 新药品-一单一码 -->
44 44
       <nz-table *ngIf="configs.showDrugsBagDetails === 1 && configs.drugsModel === 1 && (type === 'drugsJpbag' || type === 'drugsWestern' || type === 'drugsReturn' || type === 'drugsPoison' || type === 'drugsHerbal')" class="hospitalTable" [nzData]="drugsBugSingleList" nzSize="middle" [nzShowPagination]="false"
45
-        [nzLoading]="hsLoading" [nzScroll]="{ y: '500px' }">
45
+        [nzLoading]="hsLoading" >
46 46
         <thead>
47 47
           <tr class="thead">
48 48
             <th nzWidth="5%">序号</th>
@@ -64,7 +64,7 @@
64 64
       </nz-table>
65 65
       <!-- 新药品-一单多码 -->
66 66
       <nz-table *ngIf="configs.drugsModel === 2 && (type === 'drugsJpbag' || type === 'drugsWestern' || type === 'drugsReturn' || type === 'drugsPoison' || type === 'drugsHerbal')" class="hospitalTable" [nzData]="drugsBugMultipleList" nzSize="middle" [nzShowPagination]="false"
67
-        [nzLoading]="hsLoading" [nzScroll]="{ y: '500px' }">
67
+        [nzLoading]="hsLoading" >
68 68
         <thead>
69 69
           <tr class="thead">
70 70
             <th nzWidth="5%">序号</th>
@@ -179,7 +179,7 @@
179 179
       </nz-table>
180 180
       <!-- 科室检查率统计 -->
181 181
       <nz-table *ngIf="type === 'deptInspectionRateStatistics' || type === 'deptInspectionStatistics'" class="hospitalTable" [nzData]="inspectionRateStatisticsList" nzSize="middle" [nzShowPagination]="false"
182
-        [nzLoading]="hsLoading" [nzScroll]="{ y: '500px' }">
182
+        [nzLoading]="hsLoading" >
183 183
         <thead>
184 184
           <tr class="thead">
185 185
             <th nzWidth="4%">序号</th>
@@ -210,7 +210,7 @@
210 210
 
211 211
       <!-- 被服洗涤批次管理-查看视图-查看异常 -->
212 212
       <nz-table *ngIf="type === 'washingException'" class="hospitalTable" [nzData]="washingExceptionList" nzSize="middle" [nzShowPagination]="false"
213
-        [nzLoading]="hsLoading" [nzScroll]="{ y: '500px' }">
213
+        [nzLoading]="hsLoading" >
214 214
         <thead>
215 215
           <tr class="thead">
216 216
             <th nzWidth="5%">序号</th>

+ 1 - 1
src/app/share/businessData-detail-modal/businessData-detail-modal.component.less

@@ -31,7 +31,7 @@
31 31
   }
32 32
   .hospitalTable {
33 33
     width: 100%;
34
-		height: calc(100vh - 360px);
34
+		height: calc(100vh - 280px);
35 35
 		overflow-y: auto;
36 36
     td {
37 37
       text-align: center !important;

+ 484 - 32
src/app/views/blood-search/blood-search.component.html

@@ -2,6 +2,31 @@
2 2
   <div class="list-template__content">
3 3
     <div class="list-template__top" nz-row>
4 4
       <div nz-col nzXl='16' class="list-template__searchBox">
5
+				<div class="list-template__searchItem">
6
+				  <span class="label">申请科室:</span>
7
+				  <nz-select
8
+				    [nzDropdownMatchSelectWidth]="false"
9
+				    class="formItem"
10
+				    nzServerSearch
11
+				    nzShowSearch
12
+				    nzAllowClear
13
+				    nzPlaceHolder="请选择申请科室"
14
+				    [(ngModel)]="searchCriteria.applyDept"
15
+				    (nzOnSearch)="changeInp($event)"
16
+				    (nzOpenChange)="changeSearch($event)"
17
+				  >
18
+				    <ng-container *ngFor="let data of deptList">
19
+				      <nz-option
20
+				        *ngIf="!isLoading"
21
+				        nzLabel="{{ data.dept }}"
22
+				        nzValue="{{ data.id }}"
23
+				      ></nz-option>
24
+				    </ng-container>
25
+				    <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
26
+				      <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
27
+				    </nz-option>
28
+				  </nz-select>
29
+				</div>
5 30
         <div class="list-template__searchItem">
6 31
           <span class="label">血袋号:</span>
7 32
           <input nz-input class="formItem" placeholder="请输入血袋号" [(ngModel)]="searchCriteria.bloodCode" />
@@ -34,52 +59,105 @@
34 59
             </nz-option>
35 60
           </nz-select>
36 61
         </div>
62
+				<div class="list-template__searchItem">
63
+				  <span class="label">取血人:</span>
64
+				  <nz-select
65
+				    [nzDropdownMatchSelectWidth]="false"
66
+				    class="formItem"
67
+				    nzServerSearch
68
+				    nzShowSearch
69
+				    nzAllowClear
70
+				    nzPlaceHolder="请选择取血人:"
71
+				    [(ngModel)]="searchCriteria.arriver"
72
+				    (nzOnSearch)="changeInp2($event, 'search')"
73
+				    (nzOpenChange)="changeSearch2($event)"
74
+				  >
75
+				    <ng-container *ngFor="let data of userSearch">
76
+				      <nz-option
77
+				        *ngIf="!isLoading"
78
+				        nzLabel="{{ data.name }}"
79
+				        nzValue="{{ data.id }}"
80
+				      ></nz-option>
81
+				    </ng-container>
82
+				    <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
83
+				      <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
84
+				    </nz-option>
85
+				  </nz-select>
86
+				</div>
37 87
       </div>
38 88
       <div nz-col nzXl="8" class="list-template__btns">
39 89
         <button nz-button class="btn default" (click)='reset()'>重置</button>
40 90
         <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</button>
41
-      </div>
91
+				<button nz-button class="btn default ml8" (click)='addForm()'>新增</button>
92
+				<button nz-button class="btn default ml8" (click)='batchSend()'>批量发送</button>
93
+				<button nz-button class="btn default ml8" (click)='autoCreate()'>自动生成</button>
94
+			</div>
42 95
     </div>
43 96
     <div class="list-template__bottom">
44 97
       <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
45 98
         [nzLoading]="loading1">
46 99
         <thead>
47 100
           <tr class="thead">
48
-            <th nzWidth="2%">#</th>
49
-            <th nzWidth="7%">医嘱号</th>
50
-            <th nzWidth="7%">血袋号</th>
51
-            <th nzWidth="6%">状态</th>
52
-            <th nzWidth="7%">申请科室</th>
53
-            <th nzWidth="7%">血液类型</th>
54
-            <th nzWidth="4%">ABO血型</th>
55
-            <th nzWidth="4%">RH(血型)</th>
56
-            <th nzWidth="7%">血量(单位)</th>
57
-            <th nzWidth="7%">患者姓名(住院号)</th>
58
-            <th nzWidth="7%">发血时间</th>
59
-            <th nzWidth="7%">取血者</th>
60
-            <th nzWidth="7%">取血时间</th>
61
-            <th nzWidth="7%">接收人</th>
62
-            <th nzWidth="7%">接收时间</th>
63
-            <th nzWidth="7%">操作</th>
101
+						<th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked"
102
+						  (nzCheckedChange)="checkAll($event)"></th>
103
+            <!-- <th nzWidth="2%">#</th> -->
104
+						<th nzWidth="8%">血袋标识</th>
105
+						<th nzWidth="8%">血液信息</th>
106
+						<th nzWidth="8%">患者信息</th>
107
+						<th nzWidth="8%">发血号</th>
108
+						<th nzWidth="8%">申请使用科室</th>
109
+						<th nzWidth="8%">发血科室</th>
110
+						<th nzWidth="8%">状态</th>
111
+						<th nzWidth="8%">发血信息</th>
112
+						<th nzWidth="8%">取血信息</th>
113
+						<th nzWidth="8%">送达信息</th>
114
+						<th nzWidth="8%">接收信息</th>
115
+            <th nzWidth="8%">操作</th>
64 116
           </tr>
65 117
         </thead>
66 118
         <tbody>
67 119
           <tr *ngFor="let data of listOfData;let i = index">
68
-            <td>{{i+(pageIndex-1) * pageSize + 1}}</td>
69
-            <td>{{ data.applyCode || '无'}}</td>
70
-            <td>{{ data.bloodCode || '无'}}</td>
71
-            <td>{{ data.state?.name }}</td>
72
-            <td>{{ data.applyDeptDTO ? data.applyDeptDTO.dept :'无' }}</td>
73
-            <td>{{ data.type ? data.type.name : "无" }}</td>
74
-            <td>{{ data.aboType || '无' }}</td>
75
-            <td>{{ data.rhType || '无' }}</td>
76
-            <td>{{ data.volume ? (ttconfig_sign_type4 ? data.volume + data.unit : data.volume + 'ML') : '无' }}</td>
77
-            <td>{{ data.patientName }}<span *ngIf="data.hosNum">({{ data.hosNum }})</span></td>
78
-            <td>{{ data.printDate | date:"yyyy-MM-dd HH:mm:ss" }}</td>
79
-            <td>{{ data.arriverDTO ? data.arriverDTO.name: '无' }}</td>
80
-            <td>{{ data.arriveTime | date:"yyyy-MM-dd HH:mm:ss" }}</td>
81
-            <td>{{ data.receiverDTO ? data.receiverDTO.name : '' }}</td>
82
-            <td>{{ data.receiveTime | date:"yyyy-MM-dd HH:mm:ss" }}</td>
120
+            <!-- <td>{{i+(pageIndex-1) * pageSize + 1}}</td> -->
121
+						<td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" 
122
+						(nzCheckedChange)="refreshStatus()" 
123
+						[nzDisabled]="data.state.value==1 || data.state.value==2 || 
124
+						data.state.value==4 || data.state.value=='cx'"
125
+						></td>
126
+            <td>
127
+							<div>{{ data.bloodCode }}</div>
128
+							<div>{{ data.productCode }}</div>
129
+						</td>
130
+						<td>
131
+							<div>{{ data.type ? data.type.name : "无" }}、{{data.volume}}{{data.unit}}</div>
132
+							<div>{{ data.aboType }}、{{ data.rhType }}</div>
133
+						</td>
134
+						<td>
135
+							<div>{{ data.patientName }}<span *ngIf="data.bedNum">({{ data.bedNum }})</span></div>
136
+							<div>{{ data.patientNo }}</div>
137
+						</td>
138
+						<td>{{ data.dataCode || '无'}}</td>
139
+						<td>
140
+							<div>{{ data.applyDeptDTO ? data.applyDeptDTO.dept :'无' }}</div>
141
+							<div>{{ data.useDeptDTO ? data.useDeptDTO.dept :'无' }}</div>
142
+						</td>
143
+						<td>{{ data.sendDeptDTO ? data.sendDeptDTO.dept :'无'}}</td>
144
+						<td>{{ data.state?.name}}</td>
145
+						<td>
146
+							<div>{{ data.printDate | date:"yyyy-MM-dd HH:mm:ss" }}</div>
147
+							<div>{{ data.bleedUserDTO ? data.bleedUserDTO.name: '无'}}</div>
148
+						</td>
149
+						<td>
150
+							<div>{{ data.arriveTime | date:"yyyy-MM-dd HH:mm:ss" }}</div>
151
+							<div>{{ data.arriverDTO ? data.arriverDTO.name: '无' }}</div>
152
+						</td>
153
+						<td>
154
+							<div>{{ data.deliveryTime | date:"yyyy-MM-dd HH:mm:ss" }}</div>
155
+							<div>{{ data.deliveryUserDTO ? data.deliveryUserDTO.name: '无'}}</div>
156
+						</td>
157
+						<td>
158
+							<div>{{ data.receiveTime | date:"yyyy-MM-dd HH:mm:ss" }}</div>
159
+							<div>{{ data.receiverDTO ? data.receiverDTO.name: '无' }}</div>
160
+						</td>
83 161
             <td><button (click)="viewBloodHistory(data)">查看日志</button></td>
84 162
           </tr>
85 163
         </tbody>
@@ -99,3 +177,377 @@
99 177
   [bloodId]="bloodId"
100 178
   (closeModelHs)="closeModelHistory($event)"
101 179
 ></app-blood-history-prompt-modal>
180
+
181
+<!-- 操作成功/失败提示框 -->
182
+<app-prompt-modal
183
+  *ngIf="promptModalShow"
184
+  [content]="promptContent"
185
+  [success]="ifSuccess"
186
+  [show]="promptModalShow"
187
+  [info]="promptInfo"
188
+>
189
+</app-prompt-modal>
190
+
191
+<!-- 新增/编辑模态框 -->
192
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="addModal">
193
+  <div class="modalBody">
194
+    <div class="title">{{add?"新增":view?"查看":"编辑"}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
195
+    </div>
196
+    <div class="content">
197
+      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
198
+				<div class="df">
199
+					<nz-form-item>
200
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="applyDept">申请科室</nz-form-label>
201
+						<nz-form-control nzErrorTip="请选择申请科室!">
202
+							<nz-input-group>
203
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
204
+									(nzOnSearch)="changeInp($event)" (nzOpenChange)="changeSearch($event)" (ngModelChange)="onDeptChange($event)" nzAllowClear nzPlaceHolder="请选择申请科室" formControlName="applyDept">
205
+									<ng-container *ngFor="let option of deptList">
206
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
207
+									</ng-container>
208
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
209
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
210
+									</nz-option>
211
+								</nz-select>
212
+							</nz-input-group>
213
+						</nz-form-control>
214
+					</nz-form-item>
215
+					
216
+					<nz-form-item>
217
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="sendDept">发血科室</nz-form-label>
218
+						<nz-form-control nzErrorTip="请选择发血科室!">
219
+							<nz-input-group>
220
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
221
+									(nzOnSearch)="changeInp($event)" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择发血科室" formControlName="sendDept">
222
+									<ng-container *ngFor="let option of deptList">
223
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
224
+									</ng-container>
225
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
226
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
227
+									</nz-option>
228
+								</nz-select>
229
+							</nz-input-group>
230
+						</nz-form-control>
231
+					</nz-form-item>
232
+					
233
+					<nz-form-item>
234
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="useDept">使用科室</nz-form-label>
235
+						<nz-form-control nzErrorTip="请选择使用科室!">
236
+							<nz-input-group>
237
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
238
+									(nzOnSearch)="changeInp($event)" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择使用科室" formControlName="useDept">
239
+									<ng-container *ngFor="let option of deptList">
240
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
241
+									</ng-container>
242
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
243
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
244
+									</nz-option>
245
+								</nz-select>
246
+							</nz-input-group>
247
+						</nz-form-control>
248
+					</nz-form-item>
249
+				</div>
250
+				
251
+				<div class="df"> 
252
+					<nz-form-item>
253
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="type">血液类型</nz-form-label>
254
+					  <nz-form-control nzErrorTip="请选择血液类型!">
255
+					    <nz-input-group>
256
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzShowSearch
257
+								   nzAllowClear nzPlaceHolder="请选择血液类型" formControlName="type">
258
+									<ng-container *ngFor="let option of bloodTypeList">
259
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
260
+									</ng-container>
261
+								</nz-select>
262
+					    </nz-input-group>
263
+					  </nz-form-control>
264
+					</nz-form-item>
265
+					
266
+					<nz-form-item>
267
+					  <nz-form-label [nzSm]="7" [nzXs]="24" nzRequired nzFor="volume">血量</nz-form-label>
268
+					  <nz-form-control nzErrorTip="请选择血量!">
269
+					    <nz-input-group>
270
+								<input nz-input class="formItem" formControlName="volume" placeholder="请输入血量" nzSize="default" />
271
+					    </nz-input-group>
272
+					  </nz-form-control>
273
+					</nz-form-item>
274
+					
275
+					<nz-form-item>
276
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="unit">单位</nz-form-label>
277
+					  <nz-form-control nzErrorTip="请选择单位!">
278
+					    <nz-input-group>
279
+								<nz-select class="formItem" [nzDisabled]="view" (ngModelChange)="onUnitChange($event)" [nzDropdownMatchSelectWidth]="false" nzShowSearch
280
+								   nzAllowClear nzPlaceHolder="请选择单位" formControlName="unit">
281
+									<ng-container *ngFor="let option of unitList">
282
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
283
+									</ng-container>
284
+								</nz-select>
285
+					    </nz-input-group>
286
+					  </nz-form-control>
287
+					</nz-form-item>
288
+				</div>
289
+				
290
+      	<div class="df">
291
+					<nz-form-item>
292
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="aboType">ABO血型</nz-form-label>
293
+					  <nz-form-control nzErrorTip="请选择ABO血型!">
294
+					    <nz-input-group>
295
+								<nz-select class="formItem" [nzDisabled]="view" (ngModelChange)="onAboChange($event)" (ngModelChange)="onPatientChange($event)" [nzDropdownMatchSelectWidth]="false" nzShowSearch
296
+								   nzAllowClear nzPlaceHolder="请选择ABO血型" formControlName="aboType">
297
+									<ng-container *ngFor="let option of aboList">
298
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
299
+									</ng-container>
300
+								</nz-select>
301
+					    </nz-input-group>
302
+					  </nz-form-control>
303
+					</nz-form-item>
304
+					
305
+					<nz-form-item>
306
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="rhType">RH血型</nz-form-label>
307
+					  <nz-form-control nzErrorTip="请选择RH血型!">
308
+					    <nz-input-group>
309
+								<nz-select class="formItem" [nzDisabled]="view" (ngModelChange)="onRhChange($event)" [nzDropdownMatchSelectWidth]="false" nzShowSearch
310
+								   nzAllowClear nzPlaceHolder="请选择RH血型" formControlName="rhType">
311
+									<ng-container *ngFor="let option of rhList">
312
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
313
+									</ng-container>
314
+								</nz-select>
315
+					    </nz-input-group>
316
+					  </nz-form-control>
317
+					</nz-form-item>
318
+					
319
+						<nz-form-item>
320
+						  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="patientId">患者</nz-form-label>
321
+						  <nz-form-control nzErrorTip="请选择患者!">
322
+						    <nz-input-group>
323
+									<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
324
+									  (nzOnSearch)="changePatient($event, 1)" (ngModelChange)="onPatientChange($event)" nzAllowClear nzPlaceHolder="请选择患者" formControlName="patientId">
325
+										<ng-container *ngFor="let option of patientList">
326
+										  <nz-option *ngIf="!isLoading" [nzLabel]="option.patientName" [nzValue]="option.id"></nz-option>
327
+										</ng-container>
328
+										<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
329
+										  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
330
+										</nz-option>
331
+									</nz-select>
332
+						    </nz-input-group>
333
+						  </nz-form-control>
334
+						</nz-form-item>
335
+				</div>
336
+				
337
+				<div class="df">
338
+					<nz-form-item>
339
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="bleedUser">发血人</nz-form-label>
340
+					  <nz-form-control nzErrorTip="请选择发血人!">
341
+					    <nz-input-group>
342
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
343
+								  (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择发血人" formControlName="bleedUser">
344
+									<ng-container *ngFor="let option of userList">
345
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
346
+									</ng-container>
347
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
348
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
349
+									</nz-option>
350
+								</nz-select>
351
+					    </nz-input-group>
352
+					  </nz-form-control>
353
+					</nz-form-item>
354
+					
355
+					<nz-form-item>
356
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="overDate">过期时间</nz-form-label>
357
+					  <nz-form-control nzErrorTip="请选择过期时间!">
358
+					    <nz-input-group>
359
+					      <nz-date-picker
360
+					    		nzShowTime
361
+					    		nzFormat="yyyy-MM-dd HH:mm:ss"
362
+					    		nzPlaceHolder="请选择过期时间"
363
+					    		formControlName="overDate"
364
+					    		(ngModelChange)="onStartChange($event)"
365
+					    	></nz-date-picker>
366
+					    </nz-input-group>
367
+					  </nz-form-control>
368
+					</nz-form-item>
369
+					
370
+					<nz-form-item>
371
+					  <nz-form-label [nzSm]="7" [nzXs]="24" nzFor="state">默认状态</nz-form-label>
372
+					  <nz-form-control nzErrorTip="请选择默认状态!">
373
+					    <nz-input-group>
374
+								<input nz-input disabled class="formItem" formControlName="state" placeholder="请输入默认状态" nzSize="default" />
375
+					    </nz-input-group>
376
+					  </nz-form-control>
377
+					</nz-form-item>
378
+				</div>
379
+				<div class="df">
380
+					<nz-form-item>
381
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="sendMsg">是否同步发送消息</nz-form-label>
382
+					  <nz-form-control nzErrorTip="请选择是否同步发送消息!">
383
+					    <nz-input-group>
384
+								<nz-radio-group [nzDisabled]="view" formControlName="sendMsg">
385
+									<label nz-radio nzValue="1">是</label>
386
+									<label nz-radio nzValue="0">否</label>
387
+								</nz-radio-group>
388
+					    </nz-input-group>
389
+					  </nz-form-control>
390
+					</nz-form-item>
391
+				</div>
392
+      </form>
393
+    </div>
394
+    <div class="display_flex justify-content_flex-center">
395
+      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
396
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
397
+    </div>
398
+  </div>
399
+</div>
400
+
401
+<!-- 批量发送 -->
402
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="batchModal">
403
+  <div class="modalBody collect">
404
+    <div class="title">{{infoContent}}<i class="icon_transport transport-guanbi" (click)="hideMsgModal()"></i>
405
+    </div>
406
+    <div class="content">
407
+      <form nz-form [formGroup]="validateMsgForm" class="addForm" (ngSubmit)="submitMsgForm()">
408
+					<nz-form-item>
409
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="sendMsgType">消息发送类型</nz-form-label>
410
+					  <nz-form-control nzErrorTip="请选择消息发送类型!">
411
+					    <nz-input-group>
412
+								<nz-radio-group [nzDisabled]="view" formControlName="sendMsgType" (ngModelChange)="msgTypeChange($event)">
413
+									<label nz-radio nzValue="createMsg">建单消息</label>
414
+									<label nz-radio nzValue="createAndSignMsg">建单并签到消息</label>
415
+								</nz-radio-group>
416
+					    </nz-input-group>
417
+					  </nz-form-control>
418
+					</nz-form-item>
419
+					
420
+					<nz-form-item *ngIf="validateMsgForm.value.sendMsgType=='createAndSignMsg'">
421
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="arriver">取血人</nz-form-label>
422
+					  <nz-form-control nzErrorTip="请选择取血人!">
423
+					    <nz-input-group>
424
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
425
+									(nzOnSearch)="changeInp2($event, 'search')"
426
+									(nzOpenChange)="changeSearch2($event)"
427
+									nzAllowClear nzPlaceHolder="请选择取血人" formControlName="arriver">
428
+									<ng-container *ngFor="let option of userSearch">
429
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
430
+									</ng-container>
431
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
432
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
433
+									</nz-option>
434
+								</nz-select>
435
+					    </nz-input-group>
436
+					  </nz-form-control>
437
+					</nz-form-item>
438
+				
439
+      </form>
440
+    </div>
441
+    <div class="display_flex justify-content_flex-center">
442
+      <button nzType="primary" nz-button (click)="submitMsgForm()" [nzLoading]="btnLoading">确认</button>
443
+      <button class="btn cancel" nz-button nzType="default" (click)="hideMsgModal()">取消</button>
444
+    </div>
445
+  </div>
446
+</div>
447
+
448
+<!-- 自动生成模态框 -->
449
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="autoCreateModal">
450
+  <div class="modalBody collect">
451
+    <div class="title">自动生成<i class="icon_transport transport-guanbi" (click)="hideAutoModal()"></i>
452
+    </div>
453
+    <div class="content">
454
+      <form nz-form [formGroup]="validateAutoForm" class="addForm" (ngSubmit)="submitAutoForm()">
455
+					<nz-form-item>
456
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="applyDept">申请科室</nz-form-label>
457
+						<nz-form-control nzErrorTip="请选择申请科室!">
458
+							<nz-input-group>
459
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
460
+									(nzOnSearch)="changeInp($event, 'search')" (nzOpenChange)="changeSearch($event)" (ngModelChange)="onAutoDeptChange($event)" nzAllowClear nzPlaceHolder="请选择申请科室" formControlName="applyDept">
461
+									<ng-container *ngFor="let option of deptList">
462
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
463
+									</ng-container>
464
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
465
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
466
+									</nz-option>
467
+								</nz-select>
468
+							</nz-input-group>
469
+						</nz-form-control>
470
+					</nz-form-item>
471
+					
472
+					<nz-form-item>
473
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="sendDept">发血科室</nz-form-label>
474
+						<nz-form-control nzErrorTip="请选择发血科室!">
475
+							<nz-input-group>
476
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
477
+									(nzOnSearch)="changeInp($event, 'search')" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择发血科室" formControlName="sendDept">
478
+									<ng-container *ngFor="let option of deptList">
479
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
480
+									</ng-container>
481
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
482
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
483
+									</nz-option>
484
+								</nz-select>
485
+							</nz-input-group>
486
+						</nz-form-control>
487
+					</nz-form-item>
488
+					
489
+					<nz-form-item>
490
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="patientId">患者</nz-form-label>
491
+					  <nz-form-control nzErrorTip="请选择患者!">
492
+					    <nz-input-group>
493
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
494
+								  (nzOnSearch)="changePatient($event, 2)" (ngModelChange)="onPatientChange($event)" nzAllowClear nzPlaceHolder="请选择患者" formControlName="patientId">
495
+									<ng-container *ngFor="let option of patientList">
496
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.patientName" [nzValue]="option.id"></nz-option>
497
+									</ng-container>
498
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
499
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
500
+									</nz-option>
501
+								</nz-select>
502
+					    </nz-input-group>
503
+					  </nz-form-control>
504
+					</nz-form-item>
505
+					
506
+					<nz-form-item>
507
+					  <nz-form-label nzRequired [nzSm]="6" [nzXs]="24" nzFor="amount">生成数量</nz-form-label>
508
+					  <nz-form-control nzErrorTip="请选择生成数量!">
509
+					    <nz-input-group>
510
+								<nz-input-number formControlName="amount" (ngModelChange)="numChange($event)" [nzMin]="1" [nzMax]="50" [nzStep]="1"></nz-input-number>
511
+							</nz-input-group>
512
+					  </nz-form-control>
513
+					</nz-form-item>
514
+					
515
+					<nz-form-item>
516
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="sendMsgType">消息类型</nz-form-label>
517
+					  <nz-form-control nzErrorTip="请选择消息类型!">
518
+					    <nz-input-group>
519
+								<nz-radio-group [nzDisabled]="view" formControlName="sendMsgType" (ngModelChange)="autoMsgTypeChange($event)">
520
+									<label nz-radio nzValue="noMsg">不发消息</label>
521
+									<label nz-radio nzValue="createMsg">发送建单消息</label>
522
+									<label nz-radio nzValue="createAndSignMsg">发送建单并签到消息</label>
523
+								</nz-radio-group>
524
+							</nz-input-group>
525
+					  </nz-form-control>
526
+					</nz-form-item>
527
+					
528
+					<nz-form-item *ngIf="validateAutoForm.value.sendMsgType=='createAndSignMsg'">
529
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="arriver">取血人</nz-form-label>
530
+					  <nz-form-control nzErrorTip="请选择取血人!">
531
+					    <nz-input-group>
532
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
533
+									(nzOnSearch)="changeInp2($event, 'search')"
534
+									(nzOpenChange)="changeSearch2($event)"
535
+									nzAllowClear nzPlaceHolder="请选择取血人" formControlName="arriver">
536
+									<ng-container *ngFor="let option of userSearch">
537
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
538
+									</ng-container>
539
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
540
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
541
+									</nz-option>
542
+								</nz-select>
543
+					    </nz-input-group>
544
+					  </nz-form-control>
545
+					</nz-form-item>
546
+      </form>
547
+    </div>
548
+    <div class="display_flex justify-content_flex-center">
549
+      <button nzType="primary" nz-button (click)="submitAutoForm()" [nzLoading]="btnLoading">生成血制品</button>
550
+      <button class="btn cancel" nz-button nzType="default" (click)="hideAutoModal()">取消</button>
551
+    </div>
552
+  </div>
553
+</div>

+ 205 - 0
src/app/views/blood-search/blood-search.component.less

@@ -1 +1,206 @@
1 1
 @import "../../../../src/theme.less";
2
+:host ::ng-deep .on {
3
+  color: #fff !important;
4
+}
5
+.list-template__checkBoxes{
6
+  display: flex;
7
+  justify-content: space-between;
8
+}
9
+.save {
10
+  position: fixed;
11
+  left: 0;
12
+  top: 0;
13
+  width: 100%;
14
+  height: 100%;
15
+  background: rgba(0, 0, 0, 0.4);
16
+  z-index: 99;
17
+
18
+  .modalBody {
19
+    width: 350px;
20
+    height: 220px;
21
+    background: #fff;
22
+    border-radius: 5px;
23
+    padding: 10px 20px;
24
+    color: #333;
25
+
26
+    .title {
27
+      width: 100%;
28
+      text-align: center;
29
+      font-size: 18px;
30
+      position: relative;
31
+
32
+      i {
33
+        position: absolute;
34
+        right: 0;
35
+        top: 0;
36
+        font-size: 20px;
37
+        color: #666;
38
+        cursor: pointer;
39
+        padding: 0 5px;
40
+      }
41
+    }
42
+
43
+    .content {
44
+      width: 310px;
45
+      height: 117px;
46
+      background: #f9fafb;
47
+      border: 1px solid #e5e9ed;
48
+      border-radius: 5px;
49
+      overflow: hidden;
50
+      margin-top: 12px;
51
+
52
+      & > div {
53
+        text-align: center;
54
+        margin: 0;
55
+
56
+        &.icon {
57
+          margin-top: 17px;
58
+
59
+          i {
60
+            color: #34b349;
61
+            font-size: 30px !important;
62
+
63
+            &.transport-wenhao {
64
+              color: #f5a523;
65
+            }
66
+
67
+            &.transport-shibai {
68
+              color: #ff3a52;
69
+            }
70
+          }
71
+        }
72
+
73
+        &.defeat {
74
+          color: #333;
75
+          font-size: 18px;
76
+        }
77
+
78
+        &:nth-child(3) {
79
+          font-size: 14px;
80
+          color: #666;
81
+        }
82
+      }
83
+      .roundRobinTips {
84
+        font-size: 12px;
85
+      }
86
+    }
87
+
88
+    button {
89
+      margin-top: 10px;
90
+
91
+      &.btn {
92
+        margin-left: 8px;
93
+      }
94
+    }
95
+  }
96
+
97
+  // 新增
98
+  &.add {
99
+		.collect{
100
+			width: 500px !important;
101
+		}
102
+    .modalBody {
103
+      width: 70%;
104
+      height: auto;
105
+
106
+      .content {
107
+        width: 100%;
108
+        height: auto;
109
+        padding: 18px 14px 0 14px;
110
+        max-height: 497px;
111
+        overflow-y: auto;
112
+
113
+        .addForm {
114
+					.df{
115
+						display: flex;
116
+						margin-bottom: 15px;
117
+						.ant-form-item {
118
+							width: 30%;
119
+							margin-right: 3%;
120
+							.ant-form-item-label{
121
+								overflow: visible !important;
122
+							}
123
+							
124
+							.ant-select{
125
+								width: 100% !important;
126
+							}
127
+							
128
+						  .ant-form-item-label {
129
+						    line-height: 14px;
130
+						    text-align: left;
131
+						  }
132
+						
133
+						  .desc {
134
+						    margin-top: 5px;
135
+						  }
136
+						}
137
+					}
138
+          .ant-form-item {
139
+            margin-bottom: 15px;
140
+						
141
+						.ant-select{
142
+							width: 100% !important;
143
+						}
144
+						.ant-input-number{
145
+							width: 100% !important;
146
+						}
147
+            .ant-form-item-label {
148
+              line-height: 14px;
149
+              text-align: left;
150
+            }
151
+
152
+            .desc {
153
+              margin-top: 5px;
154
+            }
155
+          }
156
+
157
+          .datesControl {
158
+            margin-top: -16px;
159
+
160
+            .ant-form-item-label {
161
+              line-height: 40px;
162
+            }
163
+          }
164
+
165
+          .timer {
166
+            .ant-form-item-label {
167
+              width: 100%;
168
+              text-align: left;
169
+            }
170
+
171
+            .numInp {
172
+              margin-right: 5px;
173
+            }
174
+
175
+            .line {
176
+              margin-right: 5px;
177
+            }
178
+          }
179
+
180
+          .timer2 {
181
+            .ant-form-item-label {
182
+              line-height: 20px;
183
+            }
184
+          }
185
+        }
186
+
187
+        .editForm {
188
+          .ant-form-item {
189
+            margin-bottom: 15px;
190
+
191
+            .ant-form-item-label {
192
+              line-height: 14px;
193
+              text-align: left;
194
+            }
195
+          }
196
+        }
197
+      }
198
+
199
+      button {
200
+        &:nth-child(1) {
201
+          margin-right: 20px;
202
+        }
203
+      }
204
+    }
205
+  }
206
+}

+ 510 - 5
src/app/views/blood-search/blood-search.component.ts

@@ -4,6 +4,9 @@ import { debounceTime } from "rxjs/operators";
4 4
 import { MainService } from "src/app/services/main.service";
5 5
 import { ToolService } from "src/app/services/tool.service";
6 6
 import { format } from 'date-fns';
7
+import { Validators, FormGroup, FormControl, FormBuilder } from '@angular/forms';
8
+import { ActivatedRoute, Router } from "@angular/router";
9
+import { NzMessageService } from "ng-zorro-antd";
7 10
 
8 11
 @Component({
9 12
   selector: "app-blood-search",
@@ -11,11 +14,19 @@ import { format } from 'date-fns';
11 14
   styleUrls: ["./blood-search.component.less"],
12 15
 })
13 16
 export class BloodSearchComponent implements OnInit {
14
-  constructor(private mainService: MainService, private tool: ToolService) {}
17
+  constructor(
18
+		private mainService: MainService, 
19
+		private msg: NzMessageService, 
20
+		private tool: ToolService,
21
+		private fb: FormBuilder,
22
+		public route: ActivatedRoute,
23
+	) {}
15 24
 
16 25
   searchCriteria = {
17 26
     //搜索条件
18 27
     bloodCode: "", //血袋号
28
+		applyDept: null,
29
+		arriver: null,
19 30
     dateRange: [],
20 31
     state: null,
21 32
   };
@@ -26,10 +37,28 @@ export class BloodSearchComponent implements OnInit {
26 37
   pageSize: number = 10; //表格每页展示条数
27 38
   listLength: number = 10; //表格总数据量
28 39
   changeInpSubject = new Subject();
40
+	changeInp2Subject = new Subject();
41
+	changeInpUserSubject = new Subject();
42
+	changeInpPaSubject = new Subject();
29 43
   ngOnInit() {
30 44
     this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
31 45
       this.searchDept(v);
32 46
     });
47
+		
48
+		this.changeInp2Subject.pipe(debounceTime(500)).subscribe((v) => {
49
+		  this.searchUser(v[0], v[1]);
50
+		});
51
+		
52
+		this.changeInpUserSubject.pipe(debounceTime(500)).subscribe((v) => {
53
+		  this.getUserList(v);
54
+		});
55
+		
56
+		this.changeInpPaSubject.pipe(debounceTime(500)).subscribe((v) => {
57
+		  this.getPatient(v[1], v[0]);
58
+		});
59
+		
60
+		this.getUserList();
61
+		this.getDicList();
33 62
     this.getHospital();
34 63
   }
35 64
   // 搜索类型
@@ -48,10 +77,384 @@ export class BloodSearchComponent implements OnInit {
48 77
       this.searchTypes();
49 78
     }
50 79
   }
80
+	// 打开搜索框
81
+	changeSearch2(flag) {
82
+	  if (flag) {
83
+	    this.changeInp2("no", "search");
84
+	  }
85
+	}
86
+	
87
+	// 搜索患者
88
+	changePatient(e, type){
89
+		this.isLoading = true;
90
+		this.changeInpPaSubject.next([e, type]);
91
+	}	
92
+	
93
+	// 搜索用户
94
+	changeUser(e){
95
+		this.isLoading = true;
96
+		this.changeInpUserSubject.next(e);
97
+	}	
98
+	
99
+	// 获取用户
100
+	userList:any = [];
101
+	getUserList(name?){
102
+		let data = {
103
+		  idx: 0,
104
+		  sum: 20,
105
+		  user: {
106
+		    name: name,
107
+		    hospital: { id: this.hosId || "" },
108
+		  },
109
+		};
110
+		this.mainService
111
+		  .getFetchDataList("data", "user", data)
112
+		  .subscribe((data) => {
113
+		    this.isLoading = false;
114
+		    this.userList = data.list;
115
+		  });
116
+	}
117
+	
118
+	// 获取血型/单位/abo/rh
119
+	bloodTypeList:any = [];
120
+	unitList:any = [];
121
+	aboList:any = [];
122
+	rhList:any = [];
123
+	getDicList(){
124
+		this.mainService.getDictionary("list", "blood_trans_type").subscribe((res) => {
125
+		  this.bloodTypeList = res;
126
+		});
127
+		this.mainService.getDictionary("list", "blood_unit").subscribe((res) => {
128
+		  this.unitList = res;
129
+		});
130
+		this.mainService.getDictionary("list", "abo_type").subscribe((res) => {
131
+		  this.aboList = res;
132
+		});
133
+		this.mainService.getDictionary("list", "rh_type").subscribe((res) => {
134
+		  this.rhList = res;
135
+		});
136
+	}
137
+	
138
+	// 获取患者
139
+	patientList:any = [];
140
+	getPatient(type, patientName?){
141
+		console.log(1234, type, patientName)
142
+		let postData = {
143
+		  idx: 0,
144
+		  sum: 20,
145
+			patient:{
146
+				department:{
147
+					id: type==1 ? this.validateForm.value.applyDept : this.validateAutoForm.value.applyDept
148
+				},
149
+				keyWord: patientName,
150
+			}
151
+		};
152
+		this.mainService.getFetchDataList('nurse', 'patient', postData).subscribe((data) => {
153
+		  this.isLoading = false;
154
+		  if (data["status"] == 200) {
155
+				data["list"].forEach(i=>{
156
+					if(i.bedNum && i.residenceNo){
157
+						i.patientName = i.patientName + '('+ i.bedNum +')' +'-'+ i.residenceNo
158
+					}
159
+					if(i.bedNum && !i.residenceNo){
160
+						i.patientName = i.patientName + '('+ i.bedNum +')'
161
+					}
162
+					if(!i.bedNum && !i.residenceNo){
163
+						i.patientName = i.patientName 
164
+					}
165
+					if(!i.bedNum && i.residenceNo){
166
+						i.patientName = i.patientName +'-'+ i.residenceNo
167
+					}
168
+				})
169
+		    this.patientList = data["list"];
170
+		  }
171
+		});
172
+	}
173
+	
174
+	// 选择申请科室
175
+	onDeptChange(e){
176
+		this.validateForm.controls.patientId.setValue(null)
177
+		this.getPatient(1);
178
+	}
179
+	
180
+	// 选择患者
181
+	onPatientChange(e){
182
+	
183
+	}
184
+	
185
+	//  选择开始时间
186
+	applyDate:any;
187
+	onStartChange(result: Date): void {
188
+		if( typeof result == 'object'){
189
+			this.applyDate = format(result, 'yyyy-MM-dd HH:mm:ss');
190
+			this.validateForm.controls.overDate.setValue(this.applyDate);
191
+		}
192
+	}
193
+	
194
+	// 自动生成
195
+	autoCreateModal:boolean = false;
196
+	autoCreate(){
197
+		this.autoCreateModal = true
198
+		this.initAutoForm()
199
+	}
200
+	
201
+	// 初始化form
202
+	validateAutoForm: FormGroup
203
+	initAutoForm(){
204
+		this.validateAutoForm = this.fb.group({
205
+			applyDept: [null, [Validators.required]],
206
+			sendDept: [null, [Validators.required]],
207
+			patientId: [null, []],
208
+			amount: [1, [Validators.required]],
209
+			sendMsgType: ['noMsg', []],
210
+		});
211
+	}
212
+	
213
+	numChange(e){
214
+		console.log(4, e)
215
+	}
216
+	
217
+	// 选择消息类型
218
+	autoMsgTypeChange(e){
219
+		if(e=='createAndSignMsg'){
220
+			this.validateAutoForm.addControl(
221
+				'arriver',
222
+				new FormControl(null, Validators.required)
223
+			);
224
+		}else{
225
+			this.validateAutoForm.removeControl('arriver');
226
+		}
227
+	}
228
+	
229
+	// 选择申请科室
230
+	onAutoDeptChange(e){
231
+		this.validateAutoForm.controls.patientId.setValue(null)
232
+		this.getPatient(2);
233
+	}
234
+	
235
+	aboName:any;
236
+	onAboChange(e){
237
+		let item = this.aboList.find(i=> i.id == e)
238
+		if(item){
239
+			this.aboName = item.name
240
+		}
241
+	}
242
+	
243
+	unitName:any;
244
+	onUnitChange(e){
245
+		let item = this.unitList.find(i=> i.id == e)
246
+		if(item){
247
+			this.unitName = item.name
248
+		}
249
+	}
250
+	
251
+	rhName:any;
252
+	onRhChange(e){
253
+		let item = this.rhList.find(i=> i.id == e)
254
+		if(item){
255
+			this.rhName = item.name
256
+		}
257
+	}
258
+	
259
+	hideAutoModal(){
260
+		this.autoCreateModal = false
261
+		this.patientList = []
262
+	}
263
+	
264
+	// 自动生成提交
265
+	submitAutoForm(){
266
+		var that = this;
267
+		for (const i in that.validateAutoForm.controls) {
268
+		  that.validateAutoForm.controls[i].markAsDirty();
269
+		  that.validateAutoForm.controls[i].updateValueAndValidity();
270
+		}
271
+		if (that.validateAutoForm.invalid) return;
272
+		let data = {
273
+			blood:{
274
+				applyDept: this.validateAutoForm.value.applyDept,
275
+				sendDept: this.validateAutoForm.value.sendDept,
276
+				patientId: this.validateAutoForm.value.patientId || undefined,
277
+				arriver: this.validateAutoForm.value.arriver || undefined,
278
+				sendMsgType: this.validateAutoForm.value.sendMsgType || undefined
279
+			}
280
+		};
281
+		if(this.validateAutoForm.value.sendMsgType=='createAndSignMsg'){
282
+			data.blood.arriver = this.validateAutoForm.value.arriver
283
+		}else{
284
+			delete data.blood.arriver
285
+		}
286
+		that.btnLoading = true;
287
+		that.mainService
288
+		  .autoMake("blood", this.validateAutoForm.value.amount, data)
289
+		  .subscribe((data:any) => {
290
+		    that.btnLoading = false;
291
+		    that.hideAutoModal();
292
+		    that.initAutoForm();
293
+		    if (data.status == 200) {
294
+		      that.showPromptModal("生成", true, "");
295
+		    } else {
296
+		      that.showPromptModal("生成", false, data.msg);
297
+		    }
298
+		  });
299
+	}
300
+	
301
+	// 新增
302
+	addModal:boolean = false;
303
+	view:boolean = false;
304
+	add:boolean = false;
305
+	addForm(){
306
+		this.addModal = true;
307
+		this.initForm();
308
+	}
309
+	
310
+	hideModal() {
311
+	  this.addModal = false;
312
+		this.patientList = [];
313
+	  this.initForm();
314
+	}
315
+	
316
+	// 初始化form
317
+	validateForm: FormGroup; //新增/编辑表单
318
+	initForm() {
319
+	  this.validateForm = this.fb.group({
320
+	    applyDept: [null, [Validators.required]],
321
+	    sendDept: [null, [Validators.required]],
322
+			useDept: [null, []],
323
+	    patientId: [null, [Validators.required]],
324
+			type: [null, [Validators.required]],
325
+	    volume: [null, [Validators.required]],
326
+	    unit: [null, [Validators.required]],
327
+	    state: ['发血', [Validators.required]],
328
+			aboType: [null, [Validators.required]],
329
+			rhType: [null, [Validators.required]],
330
+			bleedUser: [null, [Validators.required]],
331
+			overDate: [null, [Validators.required]],
332
+			sendMsg: ['0', []],
333
+	  });
334
+	}
335
+	
336
+	// 表单提交
337
+	btnLoading:boolean = false;
338
+	submitForm(): void {
339
+	  var that = this;
340
+		for (const i in that.validateForm.controls) {
341
+		  that.validateForm.controls[i].markAsDirty();
342
+		  that.validateForm.controls[i].updateValueAndValidity();
343
+		}
344
+		if (that.validateForm.invalid) return;
345
+	  let data = {
346
+			blood:{
347
+				patientId:this.validateForm.value.patientId,
348
+				applyDept: this.validateForm.value.applyDept,
349
+				sendDept: this.validateForm.value.sendDept,
350
+				useDept: this.validateForm.value.useDept,
351
+				bleedUser:this.validateForm.value.bleedUser,
352
+				volume: this.validateForm.value.volume,
353
+				type: {
354
+					id: this.validateForm.value.type
355
+				},
356
+				unit: this.unitName,
357
+				aboType: this.aboName,
358
+				rhType: this.rhName,
359
+				overDate: this.validateForm.value.overDate,
360
+				sendMsg: this.validateForm.value.sendMsg
361
+			}
362
+	  };
363
+		that.btnLoading = true;
364
+	  that.mainService
365
+	    .dataPost("addData", "blood", data)
366
+	    .subscribe((data) => {
367
+	      that.btnLoading = false;
368
+	      that.hideModal();
369
+	      that.initForm();
370
+	      if (data.status == 200) {
371
+	        that.showPromptModal("新增", true, "");
372
+	      } else {
373
+	        that.showPromptModal("新增", false, data.msg);
374
+	      }
375
+	    });
376
+	}
377
+	
378
+	// 批量发送
379
+	batchModal:boolean = false;
380
+	infoContent:any;
381
+	batchSend(){
382
+		if(this.checkedDepIds.length==0){
383
+			this.msg.error('请勾选血制品列表')
384
+			return
385
+		}
386
+		this.infoContent = `您选择了${this.checkedDepIds.length}条血制品信息,确认发送建单消息吗`
387
+		this.batchModal = true
388
+		this.initMsgForm();
389
+	}
390
+	
391
+	// 初始化form
392
+	validateMsgForm: FormGroup
393
+	initMsgForm(){
394
+		this.validateMsgForm = this.fb.group({
395
+			sendMsgType: ['createMsg', [Validators.required]]
396
+		});
397
+	}
398
+	
399
+	// 选择消息发送类型
400
+	msgTypeChange(e){
401
+		if(e=='createAndSignMsg'){
402
+			this.validateMsgForm.addControl(
403
+				'arriver',
404
+				new FormControl(null, Validators.required)
405
+			);
406
+		}else{
407
+			this.validateMsgForm.removeControl('arriver');
408
+		}
409
+	}
410
+	
411
+	// 提交批量消息发送
412
+	submitMsgForm(): void{
413
+		var that = this;
414
+		for (const i in that.validateMsgForm.controls) {
415
+		  that.validateMsgForm.controls[i].markAsDirty();
416
+		  that.validateMsgForm.controls[i].updateValueAndValidity();
417
+		}
418
+		if (that.validateMsgForm.invalid) return;
419
+		let data = {
420
+			blood:{
421
+				ids: this.checkedDepIds.toString(),
422
+				sendMsgType: this.validateMsgForm.value.sendMsgType,
423
+				arriver: this.validateMsgForm.value.arriver,
424
+			}
425
+		};
426
+		if(this.validateMsgForm.value.sendMsgType=='createAndSignMsg'){
427
+			data.blood.arriver = this.validateMsgForm.value.arriver
428
+		}else{
429
+			delete data.blood.arriver
430
+		}
431
+		that.btnLoading = true;
432
+		that.mainService
433
+		  .dataPost("updData", "blood", data)
434
+		  .subscribe((data) => {
435
+		    that.btnLoading = false;
436
+		    that.hideMsgModal();
437
+		    that.initMsgForm();
438
+		    if (data.status == 200) {
439
+					this.mapOfCheckedId = {};
440
+					this.checkedDepIds = [];
441
+		      that.showPromptModal("发送", true, "");
442
+		    } else {
443
+		      that.showPromptModal("发送", false, data.msg);
444
+		    }
445
+		  });
446
+	}
447
+	
448
+	hideMsgModal(){
449
+		this.batchModal = false;
450
+	}
451
+	
51 452
   // 重置
52 453
   reset() {
53 454
     this.searchCriteria = {
54 455
       //搜索条件
456
+			applyDept: null,
457
+			arriver: null,
55 458
       bloodCode: "",
56 459
       dateRange: [],
57 460
       state: null,
@@ -113,9 +516,9 @@ export class BloodSearchComponent implements OnInit {
113 516
   // 边输边搜节流阀
114 517
   isLoading = false;
115 518
   changeInp(dept) {
116
-    if (!dept) {
117
-      return;
118
-    }
519
+    // if (!dept) {
520
+    //   return;
521
+    // }
119 522
     if (dept === "no") {
120 523
       dept = "";
121 524
     }
@@ -141,7 +544,91 @@ export class BloodSearchComponent implements OnInit {
141 544
         }
142 545
       });
143 546
   }
144
-
547
+	
548
+	// 边输边搜节流阀
549
+	userKey = "";
550
+	changeInp2(keyword, type) {
551
+	  // if (!keyword) {
552
+	  //   return;
553
+	  // }
554
+	  if (keyword === "no") {
555
+	    keyword = "";
556
+	  }
557
+	  this.userKey = keyword;
558
+	  this.isLoading = true;
559
+	  this.changeInp2Subject.next([keyword, type]);
560
+	}
561
+	
562
+	userSearch:any = [];
563
+	// 搜索科室
564
+	searchUser(keyword, type) {
565
+	  let data = {
566
+	    user: {
567
+	      usertype: { id: 106 },
568
+	      name: keyword,
569
+	      dept: {
570
+	        id: this.searchCriteria.applyDept,
571
+	      },
572
+	    },
573
+	    idx: 0,
574
+	    sum: 10,
575
+	  };
576
+	  this.mainService
577
+	    .getFetchDataList("data", "user", data)
578
+	    .subscribe((data) => {
579
+	      if (data.status == 200) {
580
+	        if (type === "search") {
581
+	          if (this.userKey === keyword) {
582
+	            this.isLoading = false;
583
+	            this.userSearch = data.list;
584
+	          }
585
+	        }
586
+	      }
587
+	    });
588
+	}
589
+	
590
+	
591
+	// 选中表格中科室
592
+	mapOfCheckedId: { [key: string]: boolean } = {};
593
+	checkedDepIds = []; //已选中科室id
594
+	refreshStatus(): void {
595
+	  this.isAllDisplayDataChecked = this.listOfData.every(
596
+	    (item) => this.mapOfCheckedId[item.id]
597
+	  );
598
+	  let arr = [];
599
+	  for (var k in this.mapOfCheckedId) {
600
+	    if (this.mapOfCheckedId[k]) {
601
+	      arr.push(Number(k));
602
+	    }
603
+	  }
604
+	  this.checkedDepIds = arr;
605
+	  console.log(this.checkedDepIds);
606
+	}
607
+	
608
+	//表格整行选中
609
+	selectedListData(id) {
610
+	  this.mapOfCheckedId[id] = !this.mapOfCheckedId[id];
611
+	  this.refreshStatus();
612
+	}
613
+	
614
+	// 全选
615
+	isAllDisplayDataChecked = false; //当前页是否全选
616
+	checkAll(value: boolean): void {
617
+		// let isConformTo = this.listOfData.some(
618
+		//   (item) => item.state.value==1 || item.state.value==4 || item.state.value=='cx'
619
+		// )
620
+		// if(isConformTo){
621
+		// 	this.msg.error('只有“发血、病房接收”状态才能被选择')
622
+		// 	return
623
+		// }
624
+	  this.listOfData.forEach((item) => {
625
+			if(item.state.value!=1 && item.state.value!=4 && item.state.value!='cx'){
626
+				this.mapOfCheckedId[item.id] = value
627
+			}
628
+		});
629
+	  this.refreshStatus();
630
+	}
631
+	
145 632
   // 表格数据
146 633
   loading1 = false;
147 634
   getList(type) {
@@ -153,6 +640,8 @@ export class BloodSearchComponent implements OnInit {
153 640
       sum: this.pageSize,
154 641
       blood: {
155 642
         hosId: this.hosId,
643
+				applyDept: this.searchCriteria.applyDept || undefined,
644
+				arriver: this.searchCriteria.arriver || undefined,
156 645
         state: this.searchCriteria.state ? { id: this.searchCriteria.state } : undefined,
157 646
       },
158 647
     };
@@ -176,5 +665,21 @@ export class BloodSearchComponent implements OnInit {
176 665
         }
177 666
       });
178 667
   }
668
+	
669
+	// 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
670
+	promptContent: string; //操作提示框提示信息
671
+	ifSuccess: boolean; //操作成功/失败
672
+	promptInfo: string; //操作结果提示信息
673
+	promptModalShow: boolean; //操作提示框是否展示
674
+	showPromptModal(con, success, promptInfo?) {
675
+	  this.promptModalShow = false;
676
+	  this.promptContent = con;
677
+	  this.ifSuccess = success;
678
+	  this.promptInfo = promptInfo;
679
+	  setTimeout(() => {
680
+	    this.promptModalShow = true;
681
+	  }, 100);
682
+	  this.getList(1);
683
+	}
179 684
 }
180 685
 

+ 86 - 2
src/app/views/drug-search/drug-search.component.html

@@ -89,7 +89,8 @@
89 89
         <button nz-button class="btn default" (click)="addMoadl()" *ngIf="coopBtns.add">新增</button>
90 90
         <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
91 91
         <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</button>
92
-      </div>
92
+				<button nz-button class="btn default ml8" (click)='autoCreate()'>自动生成</button>
93
+			</div>
93 94
     </div>
94 95
     <div class="list-template__bottom">
95 96
       <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
@@ -282,4 +283,87 @@
282 283
 </app-dialog-delete>
283 284
 
284 285
 <!-- 查看详情 -->
285
-<router-outlet></router-outlet>
286
+<router-outlet></router-outlet>
287
+
288
+<!-- 自动生成模态框 -->
289
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="autoCreateModal">
290
+  <div class="modalBody">
291
+    <div class="title">自动生成<i class="icon_transport transport-guanbi" (click)="hideAutoModal()"></i>
292
+    </div>
293
+    <div class="content">
294
+      <form nz-form [formGroup]="validateAutoForm" class="addForm" (ngSubmit)="submitAutoForm()">
295
+					<nz-form-item>
296
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="launch">发药科室</nz-form-label>
297
+						<nz-form-control nzErrorTip="请选择发药科室!">
298
+							<nz-input-group>
299
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
300
+									(nzOnSearch)="changeInp($event)" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择发药科室" formControlName="launch">
301
+									<ng-container *ngFor="let option of deptList">
302
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
303
+									</ng-container>
304
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
305
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
306
+									</nz-option>
307
+								</nz-select>
308
+							</nz-input-group>
309
+						</nz-form-control>
310
+					</nz-form-item>
311
+					
312
+					<nz-form-item>
313
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="drugsBagType">药品类型</nz-form-label>
314
+					  <nz-form-control nzErrorTip="请选择药品类型!">
315
+					    <nz-input-group>
316
+								<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear nzPlaceHolder="请选择药品类型" formControlName="drugsBagType">
317
+								  <ng-container *ngFor="let option of drugsList">
318
+								    <nz-option [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
319
+								  </ng-container>
320
+								</nz-select>
321
+					    </nz-input-group>
322
+					  </nz-form-control>
323
+					</nz-form-item>
324
+				
325
+					<nz-form-item>
326
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="target">申请科室</nz-form-label>
327
+						<nz-form-control nzErrorTip="请选择申请科室!">
328
+							<nz-input-group>
329
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
330
+									(nzOnSearch)="changeInp($event)" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择申请科室" formControlName="target">
331
+									<ng-container *ngFor="let option of deptList">
332
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
333
+									</ng-container>
334
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
335
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
336
+									</nz-option>
337
+								</nz-select>
338
+							</nz-input-group>
339
+						</nz-form-control>
340
+					</nz-form-item>
341
+					
342
+					<nz-form-item>
343
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="amount">生成数量</nz-form-label>
344
+					  <nz-form-control nzErrorTip="请选择生成数量!">
345
+					    <nz-input-group>
346
+								<nz-input-number formControlName="amount" (ngModelChange)="numChange($event)" [nzMin]="1" [nzMax]="50" [nzStep]="1"></nz-input-number>
347
+							</nz-input-group>
348
+					  </nz-form-control>
349
+					</nz-form-item>
350
+					
351
+					<nz-form-item>
352
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="sendMsg">是否自动发消息</nz-form-label>
353
+					  <nz-form-control nzErrorTip="请选择是否自动发消息!">
354
+					    <nz-input-group>
355
+								<nz-radio-group [nzDisabled]="view" formControlName="sendMsg">
356
+									<label nz-radio nzValue="1">是</label>
357
+									<label nz-radio nzValue="0">否</label>
358
+								</nz-radio-group>
359
+					    </nz-input-group>
360
+					  </nz-form-control>
361
+					</nz-form-item>
362
+      </form>
363
+    </div>
364
+    <div class="display_flex justify-content_flex-center">
365
+      <button nzType="primary" nz-button (click)="submitAutoForm()" [nzLoading]="btnLoading">生成药品</button>
366
+      <button class="btn cancel" nz-button nzType="default" (click)="hideAutoModal()">取消</button>
367
+    </div>
368
+  </div>
369
+</div>

+ 4 - 0
src/app/views/drug-search/drug-search.component.less

@@ -118,6 +118,10 @@
118 118
 							width: 100% !important;
119 119
 						}
120 120
 						
121
+						.ant-input-number{
122
+							width: 100% !important;
123
+						}
124
+						
121 125
             .ant-form-item-label {
122 126
               line-height: 14px;
123 127
               text-align: left;

+ 61 - 1
src/app/views/drug-search/drug-search.component.ts

@@ -428,7 +428,67 @@ export class DrugSearchComponent implements OnInit {
428 428
 		}
429 429
 		this.modal = true
430 430
 	}
431
-
431
+	
432
+	// 自动生成
433
+	autoCreateModal:boolean = false;
434
+	autoCreate(){
435
+		this.autoCreateModal = true
436
+		this.initAutoForm()
437
+	}
438
+	
439
+	// 初始化form
440
+	validateAutoForm: FormGroup
441
+	initAutoForm(){
442
+		this.validateAutoForm = this.fb.group({
443
+			launch: [null, [Validators.required]],
444
+			drugsBagType: [null, [Validators.required]],
445
+			target: [null, []],
446
+			amount: [1, []],
447
+			sendMsg: ['0', []],
448
+		});
449
+	}
450
+	
451
+	numChange(e){
452
+		console.log(4, e)
453
+	}
454
+	
455
+	hideAutoModal(){
456
+		this.autoCreateModal = false
457
+	}
458
+	
459
+	// 自动生成提交
460
+	submitAutoForm(){
461
+		var that = this;
462
+		for (const i in that.validateAutoForm.controls) {
463
+		  that.validateAutoForm.controls[i].markAsDirty();
464
+		  that.validateAutoForm.controls[i].updateValueAndValidity();
465
+		}
466
+		if (that.validateAutoForm.invalid) return;
467
+		let data = {
468
+			drugsBag:{
469
+				target: this.validateAutoForm.value.target || undefined,
470
+				launch: this.validateAutoForm.value.launch || undefined,
471
+				sendMsg: this.validateAutoForm.value.sendMsg || undefined,
472
+				drugsBagType: {
473
+					id: this.validateAutoForm.value.drugsBagType
474
+				}
475
+			}
476
+		};
477
+		that.btnLoading = true;
478
+		that.mainService
479
+		  .autoMake("drugsBag", this.validateAutoForm.value.amount, data)
480
+		  .subscribe((data:any) => {
481
+		    that.btnLoading = false;
482
+		    that.hideAutoModal();
483
+		    that.initAutoForm();
484
+		    if (data.status == 200) {
485
+		      that.showPromptModal("生成", true, "");
486
+		    } else {
487
+		      that.showPromptModal("生成", false, data.msg);
488
+		    }
489
+		  });
490
+	}
491
+	
432 492
 	// 消息发送
433 493
 	sendModal:boolean = false;
434 494
 	sendMsg(data){

+ 51 - 50
src/app/views/main/main.component.ts

@@ -617,40 +617,41 @@ export class MainComponent implements OnInit, OnDestroy {
617 617
 	}
618 618
 
619 619
 	initOrderScope() {
620
-	  let scopeInfo = this.user.user.scope;
621
-	  this.checkedHos = scopeInfo.hospitalId ? scopeInfo.hospitalId.id : undefined;
622
-	  this.checkedHosDTO = scopeInfo.hospitalId || undefined;
623
-	  this.orderScopeRadio = scopeInfo.range + "";
624
-	  let groupIds = scopeInfo.groupIds || [];
625
-	  let dutyGroupList = scopeInfo.dutyGroupList || [];
626
-	  this.scopeGroups = dutyGroupList.concat(groupIds);
627
-	  if(this.scopeGroups.length){
628
-	    this.typeId = this.scopeGroups[0].id;
629
-	  }
630
-	  this.hsmsData = {
631
-	    checkedHos: this.checkedHos,
632
-	    checkedHosDTO: this.checkedHosDTO,
633
-	    scopeGroups: this.scopeGroups,
634
-	    orderScopeRadio: this.orderScopeRadio || '0',
635
-	    hsmsSwitch: scopeInfo.hsmsSwitch === 1,
636
-	  }
637
-	  this.flagList.hsmsFlag1 = this.hsmsData.hsmsSwitch;
638
-	  this.flagList.hsmsFlag2 = this.hsmsData.hsmsSwitch;
639
-	  this.flagList.hsmsFlag3 = this.hsmsData.hsmsSwitch;
640
-	  this.itsmCheckedHos = scopeInfo.dutyList || [];
641
-	  this.itsmOrderScopeRadio = scopeInfo.dutyRange + "";
642
-	  this.itsmScopeGroups = scopeInfo.dutyGroupList || [];
643
-	  this.itsmData = {
644
-	    checkedHos: this.itsmCheckedHos,
645
-	    scopeGroups: this.itsmScopeGroups,
646
-	    orderScopeRadio: this.itsmOrderScopeRadio || '0',
647
-	    mdv2Switch: scopeInfo.mdv2Switch === 1,
648
-	    allDuty: scopeInfo.allDuty === undefined ? 1 : scopeInfo.allDuty,
649
-			showReassign: scopeInfo.showReassign == null || scopeInfo.showReassign == 0 ? 0 : 1,
650
-	  }
651
-	  this.flagList.itsmFlag1 = this.itsmData.mdv2Switch;
652
-	  this.flagList.itsmFlag2 = this.itsmData.mdv2Switch;
653
-	  this.flagList.itsmFlag3 = this.itsmData.mdv2Switch;
620
+	  // let scopeInfo = this.user.user.scope;
621
+		// let hsoObj = this.user.user.currentHospital;
622
+	  // this.currentHospital.id = hsoObj.hospitalId ? hsoObj.hospitalId.id : undefined;
623
+	  // this.checkedHosDTO = scopeInfo.hospitalId || undefined;
624
+	  // this.orderScopeRadio = scopeInfo.range + "";
625
+	  // let groupIds = scopeInfo.groupIds || [];
626
+	  // let dutyGroupList = scopeInfo.dutyGroupList || [];
627
+	  // this.scopeGroups = dutyGroupList.concat(groupIds);
628
+	  // if(this.scopeGroups.length){
629
+	  //   this.typeId = this.scopeGroups[0].id;
630
+	  // }
631
+	  // this.hsmsData = {
632
+	  //   checkedHos: this.currentHospital.id,
633
+	  //   checkedHosDTO: this.checkedHosDTO,
634
+	  //   scopeGroups: this.scopeGroups,
635
+	  //   orderScopeRadio: this.orderScopeRadio || '0',
636
+	  //   hsmsSwitch: scopeInfo.hsmsSwitch === 1,
637
+	  // }
638
+	  // this.flagList.hsmsFlag1 = this.hsmsData.hsmsSwitch;
639
+	  // this.flagList.hsmsFlag2 = this.hsmsData.hsmsSwitch;
640
+	  // this.flagList.hsmsFlag3 = this.hsmsData.hsmsSwitch;
641
+	  // this.itsmCheckedHos = scopeInfo.dutyList || [];
642
+	  // this.itsmOrderScopeRadio = scopeInfo.dutyRange + "";
643
+	  // this.itsmScopeGroups = scopeInfo.dutyGroupList || [];
644
+	  // this.itsmData = {
645
+	  //   checkedHos: this.itsmCheckedHos,
646
+	  //   scopeGroups: this.itsmScopeGroups,
647
+	  //   orderScopeRadio: this.itsmOrderScopeRadio || '0',
648
+	  //   mdv2Switch: scopeInfo.mdv2Switch === 1,
649
+	  //   allDuty: scopeInfo.allDuty === undefined ? 1 : scopeInfo.allDuty,
650
+			// showReassign: scopeInfo.showReassign == null || scopeInfo.showReassign == 0 ? 0 : 1,
651
+	  // }
652
+	  // this.flagList.itsmFlag1 = this.itsmData.mdv2Switch;
653
+	  // this.flagList.itsmFlag2 = this.itsmData.mdv2Switch;
654
+	  // this.flagList.itsmFlag3 = this.itsmData.mdv2Switch;
654 655
 		this.showNewOrder();
655 656
 	  this.getHospitalConfigList('allowNucleicAcidPrinting');
656 657
 	  this.getConfigTasktype();
@@ -662,7 +663,7 @@ export class MainComponent implements OnInit, OnDestroy {
662 663
 	  // if(!this.hsmsData.hsmsSwitch){
663 664
 	  //   return;
664 665
 	  // }
665
-	  let postData = { idx: 0, sum: 1, hospitalConfig: { hosId: this.checkedHos, key } };
666
+	  let postData = { idx: 0, sum: 1, hospitalConfig: { hosId: this.currentHospital.id, key } };
666 667
 	  this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe(result=>{
667 668
 	    if(result.status == 200){
668 669
 	      this.isShowNucleicAcidPrinting = result.list[0].value == 1;
@@ -682,7 +683,7 @@ export class MainComponent implements OnInit, OnDestroy {
682 683
 	    idx: 0,
683 684
 	    sum: 1,
684 685
 	    hospitalConfig: {
685
-	      hosId: this.checkedHos,
686
+	      hosId: this.currentHospital.id,
686 687
 	      key: "rebackPatientTypeId",
687 688
 	    },
688 689
 	  };
@@ -869,7 +870,7 @@ export class MainComponent implements OnInit, OnDestroy {
869 870
 	  return this.mainService.getTaskTypeBySearchKey({
870 871
 	    searchKey: keyword || undefined,
871 872
 	    countRemark: countRemark || undefined,
872
-	    hosId: this.checkedHos,
873
+	    hosId: this.currentHospital.id,
873 874
 	  });
874 875
 	}
875 876
 
@@ -898,7 +899,7 @@ export class MainComponent implements OnInit, OnDestroy {
898 899
 	  let postData = {
899 900
 	    patientLog: {
900 901
 	      sqDept: { id },
901
-	      hosId: this.checkedHos,
902
+	      hosId: this.currentHospital.id,
902 903
 	    },
903 904
 	    idx: 0,
904 905
 	    sum: 10000,
@@ -923,14 +924,14 @@ export class MainComponent implements OnInit, OnDestroy {
923 924
 	    this.noArrives = [];
924 925
 	    return;
925 926
 	  }
926
-	  let types = "";
927
-	  this.user.user.scope.typeIds.forEach((e) => {
928
-	    types += e.id + ",";
929
-	  });
930
-	  types = types.slice(0, types.length - 1);
927
+	  // let types = "";
928
+	  // this.user.user.scope.typeIds.forEach((e) => {
929
+	  //   types += e.id + ",";
930
+	  // });
931
+	  // types = types.slice(0, types.length - 1);
931 932
 	  let dataObj = {
932 933
 	    workOrder: {
933
-	      serTaskTypes: types,
934
+	      serTaskTypes: null,
934 935
 	      // serGdState: 4,
935 936
 	      range: "0",
936 937
 	      platform: 3,
@@ -1105,7 +1106,7 @@ export class MainComponent implements OnInit, OnDestroy {
1105 1106
 	getPatientByResidenceNo(residenceNo) {
1106 1107
 	  let postData = {
1107 1108
 	    residenceNo,
1108
-	    hosId: this.checkedHos,
1109
+	    hosId: this.currentHospital.id,
1109 1110
 	    idx: 0,
1110 1111
 	    sum: 2,
1111 1112
 	  };
@@ -1792,7 +1793,7 @@ export class MainComponent implements OnInit, OnDestroy {
1792 1793
 	  if(type == 'itsm'){
1793 1794
 	    cascadeHosId = this.incidentModel.hosId || undefined;
1794 1795
 	  }else{
1795
-	    cascadeHosId = this.checkedHos;
1796
+	    cascadeHosId = this.currentHospital.id;
1796 1797
 	  }
1797 1798
 	  let dataObj = {
1798 1799
 	    idx: 0,
@@ -2553,7 +2554,7 @@ export class MainComponent implements OnInit, OnDestroy {
2553 2554
 	// 查类型
2554 2555
 	getTaskTypeCountRemarkList(){
2555 2556
 	  this.mainService.getTaskTypeCountRemarkList({
2556
-	      hosId: this.checkedHos,
2557
+	      hosId: this.currentHospital.id,
2557 2558
 	      typeValues: 'other,specimen,ordinary',
2558 2559
 	  }).subscribe((data) => {
2559 2560
 	    if (data["status"] == 200){
@@ -2978,7 +2979,7 @@ export class MainComponent implements OnInit, OnDestroy {
2978 2979
 	workOrderInspectScoreList:any[] = [];
2979 2980
 	workOrderInspectScore:any;
2980 2981
 	getWorkOrderInspectScore() {
2981
-	  let postData = { idx: 0, sum: 9999, workOrderInspectScore: { hosId: this.checkedHos } };
2982
+	  let postData = { idx: 0, sum: 9999, workOrderInspectScore: { hosId: this.currentHospital.id } };
2982 2983
 	  this.mainService
2983 2984
 	    .getFetchDataList("simple/data", "workOrderInspectScore", postData)
2984 2985
 	    .subscribe((result) => {
@@ -3041,7 +3042,7 @@ export class MainComponent implements OnInit, OnDestroy {
3041 3042
 	    } else if (data["startStatus"] == 203) {
3042 3043
 	      this.startDeptQt = data["startDept"][0]["id"];
3043 3044
 	    } else if (data["startStatus"] == 204 || data["startStatus"] == 205) {
3044
-	      this.getHosDepartmentQt(this.checkedHos, "start", "");
3045
+	      this.getHosDepartmentQt(this.currentHospital.id, "start", "");
3045 3046
 	    }
3046 3047
 	    // 终点科室
3047 3048
 	    if (data["endStatus"] == 201) {
@@ -3055,7 +3056,7 @@ export class MainComponent implements OnInit, OnDestroy {
3055 3056
 	    } else if (data["endStatus"] == 203) {
3056 3057
 	      this.endDeptQt = data["endDept"][0]["id"];
3057 3058
 	    } else if (data["endStatus"] == 204 || data["endStatus"] == 205) {
3058
-	      this.getHosDepartmentQt(this.checkedHos, "end", "");
3059
+	      this.getHosDepartmentQt(this.currentHospital.id, "end", "");
3059 3060
 	    }
3060 3061
 	  });
3061 3062
 	}

+ 4 - 0
src/app/views/page-config/page-config.component.ts

@@ -19,6 +19,10 @@ export class PageConfigComponent implements OnInit, AfterViewInit {
19 19
   // 数据字典
20 20
   dictionaryKeyList:any[] = [
21 21
     { id: 1, name: '检查类型', key: "inspect_check_item"},
22
+		{ id: 2, name: 'ABO血型', key: "abo_type"},
23
+		{ id: 3, name: 'RH血型', key: "rh_type"},
24
+		{ id: 4, name: '单位', key: "blood_unit"},
25
+		{ id: 5, name: '血液类型', key: "blood_trans_type"},
22 26
   ]
23 27
 
24 28
   ngOnInit(): void {}

+ 326 - 2
src/app/views/specimen-search/specimen-search.component.html

@@ -140,6 +140,12 @@
140 140
         <button nz-button class="btn default ml8" (click)="getList(1)">
141 141
           搜索
142 142
         </button>
143
+				<button nz-button class="btn default ml8" (click)="addForm()">
144
+				  新增
145
+				</button>
146
+				<button nz-button class="btn default ml8" (click)="autoCreate()">
147
+				  自动生成
148
+				</button>
143 149
       </div>
144 150
     </div>
145 151
     <div class="list-template__checkBoxes">
@@ -167,7 +173,7 @@
167 173
             <th nzShowSort nzSortKey="arrive_time" [(nzSort)]="sortCurrent.arrive_time">收取信息</th>
168 174
             <th nzWidth="8%">中转时间</th>
169 175
             <th>送达信息</th>
170
-            <th nzWidth="7%"></th>
176
+            <th nzWidth="12%">操作</th>
171 177
           </tr>
172 178
         </thead>
173 179
         <tbody>
@@ -202,7 +208,14 @@
202 208
 							<div>{{ data.delivererName || "-" }}</div>
203 209
 							<div>{{ data.sendTime || '-' }}</div>
204 210
 						</td>
205
-            <td><button (click)="viewSpecimenHistory(data)">查看</button></td>
211
+            <td>
212
+							<!-- <button (click)="viewSpecimenHistory(data)">查看</button> -->
213
+							<div class="coop">
214
+							  <span (click)="viewSpecimenHistory(data)">查看</span>
215
+								<span *ngIf="coopBtns.collect && (data.speState.value==2 || data.speState.value==3)" (click)="collect($event,data)">设置核收</span>
216
+								<span *ngIf="coopBtns.send && (data.speState.value==1 || data.speState.value==30)" (click)="send($event,data)">消息发送</span>
217
+							</div>
218
+						</td>
206 219
           </tr>
207 220
         </tbody>
208 221
       </nz-table>
@@ -227,6 +240,14 @@
227 240
   (confirmDelEvent)="confirmDel()"
228 241
   [content]="tipsMsg1"
229 242
 ></app-dialog-delete>
243
+<!-- 发送模态框 -->
244
+<app-dialog-delete
245
+  [delModal]="sendModal"
246
+  (hideDelModalEvent)="hideSendModal()"
247
+  [btnLoading]="btnLoading"
248
+  (confirmDelEvent)="confirmSend()"
249
+  [content]="tipsMsg2"
250
+></app-dialog-delete>
230 251
 <!-- 标本历史记录查看 -->
231 252
 <app-history-prompt-modal
232 253
   *ngIf="historyPromptModalShow"
@@ -243,3 +264,306 @@
243 264
   [info]="promptInfo"
244 265
 >
245 266
 </app-prompt-modal>
267
+
268
+<!-- 新增/编辑模态框 -->
269
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="addModal">
270
+  <div class="modalBody">
271
+    <div class="title">{{add?"新增":view?"查看":"编辑"}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
272
+    </div>
273
+    <div class="content">
274
+      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
275
+				<div class="df">
276
+					<nz-form-item>
277
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="sickRoom">申请科室</nz-form-label>
278
+						<nz-form-control nzErrorTip="请选择申请科室!">
279
+							<nz-input-group>
280
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
281
+									(nzOnSearch)="changeInp($event, 'search')" (nzOpenChange)="changeSearch($event)" (ngModelChange)="onDeptChange($event)" nzAllowClear nzPlaceHolder="请选择申请科室" formControlName="sickRoom">
282
+									<ng-container *ngFor="let option of departmentSearch">
283
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
284
+									</ng-container>
285
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
286
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
287
+									</nz-option>
288
+								</nz-select>
289
+							</nz-input-group>
290
+						</nz-form-control>
291
+					</nz-form-item>
292
+					
293
+					<nz-form-item>
294
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="checkDept">检验科室</nz-form-label>
295
+						<nz-form-control nzErrorTip="请选择检验科室!">
296
+							<nz-input-group>
297
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
298
+									(nzOnSearch)="changeInp($event, 'search')" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择检验科室" formControlName="checkDept">
299
+									<ng-container *ngFor="let option of departmentSearch">
300
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
301
+									</ng-container>
302
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
303
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
304
+									</nz-option>
305
+								</nz-select>
306
+							</nz-input-group>
307
+						</nz-form-control>
308
+					</nz-form-item>
309
+					
310
+					<nz-form-item>
311
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="patientId">患者</nz-form-label>
312
+					  <nz-form-control nzErrorTip="请选择患者!">
313
+					    <nz-input-group>
314
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
315
+								  (nzOnSearch)="changePatient($event, 1)" (ngModelChange)="onPatientChange($event)" nzAllowClear nzPlaceHolder="请选择患者" formControlName="patientId">
316
+									<ng-container *ngFor="let option of patientList">
317
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.patientName" [nzValue]="option.id"></nz-option>
318
+									</ng-container>
319
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
320
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
321
+									</nz-option>
322
+								</nz-select>
323
+					    </nz-input-group>
324
+					  </nz-form-control>
325
+					</nz-form-item>
326
+				</div>
327
+				
328
+				<div class="df"> 
329
+					<nz-form-item>
330
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="examinationItemsId">检验项目</nz-form-label>
331
+					  <nz-form-control nzErrorTip="请选择检验项目!">
332
+					    <nz-input-group>
333
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
334
+								   (ngModelChange)="onExamineChange($event)" nzAllowClear nzPlaceHolder="请选择检验项目" formControlName="examinationItemsId">
335
+									<ng-container *ngFor="let option of projectList">
336
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
337
+									</ng-container>
338
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
339
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
340
+									</nz-option>
341
+								</nz-select>
342
+					    </nz-input-group>
343
+					  </nz-form-control>
344
+					</nz-form-item>
345
+					
346
+					<nz-form-item>
347
+					  <nz-form-label [nzSm]="7" [nzXs]="24" nzFor="stype">标本类型</nz-form-label>
348
+					  <nz-form-control nzErrorTip="请选择标本类型!">
349
+					    <nz-input-group>
350
+								<input nz-input disabled class="formItem" formControlName="stype" placeholder="请输入标本类型" nzSize="default" />
351
+					    </nz-input-group>
352
+					  </nz-form-control>
353
+					</nz-form-item>
354
+					
355
+					<nz-form-item>
356
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="tubeType">试管类型</nz-form-label>
357
+					  <nz-form-control nzErrorTip="请选择试管类型!">
358
+					    <nz-input-group>
359
+								<input nz-input disabled class="formItem" formControlName="tubeType" placeholder="请输入试管类型" nzSize="default" />
360
+					    </nz-input-group>
361
+					  </nz-form-control>
362
+					</nz-form-item>
363
+				</div>
364
+				
365
+      	<div class="df">
366
+					<nz-form-item>
367
+					  <nz-form-label [nzSm]="6" nzRequired [nzXs]="24" nzFor="speState">默认状态</nz-form-label>
368
+					  <nz-form-control nzErrorTip="请选择默认状态!">
369
+					    <nz-input-group>
370
+								<input nz-input disabled class="formItem" formControlName="speState" placeholder="请输入默认状态" nzSize="default" />
371
+							</nz-input-group>
372
+					  </nz-form-control>
373
+					</nz-form-item>
374
+					
375
+					<nz-form-item>
376
+					  <nz-form-label [nzSm]="6" nzRequired [nzXs]="24" nzFor="urgent">紧急度</nz-form-label>
377
+					  <nz-form-control nzErrorTip="请选择紧急度!">
378
+					    <nz-input-group>
379
+								<nz-radio-group [nzDisabled]="view" formControlName="urgent">
380
+									<label nz-radio nzValue="1">急查</label>
381
+									<label nz-radio nzValue="0">普查</label>
382
+								</nz-radio-group>
383
+							</nz-input-group>
384
+					  </nz-form-control>
385
+					</nz-form-item>
386
+					
387
+					<nz-form-item>
388
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="collectNurseId">采集人</nz-form-label>
389
+					  <nz-form-control nzErrorTip="请选择采集人!">
390
+					    <nz-input-group>
391
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
392
+								  (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择采集人" formControlName="collectNurseId">
393
+									<ng-container *ngFor="let option of userList">
394
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
395
+									</ng-container>
396
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
397
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
398
+									</nz-option>
399
+								</nz-select>
400
+					    </nz-input-group>
401
+					  </nz-form-control>
402
+					</nz-form-item>
403
+				</div>
404
+				
405
+				<div class="df">
406
+					<nz-form-item>
407
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="sendMsg">是否自动发消息</nz-form-label>
408
+					  <nz-form-control nzErrorTip="请选择是否自动发消息!">
409
+					    <nz-input-group>
410
+								<nz-radio-group [nzDisabled]="view" formControlName="sendMsg">
411
+									<label nz-radio nzValue="1">是</label>
412
+									<label nz-radio nzValue="0">否</label>
413
+								</nz-radio-group>
414
+					    </nz-input-group>
415
+					  </nz-form-control>
416
+					</nz-form-item>
417
+				</div>
418
+      </form>
419
+    </div>
420
+    <div class="display_flex justify-content_flex-center">
421
+      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
422
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
423
+    </div>
424
+  </div>
425
+</div>
426
+
427
+<!-- 设置核收 -->
428
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="collectModal">
429
+  <div class="modalBody collect">
430
+    <div class="title">设置核收<i class="icon_transport transport-guanbi" (click)="hideCollectModal()"></i>
431
+    </div>
432
+    <div class="content">
433
+      <form nz-form [formGroup]="validateCollectForm" class="addForm" (ngSubmit)="submitCollectForm()">
434
+					<nz-form-item>
435
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="collect">核收人</nz-form-label>
436
+					  <nz-form-control nzErrorTip="请选择核收人!">
437
+					    <nz-input-group>
438
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
439
+								  (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择核收人" formControlName="collect">
440
+									<ng-container *ngFor="let option of userList">
441
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
442
+									</ng-container>
443
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
444
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
445
+									</nz-option>
446
+								</nz-select>
447
+					    </nz-input-group>
448
+					  </nz-form-control>
449
+					</nz-form-item>
450
+					
451
+					<nz-form-item>
452
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="sendMsg">是否自动发消息</nz-form-label>
453
+					  <nz-form-control nzErrorTip="请选择是否自动发消息!">
454
+					    <nz-input-group>
455
+								<nz-radio-group [nzDisabled]="view" formControlName="sendMsg">
456
+									<label nz-radio nzValue="1">是</label>
457
+									<label nz-radio nzValue="0">否</label>
458
+								</nz-radio-group>
459
+					    </nz-input-group>
460
+					  </nz-form-control>
461
+					</nz-form-item>
462
+				
463
+      </form>
464
+    </div>
465
+    <div class="display_flex justify-content_flex-center">
466
+      <button nzType="primary" nz-button (click)="submitCollectForm()" [nzLoading]="btnLoading">确认</button>
467
+      <button class="btn cancel" nz-button nzType="default" (click)="hideCollectModal()">取消</button>
468
+    </div>
469
+  </div>
470
+</div>
471
+
472
+<!-- 自动生成模态框 -->
473
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="autoCreateModal">
474
+  <div class="modalBody collect">
475
+    <div class="title">自动生成<i class="icon_transport transport-guanbi" (click)="hideAutoModal()"></i>
476
+    </div>
477
+    <div class="content">
478
+      <form nz-form [formGroup]="validateAutoForm" class="addForm" (ngSubmit)="submitAutoForm()">
479
+					<nz-form-item>
480
+						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="sickRoom">申请科室</nz-form-label>
481
+						<nz-form-control nzErrorTip="请选择申请科室!">
482
+							<nz-input-group>
483
+								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
484
+									(nzOnSearch)="changeInp($event, 'search')" (nzOpenChange)="changeSearch($event)" (ngModelChange)="onAutoDeptChange($event)" nzAllowClear nzPlaceHolder="请选择申请科室" formControlName="sickRoom">
485
+									<ng-container *ngFor="let option of departmentSearch">
486
+										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
487
+									</ng-container>
488
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
489
+										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
490
+									</nz-option>
491
+								</nz-select>
492
+							</nz-input-group>
493
+						</nz-form-control>
494
+					</nz-form-item>
495
+					
496
+					<nz-form-item>
497
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="patientId">患者</nz-form-label>
498
+					  <nz-form-control nzErrorTip="请选择患者!">
499
+					    <nz-input-group>
500
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
501
+								  (nzOnSearch)="changePatient($event, 2)" (ngModelChange)="onPatientChange($event)" nzAllowClear nzPlaceHolder="请选择患者" formControlName="patientId">
502
+									<ng-container *ngFor="let option of patientList">
503
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.patientName" [nzValue]="option.id"></nz-option>
504
+									</ng-container>
505
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
506
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
507
+									</nz-option>
508
+								</nz-select>
509
+					    </nz-input-group>
510
+					  </nz-form-control>
511
+					</nz-form-item>
512
+				
513
+					<nz-form-item>
514
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="examinationItemsId">检验项目</nz-form-label>
515
+					  <nz-form-control nzErrorTip="请选择检验项目!">
516
+					    <nz-input-group>
517
+								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
518
+								   (ngModelChange)="onAutoExamineChange($event)" nzAllowClear nzPlaceHolder="请选择检验项目" formControlName="examinationItemsId">
519
+									<ng-container *ngFor="let option of projectList">
520
+									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
521
+									</ng-container>
522
+									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
523
+									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
524
+									</nz-option>
525
+								</nz-select>
526
+					    </nz-input-group>
527
+					  </nz-form-control>
528
+					</nz-form-item>
529
+					
530
+					<nz-form-item>
531
+					  <nz-form-label nzRequired [nzSm]="6" [nzXs]="24" nzFor="amount">生成数量</nz-form-label>
532
+					  <nz-form-control nzErrorTip="请选择生成数量!">
533
+					    <nz-input-group>
534
+								<nz-input-number formControlName="amount" (ngModelChange)="numChange($event)" [nzMin]="1" [nzMax]="50" [nzStep]="1"></nz-input-number>
535
+							</nz-input-group>
536
+					  </nz-form-control>
537
+					</nz-form-item>
538
+					
539
+					<nz-form-item>
540
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="urgent">紧急度</nz-form-label>
541
+					  <nz-form-control nzErrorTip="请选择紧急度!">
542
+					    <nz-input-group>
543
+								<nz-radio-group [nzDisabled]="view" formControlName="urgent">
544
+									<label nz-radio nzValue="1">急查</label>
545
+									<label nz-radio nzValue="0">普查</label>
546
+								</nz-radio-group>
547
+							</nz-input-group>
548
+					  </nz-form-control>
549
+					</nz-form-item>
550
+					
551
+					<nz-form-item>
552
+					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="sendMsg">是否自动发消息</nz-form-label>
553
+					  <nz-form-control nzErrorTip="请选择是否自动发消息!">
554
+					    <nz-input-group>
555
+								<nz-radio-group [nzDisabled]="view" formControlName="sendMsg">
556
+									<label nz-radio nzValue="1">是</label>
557
+									<label nz-radio nzValue="0">否</label>
558
+								</nz-radio-group>
559
+					    </nz-input-group>
560
+					  </nz-form-control>
561
+					</nz-form-item>
562
+      </form>
563
+    </div>
564
+    <div class="display_flex justify-content_flex-center">
565
+      <button nzType="primary" nz-button (click)="submitAutoForm()" [nzLoading]="btnLoading">生成标本</button>
566
+      <button class="btn cancel" nz-button nzType="default" (click)="hideAutoModal()">取消</button>
567
+    </div>
568
+  </div>
569
+</div>

+ 35 - 2
src/app/views/specimen-search/specimen-search.component.less

@@ -96,8 +96,11 @@
96 96
 
97 97
   // 新增
98 98
   &.add {
99
+		.collect{
100
+			width: 500px !important;
101
+		}
99 102
     .modalBody {
100
-      width: 480px;
103
+      width: 70%;
101 104
       height: auto;
102 105
 
103 106
       .content {
@@ -108,9 +111,39 @@
108 111
         overflow-y: auto;
109 112
 
110 113
         .addForm {
114
+					.df{
115
+						display: flex;
116
+						margin-bottom: 15px;
117
+						.ant-form-item {
118
+							width: 30%;
119
+							margin-right: 3%;
120
+							.ant-form-item-label{
121
+								overflow: visible !important;
122
+							}
123
+							
124
+							.ant-select{
125
+								width: 100% !important;
126
+							}
127
+							
128
+						  .ant-form-item-label {
129
+						    line-height: 14px;
130
+						    text-align: left;
131
+						  }
132
+						
133
+						  .desc {
134
+						    margin-top: 5px;
135
+						  }
136
+						}
137
+					}
111 138
           .ant-form-item {
112 139
             margin-bottom: 15px;
113
-
140
+						
141
+						.ant-select{
142
+							width: 100% !important;
143
+						}
144
+						.ant-input-number{
145
+							width: 100% !important;
146
+						}
114 147
             .ant-form-item-label {
115 148
               line-height: 14px;
116 149
               text-align: left;

+ 381 - 2
src/app/views/specimen-search/specimen-search.component.ts

@@ -4,13 +4,21 @@ import { ToolService } from "../../services/tool.service";
4 4
 import { Subject } from "rxjs";
5 5
 import { debounceTime } from "rxjs/operators";
6 6
 import { format, subDays, endOfDay, startOfDay } from "date-fns";
7
+import { Validators, FormGroup, FormBuilder } from '@angular/forms';
8
+import { ActivatedRoute, Router } from "@angular/router";
9
+
7 10
 @Component({
8 11
   selector: "app-specimen-search",
9 12
   templateUrl: "./specimen-search.component.html",
10 13
   styleUrls: ["./specimen-search.component.less"],
11 14
 })
12 15
 export class SpecimenSearchComponent implements OnInit {
13
-  constructor(private mainService: MainService, private tool: ToolService) {}
16
+  constructor(
17
+	private mainService: MainService, 
18
+	private tool: ToolService,
19
+	private fb: FormBuilder,
20
+	public route: ActivatedRoute,
21
+	) {}
14 22
 
15 23
   currentUserAccount: any = JSON.parse(localStorage.getItem("user")).user.account; //当前登录人账号
16 24
   searchCriteria = {
@@ -32,12 +40,19 @@ export class SpecimenSearchComponent implements OnInit {
32 40
   pageIndex: number = 1; //表格当前页码
33 41
   pageSize: number = 10; //表格每页展示条数
34 42
   listLength: number = 10; //表格总数据量
43
+	hosId:any;
35 44
   checkOptionsOne: Array<any> = [
36 45
     { label: "服务中心收取", value: "0", checked: true },
37 46
   ];
38 47
   changeInpSubject = new Subject();
48
+	changeInpUserSubject = new Subject();
39 49
   changeInp2Subject = new Subject();
50
+	changeInpPaSubject = new Subject();
51
+	coopBtns:any;
52
+	
40 53
   ngOnInit() {
54
+		this.coopBtns = this.tool.initCoopBtns(this.route);
55
+		this.hosId = this.tool.getCurrentHospital().id;
41 56
 		// this.searchCriteria.dateRange = [
42 57
 		// 	format(subDays(new Date(), 7), "yyyy-MM-dd") + ' ' +'00:00:00',
43 58
 		// 	format(endOfDay(new Date()), "yyyy-MM-dd HH:mm:ss")
@@ -50,7 +65,15 @@ export class SpecimenSearchComponent implements OnInit {
50 65
     this.changeInp2Subject.pipe(debounceTime(500)).subscribe((v) => {
51 66
       this.searchUser(v[0], v[1]);
52 67
     });
68
+		this.changeInpUserSubject.pipe(debounceTime(500)).subscribe((v) => {
69
+		  this.getUserList(v);
70
+		});
71
+		this.changeInpPaSubject.pipe(debounceTime(500)).subscribe((v) => {
72
+		  this.getPatient(v[1], v[0]);
73
+		});
74
+		this.getUserList();
53 75
     this.getAllHospital();
76
+		this.getProjectList();
54 77
   }
55 78
   // 表格筛选
56 79
   log(value: object[]): void {
@@ -106,7 +129,7 @@ export class SpecimenSearchComponent implements OnInit {
106 129
     setTimeout(() => {
107 130
       this.promptModalShow = true;
108 131
     }, 100);
109
-    this.getList(0, this.sortCurrentKey, this.sortCurrentValue);
132
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
110 133
   }
111 134
   // 查看标本历史记录
112 135
   historyPromptModalShow = false; //标本历史记录弹窗开关
@@ -141,6 +164,362 @@ export class SpecimenSearchComponent implements OnInit {
141 164
 	    this.searchCriteria.dateRange = [dateStart,dateEnd];
142 165
 	  }
143 166
 	}
167
+	
168
+	// 搜索患者
169
+	changePatient(e, type){
170
+		this.isLoading = true;
171
+		this.changeInpPaSubject.next([e, type]);
172
+	}	
173
+	
174
+	// 搜索用户
175
+	changeUser(e){
176
+		this.isLoading = true;
177
+		this.changeInpUserSubject.next(e);
178
+	}	
179
+	
180
+	// 获取用户
181
+	userList:any = [];
182
+	getUserList(name?){
183
+		let data = {
184
+		  idx: 0,
185
+		  sum: 20,
186
+		  user: {
187
+		    name: name,
188
+		    hospital: { id: this.hosId || "" },
189
+		  },
190
+		};
191
+		this.mainService
192
+		  .getFetchDataList("data", "user", data)
193
+		  .subscribe((data) => {
194
+		    this.isLoading = false;
195
+		    this.userList = data.list;
196
+		  });
197
+	}
198
+	
199
+	// 获取检验项目
200
+	projectList:any = [];
201
+	getProjectList(){
202
+	let data = {
203
+		idx: 0,
204
+		sum: 9999,
205
+		dictionary: {
206
+			key: "examination_items",
207
+		},
208
+	};
209
+	this.loading1 = true;
210
+	this.mainService
211
+		.getFetchDataList("simple/data", "dictionary", data)
212
+		.subscribe((data) => {
213
+			this.loading1 = false;
214
+			if (data.status == 200) {
215
+				this.projectList = data.list || [];
216
+			}
217
+		});
218
+	}
219
+	
220
+	// 获取患者
221
+	patientList:any = [];
222
+	getPatient(type, patientName?){
223
+		let postData = {
224
+		  idx: 0,
225
+		  sum: 20,
226
+			patient:{
227
+				department:{
228
+					id: type==1 ? this.validateForm.value.sickRoom : this.validateAutoForm.value.sickRoom
229
+				},
230
+				keyWord: patientName,
231
+			}
232
+		};
233
+		this.mainService.getFetchDataList('nurse', 'patient', postData).subscribe((data) => {
234
+		  this.isLoading = false;
235
+		  if (data["status"] == 200) {
236
+				data["list"].forEach(i=>{
237
+					if(i.bedNum && i.residenceNo){
238
+						i.patientName = i.patientName + '('+ i.bedNum +')' +'-'+ i.residenceNo
239
+					}
240
+					if(i.bedNum && !i.residenceNo){
241
+						i.patientName = i.patientName + '('+ i.bedNum +')'
242
+					}
243
+					if(!i.bedNum && !i.residenceNo){
244
+						i.patientName = i.patientName 
245
+					}
246
+					if(!i.bedNum && i.residenceNo){
247
+						i.patientName = i.patientName +'-'+ i.residenceNo
248
+					}
249
+				})
250
+		    this.patientList = data["list"];
251
+		  }
252
+		});
253
+	}
254
+	
255
+	// 选择检验项目
256
+	stypeId:any;
257
+	tubeTypeId:any;
258
+	onExamineChange(e){
259
+		let item = this.projectList.find(i => i.id == e);
260
+		if(item){
261
+			this.validateForm.controls.stype.setValue(item.dictionaryDTO.name)
262
+			this.validateForm.controls.tubeType.setValue(item.extra5DTO.name)
263
+			this.stypeId = item.dictionaryDTO.id
264
+			this.tubeTypeId = item.extra5DTO.id
265
+		}else{
266
+			this.validateForm.controls.stype.setValue(null)
267
+			this.validateForm.controls.tubeType.setValue(null)
268
+			this.stypeId = null
269
+			this.tubeTypeId = null
270
+		}
271
+	}
272
+	
273
+	onAutoExamineChange(e){
274
+
275
+	}
276
+	
277
+	// 选择申请科室
278
+	onDeptChange(e){
279
+		this.validateForm.controls.patientId.setValue(null)
280
+		this.getPatient(1);
281
+	}
282
+	
283
+	// 选择患者
284
+	onPatientChange(e){
285
+
286
+	}
287
+	
288
+	//  选择开始时间
289
+	applyDate:any;
290
+	onApplyChange(result: Date): void {
291
+	
292
+	}
293
+	
294
+	// 自动生成
295
+	autoCreateModal:boolean = false;
296
+	autoCreate(){
297
+		this.autoCreateModal = true
298
+		this.initAutoForm()
299
+	}
300
+	
301
+	// 初始化form
302
+	validateAutoForm: FormGroup
303
+	initAutoForm(){
304
+		this.validateAutoForm = this.fb.group({
305
+			sickRoom: [null, [Validators.required]],
306
+			patientId: [null, []],
307
+			examinationItemsId: [null, []],
308
+			amount: [1, [Validators.required]],
309
+			urgent: [null, []],
310
+			sendMsg: ['0', []],
311
+		});
312
+	}
313
+	
314
+	numChange(e){
315
+		console.log(4, e)
316
+	}
317
+	
318
+	// 选择申请科室
319
+	onAutoDeptChange(e){
320
+		this.validateAutoForm.controls.patientId.setValue(null)
321
+		this.getPatient(2);
322
+	}
323
+	
324
+	hideAutoModal(){
325
+		this.autoCreateModal = false
326
+		this.patientList = [];
327
+	}
328
+	
329
+	// 自动生成提交
330
+	submitAutoForm(){
331
+		var that = this;
332
+		for (const i in that.validateAutoForm.controls) {
333
+		  that.validateAutoForm.controls[i].markAsDirty();
334
+		  that.validateAutoForm.controls[i].updateValueAndValidity();
335
+		}
336
+		if (that.validateAutoForm.invalid) return;
337
+		let data = {
338
+			specimen:{
339
+				sickRoom: this.validateAutoForm.value.sickRoom,
340
+				patientId: this.validateAutoForm.value.patientId || undefined,
341
+				examinationItemsId: this.validateAutoForm.value.examinationItemsId || undefined,
342
+				urgent: this.validateAutoForm.value.urgent || undefined,
343
+				sendMsg: this.validateAutoForm.value.sendMsg || undefined
344
+			}
345
+		};
346
+		that.btnLoading = true;
347
+		that.mainService
348
+		  .autoMake("specimen", this.validateAutoForm.value.amount, data)
349
+		  .subscribe((data:any) => {
350
+		    that.btnLoading = false;
351
+		    that.hideAutoModal();
352
+		    that.initAutoForm();
353
+		    if (data.status == 200) {
354
+		      that.showPromptModal("生成", true, "");
355
+		    } else {
356
+		      that.showPromptModal("生成", false, data.msg);
357
+		    }
358
+		  });
359
+	}
360
+	
361
+	// 设置核收
362
+	collectModal:boolean = false;
363
+	itemData:any;
364
+	collect(e, data){
365
+		this.itemData = data;
366
+		this.collectModal = true
367
+		this.initCollectForm()
368
+	}
369
+	
370
+	// 初始化form
371
+	validateCollectForm: FormGroup
372
+	initCollectForm(){
373
+		this.validateCollectForm = this.fb.group({
374
+			collect: [null, [Validators.required]],
375
+			sendMsg: ['0', [Validators.required]],
376
+		});
377
+	}
378
+	
379
+	hideCollectModal(){
380
+		this.collectModal = false
381
+	}
382
+	
383
+	// 设置核收提交
384
+	submitCollectForm(){
385
+		var that = this;
386
+		for (const i in that.validateCollectForm.controls) {
387
+		  that.validateCollectForm.controls[i].markAsDirty();
388
+		  that.validateCollectForm.controls[i].updateValueAndValidity();
389
+		}
390
+		if (that.validateCollectForm.invalid) return;
391
+		let data = {
392
+			specimen:{
393
+				operationType: 'checkCollect',
394
+				id: this.itemData.id,
395
+				checkCollectUserId: this.validateCollectForm.value.collect,
396
+				sendMsg: this.validateCollectForm.value.sendMsg
397
+			}
398
+		};
399
+		that.btnLoading = true;
400
+		that.mainService
401
+		  .dataPost("updData", "specimen", data)
402
+		  .subscribe((data) => {
403
+		    that.btnLoading = false;
404
+		    that.hideCollectModal();
405
+		    that.initCollectForm();
406
+		    if (data.status == 200) {
407
+		      that.showPromptModal("操作", true, "");
408
+		    } else {
409
+		      that.showPromptModal("操作", false, data.msg);
410
+		    }
411
+		  });
412
+	}
413
+	
414
+	// 消息发送
415
+	sendModal:boolean = false;
416
+	tipsMsg2:any = '您确定要发送消息吗?';
417
+	send(e, data){
418
+		this.itemData = data;
419
+		this.sendModal = true;
420
+	}
421
+	
422
+	hideSendModal(){
423
+		this.sendModal = false;
424
+	}
425
+	
426
+	// 确定发送消息
427
+	confirmSend(){
428
+		let data = {
429
+			specimen:{
430
+				operationType: 'sendMessage',
431
+				id: this.itemData.id,
432
+			}
433
+		};
434
+		this.btnLoading = true;
435
+		this.mainService
436
+		  .dataPost("updData", "specimen", data)
437
+		  .subscribe((data) => {
438
+		    this.btnLoading = false;
439
+				this.sendModal = false;
440
+		    if (data.status == 200) {
441
+		      this.showPromptModal("操作", true, "");
442
+		    } else {
443
+		      this.showPromptModal("操作", false, data.msg);
444
+		    }
445
+		  });
446
+	}
447
+	
448
+	// 新增
449
+	addModal:boolean = false;
450
+	view:boolean = false;
451
+	addForm(){
452
+		this.addModal = true;
453
+		this.initForm();
454
+	}
455
+	
456
+	hideModal() {
457
+	  this.addModal = false;
458
+		this.patientList = [];
459
+	  this.initForm();
460
+	}
461
+	
462
+	// 初始化form
463
+	validateForm: FormGroup; //新增/编辑表单
464
+	initForm() {
465
+	  this.validateForm = this.fb.group({
466
+	    sickRoom: [null, [Validators.required]],
467
+	    checkDept: [null, [Validators.required]],
468
+	    patientId: [null, [Validators.required]],
469
+			examinationItemsId: [null, [Validators.required]],
470
+	    stype: [null, [Validators.required]],
471
+	    tubeType: [null, [Validators.required]],
472
+	    speState: ['已采集', [Validators.required]],
473
+			urgent: ['0', [Validators.required]],
474
+			collectNurseId: [null, []],
475
+			sendMsg: ['0', []],
476
+	  });
477
+	}
478
+	
479
+	// 表单提交
480
+	submitForm(): void {
481
+	  var that = this;
482
+		for (const i in that.validateForm.controls) {
483
+		  that.validateForm.controls[i].markAsDirty();
484
+		  that.validateForm.controls[i].updateValueAndValidity();
485
+		}
486
+		if (that.validateForm.invalid) return;
487
+	  let data = {
488
+			specimen:{
489
+				patientId:this.validateForm.value.patientId,
490
+				checkDept: {
491
+					id: this.validateForm.value.checkDept
492
+				},
493
+				sickRoom: {
494
+					id: this.validateForm.value.sickRoom
495
+				},
496
+				collectNurseId: this.validateForm.value.collectNurseId || undefined,
497
+				urgent: this.validateForm.value.urgent,
498
+				examinationItemsId: this.validateForm.value.examinationItemsId,
499
+				stype: {
500
+					id: this.stypeId
501
+				},
502
+				tubeType: {
503
+					id: this.tubeTypeId
504
+				},
505
+				sendMsg: this.validateForm.value.sendMsg
506
+			}
507
+	  };
508
+		that.btnLoading = true;
509
+	  that.mainService
510
+	    .dataPost("addData", "specimen", data)
511
+	    .subscribe((data) => {
512
+	      that.btnLoading = false;
513
+	      that.hideModal();
514
+	      that.initForm();
515
+	      if (data.status == 200) {
516
+	        that.showPromptModal("新增", true, "");
517
+	      } else {
518
+	        that.showPromptModal("新增", false, data.msg);
519
+	      }
520
+	    });
521
+	}
522
+	
144 523
   // 重置
145 524
   reset() {
146 525
     this.searchCriteria = {