seimin vor 1 Jahr
Ursprung
Commit
49af647b1e

+ 1 - 1
proxy.conf.json

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

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

@@ -143,6 +143,12 @@ export class ToolService {
143 143
         case "oneClickRecovery":
144 144
           coopBtns.oneClickRecovery = true; //一键恢复
145 145
           break;
146
+        case "view":
147
+            coopBtns.view = true; //查看视图
148
+            break;
149
+        case "recount":
150
+          coopBtns.recount = true; //重新统计
151
+          break;
146 152
       }
147 153
     });
148 154
     console.log(coopBtns);

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

@@ -188,6 +188,11 @@ const routes: Routes = [
188 188
         path: "workOrderLog",
189 189
         loadChildren: () => import("../work-order-log/work-order-log.module").then((m) => m.WorkOrderLogModule),
190 190
       },
191
+      // 洗涤批次管理
192
+      {
193
+        path: "washingBatch",
194
+        loadChildren: () => import("../washing-batch/washing-batch.module").then((m) => m.WashingBatchModule),
195
+      },
191 196
       // 统计分析-综合统计
192 197
       {
193 198
         path: "compreStatistics",

+ 1 - 1
src/app/views/quilt-department-bind/quilt-department-bind.component.html

@@ -26,7 +26,7 @@
26 26
             <td>{{data.clothesTypeNames || ''}}</td>
27 27
             <td>
28 28
               <div class="coop">
29
-                <span *ngIf="coopBtns.del&&!data.status" (click)="showDelModal(data,'您确认要删除吗?','删除','del')">删除</span>
29
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data,'您确认要删除吗?','删除','del')">删除</span>
30 30
                 <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
31 31
               </div>
32 32
             </td>

+ 14 - 0
src/app/views/washing-batch/washing-batch-routing.module.ts

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

+ 72 - 0
src/app/views/washing-batch/washing-batch.component.html

@@ -0,0 +1,72 @@
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 nzLg="6" class="list-template__btns"></div>
6
+    </div>
7
+    <div class="list-template__bottom">
8
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
9
+        [nzLoading]="loading1">
10
+        <thead>
11
+          <tr class="thead">
12
+            <th nzWidth="5%">序号</th>
13
+            <th nzWidth="13%">批次号</th>
14
+            <th nzWidth="13%">生成时间</th>
15
+            <th nzWidth="13%">科室数量</th>
16
+            <th nzWidth="13%">被服数量</th>
17
+            <th nzWidth="13%">总费用</th>
18
+            <th nzWidth="13%">状态</th>
19
+            <th nzWidth="17%">操作</th>
20
+          </tr>
21
+        </thead>
22
+        <tbody>
23
+          <tr *ngFor="let data of listOfData;let index = index">
24
+            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
25
+            <td>{{data.batchCode || ''}}</td>
26
+            <td>{{data.createTime | date: 'yyyy-MM-dd HH:mm' }}</td>
27
+            <td>{{data.deptNum || ''}}</td>
28
+            <td>{{data.clothesNum || ''}}</td>
29
+            <td>{{data.totalPrice || ''}}</td>
30
+            <td>{{data.batchState?.name}}</td>
31
+            <td>
32
+              <div class="coop">
33
+                <span *ngIf="coopBtns.view" (click)="openRecallModal(data)">查看视图</span>
34
+                <span *ngIf="coopBtns.recount" (click)="showDelModal(data,'您需要重新统计本批次的数据吗?','','recount')">重新统计</span>
35
+              </div>
36
+            </td>
37
+          </tr>
38
+        </tbody>
39
+      </nz-table>
40
+      <div class="list-template__pagination">
41
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
42
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
43
+        </nz-pagination>
44
+      </div>
45
+    </div>
46
+  </div>
47
+
48
+  <!-- 删除模态框 -->
49
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
50
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
51
+</div>
52
+<!-- 操作成功/失败提示框 -->
53
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
54
+  [info]="promptInfo">
55
+</app-prompt-modal>
56
+
57
+<!-- 撤回工单 -->
58
+<div class="recallOrder display_flex justify-content_flex-center align-items_center" *ngIf="recallOrderShow">
59
+  <div class="modalBody">
60
+    <div class="title">提示<i class="icon_transport transport-guanbi" (click)="closeRecallOrderModal()"></i></div>
61
+    <div class="content">
62
+      <div class="icon"><i class="icon_transport transport-wenhao"></i></div>
63
+      <div class="defeat">是否回收完毕,可将本批次设置为“洗涤中”?</div>
64
+    </div>
65
+    <div class="btns display_flex justify-content_flex-center align-items_center">
66
+      <button class="btn" nz-button nzType="primary" [nzLoading]='recLoading' (click)="recAndDel()">立即查看</button>
67
+      <button class="btn" style="width: 120px;" nz-button nzType="primary" [nzLoading]='btnLoading' (click)="confirmRec()">设置为洗涤中</button>
68
+      <button class="btn cancel" nz-button nzType="default" (click)="closeRecallOrderModal()">取消</button>
69
+    </div>
70
+  </div>
71
+</div>
72
+

+ 258 - 0
src/app/views/washing-batch/washing-batch.component.less

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

+ 177 - 0
src/app/views/washing-batch/washing-batch.component.ts

@@ -0,0 +1,177 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+
5
+import { ToolService } from "../../services/tool.service";
6
+import { WashingBatchService } from './washing-batch.service';
7
+import { Subject } from 'rxjs';
8
+import { debounceTime } from 'rxjs/operators';
9
+import { NzMessageService } from 'ng-zorro-antd/message';
10
+@Component({
11
+  selector: "app-washing-batch",
12
+  templateUrl: "./washing-batch.component.html",
13
+  styleUrls: ["./washing-batch.component.less"],
14
+})
15
+export class WashingBatchComponent implements OnInit {
16
+  constructor(
17
+    private fb: FormBuilder,
18
+    private washingBatchService: WashingBatchService,
19
+    private route: ActivatedRoute,
20
+    private tool: ToolService,
21
+    private message: NzMessageService,
22
+  ) {}
23
+
24
+  userInfo: any = JSON.parse(localStorage.getItem("user")) || {}; //登录用户信息
25
+  listOfData: any[] = []; //表格数据
26
+  pageIndex: number = 1; //表格当前页码
27
+  pageSize: number = 10; //表格每页展示条数
28
+  listLength: number = 10; //表格总数据量
29
+  tableHeight: number; //表格动态高
30
+  modal: boolean = false; //新增/编辑模态框
31
+  add: boolean; //true:新增;false:编辑
32
+  validateForm: FormGroup; //新增/编辑表单
33
+  coopId: any; //当前操作列
34
+  currentHospital; //当前院区
35
+
36
+  btnLoading: boolean = false; //提交按钮loading状态
37
+
38
+  promptContent: string; //操作提示框提示信息
39
+  ifSuccess: boolean; //操作成功/失败
40
+  promptInfo: string; //操作结果提示信息
41
+  promptModalShow: boolean; //操作提示框是否展示
42
+  modelName = ""; //模态框名称
43
+
44
+
45
+  ngOnInit() {
46
+    this.currentHospital = this.tool.getCurrentHospital();
47
+    this.coopBtns = this.tool.initCoopBtns(this.route);
48
+    this.getList(1);
49
+  }
50
+
51
+  // 初始化增删改按钮
52
+  coopBtns: any = {};
53
+
54
+  // 表格数据
55
+  loading1 = false;
56
+  getList(type) {
57
+    if (type == 1) {
58
+      this.pageIndex = 1;
59
+    }
60
+    let data = {
61
+      idx: this.pageIndex - 1,
62
+      sum: this.pageSize,
63
+      clothesBatch: {
64
+        hosId: this.currentHospital.id,
65
+      },
66
+    };
67
+    this.loading1 = true;
68
+    this.washingBatchService
69
+      .getFetchDataList(data)
70
+      .subscribe((data) => {
71
+        this.loading1 = false;
72
+        if (data.status == 200) {
73
+          this.listOfData = data.list;
74
+          this.listLength = data.totalNum;
75
+        }
76
+      });
77
+  }
78
+
79
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
80
+  showPromptModal(con, success, promptInfo?) {
81
+    this.promptModalShow = false;
82
+    this.promptContent = con;
83
+    this.ifSuccess = success;
84
+    this.promptInfo = promptInfo;
85
+    setTimeout(() => {
86
+      this.promptModalShow = true;
87
+    }, 100);
88
+    this.getList(0);
89
+  }
90
+
91
+  delModal: boolean = false; //删除模态框
92
+  tipsMsg1: string; //提示框信息
93
+  tipsMsg2: string; //操作后信息
94
+  confirmDelType: string; //确认的类型(启用/停用,删除)
95
+  showDelModal(
96
+    data,
97
+    tipsMsg1: string,
98
+    tipsMsg2: string,
99
+    type: string,
100
+  ) {
101
+    this.confirmDelType = type;
102
+    this.delModal = true;
103
+    this.coopId = data;
104
+    this.tipsMsg1 = tipsMsg1;
105
+    this.tipsMsg2 = tipsMsg2;
106
+  }
107
+  // 隐藏删除框
108
+  hideDelModal() {
109
+    this.delModal = false;
110
+  }
111
+  // 确认删除
112
+  confirmDel() {
113
+    this.btnLoading = true;
114
+    if (this.confirmDelType === "recount") {
115
+      //删除
116
+      this.washingBatchService
117
+        .simplePost("rmvData", "clothesBatch", [this.coopId.id])
118
+        .subscribe((data) => {
119
+          this.btnLoading = false;
120
+          this.delModal = false;
121
+          if (data.status == 200) {
122
+            if (
123
+              this.listOfData.length == 1 &&
124
+              this.pageIndex == Math.ceil(this.listLength / this.pageSize)
125
+            ) {
126
+              this.listLength--;
127
+              if (this.listLength === 0) {
128
+                this.pageIndex = 1;
129
+              } else {
130
+                this.pageIndex = Math.ceil(this.listLength / this.pageSize);
131
+              }
132
+            }
133
+            this.showPromptModal(this.tipsMsg2, true, "");
134
+          } else {
135
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
136
+          }
137
+        });
138
+    }
139
+  }
140
+
141
+  // 打开查看视图
142
+  recallOrderShow: boolean = false;
143
+  coopData:any = {};
144
+  openRecallModal(data): void {
145
+    this.coopData = data;
146
+    this.recallOrderShow = true;
147
+  }
148
+  // 设置为洗涤中
149
+  confirmRec() {
150
+    this.btnLoading = true;
151
+    let postData = {
152
+      id: this.coopData.id,
153
+      stateType: "xdz",
154
+    };
155
+    this.washingBatchService
156
+      .simplePost("addData", 'clothesBatch', postData)
157
+      .subscribe((data) => {
158
+        this.btnLoading = false;
159
+        this.closeRecallOrderModal();
160
+        if (data.status == 200) {
161
+          this.showPromptModal("操作", true, "");
162
+        } else {
163
+          this.showPromptModal("操作", false, data.msg);
164
+        }
165
+      });
166
+  }
167
+  // 立即查看
168
+  recAndDel() {
169
+    alert('立即查看');
170
+  }
171
+  // 取消
172
+  closeRecallOrderModal() {
173
+    this.recallOrderShow = false;
174
+  }
175
+}
176
+
177
+

+ 19 - 0
src/app/views/washing-batch/washing-batch.module.ts

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

+ 41 - 0
src/app/views/washing-batch/washing-batch.service.ts

@@ -0,0 +1,41 @@
1
+import { Injectable } from '@angular/core';
2
+import { MainService } from 'src/app/services/main.service';
3
+import { map } from 'rxjs/operators';
4
+
5
+@Injectable({
6
+  providedIn: 'root'
7
+})
8
+export class WashingBatchService {
9
+
10
+  constructor(
11
+    private mainService: MainService,
12
+  ) { }
13
+
14
+  // simple增删改
15
+  simplePost(type, model, postData) {
16
+    return this.mainService.simplePost(type, model, postData);
17
+  }
18
+
19
+  // 查询
20
+  getFetchDataList(postData) {
21
+    return this.mainService.getFetchDataList("simple/data", "clothesBatch", postData).pipe(map((v:any) => {
22
+      if(Array.isArray(v.list)){
23
+        v.list = v.list.map(vv => ({
24
+          ...vv,
25
+          buildingListNames: vv.buildingList ? vv.buildingList.map(v => v.buildingName).toString() : '',
26
+          deptListNames: vv.deptList ? vv.deptList.map(v => v.dept).toString() : '',
27
+        }));
28
+      }else{
29
+        v.list = [];
30
+      }
31
+      return v;
32
+    }));;
33
+  }
34
+
35
+  // 字典
36
+  getDictionary(type) {
37
+    return this.mainService.getDictionary("list", type);
38
+  }
39
+}
40
+
41
+