Browse Source

feat: 护士端报修功能

seimin 10 months ago
parent
commit
71405d9788

+ 1 - 1
proxy.conf.json

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

+ 8 - 2
src/app/services/main.service.ts

@@ -538,9 +538,9 @@ export class MainService {
538
       headers: this.headers,
538
       headers: this.headers,
539
     });
539
     });
540
   }
540
   }
541
-  //获取微信报修ID
541
+  //获取工单单号
542
   wxbx(data) {
542
   wxbx(data) {
543
-    return this.http.post(host.host + "/itsm/restful/wxbx", data, {
543
+    return this.http.post(host.host + "/itsm/restful/sj", data, {
544
       headers: this.headers,
544
       headers: this.headers,
545
     });
545
     });
546
   }
546
   }
@@ -562,6 +562,12 @@ export class MainService {
562
       headers: this.headers,
562
       headers: this.headers,
563
     });
563
     });
564
   }
564
   }
565
+  //修改用户
566
+  saveUser(data) {
567
+    return this.http.post(host.host + "/itsm/user/saveUser", data, {
568
+      headers: this.headers,
569
+    });
570
+  }
565
   //复制院区
571
   //复制院区
566
   copyHosTaskType(data) {
572
   copyHosTaskType(data) {
567
     return this.http.post(host.host + "/api/copyHosTaskType", data, {
573
     return this.http.post(host.host + "/api/copyHosTaskType", data, {

+ 37 - 0
src/app/share/dialog-bx/dialog-bx.component.html

@@ -0,0 +1,37 @@
1
+<div class="detail" *ngIf="delModal">
2
+  <div class="modalBody">
3
+    <div class="title">提示<i class="icon_transport transport-guanbi" (click)="hideDelModal()"></i></div>
4
+    <div class="content">
5
+      <div class="top display_flex justify-content_flex-center align-items_center">
6
+        您是否将以下信息设置为常用信息
7
+      </div>
8
+      <div nz-row class="info">
9
+        <div class="left" nz-col nzSpan="12">
10
+          <div class="item display_flex  justify-content_space-between align-items_flex-start">
11
+            <span>联系人</span>
12
+            <span>{{validateBxForm.value.contacts || ''}}</span>
13
+          </div>
14
+          <div class="item display_flex  justify-content_space-between align-items_flex-start">
15
+            <span>联系电话</span>
16
+            <span>{{validateBxForm.value.contactsInformation || ''}}</span>
17
+          </div>
18
+        </div>
19
+        <div class="right" nz-col nzSpan="12">
20
+          <div class="item display_flex  justify-content_space-between align-items_flex-start">
21
+            <span>楼栋</span>
22
+            <span>{{deptDto.place?.area?.area}}</span>
23
+          </div>
24
+          <div class="item display_flex  justify-content_space-between align-items_flex-start">
25
+            <span>楼层</span>
26
+            <span>{{deptDto.place?.place}}</span>
27
+          </div>
28
+        </div>
29
+      </div>
30
+    </div>
31
+    <div class="display_flex justify-content_flex-center">
32
+      <button nz-button nzType="primary" (click)="confirmDel()" [nzLoading]="btnLoading">{{confirmTxt}}</button>
33
+      <button class="btn cancel ml8" nz-button nzType="default" (click)="cancel()" [nzLoading]="cancenlLoading">{{cancelTxt}}</button>
34
+    </div>
35
+  </div>
36
+</div>
37
+

+ 155 - 0
src/app/share/dialog-bx/dialog-bx.component.less

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

+ 41 - 0
src/app/share/dialog-bx/dialog-bx.component.ts

@@ -0,0 +1,41 @@
1
+import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
2
+@Component({
3
+  selector: "app-dialog-bx",
4
+  templateUrl: "./dialog-bx.component.html",
5
+  styleUrls: ["./dialog-bx.component.less"],
6
+})
7
+export class DialogBxComponent implements OnInit {
8
+  @Output() hideDelModalEvent = new EventEmitter<any>();
9
+  @Output() confirmDelEvent = new EventEmitter<any>();
10
+  @Output() cancelDelEvent = new EventEmitter<any>();
11
+  @Input() btnLoading: boolean = false;
12
+  @Input() cancenlLoading: boolean = false;
13
+  @Input() delModal: boolean = false;
14
+  @Input() confirmTxt: string = "是";
15
+  @Input() cancelTxt: string = "否";
16
+  @Input() deptDto: object = {};
17
+  @Input() validateBxForm: object = {};
18
+  constructor() {}
19
+
20
+  officeInfo:any = {}
21
+
22
+  ngOnInit() {
23
+    console.log(this.deptDto);
24
+    console.log(this.validateBxForm);
25
+  }
26
+
27
+  // 隐藏
28
+  hideDelModal(e: string) {
29
+    this.hideDelModalEvent.emit(e);
30
+  }
31
+
32
+  // 确认
33
+  confirmDel() {
34
+    this.confirmDelEvent.emit();
35
+  }
36
+
37
+  // 取消|否
38
+  cancel() {
39
+    this.cancelDelEvent.emit();
40
+  }
41
+}

+ 1 - 1
src/app/share/mask/mask.component.less

@@ -5,5 +5,5 @@
5
   width: 100vw;
5
   width: 100vw;
6
   height: 100vh;
6
   height: 100vh;
7
   background-color: rgba(0, 0, 0, 0.4);
7
   background-color: rgba(0, 0, 0, 0.4);
8
-  z-index: 99;
8
+  z-index: 9999;
9
 }
9
 }

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

@@ -19,6 +19,7 @@ import { DateTransformPipe } from '../pipes/date-transform.pipe';
19
 import { AppraiseDetailComponent } from './appraise-detail/appraise-detail.component';
19
 import { AppraiseDetailComponent } from './appraise-detail/appraise-detail.component';
20
 import { OrderDetailComponent } from './order-detail/order-detail.component';
20
 import { OrderDetailComponent } from './order-detail/order-detail.component';
21
 import { DialogDeleteComponent } from './dialog-delete/dialog-delete.component';
21
 import { DialogDeleteComponent } from './dialog-delete/dialog-delete.component';
22
+import { DialogBxComponent } from './dialog-bx/dialog-bx.component';
22
 import { DialogSurgeryComponent } from './dialog-surgery/dialog-surgery.component';
23
 import { DialogSurgeryComponent } from './dialog-surgery/dialog-surgery.component';
23
 import { MaskComponent } from './mask/mask.component';
24
 import { MaskComponent } from './mask/mask.component';
24
 import { GenerateFloorComponent } from './generate-floor/generate-floor.component';
25
 import { GenerateFloorComponent } from './generate-floor/generate-floor.component';
@@ -66,6 +67,7 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
66
     OutgoingRecordDetailComponent,
67
     OutgoingRecordDetailComponent,
67
     DateTransformPipe,
68
     DateTransformPipe,
68
     DialogDeleteComponent,
69
     DialogDeleteComponent,
70
+    DialogBxComponent,
69
     DialogSurgeryComponent,
71
     DialogSurgeryComponent,
70
     MaskComponent,
72
     MaskComponent,
71
     GenerateFloorComponent,
73
     GenerateFloorComponent,
@@ -123,6 +125,7 @@ import { OutgoingRecordDetailComponent } from './outgoing-record-detail/outgoing
123
     OverlayscrollbarsModule,
125
     OverlayscrollbarsModule,
124
     DateTransformPipe,
126
     DateTransformPipe,
125
     DialogDeleteComponent,
127
     DialogDeleteComponent,
128
+    DialogBxComponent,
126
     DialogSurgeryComponent,
129
     DialogSurgeryComponent,
127
     MaskComponent,
130
     MaskComponent,
128
     GenerateFloorComponent,
131
     GenerateFloorComponent,

+ 70 - 21
src/app/views/hushijiandan/hushijiandan.component.html

@@ -1463,14 +1463,7 @@
1463
                                       >
1463
                                       >
1464
                                         <tbody>
1464
                                         <tbody>
1465
                                           <tr
1465
                                           <tr
1466
-                                            (click)="
1467
-                                              showBxModal(
1468
-                                                data,
1469
-                                                '您的报修为“' +
1470
-                                                  data.content +
1471
-                                                  '” 是否确认报修?'
1472
-                                              )
1473
-                                            "
1466
+                                            (click)="showBxModal(data)"
1474
                                             *ngFor="
1467
                                             *ngFor="
1475
                                               let data of quickBxlbList;
1468
                                               let data of quickBxlbList;
1476
                                               let i = index
1469
                                               let i = index
@@ -2112,14 +2105,12 @@
2112
                   </div>
2105
                   </div>
2113
 
2106
 
2114
                   <div class="btns">
2107
                   <div class="btns">
2115
-                    <button
2116
-                      nz-button
2117
-                      nzType="primary"
2118
-                      nzGhost
2119
-                      (click)="getBxlb(true)"
2120
-                    >
2108
+                    <button nz-button nzType="primary" nzGhost (click)="getBxlb(true)">
2121
                       搜索
2109
                       搜索
2122
                     </button>
2110
                     </button>
2111
+                    <button nz-button nzType="primary" nzGhost (click)="showBxModal()">
2112
+                      新增
2113
+                    </button>
2123
                   </div>
2114
                   </div>
2124
                 </div>
2115
                 </div>
2125
                 <div class="table">
2116
                 <div class="table">
@@ -2161,7 +2152,7 @@
2161
                           <td>
2152
                           <td>
2162
                             <!-- <button (click)="viewBx(data)">查看</button> -->
2153
                             <!-- <button (click)="viewBx(data)">查看</button> -->
2163
                             <button class="btn1 mr8 mb8 mt8" (click)="detailBx(data)">查看</button>
2154
                             <button class="btn1 mr8 mb8 mt8" (click)="detailBx(data)">查看</button>
2164
-                            <button class="btn1 mr8 mb8 mt8" (click)="showAppraiseBx(data.id)" *ngIf="data.state.value == 'close' && !data.wxdegree">评价</button>
2155
+                            <button class="btn1 mr8 mb8 mt8" (click)="showAppraiseBx(data.id)" *ngIf="data.state && data.state.value == 'close' && !data.wxdegree">评价</button>
2165
                           </td>
2156
                           </td>
2166
                         </tr>
2157
                         </tr>
2167
                       </tbody>
2158
                       </tbody>
@@ -3673,6 +3664,18 @@
3673
     ></i>
3664
     ></i>
3674
   </div>
3665
   </div>
3675
 </div>
3666
 </div>
3667
+<!-- 报修提示模态框 -->
3668
+<app-dialog-bx
3669
+  *ngIf="reqModal"
3670
+  [delModal]="reqModal"
3671
+  (hideDelModalEvent)="hideReqModal()"
3672
+  [btnLoading]="btnLoading"
3673
+  [cancenlLoading]="cancenlLoading"
3674
+  [deptDto]="deptDto"
3675
+  [validateBxForm]="validateBxForm"
3676
+  (confirmDelEvent)="confirmReq()"
3677
+  (cancelDelEvent)="cancelReq()"
3678
+></app-dialog-bx>
3676
 <!-- 删除意见模态框 -->
3679
 <!-- 删除意见模态框 -->
3677
 <app-dialog-delete
3680
 <app-dialog-delete
3678
   [delModal]="delAdviceModal"
3681
   [delModal]="delAdviceModal"
@@ -3724,21 +3727,67 @@
3724
 >
3727
 >
3725
   <div class="modalBody">
3728
   <div class="modalBody">
3726
     <div class="title">
3729
     <div class="title">
3727
-      提示<i
3730
+      一键报修<i
3728
         class="icon_transport transport-guanbi"
3731
         class="icon_transport transport-guanbi"
3729
         (click)="hideBxModal()"
3732
         (click)="hideBxModal()"
3730
       ></i>
3733
       ></i>
3731
     </div>
3734
     </div>
3732
-    <div class="content">
3733
-      <div class="icon"><i class="icon_transport transport-wenhao"></i></div>
3734
-      <div class="defeat">{{ tipsMsg2 }}</div>
3735
-    </div>
3735
+    <overlay-scrollbars #osComponentRef5 class="content">
3736
+      <form nz-form [formGroup]="validateBxForm" class="bxFormAdd" (ngSubmit)="confirmBx()">
3737
+        <nz-form-item>
3738
+          <nz-form-label [nzSm]="4" [nzXs]="4" nzRequired nzFor="description">故障描述</nz-form-label>
3739
+          <nz-form-control>
3740
+            <nz-input-group style="width:442px;">
3741
+              <textarea nz-input formControlName="description" rows="4" placeholder="请输入故障描述"></textarea>
3742
+            </nz-input-group>
3743
+          </nz-form-control>
3744
+        </nz-form-item>
3745
+        <nz-form-item>
3746
+          <nz-form-label [nzSm]="4" [nzXs]="4" nzRequired nzFor="contacts">联系人</nz-form-label>
3747
+          <nz-form-control style="display: inline-block;">
3748
+            <nz-input-group>
3749
+              <input style="width:168px;" class="mr8" nz-input formControlName="contacts" placeholder="请输入联系人" />
3750
+            </nz-input-group>
3751
+          </nz-form-control>
3752
+
3753
+          <nz-form-label nzRequired nzFor="contactsInformation">联系电话</nz-form-label>
3754
+          <nz-form-control style="display: inline-block;">
3755
+            <nz-input-group>
3756
+              <input style="width:185px;" nz-input formControlName="contactsInformation" placeholder="请输入联系电话" />
3757
+            </nz-input-group>
3758
+          </nz-form-control>
3759
+        </nz-form-item>
3760
+        <nz-form-item style="display: inline-block;vertical-align:bottom;" class="last">
3761
+          <nz-form-label [nzSm]="4" [nzXs]="4" nzRequired nzFor="building">详细地址</nz-form-label>
3762
+          <nz-form-control style="display: inline-block;">
3763
+            <nz-select [nzDropdownMatchSelectWidth]="false" style="width:120px;" class="mr8" type="building"
3764
+              nzShowSearch formControlName="building" nzPlaceHolder="请选择楼栋"
3765
+              (ngModelChange)="changeBuilding($event)">
3766
+              <nz-option [nzLabel]="data.area" [nzValue]="data.id" *ngFor="let data of buildings">
3767
+              </nz-option>
3768
+            </nz-select>
3769
+          </nz-form-control>
3770
+          <nz-form-label [nzSm]="4" [nzXs]="4" nzRequired nzFor="floor" hidden></nz-form-label>
3771
+          <nz-form-control style="display: inline-block;">
3772
+            <nz-select [nzDropdownMatchSelectWidth]="false" style="width:120px;" class="mr8" type="floor" nzShowSearch
3773
+             formControlName="floor" nzPlaceHolder="请选择楼层" [nzLoading]="floorLoading">
3774
+              <nz-option [nzLabel]="data.place" [nzValue]="data.id" *ngFor="let data of floors"></nz-option>
3775
+            </nz-select>
3776
+          </nz-form-control>
3777
+          <nz-form-label [nzSm]="4" [nzXs]="4" nzRequired nzFor="officeAddress" hidden></nz-form-label>
3778
+          <nz-form-control style="display: inline-block;">
3779
+            <nz-input-group>
3780
+              <input style="width:185px;" nz-input formControlName="officeAddress" placeholder="请输入详细位置" />
3781
+            </nz-input-group>
3782
+          </nz-form-control>
3783
+        </nz-form-item>
3784
+      </form>
3785
+    </overlay-scrollbars>
3736
     <div class="display_flex justify-content_flex-center">
3786
     <div class="display_flex justify-content_flex-center">
3737
       <button
3787
       <button
3738
         nz-button
3788
         nz-button
3739
         nzType="primary"
3789
         nzType="primary"
3740
         (click)="confirmBx()"
3790
         (click)="confirmBx()"
3741
-        [nzLoading]="loading6"
3742
       >
3791
       >
3743
         确认
3792
         确认
3744
       </button>
3793
       </button>

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

@@ -1884,9 +1884,24 @@
1884
   background: rgba(0, 0, 0, 0.4);
1884
   background: rgba(0, 0, 0, 0.4);
1885
   z-index: 99;
1885
   z-index: 99;
1886
 
1886
 
1887
+  .bxFormAdd{
1888
+    padding: 8px 8px 4px;
1889
+  }
1890
+
1891
+  ::ng-deep .ant-form-item{
1892
+    margin-bottom: 8px!important;
1893
+  }
1894
+
1895
+  ::ng-deep .ant-form-item.last{
1896
+    margin-bottom: 0!important;
1897
+  }
1898
+
1899
+  ::ng-deep .ant-form-item-label{
1900
+    text-align: left!important;
1901
+  }
1902
+
1887
   .modalBody {
1903
   .modalBody {
1888
-    width: 500px;
1889
-    height: 250px;
1904
+    width: 590px;
1890
     background: #fff;
1905
     background: #fff;
1891
     border-radius: 5px;
1906
     border-radius: 5px;
1892
     padding: 10px 20px;
1907
     padding: 10px 20px;
@@ -1910,8 +1925,7 @@
1910
     }
1925
     }
1911
 
1926
 
1912
     .content {
1927
     .content {
1913
-      width: 460px;
1914
-      height: 147px;
1928
+      width: 550px;
1915
       background: #f9fafb;
1929
       background: #f9fafb;
1916
       border: 1px solid @hs_border_color;
1930
       border: 1px solid @hs_border_color;
1917
       border-radius: 5px;
1931
       border-radius: 5px;

+ 218 - 43
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -74,6 +74,11 @@ export class HushijiandanComponent implements OnInit {
74
     static: false,
74
     static: false,
75
   })
75
   })
76
   osComponentRef4: OverlayScrollbarsComponent;
76
   osComponentRef4: OverlayScrollbarsComponent;
77
+  @ViewChild("osComponentRef5", {
78
+    read: OverlayScrollbarsComponent,
79
+    static: false,
80
+  })
81
+  osComponentRef5: OverlayScrollbarsComponent;
77
   @ViewChild("osComponentRef6", {
82
   @ViewChild("osComponentRef6", {
78
     read: OverlayScrollbarsComponent,
83
     read: OverlayScrollbarsComponent,
79
     static: false,
84
     static: false,
@@ -1086,15 +1091,107 @@ export class HushijiandanComponent implements OnInit {
1086
       }
1091
       }
1087
     );
1092
     );
1088
   }
1093
   }
1094
+  // 初始化新增form表单
1095
+  initBxForm(content) {
1096
+    this.validateBxForm = this.fb.group({
1097
+      description: [content || null, [Validators.required]],
1098
+      building: [null, [Validators.required]],
1099
+      floor: [null, [Validators.required]],
1100
+      officeAddress: [null, [Validators.required]],
1101
+      contacts: [this.loginUser.name, [Validators.required]],
1102
+      contactsInformation: [this.loginUser.phone, [Validators.required]],
1103
+    });
1104
+    this.getDeptByCode(this.currentDept.pcode);
1105
+  }
1106
+  // 根据科室Code获取详情
1107
+  deptDto:any = {};
1108
+  getDeptByCode(code){
1109
+    this.mainService
1110
+      .fetchListBx("department", {
1111
+        idx: 0,
1112
+        sum: 1,
1113
+        department: {
1114
+          eqCode: code,
1115
+        }
1116
+      })
1117
+      .subscribe((data:any) => {
1118
+        let list = data.list || [];
1119
+        this.deptDto = list.length > 0 ? list[0] : {};
1120
+        console.log(this.deptDto);
1121
+        this.changeHosp();
1122
+        // 回显楼栋
1123
+        if(this.deptDto.place){
1124
+          this.validateBxForm.controls.building.setValue(this.deptDto.place.area.id);
1125
+        }
1126
+
1127
+        // 回显楼层
1128
+        if(this.deptDto.place){
1129
+          this.validateBxForm.controls.floor.setValue(this.deptDto.place.id);
1130
+        }
1131
+      });
1132
+  }
1133
+  // 切换院区选项
1134
+  buildings: any = []; //楼栋
1135
+  changeHosp() {
1136
+    this.validateBxForm.controls.building.setValue(null);
1137
+    this.buildings = [];
1138
+    let data = {
1139
+      idx: 0,
1140
+      sum: 9999,
1141
+      area: {
1142
+        branch: this.deptDto.branch,
1143
+      }
1144
+    };
1145
+    this.mainService
1146
+      .fetchListBx("area", data)
1147
+      .subscribe((data:any) => {
1148
+        this.buildings = data.list || [];
1149
+        this.floors = [];
1150
+        this.message.remove(this.maskFlag);
1151
+        this.maskFlag = false;
1152
+      });
1153
+  }
1154
+
1155
+  // 切换楼栋信息
1156
+  floors: Array<any> = []; //楼层
1157
+  floorLoading: boolean = false;
1158
+  changeBuilding(buildingId) {
1159
+    if(!buildingId){
1160
+      return;
1161
+    }
1162
+    this.validateBxForm.controls.floor.setValue(null);
1163
+    this.validateBxForm.controls.officeAddress.setValue(null);
1164
+    this.floors = [];
1165
+
1166
+    let data = {
1167
+      idx: 0,
1168
+      sum: 9999,
1169
+      place: {
1170
+        area: { id: buildingId },
1171
+      }
1172
+    };
1173
+    this.floorLoading = true;
1174
+    this.mainService
1175
+      .fetchListBx("place", data)
1176
+      .subscribe((data:any) => {
1177
+        this.floorLoading = false;
1178
+        this.message.remove(this.maskFlag);
1179
+        this.maskFlag = false;
1180
+        this.floors = data.list || [];
1181
+      });
1182
+  }
1089
   // 是否确定报修模态框
1183
   // 是否确定报修模态框
1090
   bxModal: boolean = false; //模态框
1184
   bxModal: boolean = false; //模态框
1091
   loading6 = false;
1185
   loading6 = false;
1092
-  tipsMsg2: string; //提示框信息
1093
   coopBx: any; //当前操作列
1186
   coopBx: any; //当前操作列
1094
-  showBxModal(data: any, tipsMsg2: string) {
1187
+  validateBxForm: FormGroup; //新增/编辑表单
1188
+  showBxModal(data: any) {
1189
+    this.maskFlag = this.message.loading("正在加载中..", {
1190
+      nzDuration: 0,
1191
+    }).messageId;
1095
     this.bxModal = true;
1192
     this.bxModal = true;
1096
-    this.coopBx = data;
1097
-    this.tipsMsg2 = tipsMsg2;
1193
+    this.coopBx = data || {};
1194
+    this.initBxForm(this.coopBx.content);
1098
   }
1195
   }
1099
   // 隐藏模态框
1196
   // 隐藏模态框
1100
   hideBxModal() {
1197
   hideBxModal() {
@@ -1102,46 +1199,110 @@ export class HushijiandanComponent implements OnInit {
1102
   }
1199
   }
1103
   // 确认
1200
   // 确认
1104
   confirmBx() {
1201
   confirmBx() {
1105
-    this.loading6 = true;
1106
-    this.mainService.wxbx({}).subscribe((result) => {
1107
-      if ((result as any).status == 200) {
1108
-        let bxcode = (result as any).data; //生成微信报修号
1109
-        let postData: any = {
1110
-          verification: "true",
1111
-          incident: {
1112
-            branch:this.loginUser.currentHospital.id,
1113
-            deptId:this.loginUser.dept.id,
1114
-            // contacts: this.loginUser.name,
1115
-            // contactsInformation: this.loginUser.phone,
1116
-            description: this.coopBx.content,
1117
-            requester: { account: this.loginUser.account },
1118
-            sourceType: "wechatUserIncident",
1119
-            fileUrl: "url",
1120
-            bxcode,
1121
-          },
1122
-          loginUser: {
1123
-            account: this.loginUser.account,
1124
-            id: this.loginUser.id,
1125
-          },
1126
-        };
1127
-        if (this.coopBx.category) {
1128
-          postData.incident.categoryId = this.coopBx.category.id;
1129
-        }
1130
-        this.mainService.addWxIncident(postData).subscribe((res) => {
1131
-          this.loading6 = false;
1132
-          this.bxModal = false;
1133
-          if ((res as any).state == 200) {
1134
-            this.showPromptModal("提交", true, "");
1135
-            this.checkTable("bxlb");
1136
-          } else {
1137
-            this.showPromptModal("提交", false, (res as any).msg);
1138
-          }
1139
-        });
1140
-      } else {
1141
-        this.loading6 = false;
1142
-        this.showPromptModal("提交", false, "");
1202
+    for (const i in this.validateBxForm.controls) {
1203
+      this.validateBxForm.controls[i].markAsDirty();
1204
+      this.validateBxForm.controls[i].updateValueAndValidity();
1205
+    }
1206
+    if (this.validateBxForm.invalid){
1207
+      this.message.error('请填写必填字段!');
1208
+      return;
1209
+    };
1210
+    this.showReqModal();
1211
+  }
1212
+
1213
+  // 报修
1214
+  // type, 1是,0否
1215
+  async confirmBxNext(type){
1216
+    this.maskFlag = this.message.loading("正在加载中..", {
1217
+      nzDuration: 0,
1218
+    }).messageId;
1219
+    if(type == 1){
1220
+      this.btnLoading = true;
1221
+      let loginUser:any = {
1222
+        account: this.loginUser.account,
1223
+      };
1224
+      if(this.deptDto.branch){
1225
+        loginUser.branch = { id: this.deptDto.branch };
1143
       }
1226
       }
1144
-    });
1227
+      if(this.deptDto){
1228
+        loginUser.dept = {id: this.deptDto.id};
1229
+      }
1230
+      if(this.validateBxForm.value.contacts){
1231
+        loginUser.name = this.validateBxForm.value.contacts;
1232
+      }
1233
+      if(this.validateBxForm.value.floor){
1234
+        loginUser.place = {id: this.validateBxForm.value.floor, area: { id: this.validateBxForm.value.building }};
1235
+      }
1236
+      if(this.validateBxForm.value.officeAddress){
1237
+        loginUser.houseNumber = this.validateBxForm.value.officeAddress;
1238
+      }
1239
+      if(this.validateBxForm.value.contactsInformation){
1240
+        loginUser.phone = this.validateBxForm.value.contactsInformation;
1241
+      }
1242
+      let result:any = await this.mainService.saveUser({loginUser}).toPromise();
1243
+      console.log(result);
1244
+      if(result.state != 200){
1245
+        this.hideReqModal();
1246
+        this.btnLoading = false;
1247
+        this.message.remove(this.maskFlag);
1248
+        this.maskFlag = false;
1249
+        this.message.error(result.msg);
1250
+        return;
1251
+      }
1252
+    }else{
1253
+      this.cancenlLoading = true;
1254
+    }
1255
+    this.mainService.getDictionaryByITSM({key: "incident_source", type: "list"}).subscribe((source:any) => {
1256
+      let incidentSourceList = source.data || [];
1257
+      let im = incidentSourceList.find(v => v.value === 'im');
1258
+      this.mainService.wxbx({}).subscribe((result) => {
1259
+        if ((result as any).status == 200) {
1260
+          let bxcode = (result as any).data; //生成微信报修号
1261
+          let postData: any = {
1262
+            incident: {
1263
+              "incidentsign": bxcode,
1264
+              "deleteFlag": 0,
1265
+              "department": { id: this.deptDto.id },
1266
+              "contactsInformation": this.validateBxForm.value.contactsInformation,
1267
+              "contacts": this.validateBxForm.value.contacts,
1268
+              "branch": this.deptDto.branch,
1269
+              "area": { id: this.validateBxForm.value.building },
1270
+              "place": { id: this.validateBxForm.value.floor },
1271
+              "houseNumber": this.validateBxForm.value.officeAddress,
1272
+              "source": im,
1273
+              "description": this.validateBxForm.value.description,
1274
+              "repairType": 2,
1275
+              "requester": this.loginUser,
1276
+              "acceptUser": this.loginUser,
1277
+            },
1278
+            loginUser: {
1279
+              account: this.loginUser.account,
1280
+              id: this.loginUser.id,
1281
+            }
1282
+          };
1283
+          if (this.coopBx.category) {
1284
+            postData.incident.category = this.coopBx.category;
1285
+          }
1286
+          this.mainService.addWxIncident(postData).subscribe((res) => {
1287
+            this.btnLoading = false;
1288
+            this.cancenlLoading = false;
1289
+            this.message.remove(this.maskFlag);
1290
+            this.maskFlag = false;
1291
+            this.bxModal = false;
1292
+            this.hideReqModal();
1293
+            if ((res as any).state == 200) {
1294
+              this.showPromptModal("提交", true, "");
1295
+              this.checkTable("bxlb");
1296
+            } else {
1297
+              this.showPromptModal("提交", false, (res as any).msg);
1298
+            }
1299
+          });
1300
+        } else {
1301
+          this.btnLoading = false;
1302
+          this.showPromptModal("提交", false, "");
1303
+        }
1304
+      });
1305
+    })
1145
   }
1306
   }
1146
 
1307
 
1147
   // 获取星级
1308
   // 获取星级
@@ -3825,6 +3986,20 @@ export class HushijiandanComponent implements OnInit {
3825
   hideDelAdviceModal() {
3986
   hideDelAdviceModal() {
3826
     this.delAdviceModal = false;
3987
     this.delAdviceModal = false;
3827
   }
3988
   }
3989
+  // 报修提示框
3990
+  reqModal: boolean = false;
3991
+  showReqModal() {
3992
+    this.reqModal = true;
3993
+  }
3994
+  confirmReq() {
3995
+    this.confirmBxNext(1);
3996
+  }
3997
+  cancelReq() {
3998
+    this.confirmBxNext(0);
3999
+  }
4000
+  hideReqModal() {
4001
+    this.reqModal = false;
4002
+  }
3828
   // 工单列表下拉筛选
4003
   // 工单列表下拉筛选
3829
   selectedType: null;
4004
   selectedType: null;
3830
   changeOrderSel(e) {
4005
   changeOrderSel(e) {