Browse Source

医废信息

seimin 1 year ago
parent
commit
98ce75cc19

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

@@ -149,6 +149,9 @@ export class ToolService {
149 149
         case "recount":
150 150
           coopBtns.recount = true; //重新统计
151 151
           break;
152
+        case "editNum":
153
+          coopBtns.editNum = true; //矫正重量
154
+          break;
152 155
       }
153 156
     });
154 157
     console.log(coopBtns);

+ 5 - 0
src/app/share/medical-waste-history-prompt-modal/medical-waste-history-prompt-modal.component.less

@@ -91,6 +91,11 @@
91 91
         text-align: center;
92 92
         margin: 0;
93 93
 
94
+        &.pagination{
95
+          margin: 8px;
96
+          margin-left: auto;
97
+        }
98
+
94 99
         &.defeat {
95 100
           color: #333;
96 101
           font-size: 28px;

+ 39 - 0
src/app/share/medical-waste-log-prompt-modal/medical-waste-log-prompt-modal.component.html

@@ -0,0 +1,39 @@
1
+<div class="modal display_flex justify-content_flex-center align-items_center" *ngIf="show">
2
+  <div class="modalBody">
3
+    <div class="title">查看日志<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
4
+    <div class="content">
5
+      <nz-table class="hospitalTable" [nzData]="historySpecimenList" nzSize="middle" [nzShowPagination]="false"
6
+        [nzLoading]="hsLoading">
7
+        <thead>
8
+          <tr class="thead">
9
+            <th nzWidth="10%">动作</th>
10
+            <th nzWidth="18%">操作人</th>
11
+            <th nzWidth="18%">操作时间</th>
12
+            <th nzWidth="18%">原重量</th>
13
+            <th nzWidth="18%">矫正后重量</th>
14
+            <th nzWidth="18%">交接人</th>
15
+          </tr>
16
+        </thead>
17
+        <tbody>
18
+          <tr *ngFor="let data of historySpecimenList;let i = index;">
19
+            <td>{{ data.operationType ? data.operationType.name : '' }}</td>
20
+            <td>{{ data.operatorName }}</td>
21
+            <td>{{ data.operationTime | date:"yyyy-MM-dd HH:mm:ss" }}</td>
22
+            <td>{{ data.lastWeight }}<span *ngIf="data.lastWeight">kg</span></td>
23
+            <td>{{ data.correctWeight }}<span *ngIf="data.correctWeight">kg</span></td>
24
+            <td>{{ data.handoverName }}</td>
25
+          </tr>
26
+        </tbody>
27
+      </nz-table>
28
+      <!-- <div class="pagination">
29
+        <nz-pagination [(nzPageIndex)]="historySpecimenPageIndex" [(nzTotal)]="historySpecimenListLength"
30
+          [(nzPageSize)]="historySpecimenPageSize" (nzPageIndexChange)="getHistorySpecimen()"
31
+          (nzPageSizeChange)="getHistorySpecimen()">
32
+        </nz-pagination>
33
+      </div> -->
34
+    </div>
35
+    <div class="display_flex justify-content_flex-center">
36
+      <button class="btn know" nz-button nzType="primary" (click)="hideModal()">知道了</button>
37
+    </div>
38
+  </div>
39
+</div>

+ 168 - 0
src/app/share/medical-waste-log-prompt-modal/medical-waste-log-prompt-modal.component.less

@@ -0,0 +1,168 @@
1
+@import "../../../../src/theme.less";
2
+.modal {
3
+  position: fixed;
4
+  left: 0;
5
+  top: 0;
6
+  width: 100%;
7
+  height: 100%;
8
+  background: rgba(0, 0, 0, 0.4);
9
+  z-index: 999;
10
+  .hospitalTable {
11
+    width: 100%;
12
+    td {
13
+      text-align: center !important;
14
+    }
15
+    .thead {
16
+      background-image: linear-gradient(to right, @bg-start, @bg-end);
17
+      th {
18
+        text-align: center !important;
19
+        color: #fff;
20
+        background: transparent;
21
+      }
22
+    }
23
+  }
24
+
25
+  .modalBody {
26
+    width: 700px;
27
+    min-height: 220px;
28
+    background: #fff;
29
+    border-radius: 5px;
30
+    padding: 10px 20px;
31
+    color: #333;
32
+    &.modalBody-search {
33
+      width: 480px;
34
+      min-height: 250px;
35
+    }
36
+
37
+    .title {
38
+      width: 100%;
39
+      text-align: center;
40
+      font-size: 18px;
41
+      position: relative;
42
+
43
+      i {
44
+        position: absolute;
45
+        right: 0;
46
+        top: 0;
47
+        font-size: 20px;
48
+        color: #666;
49
+        cursor: pointer;
50
+        padding: 0 5px;
51
+      }
52
+    }
53
+
54
+    .content {
55
+      min-height: 117px;
56
+      background: #f9fafb;
57
+      border: 1px solid #e5e9ed;
58
+      border-radius: 5px;
59
+      overflow: hidden;
60
+      margin-top: 12px;
61
+      display: flex;
62
+      flex-direction: column;
63
+      justify-content: center;
64
+      align-items: center;
65
+      &.content-search {
66
+        min-height: 147px;
67
+        justify-content: start;
68
+        .defeat-search {
69
+          width: 100%;
70
+          height: 52px;
71
+          display: flex;
72
+          justify-content: center;
73
+          align-items: center;
74
+          border-bottom: solid 1px #e5e9ed;
75
+          em {
76
+            color: #666;
77
+            font-style: normal;
78
+          }
79
+        }
80
+        .form {
81
+          width: 100%;
82
+          padding: 0 16px;
83
+          .ant-form-item-label,
84
+          .ant-form-explain {
85
+            text-align: left !important;
86
+          }
87
+        }
88
+      }
89
+
90
+      div {
91
+        text-align: center;
92
+        margin: 0;
93
+
94
+        &.pagination{
95
+          margin: 8px;
96
+          margin-left: auto;
97
+        }
98
+
99
+        &.defeat {
100
+          color: #333;
101
+          font-size: 28px;
102
+        }
103
+        &.countDown {
104
+          font-size: 14px;
105
+          color: 666;
106
+          em {
107
+            font-style: normal;
108
+            color: @primary-color;
109
+          }
110
+        }
111
+
112
+        &:nth-child(3) {
113
+          font-size: 14px;
114
+          color: #666;
115
+          padding-bottom: 10px;
116
+        }
117
+      }
118
+    }
119
+
120
+    button {
121
+      margin-top: 10px;
122
+
123
+      &.btn {
124
+        margin-left: 8px;
125
+      }
126
+    }
127
+  }
128
+
129
+  // 新增
130
+  &.add {
131
+    .modalBody {
132
+      width: 480px;
133
+      height: auto;
134
+
135
+      .content {
136
+        width: 100%;
137
+        height: auto;
138
+        padding: 18px 14px 0 14px;
139
+
140
+        .addForm {
141
+          .ant-form-item {
142
+            margin-bottom: 15px;
143
+
144
+            .ant-form-item-label {
145
+              line-height: 0;
146
+            }
147
+          }
148
+        }
149
+
150
+        .editForm {
151
+          .ant-form-item {
152
+            margin-bottom: 15px;
153
+
154
+            .ant-form-item-label {
155
+              line-height: 0;
156
+            }
157
+          }
158
+        }
159
+      }
160
+
161
+      button {
162
+        &:nth-child(1) {
163
+          margin-right: 20px;
164
+        }
165
+      }
166
+    }
167
+  }
168
+}

+ 58 - 0
src/app/share/medical-waste-log-prompt-modal/medical-waste-log-prompt-modal.component.ts

@@ -0,0 +1,58 @@
1
+import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2
+import { MainService } from '../../services/main.service';
3
+import { ToolService } from 'src/app/services/tool.service';
4
+
5
+@Component({
6
+  selector: 'app-medical-waste-log-prompt-modal',
7
+  templateUrl: './medical-waste-log-prompt-modal.component.html',
8
+  styleUrls: ['./medical-waste-log-prompt-modal.component.less']
9
+})
10
+export class MedicalWasteLogPromptModalComponent implements OnInit {
11
+  hosId;
12
+  // 切换科室,切换弹窗
13
+  hsLoading = false;
14
+  historySpecimenList: any = [];
15
+  historySpecimenPageIndex: number = 1;//表格当前页码
16
+  historySpecimenPageSize: number = 10;//表格每页展示条数
17
+  historySpecimenListLength: number = 10;//表格总数据量
18
+  @Input() show: Boolean;
19
+  @Input() id: String;
20
+
21
+  @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
22
+
23
+  constructor(
24
+    private mainService: MainService,
25
+    private tool: ToolService
26
+  ) { }
27
+
28
+  ngOnInit() {
29
+    this.hosId = this.tool.getCurrentHospital().id;
30
+    this.getList();
31
+  }
32
+  // 关闭弹窗
33
+  hideModal() {
34
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
35
+  }
36
+  // 获取列表数据
37
+  getList(idx?) {
38
+    if (idx) {
39
+      this.historySpecimenPageIndex = 1;
40
+    }
41
+    let postData = {
42
+      idx: this.historySpecimenPageIndex - 1,
43
+      sum: this.historySpecimenPageSize,
44
+      clinicalWasteLog: {
45
+        clinicalWasteId: this.id,
46
+        hosId: this.hosId,
47
+      }
48
+    }
49
+    this.hsLoading = true;
50
+    this.mainService.getFetchDataList('simple/data','clinicalWasteLog',postData).subscribe(data => {
51
+      this.hsLoading = false;
52
+      this.historySpecimenList = data.list || [];
53
+      this.historySpecimenListLength = data.totalNum || 0;
54
+    })
55
+  }
56
+}
57
+
58
+

+ 3 - 0
src/app/share/share.module.ts

@@ -40,6 +40,7 @@ import { RelationTransDetailModalComponent } from './relationTrans-detail-modal/
40 40
 import { DetailOrdinaryComponent } from './detail-ordinary/detail-ordinary.component';
41 41
 import { BloodHistoryPromptModalComponent } from './blood-history-prompt-modal/blood-history-prompt-modal.component';
42 42
 import { MedicalWasteHistoryPromptModalComponent } from './medical-waste-history-prompt-modal/medical-waste-history-prompt-modal.component';
43
+import { MedicalWasteLogPromptModalComponent } from './medical-waste-log-prompt-modal/medical-waste-log-prompt-modal.component';
43 44
 
44 45
 @NgModule({
45 46
   declarations: [
@@ -82,6 +83,7 @@ import { MedicalWasteHistoryPromptModalComponent } from './medical-waste-history
82 83
     DetailOrdinaryComponent,
83 84
     BloodHistoryPromptModalComponent,
84 85
     MedicalWasteHistoryPromptModalComponent,
86
+    MedicalWasteLogPromptModalComponent,
85 87
   ],
86 88
   imports: [
87 89
     CommonModule,
@@ -133,6 +135,7 @@ import { MedicalWasteHistoryPromptModalComponent } from './medical-waste-history
133 135
     OrderPromptModalComponent,
134 136
     BloodHistoryPromptModalComponent,
135 137
     MedicalWasteHistoryPromptModalComponent,
138
+    MedicalWasteLogPromptModalComponent,
136 139
   ]
137 140
 })
138 141
 export class ShareModule { }

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

@@ -438,6 +438,11 @@ const routes: Routes = [
438 438
         path: "inventoryInformation",
439 439
         loadChildren: () => import("../inventory-information/inventory-information.module").then((m) => m.InventoryInformationModule),
440 440
       },
441
+      // 医废信息
442
+      {
443
+        path: "medicalWasteInformation",
444
+        loadChildren: () => import("../medical-waste-information/medical-waste-information.module").then((m) => m.MedicalWasteInformationModule),
445
+      },
441 446
     ],
442 447
   },
443 448
 ];

+ 12 - 0
src/app/views/medical-waste-information/medical-waste-information-routing.module.ts

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

+ 142 - 0
src/app/views/medical-waste-information/medical-waste-information.component.html

@@ -0,0 +1,142 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
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.clinicalWasteType"
15
+            (nzOnSearch)="changeInp($event)"
16
+            (nzOpenChange)="changeSearch($event)"
17
+          >
18
+            <ng-container *ngFor="let data of clinicalWasteTypeList">
19
+              <nz-option
20
+                *ngIf="!isLoading"
21
+                nzLabel="{{ data.typeName }}"
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>
30
+        <div class="list-template__searchItem">
31
+          <span class="label">医废序号:</span>
32
+          <input nz-input class="formItem" placeholder="请输入医废序号:" [(ngModel)]="searchCriteria.clinicalWasteSn" />
33
+        </div>
34
+        <div class="list-template__searchItem">
35
+          <span class="label">医废状态:</span>
36
+          <nz-select
37
+            [nzDropdownMatchSelectWidth]="false"
38
+            class="formItem"
39
+            nzServerSearch
40
+            nzShowSearch
41
+            nzAllowClear
42
+            nzPlaceHolder="请选择医废状态"
43
+            [(ngModel)]="searchCriteria.status"
44
+            (nzOpenChange)="changeSearch1($event)"
45
+          >
46
+            <ng-container *ngFor="let data of types">
47
+              <nz-option
48
+                *ngIf="!isLoading1"
49
+                nzLabel="{{ data.name }}"
50
+                nzValue="{{ data.id }}"
51
+              ></nz-option>
52
+            </ng-container>
53
+            <nz-option *ngIf="isLoading1" nzDisabled nzCustomContent>
54
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
55
+            </nz-option>
56
+          </nz-select>
57
+        </div>
58
+        <div class="list-template__searchItem">
59
+          <span class="label">收取时间:</span>
60
+          <nz-range-picker [(ngModel)]="searchCriteria.dateRange"></nz-range-picker>
61
+        </div>
62
+      </div>
63
+      <div nz-col nzXl="8" class="list-template__btns">
64
+        <button nz-button class="btn default" (click)='reset()'>重置</button>
65
+        <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</button>
66
+      </div>
67
+    </div>
68
+    <div class="list-template__bottom">
69
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
70
+        [nzLoading]="loading1">
71
+        <thead>
72
+          <tr class="thead">
73
+            <th nzWidth="12.5%">医废类型</th>
74
+            <th nzWidth="12.5%">序号</th>
75
+            <th nzWidth="12.5%">重量(KG)</th>
76
+            <th nzWidth="12.5%">科室名称</th>
77
+            <th nzWidth="12.5%">收取人</th>
78
+            <th nzWidth="12.5%">收取时间</th>
79
+            <th nzWidth="12.5%">备注</th>
80
+            <th nzWidth="12.5%">操作</th>
81
+          </tr>
82
+        </thead>
83
+        <tbody>
84
+          <tr *ngFor="let data of listOfData;let i = index">
85
+            <td>{{ data.clinicalWasteType ? data.clinicalWasteType.typeName : '' }}</td>
86
+            <td>{{ data.clinicalWasteSn }}</td>
87
+            <td>{{ data.weight }}</td>
88
+            <td>{{ data.dept ? data.dept.dept: '' }}</td>
89
+            <td>{{ data.receivor ? data.receivor.name: '' }}</td>
90
+            <td>{{ data.receiveTime | date:"yyyy-MM-dd HH:mm:ss" }}</td>
91
+            <td>{{ data.remark }}</td>
92
+            <td>
93
+              <div class="coop">
94
+                <span *ngIf="coopBtns.look" (click)="viewHistory(data)">查看日志</span>
95
+                <span *ngIf="coopBtns.editNum && data.status.value != 4" (click)="showModal(data)">矫正重量</span>
96
+              </div>
97
+            </td>
98
+          </tr>
99
+        </tbody>
100
+      </nz-table>
101
+      <div class="list-template__pagination">
102
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
103
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
104
+        </nz-pagination>
105
+      </div>
106
+    </div>
107
+  </div>
108
+</div>
109
+<!-- 矫正重量模态框 -->
110
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
111
+  <div class="modalBody">
112
+    <div class="title">矫正重量<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
113
+    </div>
114
+    <overlay-scrollbars #osComponentRef1 class="content">
115
+      <div style="height: 50px;line-height: 50px;">原重量:{{coopData.weight}}kg</div>
116
+      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
117
+        <nz-form-item>
118
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="weight">矫正重量</nz-form-label>
119
+          <nz-form-control nzErrorTip="请填写矫正重量!">
120
+            <nz-input-number nz-input formControlName="weight" nzPlaceHolder="请填写矫正重量" [nzMin]="0" [nzStep]="0.01" [nzPrecision]="2"></nz-input-number>
121
+            <span class="red">(kg)</span>
122
+          </nz-form-control>
123
+        </nz-form-item>
124
+      </form>
125
+    </overlay-scrollbars>
126
+    <div class="display_flex justify-content_flex-center">
127
+      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
128
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
129
+    </div>
130
+  </div>
131
+</div>
132
+<!-- 删除模态框 -->
133
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" (confirmDelEvent)="confirmDel()" [content]="content"></app-dialog-delete>
134
+<!-- 操作成功/失败提示框 -->
135
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow" [info]="promptInfo"></app-prompt-modal>
136
+<!-- 查看 -->
137
+<app-medical-waste-log-prompt-modal
138
+  *ngIf="historyPromptModalShow"
139
+  [show]="historyPromptModalShow"
140
+  [id]="id"
141
+  (closeModelHs)="closeModelHistory($event)"
142
+></app-medical-waste-log-prompt-modal>

+ 121 - 0
src/app/views/medical-waste-information/medical-waste-information.component.less

@@ -0,0 +1,121 @@
1
+@import "../../../../src/theme.less";
2
+.save {
3
+  position: fixed;
4
+  left: 0;
5
+  top: 0;
6
+  width: 100%;
7
+  height: 100%;
8
+  background: rgba(0, 0, 0, 0.4);
9
+  z-index: 99;
10
+
11
+  .modalBody {
12
+    width: 350px;
13
+    background: #fff;
14
+    border-radius: 5px;
15
+    padding: 10px 20px;
16
+    color: #333;
17
+
18
+    .title {
19
+      width: 100%;
20
+      text-align: center;
21
+      font-size: 18px;
22
+      position: relative;
23
+
24
+      i {
25
+        position: absolute;
26
+        right: 0;
27
+        top: 0;
28
+        font-size: 20px;
29
+        color: #666;
30
+        cursor: pointer;
31
+        padding: 0 5px;
32
+      }
33
+    }
34
+
35
+    .content {
36
+      width: 100%;
37
+      height: 117px;
38
+      background: #f9fafb;
39
+      border: 1px solid #e5e9ed;
40
+      border-radius: 5px;
41
+      overflow: hidden;
42
+      margin-top: 12px;
43
+
44
+      div {
45
+        text-align: center;
46
+        margin: 0;
47
+
48
+        &.icon {
49
+          margin-top: 17px;
50
+
51
+          i {
52
+            color: #34b349;
53
+            font-size: 30px !important;
54
+
55
+            &.transport-wenhao {
56
+              color: #f5a523;
57
+            }
58
+
59
+            &.transport-shibai {
60
+              color: #ff3a52;
61
+            }
62
+          }
63
+        }
64
+
65
+        &.defeat {
66
+          color: #333;
67
+          font-size: 18px;
68
+        }
69
+
70
+        &:nth-child(3) {
71
+          font-size: 14px;
72
+          color: #666;
73
+        }
74
+      }
75
+    }
76
+
77
+    button {
78
+      margin-top: 10px;
79
+
80
+      &.btn {
81
+        margin-left: 8px;
82
+      }
83
+    }
84
+  }
85
+
86
+  // 新增
87
+  &.add {
88
+    .modalBody {
89
+      width: 480px;
90
+      height: auto;
91
+
92
+      .content {
93
+        width: 100%;
94
+        height: auto;
95
+        padding: 19px 14px 0 14px;
96
+        max-height: 500px;
97
+        overflow-y: auto;
98
+
99
+        .addForm {
100
+          .ant-form-item {
101
+            margin-bottom: 8px;
102
+          }
103
+        }
104
+
105
+        .editForm {
106
+          .ant-form-item {
107
+            margin-bottom: 14px;
108
+
109
+            .ant-form-item-label {
110
+              line-height: 0;
111
+            }
112
+          }
113
+        }
114
+      }
115
+
116
+      button:nth-child(1) {
117
+        margin-right: 20px;
118
+      }
119
+    }
120
+  }
121
+}

+ 244 - 0
src/app/views/medical-waste-information/medical-waste-information.component.ts

@@ -0,0 +1,244 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { Subject } from "rxjs";
3
+import { debounceTime } from "rxjs/operators";
4
+import { MainService } from "src/app/services/main.service";
5
+import { ToolService } from "src/app/services/tool.service";
6
+import { format } from 'date-fns';
7
+import { ActivatedRoute } from '@angular/router';
8
+import { FormGroup, Validators, FormBuilder } from '@angular/forms';
9
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
10
+
11
+@Component({
12
+  selector: "app-medical-waste-information",
13
+  templateUrl: "./medical-waste-information.component.html",
14
+  styleUrls: ["./medical-waste-information.component.less"],
15
+})
16
+export class MedicalWasteInformationComponent implements OnInit {
17
+  @ViewChild("osComponentRef1", {
18
+    read: OverlayScrollbarsComponent,
19
+    static: false,
20
+  })
21
+  osComponentRef1: OverlayScrollbarsComponent;
22
+  constructor(
23
+    private mainService: MainService,
24
+    private tool: ToolService,
25
+    private route: ActivatedRoute,
26
+    private fb: FormBuilder,
27
+  ) {}
28
+
29
+  searchCriteria = {
30
+    //搜索条件
31
+    clinicalWasteSn: "",
32
+    dateRange: [],
33
+    status: null,
34
+    clinicalWasteType: null,
35
+  };
36
+  clinicalWasteTypeList = []; // 院区下的配送人员列表(搜索框)
37
+  hosId;
38
+  listOfData: any[] = []; //表格数据
39
+  pageIndex: number = 1; //表格当前页码
40
+  pageSize: number = 10; //表格每页展示条数
41
+  listLength: number = 10; //表格总数据量
42
+  changeInpSubject = new Subject();
43
+
44
+  // 初始化增删改按钮
45
+  coopBtns: any = {};
46
+  ngOnInit() {
47
+    this.coopBtns = this.tool.initCoopBtns(this.route);
48
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
49
+      this.searchDept(v);
50
+    });
51
+    this.getHospital();
52
+  }
53
+
54
+  // 删除
55
+  delModal: boolean = false; //删除模态框
56
+  del() {
57
+    this.content = `原重量为${this.coopData.weight}kg矫正后重量为${this.validateForm.value.weight}kg,您确认修改吗?`;
58
+    this.delModal = true;
59
+  }
60
+  // 确认删除
61
+  confirmDel() {
62
+    this.btnLoading = true;
63
+
64
+    let coopData = {...this.coopData, ...{weight: this.validateForm.value.weight}};
65
+    this.mainService.simplePost("addData", "clinicalWaste", coopData)
66
+      .subscribe((data) => {
67
+        this.btnLoading = false;
68
+        this.hideModal();
69
+        this.hideDelModal();
70
+        if (data.status == 200) {
71
+          this.showPromptModal("修改", true, "");
72
+        } else {
73
+          this.showPromptModal("修改", false, data.msg);
74
+        }
75
+      });
76
+  }
77
+
78
+  // 关闭删除模态框
79
+  hideDelModal() {
80
+    this.delModal = false;
81
+  }
82
+  // 修改重量弹框
83
+  modal: boolean = false;
84
+  coopData:any = {};
85
+  content:string = '';
86
+  showModal(data) {
87
+    this.coopData = data;
88
+    this.modal = true;
89
+    this.initForm();
90
+  }
91
+  hideModal() {
92
+    this.modal = false;
93
+    this.initForm();
94
+  }
95
+  // 初始化form表单
96
+  validateForm: FormGroup; //编辑表单
97
+  initForm() {
98
+    this.validateForm = this.fb.group({
99
+      weight: [0, [Validators.required]],
100
+    });
101
+  }
102
+  // 表单提交
103
+  btnLoading:boolean = false;
104
+  submitForm(): void {
105
+    for (const i in this.validateForm.controls) {
106
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
107
+      this.validateForm.controls[i].updateValueAndValidity();
108
+    }
109
+    if (this.validateForm.invalid) return;
110
+    this.del();
111
+  }
112
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
113
+  promptContent: string; //操作提示框提示信息
114
+  ifSuccess: boolean; //操作成功/失败
115
+  promptInfo: string; //操作结果提示信息
116
+  promptModalShow: boolean; //操作提示框是否展示
117
+  showPromptModal(con, success, promptInfo?) {
118
+    this.promptModalShow = false;
119
+    this.promptContent = con;
120
+    this.ifSuccess = success;
121
+    this.promptInfo = promptInfo;
122
+    setTimeout(() => {
123
+      this.promptModalShow = true;
124
+    }, 100);
125
+    this.getList(1);
126
+  }
127
+  // 搜索类型
128
+  isLoading1 = false;
129
+  types = []; // 类型列表(搜索框)
130
+  searchTypes() {
131
+    this.isLoading1 = true;
132
+    this.mainService.getDictionary("list", "waste_status").subscribe((res) => {
133
+      this.isLoading1 = false;
134
+      this.types = res;
135
+    });
136
+  }
137
+  // 打开搜索框
138
+  changeSearch1(flag) {
139
+    if (flag) {
140
+      this.searchTypes();
141
+    }
142
+  }
143
+  // 重置
144
+  reset() {
145
+    this.searchCriteria = {
146
+      //搜索条件
147
+      clinicalWasteSn: "",
148
+      dateRange: [],
149
+      status: null,
150
+      clinicalWasteType: null,
151
+    };
152
+    this.getList(1);
153
+  }
154
+
155
+  // 获取所有院区
156
+  getHospital() {
157
+    this.hosId = this.tool.getCurrentHospital().id;
158
+    this.getList(1);
159
+  }
160
+  // 查看弹窗
161
+  historyPromptModalShow = false; //标本历史记录弹窗开关
162
+  id = ""; //查看
163
+  viewHistory(data) {
164
+    this.id = data.id;
165
+    this.historyPromptModalShow = true;
166
+  }
167
+  // 关闭弹窗
168
+  closeModelHistory(e) {
169
+    this.historyPromptModalShow = JSON.parse(e).show;
170
+  }
171
+  // 打开搜索框
172
+  changeSearch(flag) {
173
+    if (flag) {
174
+      this.changeInp("no");
175
+    }
176
+  }
177
+  // 边输边搜节流阀
178
+  isLoading = false;
179
+  changeInp(dept) {
180
+    if (!dept) {
181
+      return;
182
+    }
183
+    if (dept === "no") {
184
+      dept = "";
185
+    }
186
+    this.isLoading = true;
187
+    this.changeInpSubject.next(dept);
188
+  }
189
+  // 搜索医废类型
190
+  searchDept(dept) {
191
+    let postData = {
192
+      clinicalWasteType: {
193
+        hosId: this.hosId,
194
+      },
195
+      idx: 0,
196
+      sum: 9999,
197
+    };
198
+    this.mainService
199
+      .getFetchDataList("simple/data", "clinicalWasteType", postData)
200
+      .subscribe((result) => {
201
+        if (result.status == 200) {
202
+          this.isLoading = false;
203
+          this.clinicalWasteTypeList = result.list;
204
+        }
205
+      });
206
+  }
207
+
208
+  // 表格数据
209
+  loading1 = false;
210
+  getList(type) {
211
+    if (type == 1) {
212
+      this.pageIndex = 1;
213
+    }
214
+    let postData: any = {
215
+      idx: this.pageIndex - 1,
216
+      sum: this.pageSize,
217
+      clinicalWaste: {
218
+        hosId: this.hosId,
219
+        status: this.searchCriteria.status ? { id: this.searchCriteria.status } : undefined,
220
+        clinicalWasteType: this.searchCriteria.clinicalWasteType ? { id: this.searchCriteria.clinicalWasteType } : undefined,
221
+      },
222
+    };
223
+    if (this.searchCriteria.dateRange.length) {
224
+      postData.clinicalWaste.startTime =
225
+        format(this.searchCriteria.dateRange[0], "yyyy-MM-dd ") + "00:00:00";
226
+      postData.clinicalWaste.endTime =
227
+        format(this.searchCriteria.dateRange[1], "yyyy-MM-dd ") + "23:59:59";
228
+    }
229
+    if (this.searchCriteria.clinicalWasteSn) {
230
+      postData.clinicalWaste.clinicalWasteSn = this.searchCriteria.clinicalWasteSn;
231
+    }
232
+    this.loading1 = true;
233
+    this.mainService
234
+      .getFetchDataList("simple/data", "clinicalWaste", postData)
235
+      .subscribe((data) => {
236
+        this.loading1 = false;
237
+        if (data["status"] == 200) {
238
+          this.listOfData = data["list"];
239
+          this.listLength = data["totalNum"];
240
+        }
241
+      });
242
+  }
243
+}
244
+

+ 17 - 0
src/app/views/medical-waste-information/medical-waste-information.module.ts

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