Browse Source

增加报修与展示

seimin 3 years ago
parent
commit
fb86cf8034

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

@@ -481,4 +481,28 @@ export class MainService {
481 481
       headers: this.headers,
482 482
     });
483 483
   }
484
+  //查报修列表
485
+  listWxIncident(data) {
486
+    return this.http.post(host.host + "/api/listWxIncident", data, {
487
+      headers: this.headers,
488
+    });
489
+  }
490
+  //查区域地点接口
491
+  fetchListBx(type,data) {
492
+    return this.http.post(host.host + "/api/fetchDataList/" + type, data, {
493
+      headers: this.headers,
494
+    });
495
+  }
496
+  //提交报修
497
+  addWxIncident(data) {
498
+    return this.http.post(host.host + "/api/addWxIncident", data, {
499
+      headers: this.headers,
500
+    });
501
+  }
502
+  //获取微信报修ID
503
+  wxbx(data) {
504
+    return this.http.post(host.host + "/api/restful/wxbx", data, {
505
+      headers: this.headers,
506
+    });
507
+  }
484 508
 }

+ 48 - 0
src/app/share/bx-prompt-modal/bx-prompt-modal.component.html

@@ -0,0 +1,48 @@
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
+      <div class="info">
6
+        <div nz-row>
7
+          <div class="left" nz-col nzSpan="12">
8
+            <div class="item display_flex  justify-content_space-between align-items_flex-start">
9
+              <span>报修内容</span>
10
+              <span>{{ bData.description||'无' }}</span>
11
+            </div>
12
+          </div>
13
+          <div class="right" nz-col nzSpan="12">
14
+            <div class="item display_flex  justify-content_space-between align-items_flex-start">
15
+              <span>报修时间</span>
16
+              <span>{{ bData.createTime|date:'MM-dd HH:mm' }}</span>
17
+            </div>
18
+          </div>
19
+        </div>
20
+        <div nz-row>
21
+          <div class="left" nz-col nzSpan="12">
22
+            <div class="item display_flex  justify-content_space-between align-items_flex-start">
23
+              <span>报修人</span>
24
+              <span>{{ bData.requester?bData.requester.name:'无' }}</span>
25
+            </div>
26
+          </div>
27
+          <div class="right" nz-col nzSpan="12">
28
+            <div class="item display_flex  justify-content_space-between align-items_flex-start">
29
+              <span>状态</span>
30
+              <span>{{ bData.state.name }}</span>
31
+            </div>
32
+          </div>
33
+        </div>
34
+        <div nz-row>
35
+          <div class="left" nz-col nzSpan="12">
36
+            <div class="item display_flex  justify-content_space-between align-items_flex-start">
37
+              <span>处理人</span>
38
+              <span>{{ bData.incident?(bData.incident.contacts?bData.incident.contacts:'无'):'无' }}</span>
39
+            </div>
40
+          </div>
41
+        </div>
42
+      </div>
43
+    </div>
44
+    <div class="display_flex justify-content_flex-center">
45
+      <button class="btn know" nz-button nzType="primary" (click)="hideModal()">知道了</button>
46
+    </div>
47
+  </div>
48
+</div>

+ 160 - 0
src/app/share/bx-prompt-modal/bx-prompt-modal.component.less

@@ -0,0 +1,160 @@
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
+      width: 100%;
56
+      background: #f9fafb;
57
+      border: 1px solid #e5e9ed;
58
+      border-radius: 5px;
59
+      overflow: hidden;
60
+      margin-top: 12px;
61
+      padding: 9px 24px;
62
+
63
+      .top {
64
+        height: 35px;
65
+        border-bottom: 2px solid #eff2f4;
66
+
67
+        span:nth-child(1) {
68
+          font-size: 14px;
69
+          color: @primary-color;
70
+        }
71
+
72
+        span:nth-child(2) {
73
+          font-size: 12px;
74
+          color: #999;
75
+        }
76
+      }
77
+
78
+      .info {
79
+        margin-top: 15px;
80
+        margin-bottom: 4px;
81
+
82
+        .left {
83
+          border-right: 2px dashed #eff2f4;
84
+          padding-right: 23px;
85
+        }
86
+
87
+        .right {
88
+          padding-left: 23px;
89
+        }
90
+
91
+        .item {
92
+          // display: flex;
93
+          // justify-content: space-between;
94
+          // align-items: flex-start;
95
+          margin-bottom: 5px;
96
+
97
+          &>span:nth-child(1) {
98
+            color: #666;
99
+            min-width: 70px;
100
+          }
101
+
102
+          &>span:nth-child(2) {
103
+            color: #333;
104
+          }
105
+        }
106
+
107
+
108
+      }
109
+
110
+    }
111
+
112
+    button {
113
+      margin-top: 10px;
114
+
115
+      &.btn {
116
+        margin-left: 8px;
117
+      }
118
+    }
119
+  }
120
+
121
+  // 新增
122
+  &.add {
123
+    .modalBody {
124
+      width: 480px;
125
+      height: auto;
126
+
127
+      .content {
128
+        width: 100%;
129
+        height: auto;
130
+        padding: 18px 14px 0 14px;
131
+
132
+        .addForm {
133
+          .ant-form-item {
134
+            margin-bottom: 15px;
135
+
136
+            .ant-form-item-label {
137
+              line-height: 0;
138
+            }
139
+          }
140
+        }
141
+
142
+        .editForm {
143
+          .ant-form-item {
144
+            margin-bottom: 15px;
145
+
146
+            .ant-form-item-label {
147
+              line-height: 0;
148
+            }
149
+          }
150
+        }
151
+      }
152
+
153
+      button {
154
+        &:nth-child(1) {
155
+          margin-right: 20px;
156
+        }
157
+      }
158
+    }
159
+  }
160
+}

+ 25 - 0
src/app/share/bx-prompt-modal/bx-prompt-modal.component.ts

@@ -0,0 +1,25 @@
1
+import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2
+
3
+@Component({
4
+  selector: 'app-bx-prompt-modal',
5
+  templateUrl: './bx-prompt-modal.component.html',
6
+  styleUrls: ['./bx-prompt-modal.component.less']
7
+})
8
+export class BxPromptModalComponent implements OnInit {
9
+  // 切换科室,切换弹窗
10
+  hsLoading = false;
11
+  @Input() show: Boolean;
12
+  @Input() bData: Object = {};
13
+
14
+  @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
15
+
16
+  constructor() { }
17
+
18
+  ngOnInit() {}
19
+  // 关闭弹窗
20
+  hideModal() {
21
+    this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
22
+  }
23
+}
24
+
25
+

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

@@ -27,6 +27,7 @@ import { BatchOrdersComponent } from './batch-orders/batch-orders.component';
27 27
 import { CollapseComponent } from './collapse/collapse.component';
28 28
 import { CollapsePanelComponent } from './collapse-panel/collapse-panel.component';
29 29
 import { HtmlTransformPipe } from '../pipes/html-transform.pipe';
30
+import { BxPromptModalComponent } from './bx-prompt-modal/bx-prompt-modal.component';
30 31
 
31 32
 @NgModule({
32 33
   declarations: [
@@ -41,6 +42,7 @@ import { HtmlTransformPipe } from '../pipes/html-transform.pipe';
41 42
     ReplicationSchemeComponent,
42 43
     HsPromptModalComponent,
43 44
     HistoryPromptModalComponent,
45
+    BxPromptModalComponent,
44 46
     AppraiseDetailComponent,
45 47
     OrderDetailComponent,
46 48
     DateTransformPipe,
@@ -74,6 +76,7 @@ import { HtmlTransformPipe } from '../pipes/html-transform.pipe';
74 76
     ReplicationSchemeComponent,
75 77
     HsPromptModalComponent,
76 78
     HistoryPromptModalComponent,
79
+    BxPromptModalComponent,
77 80
     AppraiseDetailComponent,
78 81
     OrderDetailComponent,
79 82
     CommonModule,

File diff suppressed because it is too large
+ 627 - 1573
src/app/views/hushijiandan/hushijiandan.component.html


+ 4 - 0
src/app/views/hushijiandan/hushijiandan.component.less

@@ -3,6 +3,9 @@
3 3
   width: 100%;
4 4
   height: 100%;
5 5
   display: flex;
6
+  .bxForm{
7
+    margin-top: 16px;
8
+  }
6 9
   .yyTime {
7 10
     display: flex;
8 11
     align-items: center;
@@ -933,6 +936,7 @@
933 936
                 color: #333;
934 937
                 border: 1px solid #e5e9ed;
935 938
                 .text {
939
+                  width: 100%;
936 940
                   text-align: center;
937 941
                   position: absolute;
938 942
                   left: 50%;

+ 132 - 7
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -119,7 +119,7 @@ export class HushijiandanComponent implements OnInit {
119 119
           });
120 120
           this.mainService
121 121
             .coopConfig("setOrders", postData)
122
-            .subscribe((result) => {});
122
+            .subscribe((result) => { });
123 123
         }, 500);
124 124
       },
125 125
     };
@@ -230,6 +230,27 @@ export class HushijiandanComponent implements OnInit {
230 230
   specimenWorkOrderMsg: any = {}; //急标普标数量&信息
231 231
   jpDrugsWKOMsg: any = {}; //药品静配提示信息
232 232
 
233
+  // 获取报修区域(所属院区)
234
+  areas: any = [];//区域(所属院区)列表
235
+  getArea() {
236
+    this.areas = [];
237
+    this.mainService.fetchListBx('area', { idx: 0, sum: 1000 }).subscribe((result: any) => {
238
+      if (result.status == 200) {
239
+        this.areas = result.list;
240
+      }
241
+    });
242
+  }
243
+  //根据区域(所属院区)获取地点(楼栋)
244
+  places: any = [];//地点(楼栋)列表
245
+  getPlace(buildingId) {
246
+    this.places = [];
247
+    this.mainService.fetchListBx('place', { idx: 0, sum: 1000, place: { area: { id: buildingId } } }).subscribe((result: any) => {
248
+      if (result.status == 200) {
249
+        this.places = result.list;
250
+      }
251
+    });
252
+  }
253
+
233 254
   btnLoading: boolean = false; //确认按钮loading状态
234 255
   workOrderRemark = ""; //备注
235 256
   workOrderRemark1 = ""; //备注
@@ -379,6 +400,17 @@ export class HushijiandanComponent implements OnInit {
379 400
   closeModelHistory(e) {
380 401
     this.historyPromptModalShow = JSON.parse(e).show;
381 402
   }
403
+  // 查看报修信息弹窗
404
+  bxPromptModalShow = false; //弹窗开关
405
+  bData = ""; //查看详情携带所有数据
406
+  viewBx(data) {
407
+    this.bData = data;
408
+    this.bxPromptModalShow = true;
409
+  }
410
+  // 关闭报修信息弹窗
411
+  closeModelBx(e) {
412
+    this.bxPromptModalShow = JSON.parse(e).show;
413
+  }
382 414
   // 护士端患者信息列表,鼠标移入姓名展示最近一条检查信息
383 415
   recentInfo = "";
384 416
   recentInfoTimer = null;
@@ -647,11 +679,11 @@ export class HushijiandanComponent implements OnInit {
647 679
       data,
648 680
       data.focusPatient === 0
649 681
         ? "您将设置患者【" +
650
-            data.patientName +
651
-            "】为重点关注,后期此患者的相关检查将会自动建单通知支助中心"
682
+        data.patientName +
683
+        "】为重点关注,后期此患者的相关检查将会自动建单通知支助中心"
652 684
         : "您将取消设置患者【" +
653
-            data.patientName +
654
-            "】为重点关注,后期此患者的相关检查将不会自动建单通知支助中心"
685
+        data.patientName +
686
+        "】为重点关注,后期此患者的相关检查将不会自动建单通知支助中心"
655 687
     );
656 688
   }
657 689
   // 通用提示模态框
@@ -1066,6 +1098,15 @@ export class HushijiandanComponent implements OnInit {
1066 1098
       targetOffice: [null, [this.targetOfficeShortCutValidator1]],
1067 1099
       originOffice: [null, [this.originOfficeShortCutValidator1]],
1068 1100
     });
1101
+    //新增报修
1102
+    this.bxForm = this.fb.group({
1103
+      name: [null, [Validators.required]],
1104
+      phone: [null, [Validators.required]],
1105
+      hospital: [null, [Validators.required]],
1106
+      building: [null, [Validators.required]],
1107
+      address: [null, [Validators.required]],
1108
+      content: [null, [Validators.required]],
1109
+    });
1069 1110
   }
1070 1111
   //创建自定义校验规则dateValidator,用于复选框组校验时调用。
1071 1112
   // 起点科室校验
@@ -1871,6 +1912,7 @@ export class HushijiandanComponent implements OnInit {
1871 1912
       });
1872 1913
   }
1873 1914
   shortcutForm: FormGroup; //一键发起建单表单
1915
+  bxForm: FormGroup; //报修表单
1874 1916
   // 一键建单校验
1875 1917
   // 起点科室校验
1876 1918
   originOfficeShortCutValidator = (
@@ -2232,7 +2274,63 @@ export class HushijiandanComponent implements OnInit {
2232 2274
     this.checkedTableType = type;
2233 2275
     if (type === "historySpecimen") {
2234 2276
       this.getHistorySpecimen();
2235
-    }
2277
+    } else if (type === "bxlb") {
2278
+      this.getBxlb();
2279
+    } else if (type === "kjbx") {
2280
+      // 获取报修的区域(所属院区)
2281
+      this.getArea();
2282
+      this.bxForm.controls.name.setValue(this.loginUser.name);
2283
+      this.bxForm.controls.phone.setValue(this.loginUser.phone);
2284
+      this.bxForm.controls.hospital.setValue(null);
2285
+      this.bxForm.controls.building.setValue(null);
2286
+      this.bxForm.controls.address.setValue(null);
2287
+      this.bxForm.controls.content.setValue(null);
2288
+    }
2289
+  }
2290
+  //提交报修
2291
+  bxLoading = false;
2292
+  submitBxForm() {
2293
+    for (const i in this.bxForm.controls) {
2294
+      this.bxForm.controls[i].markAsDirty();
2295
+      this.bxForm.controls[i].updateValueAndValidity();
2296
+    }
2297
+    this.bxLoading = true;
2298
+    this.mainService.wxbx({}).subscribe(result => {
2299
+      if ((result as any).status = 200) {
2300
+        let bxcode = (result as any).data;//生成微信报修号
2301
+        let postData = {
2302
+          verification: "true",
2303
+          incident: {
2304
+            address: this.bxForm.controls.address.value,
2305
+            areaId: this.bxForm.controls.hospital.value,
2306
+            contacts: this.bxForm.controls.name.value,
2307
+            contactsInformation: this.bxForm.controls.phone.value,
2308
+            description: this.bxForm.controls.content.value,
2309
+            placeId: this.bxForm.controls.building.value,
2310
+            requester: { account: this.loginUser.account },
2311
+            sourceType: "wechatUserIncident",
2312
+            fileUrl: "url",
2313
+            bxcode
2314
+          },
2315
+          loginUser: {
2316
+            account: this.loginUser.account,
2317
+            id: this.loginUser.id
2318
+          }
2319
+        };
2320
+        this.mainService.addWxIncident(postData).subscribe(res => {
2321
+          this.bxLoading = false;
2322
+          if ((res as any).state = 200) {
2323
+            this.showPromptModal("提交", true, "");
2324
+            this.checkTable('bxlb');
2325
+          }else{
2326
+            this.showPromptModal("提交", false, "");
2327
+          }
2328
+        })
2329
+      }else{
2330
+        this.bxLoading = false;
2331
+        this.showPromptModal("提交", false, "");
2332
+      }
2333
+    })
2236 2334
   }
2237 2335
 
2238 2336
   // 意见箱表格数据
@@ -2306,6 +2404,33 @@ export class HushijiandanComponent implements OnInit {
2306 2404
         this.historySpecimenListLength = data.totalNum || 0;
2307 2405
       });
2308 2406
   }
2407
+  // 报修列表查询表格数据
2408
+  bxlbList: any = [];
2409
+  bxlbPageIndex: number = 1; //表格当前页码
2410
+  bxlbPageSize: number = 10; //表格每页展示条数
2411
+  bxlbListLength: number = 10; //表格总数据量
2412
+  bxlbCodeSearchInp: string = ""; //标本编码搜索
2413
+  bxlbParentSearchInp: string = ""; //患者信息搜索
2414
+  bxlbLoading = false;
2415
+  getBxlb(idx?) {
2416
+    if (idx) {
2417
+      this.bxlbPageIndex = 1;
2418
+    }
2419
+    let current = JSON.parse(localStorage.getItem("user"));
2420
+    this.bxlbLoading = true;
2421
+    this.mainService
2422
+      .listWxIncident({
2423
+        "assignee": current.user.account,
2424
+        "state": 0,
2425
+        "idx": this.bxlbPageIndex - 1,
2426
+        "sum": this.bxlbPageSize
2427
+      })
2428
+      .subscribe((data: any) => {
2429
+        this.bxlbLoading = false;
2430
+        this.bxlbList = data.data || [];
2431
+        this.bxlbListLength = data.resultCount || 0;
2432
+      });
2433
+  }
2309 2434
 
2310 2435
   // 意见箱-查看模态框
2311 2436
   adviceModal: boolean = false;
@@ -2433,7 +2558,7 @@ export class HushijiandanComponent implements OnInit {
2433 2558
           if (
2434 2559
             that.adviceList.length == 1 &&
2435 2560
             that.advicePageIndex ==
2436
-              Math.ceil(that.adviceListLength / that.advicePageSize)
2561
+            Math.ceil(that.adviceListLength / that.advicePageSize)
2437 2562
           ) {
2438 2563
             that.adviceListLength--;
2439 2564
             that.advicePageIndex = Math.ceil(