seimin vor 1 Jahr
Ursprung
Commit
71402dcace

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

@@ -443,6 +443,11 @@ const routes: Routes = [
443 443
         path: "medicalWasteInformation",
444 444
         loadChildren: () => import("../medical-waste-information/medical-waste-information.module").then((m) => m.MedicalWasteInformationModule),
445 445
       },
446
+      // 入库记录
447
+      {
448
+        path: "storageRecord",
449
+        loadChildren: () => import("../medical-waste-storage-record/medical-waste-storage-record.module").then((m) => m.MedicalWasteStorageRecordModule),
450
+      },
446 451
     ],
447 452
   },
448 453
 ];

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

@@ -54,7 +54,7 @@ export class MedicalWasteInformationComponent implements OnInit {
54 54
   // 删除
55 55
   delModal: boolean = false; //删除模态框
56 56
   del() {
57
-    this.content = `原重量为${this.coopData.weight}kg矫正后重量为${this.validateForm.value.weight}kg,您确认修改吗?`;
57
+    this.content = `原重量为<strong class="red">${this.coopData.weight}kg</strong>,矫正后重量为<strong class="red">${this.validateForm.value.weight}kg</strong>,您确认修改吗?`;
58 58
     this.delModal = true;
59 59
   }
60 60
   // 确认删除
@@ -222,9 +222,9 @@ export class MedicalWasteInformationComponent implements OnInit {
222 222
     };
223 223
     if (this.searchCriteria.dateRange.length) {
224 224
       postData.clinicalWaste.startTime =
225
-        format(this.searchCriteria.dateRange[0], "yyyy-MM-dd ") + "00:00:00";
225
+        format(this.searchCriteria.dateRange[0], "yyyy-MM-dd HH:mm:ss");
226 226
       postData.clinicalWaste.endTime =
227
-        format(this.searchCriteria.dateRange[1], "yyyy-MM-dd ") + "23:59:59";
227
+        format(this.searchCriteria.dateRange[1], "yyyy-MM-dd HH:mm:ss");
228 228
     }
229 229
     if (this.searchCriteria.clinicalWasteSn) {
230 230
       postData.clinicalWaste.clinicalWasteSn = this.searchCriteria.clinicalWasteSn;

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

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

+ 84 - 0
src/app/views/medical-waste-storage-record/medical-waste-storage-record.component.html

@@ -0,0 +1,84 @@
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-range-picker nzShowTime [(ngModel)]="searchCriteria.dateRange"></nz-range-picker>
8
+        </div>
9
+        <div class="list-template__searchItem">
10
+          <span class="label">操作人:</span>
11
+          <input nz-input class="formItem" placeholder="请输入操作人" [(ngModel)]="searchCriteria.name" />
12
+        </div>
13
+      </div>
14
+      <div nz-col nzXl="8" class="list-template__btns">
15
+        <button nz-button class="btn default" (click)='reset()'>重置</button>
16
+        <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</button>
17
+      </div>
18
+    </div>
19
+    <div class="list-template__bottom">
20
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
21
+        [nzLoading]="loading1">
22
+        <thead>
23
+          <tr class="thead">
24
+            <th nzWidth="17%">批次号</th>
25
+            <th nzWidth="17%">入库时间</th>
26
+            <th nzWidth="17%">操作人</th>
27
+            <th nzWidth="17%">总重量(KG)</th>
28
+            <th nzWidth="16%">总袋数</th>
29
+            <th nzWidth="16%">科室数</th>
30
+          </tr>
31
+        </thead>
32
+        <tbody>
33
+          <tr *ngFor="let data of listOfData;let i = index">
34
+            <td>{{ data.batchNo }}</td>
35
+            <td>{{ data.intoTime | date:"yyyy-MM-dd HH:mm:ss" }}</td>
36
+            <td>{{ data.operator ? data.operator.name: '' }}</td>
37
+            <td>{{ data.totalWeight }}</td>
38
+            <td>{{ data.totalBags }}</td>
39
+            <td>{{ data.deptNum }}</td>
40
+          </tr>
41
+        </tbody>
42
+      </nz-table>
43
+      <div class="list-template__pagination">
44
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
45
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
46
+        </nz-pagination>
47
+      </div>
48
+    </div>
49
+  </div>
50
+</div>
51
+<!-- 矫正重量模态框 -->
52
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
53
+  <div class="modalBody">
54
+    <div class="title">矫正重量<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
55
+    </div>
56
+    <overlay-scrollbars #osComponentRef1 class="content">
57
+      <div style="height: 50px;line-height: 50px;">原重量:{{coopData.weight}}kg</div>
58
+      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
59
+        <nz-form-item>
60
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="weight">矫正重量</nz-form-label>
61
+          <nz-form-control nzErrorTip="请填写矫正重量!">
62
+            <nz-input-number nz-input formControlName="weight" nzPlaceHolder="请填写矫正重量" [nzMin]="0" [nzStep]="0.01" [nzPrecision]="2"></nz-input-number>
63
+            <span class="red">(kg)</span>
64
+          </nz-form-control>
65
+        </nz-form-item>
66
+      </form>
67
+    </overlay-scrollbars>
68
+    <div class="display_flex justify-content_flex-center">
69
+      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
70
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
71
+    </div>
72
+  </div>
73
+</div>
74
+<!-- 删除模态框 -->
75
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" (confirmDelEvent)="confirmDel()" [content]="content"></app-dialog-delete>
76
+<!-- 操作成功/失败提示框 -->
77
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow" [info]="promptInfo"></app-prompt-modal>
78
+<!-- 查看 -->
79
+<app-medical-waste-log-prompt-modal
80
+  *ngIf="historyPromptModalShow"
81
+  [show]="historyPromptModalShow"
82
+  [id]="id"
83
+  (closeModelHs)="closeModelHistory($event)"
84
+></app-medical-waste-log-prompt-modal>

+ 121 - 0
src/app/views/medical-waste-storage-record/medical-waste-storage-record.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
+}

+ 181 - 0
src/app/views/medical-waste-storage-record/medical-waste-storage-record.component.ts

@@ -0,0 +1,181 @@
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-storage-record",
13
+  templateUrl: "./medical-waste-storage-record.component.html",
14
+  styleUrls: ["./medical-waste-storage-record.component.less"],
15
+})
16
+export class MedicalWasteStorageRecordComponent 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
+    name: "",
32
+    dateRange: [],
33
+  };
34
+  hosId;
35
+  listOfData: any[] = []; //表格数据
36
+  pageIndex: number = 1; //表格当前页码
37
+  pageSize: number = 10; //表格每页展示条数
38
+  listLength: number = 10; //表格总数据量
39
+
40
+  // 初始化增删改按钮
41
+  coopBtns: any = {};
42
+  ngOnInit() {
43
+    this.coopBtns = this.tool.initCoopBtns(this.route);
44
+    this.getHospital();
45
+  }
46
+
47
+  // 删除
48
+  delModal: boolean = false; //删除模态框
49
+  del() {
50
+    this.content = `原重量为<strong class="red">${this.coopData.weight}kg</strong>,矫正后重量为<strong class="red">${this.validateForm.value.weight}kg</strong>,您确认修改吗?`;
51
+    this.delModal = true;
52
+  }
53
+  // 确认删除
54
+  confirmDel() {
55
+    this.btnLoading = true;
56
+
57
+    let coopData = {...this.coopData, ...{weight: this.validateForm.value.weight}};
58
+    this.mainService.simplePost("addData", "clinicalWaste", coopData)
59
+      .subscribe((data) => {
60
+        this.btnLoading = false;
61
+        this.hideModal();
62
+        this.hideDelModal();
63
+        if (data.status == 200) {
64
+          this.showPromptModal("修改", true, "");
65
+        } else {
66
+          this.showPromptModal("修改", false, data.msg);
67
+        }
68
+      });
69
+  }
70
+
71
+  // 关闭删除模态框
72
+  hideDelModal() {
73
+    this.delModal = false;
74
+  }
75
+  // 修改重量弹框
76
+  modal: boolean = false;
77
+  coopData:any = {};
78
+  content:string = '';
79
+  showModal(data) {
80
+    this.coopData = data;
81
+    this.modal = true;
82
+    this.initForm();
83
+  }
84
+  hideModal() {
85
+    this.modal = false;
86
+    this.initForm();
87
+  }
88
+  // 初始化form表单
89
+  validateForm: FormGroup; //编辑表单
90
+  initForm() {
91
+    this.validateForm = this.fb.group({
92
+      weight: [0, [Validators.required]],
93
+    });
94
+  }
95
+  // 表单提交
96
+  btnLoading:boolean = false;
97
+  submitForm(): void {
98
+    for (const i in this.validateForm.controls) {
99
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
100
+      this.validateForm.controls[i].updateValueAndValidity();
101
+    }
102
+    if (this.validateForm.invalid) return;
103
+    this.del();
104
+  }
105
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
106
+  promptContent: string; //操作提示框提示信息
107
+  ifSuccess: boolean; //操作成功/失败
108
+  promptInfo: string; //操作结果提示信息
109
+  promptModalShow: boolean; //操作提示框是否展示
110
+  showPromptModal(con, success, promptInfo?) {
111
+    this.promptModalShow = false;
112
+    this.promptContent = con;
113
+    this.ifSuccess = success;
114
+    this.promptInfo = promptInfo;
115
+    setTimeout(() => {
116
+      this.promptModalShow = true;
117
+    }, 100);
118
+    this.getList(1);
119
+  }
120
+  // 重置
121
+  reset() {
122
+    this.searchCriteria = {
123
+      //搜索条件
124
+      name: "",
125
+      dateRange: [],
126
+    };
127
+    this.getList(1);
128
+  }
129
+
130
+  // 获取所有院区
131
+  getHospital() {
132
+    this.hosId = this.tool.getCurrentHospital().id;
133
+    this.getList(1);
134
+  }
135
+  // 查看弹窗
136
+  historyPromptModalShow = false; //标本历史记录弹窗开关
137
+  id = ""; //查看
138
+  viewHistory(data) {
139
+    this.id = data.id;
140
+    this.historyPromptModalShow = true;
141
+  }
142
+  // 关闭弹窗
143
+  closeModelHistory(e) {
144
+    this.historyPromptModalShow = JSON.parse(e).show;
145
+  }
146
+
147
+  // 表格数据
148
+  loading1 = false;
149
+  getList(type) {
150
+    if (type == 1) {
151
+      this.pageIndex = 1;
152
+    }
153
+    let postData: any = {
154
+      idx: this.pageIndex - 1,
155
+      sum: this.pageSize,
156
+      clinicalWasteInto: {
157
+        hosId: this.hosId,
158
+      },
159
+    };
160
+    if (this.searchCriteria.dateRange.length) {
161
+      postData.clinicalWasteInto.startTime =
162
+        format(this.searchCriteria.dateRange[0], "yyyy-MM-dd HH:mm:ss");
163
+      postData.clinicalWasteInto.endTime =
164
+        format(this.searchCriteria.dateRange[1], "yyyy-MM-dd HH:mm:ss");
165
+    }
166
+    if (this.searchCriteria.name) {
167
+      postData.clinicalWasteInto.name = this.searchCriteria.name;
168
+    }
169
+    this.loading1 = true;
170
+    this.mainService
171
+      .getFetchDataList("simple/data", "clinicalWasteInto", postData)
172
+      .subscribe((data) => {
173
+        this.loading1 = false;
174
+        if (data["status"] == 200) {
175
+          this.listOfData = data["list"];
176
+          this.listLength = data["totalNum"];
177
+        }
178
+      });
179
+  }
180
+}
181
+

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

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