Browse Source

医废类型

seimin 1 year ago
parent
commit
d33695cc00

+ 1 - 1
proxy.conf.json

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

+ 1 - 6
src/app/views/barcode-prefabrication/barcode-prefabrication.component.html

@@ -146,12 +146,7 @@
146 146
             <div style="font-size: 3mm;margin: 1mm; overflow: hidden;">
147 147
               <p style="float: left;margin: 0;">医废类型:</p>
148 148
               <ul style="margin:0;padding: 0;list-style-type: none;float: right;">
149
-                <li><span style="display: inline-block;width: 3mm;height: 3mm;border:1px solid #000;position: relative;top: 0.7mm;margin-right: 1mm;"></span>感染性废物</li>
150
-                <li style="margin-top: 1.1mm;"><span style="display: inline-block;width: 3mm;height: 3mm;border:1px solid #000;position: relative;top: 0.7mm;margin-right: 1mm;"></span>感染性废物</li>
151
-                <li style="margin-top: 1.1mm;"><span style="display: inline-block;width: 3mm;height: 3mm;border:1px solid #000;position: relative;top: 0.7mm;margin-right: 1mm;"></span>感染性废物</li>
152
-                <li style="margin-top: 1.1mm;"><span style="display: inline-block;width: 3mm;height: 3mm;border:1px solid #000;position: relative;top: 0.7mm;margin-right: 1mm;"></span>感染性废物</li>
153
-                <li style="margin-top: 1.1mm;"><span style="display: inline-block;width: 3mm;height: 3mm;border:1px solid #000;position: relative;top: 0.7mm;margin-right: 1mm;"></span>感染性废物</li>
154
-                <li style="margin-top: 1.1mm;"><span style="display: inline-block;width: 3mm;height: 3mm;border:1px solid #000;position: relative;top: 0.7mm;margin-right: 1mm;"></span>感染性废物</li>
149
+                <li *ngFor="let clinicalWasteType of clinicalWasteTypes;let first = first;" [ngStyle]="{'margin-top': first ? '' : '1.1mm'}"><span style="display: inline-block;width: 3mm;height: 3mm;border:1px solid #000;position: relative;top: 0.7mm;margin-right: 1mm;"></span>{{clinicalWasteType.typeName}}</li>
155 150
               </ul>
156 151
             </div>
157 152
           </div>

+ 9 - 0
src/app/views/barcode-prefabrication/barcode-prefabrication.component.ts

@@ -61,6 +61,7 @@ export class BarcodePrefabricationComponent implements OnInit {
61 61
     this.initForm();
62 62
     this.getCodeType();
63 63
     this.getSnConfigs();
64
+    this.getClinicalWasteType();
64 65
   }
65 66
 
66 67
   // 初始化增删改按钮
@@ -108,6 +109,14 @@ export class BarcodePrefabricationComponent implements OnInit {
108 109
     });
109 110
   }
110 111
 
112
+  // 获取废物类型
113
+  clinicalWasteTypes: Array<any> = [];
114
+  getClinicalWasteType(keyword = "") {
115
+    this.mainService.getFetchDataList("simple/data", "clinicalWasteType", {idx: 0, sum: 9999, clinicalWasteType: { hosId: this.hosId }}).subscribe((data) => {
116
+      this.clinicalWasteTypes = data.list || [];
117
+    });
118
+  }
119
+
111 120
   // 边输边搜节流阀
112 121
   isLoading = false;
113 122
   changeInp(e) {

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

@@ -418,6 +418,11 @@ const routes: Routes = [
418 418
         path: "unitManagement",
419 419
         loadChildren: () => import("../unit-management/unit-management.module").then((m) => m.UnitManagementModule),
420 420
       },
421
+      // 医废类型
422
+      {
423
+        path: "medicalWasteType",
424
+        loadChildren: () => import("../medical-waste-type/medical-waste-type.module").then((m) => m.MedicalWasteTypeModule),
425
+      },
421 426
     ],
422 427
   },
423 428
 ];

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

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

+ 109 - 0
src/app/views/medical-waste-type/medical-waste-type.component.html

@@ -0,0 +1,109 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='18' class="list-template__searchBox"></div>
5
+      <div nz-col nzXl='6' class="list-template__btns">
6
+        <button nz-button *ngIf="coopBtns.add" class="btn ml8 default" (click)="showModal()">新增</button>
7
+      </div>
8
+    </div>
9
+    <div class="list-template__bottom">
10
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
11
+        [nzLoading]="loading1">
12
+        <thead>
13
+          <tr class="thead">
14
+            <th nzWidth="20%">类型名称</th>
15
+            <th nzWidth="20%">单位</th>
16
+            <th nzWidth="20%">储存单位</th>
17
+            <th nzWidth="20%">库存限制天数</th>
18
+            <th nzWidth="20%">操作</th>
19
+          </tr>
20
+        </thead>
21
+        <tbody>
22
+          <tr *ngFor="let data of listOfData;let index=index;">
23
+            <td>{{ data.typeName }}</td>
24
+            <td>{{ data.unit ? data.unit.name : '' }}</td>
25
+            <td>{{ data.storageUnit ? data.storageUnit.name : '' }}</td>
26
+            <td>{{ data.inventoryDays }}</td>
27
+            <td>
28
+              <div class="coop">
29
+                <span *ngIf="coopBtns.look" (click)="detail(data.id)">查看</span>
30
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">修改</span>
31
+                <span *ngIf="coopBtns.del" (click)="del(data)">删除</span>
32
+              </div>
33
+            </td>
34
+          </tr>
35
+        </tbody>
36
+      </nz-table>
37
+      <div class="list-template__pagination">
38
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
39
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
40
+        </nz-pagination>
41
+      </div>
42
+    </div>
43
+  </div>
44
+</div>
45
+<!-- 新增/编辑模态框 -->
46
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
47
+  <div class="modalBody">
48
+    <div class="title">{{add?"新增":"编辑"}}医费类型<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
49
+    </div>
50
+    <overlay-scrollbars #osComponentRef1 class="content">
51
+      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
52
+        <nz-form-item>
53
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="typeName">类型名称</nz-form-label>
54
+          <nz-form-control nzErrorTip="请填写类型名称!">
55
+            <nz-input-group>
56
+              <input nz-input formControlName="typeName" placeholder="请填写类型名称" />
57
+            </nz-input-group>
58
+          </nz-form-control>
59
+        </nz-form-item>
60
+        <nz-form-item>
61
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="unit">单位</nz-form-label>
62
+          <nz-form-control nzErrorTip="请选择单位!">
63
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear
64
+              formControlName="unit" nzPlaceHolder="请选择单位">
65
+              <nz-option [nzLabel]="data.name" [nzValue]="data.id" *ngFor="let data of units">
66
+              </nz-option>
67
+            </nz-select>
68
+          </nz-form-control>
69
+        </nz-form-item>
70
+        <nz-form-item>
71
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="storageUnit">储存单位</nz-form-label>
72
+          <nz-form-control nzErrorTip="请选择储存单位!">
73
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear
74
+              formControlName="storageUnit" nzPlaceHolder="请选择储存单位">
75
+              <nz-option [nzLabel]="data.name" [nzValue]="data.id" *ngFor="let data of storageUnits">
76
+              </nz-option>
77
+            </nz-select>
78
+          </nz-form-control>
79
+        </nz-form-item>
80
+        <nz-form-item>
81
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="inventoryDays">库存限制天数</nz-form-label>
82
+          <nz-form-control nzErrorTip="请填写库存限制天数!">
83
+            <div style="margin-top: 15px;">
84
+              <nz-input-number nz-input formControlName="inventoryDays" nzPlaceHolder="请填写库存限制天数" [nzMin]="0" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
85
+              <span class="red">(零为不限制,1以上为限制)</span>
86
+            </div>
87
+          </nz-form-control>
88
+        </nz-form-item>
89
+      </form>
90
+    </overlay-scrollbars>
91
+    <div class="display_flex justify-content_flex-center">
92
+      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
93
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
94
+    </div>
95
+  </div>
96
+</div>
97
+<!-- 删除模态框 -->
98
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
99
+  (confirmDelEvent)="confirmDel()" content="您确认要删除吗?">
100
+</app-dialog-delete>
101
+<!-- 操作成功/失败提示框 -->
102
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
103
+  [info]="promptInfo"></app-prompt-modal>
104
+
105
+<!-- 查看详情 -->
106
+<router-outlet (deactivate)="getList()"></router-outlet>
107
+
108
+<!-- 遮罩 -->
109
+<app-mask *ngIf="maskFlag"></app-mask>

+ 125 - 0
src/app/views/medical-waste-type/medical-waste-type.component.less

@@ -0,0 +1,125 @@
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
+        margin: 0;
46
+
47
+        &.icon {
48
+          margin-top: 17px;
49
+
50
+          i {
51
+            color: #34b349;
52
+            font-size: 30px !important;
53
+
54
+            &.transport-wenhao {
55
+              color: #f5a523;
56
+            }
57
+
58
+            &.transport-shibai {
59
+              color: #ff3a52;
60
+            }
61
+          }
62
+        }
63
+
64
+        &.defeat {
65
+          color: #333;
66
+          font-size: 18px;
67
+        }
68
+
69
+        &:nth-child(3) {
70
+          font-size: 14px;
71
+          color: #666;
72
+        }
73
+      }
74
+    }
75
+
76
+    button {
77
+      margin-top: 10px;
78
+
79
+      &.btn {
80
+        margin-left: 8px;
81
+      }
82
+    }
83
+  }
84
+
85
+  // 新增
86
+  &.add {
87
+    .modalBody {
88
+      width: 480px;
89
+      height: auto;
90
+
91
+      .content {
92
+        width: 100%;
93
+        height: auto;
94
+        padding: 19px 14px 0 14px;
95
+        max-height: 500px;
96
+        overflow-y: auto;
97
+
98
+        .addForm {
99
+          .ant-form-item {
100
+            margin-bottom: 8px;
101
+
102
+            .ant-form-item-label {
103
+              line-height: 14px;
104
+              text-align: left;
105
+            }
106
+          }
107
+        }
108
+
109
+        .editForm {
110
+          .ant-form-item {
111
+            margin-bottom: 14px;
112
+
113
+            .ant-form-item-label {
114
+              line-height: 0;
115
+            }
116
+          }
117
+        }
118
+      }
119
+
120
+      button:nth-child(1) {
121
+        margin-right: 20px;
122
+      }
123
+    }
124
+  }
125
+}

+ 219 - 0
src/app/views/medical-waste-type/medical-waste-type.component.ts

@@ -0,0 +1,219 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
7
+import { ToolService } from "../../services/tool.service";
8
+import { NzMessageService } from "ng-zorro-antd";
9
+
10
+@Component({
11
+  selector: "app-medical-waste-type",
12
+  templateUrl: "./medical-waste-type.component.html",
13
+  styleUrls: ["./medical-waste-type.component.less"],
14
+})
15
+export class MedicalWasteTypeComponent implements OnInit {
16
+  @ViewChild("osComponentRef1", {
17
+    read: OverlayScrollbarsComponent,
18
+    static: false,
19
+  })
20
+  osComponentRef1: OverlayScrollbarsComponent;
21
+  constructor(
22
+    private message: NzMessageService,
23
+    private fb: FormBuilder,
24
+    private route: ActivatedRoute,
25
+    private router: Router,
26
+    private mainService: MainService,
27
+    private tool: ToolService
28
+  ) {}
29
+
30
+  listOfData: any[] = []; //表格数据
31
+
32
+  modal: boolean = false; //新增/编辑模态框
33
+  add: boolean; //true:新增;false:编辑
34
+  validateForm: FormGroup; //新增/编辑表单
35
+  coopId: number; //表格中执行操作的id
36
+  hosId: any; //院区(搜索)
37
+  storageUnits: Array<any> = []; //所有储存单位
38
+  pageIndex: number = 1; //页码
39
+  listLength: number = 10; //总条数
40
+  pageSize: number = 10; //每页条数
41
+
42
+  promptContent: string; //操作提示框提示信息
43
+  ifSuccess: boolean; //操作成功/失败
44
+  promptInfo: string; //操作结果提示信息
45
+  promptModalShow: boolean; //操作提示框是否展示
46
+
47
+  btnLoading: boolean = false; //提交按钮loading状态
48
+
49
+  ngOnInit() {
50
+    this.coopBtns = this.tool.initCoopBtns(this.route);
51
+    this.initForm();
52
+    this.getStorageUnit();
53
+    this.getUnit();
54
+  }
55
+
56
+  // 初始化增删改按钮
57
+  coopBtns: any = {};
58
+  // 表格数据
59
+  loading1 = false;
60
+  getList() {
61
+    let data = {
62
+      idx: this.pageIndex - 1,
63
+      sum: this.pageSize,
64
+      clinicalWasteType: {
65
+        hosId: this.hosId,
66
+      },
67
+    };
68
+    this.loading1 = true;
69
+    this.mainService
70
+      .getFetchDataList("simple/data", "clinicalWasteType", data)
71
+      .subscribe((data) => {
72
+        this.loading1 = false;
73
+        this.listOfData = data.list;
74
+        this.listLength = data.totalNum;
75
+      });
76
+  }
77
+
78
+  // 获取所有储存单位
79
+  getStorageUnit() {
80
+    this.mainService.getDictionary("list", "storage_unit").subscribe((data) => {
81
+      this.storageUnits = data;
82
+      this.getAllHospital();
83
+    });
84
+  }
85
+
86
+  // 获取相应的院区
87
+  getAllHospital() {
88
+    this.hosId = this.tool.getCurrentHospital().id;
89
+    this.getList();
90
+  }
91
+
92
+  // 获取生成方案
93
+  units: Array<any> = [];
94
+  getUnit() {
95
+    var that = this;
96
+    that.mainService.getDictionary("list", "unit").subscribe((data) => {
97
+      that.units = data;
98
+    });
99
+  }
100
+
101
+  // 新增弹框
102
+  showModal() {
103
+    this.add = true;
104
+    this.initForm();
105
+    this.modal = true;
106
+  }
107
+  hideModal() {
108
+    this.modal = false;
109
+    this.initForm();
110
+  }
111
+
112
+  // 初始化新增form表单
113
+  initForm() {
114
+    this.validateForm = this.fb.group({
115
+      typeName: [null, [Validators.required]],
116
+      inventoryDays: [0, [Validators.required]],
117
+      unit: [null, [Validators.required]],
118
+      storageUnit: [null, [Validators.required]],
119
+    });
120
+  }
121
+  // 表单提交
122
+  submitForm(): void {
123
+    var that = this;
124
+    for (const i in that.validateForm.controls) {
125
+      that.validateForm.controls[i].markAsDirty({ onlySelf: true });
126
+      that.validateForm.controls[i].updateValueAndValidity();
127
+    }
128
+    if (that.validateForm.invalid) return;
129
+    that.btnLoading = true;
130
+    let data:any = {
131
+      typeName: that.validateForm.value.typeName,
132
+      inventoryDays: that.validateForm.value.inventoryDays,
133
+      unit: that.validateForm.value.unit ? { id: that.validateForm.value.unit } : undefined,
134
+      storageUnit: that.validateForm.value.storageUnit ? { id: that.validateForm.value.storageUnit } : undefined,
135
+      hosId: that.hosId,
136
+    };
137
+    if (!that.add) {
138
+      data = {...this.coopData, ...data};
139
+    }
140
+    that.mainService
141
+      .simplePost("addData", "clinicalWasteType", data)
142
+      .subscribe((data) => {
143
+        that.btnLoading = false;
144
+        that.hideModal();
145
+        that.initForm();
146
+        if (data.status == 200) {
147
+          that.showPromptModal(that.add ? "新增" : "编辑", true, "");
148
+        } else {
149
+          that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
150
+        }
151
+      });
152
+  }
153
+
154
+  // 编辑
155
+  maskFlag: any = false;
156
+  coopData:any = {};
157
+  edit(data) {
158
+    this.modal = true;
159
+    this.add = false;
160
+    this.coopId = data.id;
161
+    this.coopData = data;
162
+    this.validateForm.controls.typeName.setValue(data.typeName);
163
+    this.validateForm.controls.inventoryDays.setValue(data.inventoryDays);
164
+    this.validateForm.controls.unit.setValue(data.unit.id);
165
+    this.validateForm.controls.storageUnit.setValue(data.storageUnit.id);
166
+  }
167
+
168
+  // 删除
169
+  delModal: boolean = false; //删除模态框
170
+  del(data) {
171
+    this.coopId = data.id;
172
+    this.delModal = true;
173
+  }
174
+  // 确认删除
175
+  confirmDel() {
176
+    let that = this;
177
+    that.btnLoading = true;
178
+    that.mainService
179
+      .simplePost("rmvData", "clinicalWasteType", [that.coopId])
180
+      .subscribe((data) => {
181
+        that.btnLoading = false;
182
+        that.hideDelModal();
183
+        if (data["status"] == 200) {
184
+          if (
185
+            that.listOfData.length == 1 &&
186
+            that.pageIndex == Math.ceil(that.listLength / that.pageSize)
187
+          ) {
188
+            that.listLength--;
189
+            that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
190
+          }
191
+          that.showPromptModal("删除", true, "");
192
+        } else {
193
+          that.showPromptModal("删除", false, data["msg"]);
194
+        }
195
+      });
196
+  }
197
+  // 关闭删除模态框
198
+  hideDelModal() {
199
+    this.delModal = false;
200
+  }
201
+
202
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
203
+  showPromptModal(con, success, promptInfo?) {
204
+    this.promptModalShow = false;
205
+    this.promptContent = con;
206
+    this.ifSuccess = success;
207
+    this.promptInfo = promptInfo;
208
+    setTimeout(() => {
209
+      this.promptModalShow = true;
210
+    }, 100);
211
+    this.getList();
212
+  }
213
+
214
+  // 查看
215
+  detail(id) {
216
+    this.router.navigateByUrl("/main/serialNumberSetting/serialNumberSettingDetail/" + id);
217
+  }
218
+  isLoading = false;
219
+}

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

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