Quellcode durchsuchen

护士端报修功能修改

seimin vor 5 Monaten
Ursprung
Commit
69b17915f7

+ 0 - 70
src/app/components/incidentManagement/incident-create/incident-create.component copy.html

@@ -1,70 +0,0 @@
1
-<!--
2
- * @Author: seimin
3
- * @Date: 2024-10-24 13:47:40
4
- * @LastEditors: seimin
5
- * @LastEditTime: 2024-10-24 13:58:19
6
- * @Description: 创建
7
--->
8
-<div class="save display_flex justify-content_flex-center align-items_center add">
9
-  <div class="modalBody">
10
-    <div class="title">回访<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
11
-    <div class="content">
12
-      <overlay-scrollbars #osComponentRef1 class="workingArea">
13
-        <div class="tabs">
14
-          <div class="tab" *ngFor="let item of tabs" (click)="clickTbab(item)" [ngClass]="{ active: activeTabValue === item.value }">{{ item.name }}</div>
15
-        </div>
16
-        <div class="detail">
17
-          <ng-container *ngIf="activeTabValue === 1">
18
-            <!-- <app-incident-handle-repair [incidentData]="incidentData"></app-incident-handle-repair> -->
19
-          </ng-container>
20
-          <ng-container *ngIf="activeTabValue === 2">
21
-            <!-- <app-incident-handle-handle [incidentData]="incidentData"></app-incident-handle-handle> -->
22
-          </ng-container>
23
-        </div>
24
-      </overlay-scrollbars>
25
-      <form nz-form [formGroup]="validateForm" class="addForm">
26
-        <nz-form-item>
27
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="degree">满意度评价</nz-form-label>
28
-          <nz-form-control [nzSpan]="18" nzErrorTip="请选择满意度评价!">
29
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="degree" nzPlaceHolder="请选择满意度评价" nzServerSearch>
30
-              <ng-container *ngFor="let data of deferralDayList">
31
-                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
32
-              </ng-container>
33
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
34
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
35
-              </nz-option>
36
-            </nz-select>
37
-          </nz-form-control>
38
-        </nz-form-item>
39
-        <nz-form-item>
40
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="handleResult">回访处理结果</nz-form-label>
41
-          <nz-form-control [nzSpan]="18" nzErrorTip="请选择回访处理结果!">
42
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="handleResult" nzPlaceHolder="请选择回访处理结果" nzServerSearch>
43
-              <ng-container *ngFor="let data of repairTypeList">
44
-                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
45
-              </ng-container>
46
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
47
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
48
-              </nz-option>
49
-            </nz-select>
50
-          </nz-form-control>
51
-        </nz-form-item>
52
-        <nz-form-item>
53
-          <nz-form-label [nzSpan]="6" nzFor="visitRemarks" style="text-indent: 11px;">回访备注</nz-form-label>
54
-          <nz-form-control [nzSpan]="18" nzErrorTip="请输入回访备注!">
55
-            <nz-input-group>
56
-              <textarea formControlName="visitRemarks" nz-input rows="3" placeholder="请输入回访备注"></textarea>
57
-            </nz-input-group>
58
-          </nz-form-control>
59
-        </nz-form-item>
60
-      </form>
61
-    </div>
62
-    <div class="display_flex justify-content_flex-center">
63
-      <button nz-button nzType="primary" (click)="submitForm()"[nzLoading]="isLoading">确认</button>
64
-      <button nz-button nzType="default" class="btn cancel" (click)="hideModal()">取消</button>
65
-    </div>
66
-  </div>
67
-</div>
68
-
69
-<!-- 遮罩 -->
70
-<app-mask *ngIf="maskFlag"></app-mask>

+ 11 - 56
src/app/share/detail-bx/detail-bx.component.html

@@ -10,13 +10,17 @@
10 10
         </div>
11 11
         <div class="info" nz-row>
12 12
           <div nz-col nzSpan="8">报修类别:{{orderInfo.category?orderInfo.category.category:''}}</div>
13
-          <div nz-col nzSpan="8">报修地址:<ng-container *ngIf="orderInfo.place">{{ orderInfo.place.area.area }} {{ orderInfo.place.place }} {{ orderInfo.houseNumber }}</ng-container></div>
13
+          <div nz-col nzSpan="8">报修地址:<ng-container *ngIf="orderInfo.place">{{ orderInfo.place.building.buildingName }} {{ orderInfo.place.floorName }}层 {{ orderInfo.houseNumber }}</ng-container></div>
14 14
           <div nz-col nzSpan="24">报修内容:{{orderInfo.description}}</div>
15 15
           <div nz-col nzSpan="24">报修图片:
16
-            <app-image-viewer [imageUrl]="imgs_wechatRequesterIncident" *ngIf="imgs_wechatRequesterIncident.length"></app-image-viewer>
16
+            <div class="thumbList" *ngIf="imgs_wechatRequesterIncident.length > 0">
17
+              <div class="thumb" *ngFor="let item of imgs_wechatRequesterIncident;let index = index;" (click)="previewImageHandler(imgs_wechatRequesterIncident, index)"><img [src]="item.thumbFilePath" alt=""></div>
18
+            </div>
17 19
           </div>
18 20
           <div nz-col nzSpan="24">处理图片:
19
-            <app-image-viewer [imageUrl]="imgs_incident" *ngIf="imgs_incident.length"></app-image-viewer>
21
+            <div class="thumbList" *ngIf="imgs_incident.length > 0">
22
+              <div class="thumb" *ngFor="let item of imgs_incident;let index = index;" (click)="previewImageHandler(imgs_incident, index)"><img [src]="item.thumbFilePath" alt=""></div>
23
+            </div>
20 24
           </div>
21 25
           <div nz-col nzSpan="8">维修人:<ng-container *ngIf="orderInfo.handlingPersonnelUser">{{ orderInfo.handlingPersonnelUser.name }}</ng-container></div>
22 26
           <div nz-col nzSpan="8">维修人电话:<ng-container *ngIf="orderInfo.handlingPersonnelUser">{{ orderInfo.handlingPersonnelUser.phone }}</ng-container></div>
@@ -51,66 +55,14 @@
51 55
           <!-- 流程图 end -->
52 56
         </div>
53 57
       </div>
54
-      <div class="bottom" *ngIf="orderInfo.urgentDetails&&showCoop">
55
-        <div class="urgent">
56
-          <div>
57
-            <ng-container *ngIf="amplificationShow&&orderInfo.urgentDetails&&showCoop">
58
-                加急原因:{{orderInfo.urgentDetails.urgentReason}}
59
-              <button *ngIf="orderInfo.urgentDetails.checkStatus.id==329" class=" btn default" nz-button nzType="primary"
60
-                [nzLoading]="urgentLoading" nzGhost (click)="urgent()">确认加急</button>
61
-            </ng-container>
62
-          </div>
63
-          <div class="amplification">
64
-            <button
65
-              nz-button
66
-              nzType="primary"
67
-              class="btn default"
68
-              (click)="amplification()"
69
-            >
70
-              {{ amplificationShow ? "放大" : "还原" }}
71
-            </button>
72
-          </div>
73
-        </div>
74
-      </div>
75 58
     </div>
76 59
   </overlay-scrollbars>
77 60
   <div class="btns display_flex justify-content_flex-center">
78
-    <button nz-button nzType="primary" (click)="goToSummary()" *ngIf="orderInfo.duty && orderInfo.duty.addSummary == 1">汇总单</button>
61
+    <button nz-button nzType="primary" (click)="goToSummary()" *ngIf="orderInfo.state.value == 'close' && itsmSummarySheet.value == 1 && orderInfo.summaryId">汇总单</button>
79 62
     <button class=" btn cancel" nz-button nzType="default" (click)="close()">取消</button>
80 63
   </div>
81 64
 </div>
82 65
 
83
-<!-- 撤回工单 -->
84
-<div class="recallOrder" *ngIf="recallOrderShow">
85
-  <div class="modalBody">
86
-    <div class="title">提示<i class="icon_transport transport-guanbi" (click)="closeRecallOrderModal()"></i></div>
87
-    <div class="content">
88
-      <div class="icon"><i class="icon_transport transport-wenhao"></i></div>
89
-      <div class="defeat">您确认要撤回此工单吗?</div>
90
-    </div>
91
-    <div class="btns display_flex justify-content_flex-center">
92
-      <button nz-button nzType="primary" [nzLoading]='btnLoading' (click)="confirmRec()">确认</button>
93
-      <button nz-button nzType="primary" [nzLoading]='recLoading' nzGhost (click)="recAndDel()">撤回并删除</button>
94
-      <button class=" btn cancel" nz-button nzType="default" (click)="closeRecallOrderModal()">取消</button>
95
-    </div>
96
-  </div>
97
-</div>
98
-
99
-<!-- 删除工单 -->
100
-<div class="recallOrder delModel" *ngIf="delOrderShow">
101
-  <div class="modalBody">
102
-    <div class="title">提示<i class="icon_transport transport-guanbi" (click)="closeDelOrderModal()"></i></div>
103
-    <div class="content">
104
-      <div class="icon"><i class="icon_transport transport-wenhao"></i></div>
105
-      <div class="defeat">您确认要删除此工单吗?</div>
106
-    </div>
107
-    <div class="btns display_flex justify-content_flex-center">
108
-      <button nz-button nzType="primary" [nzLoading]='btnLoading' (click)="confirmDel()">确认</button>
109
-      <button class="btn cancel" nz-button nzType="default" (click)="closeDelOrderModal()">关闭</button>
110
-    </div>
111
-  </div>
112
-</div>
113
-
114 66
 <!-- 操作成功/失败提示框 -->
115 67
 <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
116 68
   [info]="promptInfo" (closeModel)="close()">
@@ -119,3 +71,6 @@
119 71
 <app-incident-details *ngIf="isShowIncidentDetails" (close)="closeIncidentDetails()" [incidentId]="orderInfo.id"></app-incident-details>
120 72
 <!-- 遮罩 -->
121 73
 <app-mask *ngIf="maskFlag"></app-mask>
74
+
75
+<!-- 图片预览 -->
76
+<app-image-viewer [imageUrl]="imgs" hidden *ngIf="isPreview" [isPreviewNow]="true" [initialViewIndex]="initialViewIndex"></app-image-viewer>

+ 21 - 0
src/app/share/detail-bx/detail-bx.component.less

@@ -13,6 +13,27 @@
13 13
   align-items: center;
14 14
 }
15 15
 
16
+.thumbList{
17
+  display: flex;
18
+  align-items: center;
19
+  flex-wrap: wrap;
20
+  gap: 8px;
21
+  .thumb{
22
+    width: 64px;
23
+    height: 64px;
24
+    padding: 4px;
25
+    border-radius: 4px;
26
+    border: 1px solid rgba(0,0,0,0.15);
27
+    img{
28
+      width: 100%;
29
+      height: 100%;
30
+      object-fit: cover;
31
+      object-position: center;
32
+      cursor: pointer;
33
+    }
34
+  }
35
+}
36
+
16 37
 .detail {
17 38
   width: 1000px;
18 39
   height: calc(100vh - 100px);

+ 46 - 143
src/app/share/detail-bx/detail-bx.component.ts

@@ -47,7 +47,11 @@ export class DetailBxComponent implements OnInit {
47 47
 
48 48
   isShowIncidentDetails:boolean = false;
49 49
 
50
+  hosId:any;
51
+
50 52
   ngOnInit() {
53
+    this.hosId = this.tool.getCurrentHospital().id;
54
+    this.getHospitalConfig();
51 55
     this.tool.getDeptDisplay().subscribe((result) => {
52 56
       if (result.status == 200) {
53 57
         this.deptDisplay = result.list[0].valueconfig;
@@ -85,22 +89,58 @@ export class DetailBxComponent implements OnInit {
85 89
     this.isShowIncidentDetails = false;
86 90
   }
87 91
 
92
+  // 获取院区配置信息
93
+  itsmSummarySheet:any = {};//是否需要填写汇总单
94
+  getHospitalConfig() {
95
+    let postData = {
96
+      idx: 0,
97
+      sum: 9999,
98
+      hospitalConfig: {
99
+        model: "itsm",
100
+        hosId: this.hosId,
101
+      },
102
+    }
103
+    this.mainService
104
+      .getFetchDataList("simple/data", "hospitalConfig", postData)
105
+      .subscribe((result) => {
106
+        let list = result.list || [];
107
+        this.itsmSummarySheet = list.find(v => v.key == 'itsmSummarySheet') || {};
108
+      });
109
+  }
110
+
88 111
   // 获取图片信息
89 112
   getImgsData(type) {
90 113
     let id = this.orderInfo.id;
91 114
     this.mainService
92
-      .listAttachment(type, id)
115
+      .getPreviewImage(type, id)
93 116
       .subscribe((res:any)=> {
94 117
         // this.imgs = ['https://img2.woyaogexing.com/2022/08/19/1f5e056b1d076920!400x400.jpg','https://img2.woyaogexing.com/2022/08/19/359346943c3c489f!400x400.jpg']
95
-        for (var i = 0; i < res.data.length; i++) {
96
-          this['imgs_' + type].push(location.origin + '/file' + res.data[i].relativeFilePath);
97
-        }
118
+        res.data.forEach(v => {
119
+          v.previewUrl = location.origin + "/file" + v.relativeFilePath;
120
+          v.thumbFilePath = location.origin + "/file" + v.thumbFilePath;
121
+        })
122
+        this['imgs_' + type] = res.data;
98 123
       });
99 124
   }
100 125
 
126
+  // 预览图片
127
+  imgs = [];
128
+  isPreview = false;
129
+  initialViewIndex:number = 0;
130
+  previewImageHandler(data = [], index = 0) {
131
+    this.initialViewIndex = index;
132
+    console.log(index)
133
+    this.isPreview = false;
134
+    data = data || [];
135
+    this.imgs = data.map((v) => location.origin + '/file' + v.relativeFilePath);
136
+    setTimeout(() => {
137
+      this.isPreview = true;
138
+    }, 0)
139
+  }
140
+
101 141
   //获取处理进度
102 142
   getProgressInfo() {
103
-    this.mainService .fetchListBx("incidentLog", {
143
+    this.mainService.getFetchDataList("simple/data", "incidentLog", {
104 144
       "idx": 0,
105 145
       "sum": 9999,
106 146
       "incidentLog": {
@@ -120,31 +160,7 @@ export class DetailBxComponent implements OnInit {
120 160
 
121 161
   // 获取工单详情
122 162
   getDetail() {
123
-    return this.mainService.fetchDataBx("incident", this.id);
124
-  }
125
-
126
-  // 确认加急
127
-  urgent() {
128
-    let that = this;
129
-    that.urgentLoading = true;
130
-    let postData = {
131
-      urgentDetails: {
132
-        workerOrder: this.orderInfo["id"],
133
-        checkStatus: {
134
-          id: 330,
135
-        },
136
-        urgentReason: this.orderInfo["urgentDetails"].urgentReason,
137
-        id: this.orderInfo["urgentDetails"].id,
138
-      },
139
-    };
140
-    that.mainService.coopWorkerOrder("urge", postData).subscribe((data) => {
141
-      that.urgentLoading = false;
142
-      if (data.status == 200) {
143
-        that.showPromptModal("加急", true, "");
144
-      } else {
145
-        that.showPromptModal("加急", false, data.msg);
146
-      }
147
-    });
163
+    return this.mainService.getFetchData("simple/data", "incident", this.id);
148 164
   }
149 165
 
150 166
   // 关闭弹框
@@ -168,117 +184,4 @@ export class DetailBxComponent implements OnInit {
168 184
     // return this.mainService.getWorkOrderLog(this.id);
169 185
     return Promise.resolve(111);
170 186
   }
171
-
172
-  // 派单
173
-  allotWorker() {
174
-    this.router.navigateByUrl(
175
-      "dispatchingDesk/allotWorker/" +
176
-        this.id +
177
-        "/" +
178
-        this.orderInfo["gdState"]["id"]
179
-    );
180
-  }
181
-
182
-  // 撤回
183
-  recallOrderShow: boolean = false;
184
-  openRecallModal(): void {
185
-    this.recallOrderShow = true;
186
-  }
187
-  // 撤回并删除
188
-  recAndDel() {
189
-    let that = this;
190
-    that.recLoading = true;
191
-    that.mainService.delOrder(that.id).subscribe((data) => {
192
-      console.log(data);
193
-      that.recLoading = false;
194
-      that.closeDelOrderModal();
195
-      if (data.status == 200) {
196
-        that.showPromptModal("删除", true, "");
197
-      } else {
198
-        that.showPromptModal("删除", false, data.msg);
199
-      }
200
-    });
201
-  }
202
-  // 确认撤回
203
-  confirmRec() {
204
-    let that = this;
205
-    that.btnLoading = true;
206
-    let postData = {
207
-      workOrder: {
208
-        id: that.id,
209
-      },
210
-    };
211
-    that.mainService
212
-      .coopWorkerOrder("excuteWorkOrder/recall", postData)
213
-      .subscribe((data) => {
214
-        that.btnLoading = false;
215
-        that.closeRecallOrderModal();
216
-        if (data.status == 200) {
217
-          that.showPromptModal("撤回", true, "");
218
-        } else {
219
-          that.showPromptModal("撤回", false, data.msg);
220
-        }
221
-      });
222
-  }
223
-  // 关闭撤回弹框
224
-  closeRecallOrderModal() {
225
-    this.recallOrderShow = false;
226
-  }
227
-
228
-  // 删除
229
-  // 打开模态框
230
-  delOrderShow: boolean = false;
231
-  openDelModal() {
232
-    this.delOrderShow = true;
233
-  }
234
-  // 确认删除
235
-  confirmDel() {
236
-    let that = this;
237
-    that.btnLoading = true;
238
-    that.mainService.delOrder(that.id).subscribe((data) => {
239
-      that.btnLoading = false;
240
-      that.closeDelOrderModal();
241
-      if (data.status == 200) {
242
-        that.showPromptModal("删除", true, "");
243
-      } else {
244
-        that.showPromptModal("删除", false, data.msg);
245
-      }
246
-    });
247
-  }
248
-
249
-  // 关闭模态框
250
-  closeDelOrderModal() {
251
-    this.delOrderShow = false;
252
-  }
253
-
254
-  // 格式化时分秒
255
-  // (时间小于一分钟则显示秒,时间大于一分钟则显示分钟数,如超出一小时则显示小时和分钟。)time单位:秒
256
-  formatTime(time) {
257
-    let timeStr = "";
258
-    if (time >= 0 && time < 60) {
259
-      // 秒
260
-      timeStr = time + "秒";
261
-    } else if (time >= 60 && time < 3600) {
262
-      // 分钟
263
-      timeStr = Math.floor(time / 60) + "分钟";
264
-    } else if (time >= 3600) {
265
-      // 时 + 分
266
-      let h = "";
267
-      let m = "";
268
-      h = Math.floor(time / 3600) + "小时";
269
-      m = time % 3600 >= 60 ? Math.floor((time % 3600) / 60) + "分钟" : "";
270
-      timeStr = h + m;
271
-    }
272
-    return timeStr;
273
-  }
274
-
275
-  // 计算历史记录耗时
276
-  filterTime(step) {
277
-    // step = [{ difTime: 2 }, { difTime: 6 }]
278
-    let num = 0;
279
-    step.forEach((e) => {
280
-      num += e.difTime;
281
-    });
282
-    return this.formatTime(num / 1000);
283
-  }
284 187
 }

+ 2 - 2
src/app/share/dialog-bx/dialog-bx.component.html

@@ -19,11 +19,11 @@
19 19
         <div class="right" nz-col nzSpan="12">
20 20
           <div class="item display_flex  justify-content_space-between align-items_flex-start">
21 21
             <span>楼栋</span>
22
-            <span>{{extraData.place?.area?.area}}</span>
22
+            <span>{{extraData.floor?.building?.buildingName}}</span>
23 23
           </div>
24 24
           <div class="item display_flex  justify-content_space-between align-items_flex-start">
25 25
             <span>楼层</span>
26
-            <span>{{extraData.place?.place}}</span>
26
+            <span>{{extraData.floor?.floorName}}</span>
27 27
           </div>
28 28
         </div>
29 29
       </div>

+ 2 - 0
src/app/share/image-viewer/image-viewer.component.less

@@ -1,5 +1,7 @@
1 1
 .imgViewHelp {
2 2
   img {
3 3
     margin-right: 8px;
4
+    width: 64px;
5
+    height: 64px;
4 6
   }
5 7
 }

+ 1 - 1
src/app/share/incident-details/incident-details.component.ts

@@ -36,7 +36,7 @@ export class IncidentDetailsComponent implements OnInit {
36 36
     this.maskFlag = this.message.loading("正在加载中..", {
37 37
       nzDuration: 0,
38 38
     }).messageId;
39
-    this.mainService.querySummaryDoc({incidentId: this.incidentId}).subscribe((res:any) => {
39
+    this.mainService.querySummaryDocNew({incidentId: this.incidentId}).subscribe((res:any) => {
40 40
       this.message.remove(this.maskFlag);
41 41
       this.maskFlag = false;
42 42
       if(res.status == 200){

+ 5 - 2
src/app/views/fuwutai/fuwutai.component.ts

@@ -2683,11 +2683,11 @@ export class FuwutaiComponent implements OnInit {
2683 2683
   }
2684 2684
   // 修改故障现象
2685 2685
   incidentCategoryConfig:any = {};//当前匹配的故障现象规则
2686
-  changeApplyCategory(e){
2686
+  changeApplyCategory(e, isCoverage = false){
2687 2687
     console.log(e)
2688 2688
     // 知识库
2689 2689
     this.getKnowageList();
2690
-    if(e){
2690
+    if(e && !isCoverage){
2691 2691
       // 根据故障现象带出故障描述
2692 2692
       if(this.incidentModel.description){
2693 2693
         this.incidentModel.description = this.incidentModel.description + ';' + this.applicationCategoryList.find(v => v.id == e).mutiCategory;
@@ -4741,8 +4741,11 @@ export class FuwutaiComponent implements OnInit {
4741 4741
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
4742 4742
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
4743 4743
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
4744
+    incidentModel.category && (this.applicationCategoryList = [cloneDeep(incidentModel.category)]);
4745
+    incidentModel.category && (incidentModel.category = incidentModel.category.id);
4744 4746
     this.incidentModel = incidentModel;
4745 4747
     this.incidentMsg = incidentMsg;
4748
+    this.incidentModel.category && this.changeApplyCategory(this.incidentModel.category, true);
4746 4749
     console.log('this.applicationDeptList:', this.applicationDeptList)
4747 4750
     console.log('incidentModel:', incidentModel)
4748 4751
     this.showNewOrder('', '', true, '报修转事件');

+ 6 - 15
src/app/views/hushijiandan/hushijiandan.component.html

@@ -1934,7 +1934,7 @@
1934 1934
                       >
1935 1935
                         <nz-option
1936 1936
                           [nzLabel]="data.name"
1937
-                          [nzValue]="data.id"
1937
+                          [nzValue]="data.value"
1938 1938
                           *ngFor="let data of incidentStateList"
1939 1939
                         ></nz-option>
1940 1940
                       </nz-select>
@@ -1983,7 +1983,7 @@
1983 1983
                           <td>
1984 1984
                             <!-- <button (click)="viewBx(data)">查看</button> -->
1985 1985
                             <button class="btn1 mr8 mb8 mt8" (click)="detailBx(data)">查看</button>
1986
-                            <button class="btn1 mr8 mb8 mt8" (click)="showAppraiseBx(data.id)" *ngIf="data.state && data.state.value == 'close' && !data.wxdegree">评价</button>
1986
+                            <button class="btn1 mr8 mb8 mt8" (click)="showAppraiseBx(data)" *ngIf="data.state && data.state.value == 'close' && !data.wxdegree">评价</button>
1987 1987
                           </td>
1988 1988
                         </tr>
1989 1989
                       </tbody>
@@ -3588,7 +3588,7 @@
3588 3588
             <nz-select [nzDropdownMatchSelectWidth]="false" style="width:120px;" class="mr8" type="building"
3589 3589
               nzShowSearch formControlName="building" nzPlaceHolder="请选择楼栋"
3590 3590
               (ngModelChange)="changeBuilding($event)">
3591
-              <nz-option [nzLabel]="data.area" [nzValue]="data.id" *ngFor="let data of buildings">
3591
+              <nz-option [nzLabel]="data.buildingName" [nzValue]="data.id" *ngFor="let data of buildings">
3592 3592
               </nz-option>
3593 3593
             </nz-select>
3594 3594
           </nz-form-control>
@@ -3596,7 +3596,7 @@
3596 3596
           <nz-form-control style="display: inline-block;">
3597 3597
             <nz-select [nzDropdownMatchSelectWidth]="false" style="width:120px;" class="mr8" type="floor" nzShowSearch
3598 3598
              formControlName="floor" nzPlaceHolder="请选择楼层" [nzLoading]="floorLoading">
3599
-              <nz-option [nzLabel]="data.place" [nzValue]="data.id" *ngFor="let data of floors"></nz-option>
3599
+              <nz-option [nzLabel]="data.floorName" [nzValue]="data.id" *ngFor="let data of floors"></nz-option>
3600 3600
             </nz-select>
3601 3601
           </nz-form-control>
3602 3602
           <nz-form-label [nzSm]="4" [nzXs]="4" nzRequired nzFor="officeAddress" hidden></nz-form-label>
@@ -3609,19 +3609,10 @@
3609 3609
       </form>
3610 3610
     </overlay-scrollbars>
3611 3611
     <div class="display_flex justify-content_flex-center">
3612
-      <button
3613
-        nz-button
3614
-        nzType="primary"
3615
-        (click)="confirmBx()"
3616
-      >
3612
+      <button nz-button nzType="primary" (click)="confirmBx()">
3617 3613
         确认
3618 3614
       </button>
3619
-      <button
3620
-        class="btn cancel"
3621
-        nz-button
3622
-        nzType="default"
3623
-        (click)="hideBxModal()"
3624
-      >
3615
+      <button class="btn cancel" nz-button nzType="default" (click)="hideBxModal()">
3625 3616
         取消
3626 3617
       </button>
3627 3618
     </div>

+ 96 - 99
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -1147,17 +1147,17 @@ export class HushijiandanComponent implements OnInit {
1147 1147
       contacts: [this.loginUser.name, [Validators.required]],
1148 1148
       contactsInformation: [this.loginUser.phone, [Validators.required]],
1149 1149
     });
1150
-    this.getDeptByCode(this.currentDept.pcode);
1150
+    this.getDeptById(this.currentDept.id);
1151 1151
   }
1152
-  // 根据科室Code获取详情
1152
+  // 根据科室ID获取详情
1153 1153
   deptDto:any = {};
1154
-  getDeptByCode(code){
1154
+  getDeptById(id){
1155 1155
     this.mainService
1156
-      .fetchListBx("department", {
1156
+      .getFetchDataList("simple/data", "department", {
1157 1157
         idx: 0,
1158 1158
         sum: 1,
1159 1159
         department: {
1160
-          eqCode: code,
1160
+          id,
1161 1161
         }
1162 1162
       })
1163 1163
       .subscribe((data:any) => {
@@ -1166,13 +1166,13 @@ export class HushijiandanComponent implements OnInit {
1166 1166
         console.log(this.deptDto);
1167 1167
         this.changeHosp();
1168 1168
         // 回显楼栋
1169
-        if(this.deptDto.place){
1170
-          this.validateBxForm.controls.building.setValue(this.deptDto.place.area.id);
1169
+        if(this.deptDto.building){
1170
+          this.validateBxForm.controls.building.setValue(this.deptDto.building.id);
1171 1171
         }
1172 1172
 
1173 1173
         // 回显楼层
1174
-        if(this.deptDto.place){
1175
-          this.validateBxForm.controls.floor.setValue(this.deptDto.place.id);
1174
+        if(this.deptDto.floor){
1175
+          this.validateBxForm.controls.floor.setValue(this.deptDto.floor.id);
1176 1176
         }
1177 1177
       });
1178 1178
   }
@@ -1184,12 +1184,12 @@ export class HushijiandanComponent implements OnInit {
1184 1184
     let data = {
1185 1185
       idx: 0,
1186 1186
       sum: 9999,
1187
-      area: {
1188
-        branch: this.deptDto.branch,
1187
+      building: {
1188
+        hosId: this.deptDto.hospital.id,
1189 1189
       }
1190 1190
     };
1191 1191
     this.mainService
1192
-      .fetchListBx("area", data)
1192
+      .getFetchDataList("simple/data", "building", data)
1193 1193
       .subscribe((data:any) => {
1194 1194
         this.buildings = data.list || [];
1195 1195
         this.floors = [];
@@ -1212,13 +1212,13 @@ export class HushijiandanComponent implements OnInit {
1212 1212
     let data = {
1213 1213
       idx: 0,
1214 1214
       sum: 9999,
1215
-      place: {
1216
-        area: { id: buildingId },
1215
+      floor: {
1216
+        buildId: buildingId,
1217 1217
       }
1218 1218
     };
1219 1219
     this.floorLoading = true;
1220 1220
     this.mainService
1221
-      .fetchListBx("place", data)
1221
+      .getFetchDataList("simple/data", "floor", data)
1222 1222
       .subscribe((data:any) => {
1223 1223
         this.floorLoading = false;
1224 1224
         this.message.remove(this.maskFlag);
@@ -1268,11 +1268,9 @@ export class HushijiandanComponent implements OnInit {
1268 1268
     }).messageId;
1269 1269
     if(type == 1){
1270 1270
       this.btnLoading = true;
1271
-      let loginUser:any = {
1272
-        account: this.loginUser.account,
1273
-      };
1274
-      if(this.deptDto.branch){
1275
-        loginUser.branch = { id: this.deptDto.branch };
1271
+      let loginUser:any = cloneDeep(this.loginUser);
1272
+      if(this.deptDto.hospital){
1273
+        loginUser.hospital = { id: this.deptDto.hospital.id };
1276 1274
       }
1277 1275
       if(this.deptDto){
1278 1276
         loginUser.dept = {id: this.deptDto.id};
@@ -1280,18 +1278,18 @@ export class HushijiandanComponent implements OnInit {
1280 1278
       if(this.validateBxForm.value.contacts){
1281 1279
         loginUser.name = this.validateBxForm.value.contacts;
1282 1280
       }
1283
-      if(this.validateBxForm.value.floor){
1284
-        loginUser.place = {id: this.validateBxForm.value.floor, area: { id: this.validateBxForm.value.building }};
1285
-      }
1286
-      if(this.validateBxForm.value.officeAddress){
1287
-        loginUser.houseNumber = this.validateBxForm.value.officeAddress;
1288
-      }
1281
+      // if(this.validateBxForm.value.floor){
1282
+      //   loginUser.place = {id: this.validateBxForm.value.floor, area: { id: this.validateBxForm.value.building }};
1283
+      // }
1284
+      // if(this.validateBxForm.value.officeAddress){
1285
+      //   loginUser.houseNumber = this.validateBxForm.value.officeAddress;
1286
+      // }
1289 1287
       if(this.validateBxForm.value.contactsInformation){
1290 1288
         loginUser.phone = this.validateBxForm.value.contactsInformation;
1291 1289
       }
1292
-      let result:any = await this.mainService.saveUser({loginUser}).toPromise();
1290
+      let result:any = await this.mainService.coopData("updData", "user", { user: loginUser }).toPromise();
1293 1291
       console.log(result);
1294
-      if(result.state != 200){
1292
+      if(result.status != 200){
1295 1293
         this.hideReqModal();
1296 1294
         this.btnLoading = false;
1297 1295
         this.message.remove(this.maskFlag);
@@ -1302,38 +1300,34 @@ export class HushijiandanComponent implements OnInit {
1302 1300
     }else{
1303 1301
       this.cancenlLoading = true;
1304 1302
     }
1305
-    this.mainService.getDictionaryByITSM({key: "incident_source", type: "list"}).subscribe((source:any) => {
1306
-      let incidentSourceList = source.data || [];
1303
+    this.mainService.getDictionary("list", "incident_source").subscribe((source:any) => {
1304
+      let incidentSourceList = source || [];
1307 1305
       let im = incidentSourceList.find(v => v.value === 'im');
1308
-      this.mainService.wxbx({}).subscribe((result) => {
1309
-        if ((result as any).status == 200) {
1310
-          let bxcode = (result as any).data; //生成微信报修号
1306
+      this.mainService.getDictionary("list", "repair_incident_type").subscribe((result) => {
1307
+        let repairIncidentTypeList = result || [];
1308
+        let repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
1309
+        if (repairIncidentType) {
1311 1310
           let postData: any = {
1312 1311
             incident: {
1313
-              "incidentsign": bxcode,
1314
-              "deleteFlag": 0,
1315
-              "department": { id: this.deptDto.id },
1316
-              "contactsInformation": this.validateBxForm.value.contactsInformation,
1317
-              "contacts": this.validateBxForm.value.contacts,
1318
-              "branch": this.deptDto.branch,
1319
-              "area": { id: this.validateBxForm.value.building },
1320
-              "place": { id: this.validateBxForm.value.floor },
1321
-              "houseNumber": this.validateBxForm.value.officeAddress,
1322
-              "source": im,
1323
-              "description": this.validateBxForm.value.description,
1324
-              "repairType": 2,
1325
-              "requester": this.loginUser,
1326
-              "acceptUser": this.loginUser,
1312
+              repairIncidentType,
1313
+              place: { id: this.deptDto.floor.id },
1314
+              department: { id: this.deptDto.id},
1315
+              description: this.validateBxForm.value.description,
1316
+              houseNumber: this.validateBxForm.value.officeAddress,
1317
+              contacts: this.validateBxForm.value.contacts,
1318
+              contactsInformation: this.validateBxForm.value.contactsInformation,
1319
+              hosId: this.deptDto.hospital.id,
1320
+              source: im,
1321
+              fromWx: true,
1322
+              requester: this.loginUser,
1323
+              acceptUser: this.loginUser,
1324
+              deleteFlag: 0,
1327 1325
             },
1328
-            loginUser: {
1329
-              account: this.loginUser.account,
1330
-              id: this.loginUser.id,
1331
-            }
1332 1326
           };
1333 1327
           if (this.coopBx.category) {
1334 1328
             postData.incident.category = this.coopBx.category;
1335 1329
           }
1336
-          this.mainService.addWxIncident(postData).subscribe((res) => {
1330
+          this.mainService.flowPost("incident/task/request", postData).subscribe((res) => {
1337 1331
             this.btnLoading = false;
1338 1332
             this.cancenlLoading = false;
1339 1333
             this.message.remove(this.maskFlag);
@@ -1349,7 +1343,7 @@ export class HushijiandanComponent implements OnInit {
1349 1343
           });
1350 1344
         } else {
1351 1345
           this.btnLoading = false;
1352
-          this.showPromptModal("提交", false, "");
1346
+          this.showPromptModal("提交", false, "缺少【科室内报修】数据字典");
1353 1347
         }
1354 1348
       });
1355 1349
     })
@@ -1358,13 +1352,10 @@ export class HushijiandanComponent implements OnInit {
1358 1352
   // 获取星级
1359 1353
   degrees = [];
1360 1354
   getDegrees() {
1361
-    let postData = { type: "list", key: "incident_degree" };
1362 1355
     this.iLoading = true;
1363
-    this.mainService.getDictionaryByITSM(postData).subscribe((data: any) => {
1356
+    this.mainService.getDictionary("list", "incident_degree").subscribe((data: any) => {
1364 1357
       this.iLoading = false;
1365
-      if (data.status == 200) {
1366
-        this.degrees = data.data || [];
1367
-      }
1358
+      this.degrees = data || [];
1368 1359
     });
1369 1360
   }
1370 1361
   iLoading = false;
@@ -3842,7 +3833,15 @@ export class HushijiandanComponent implements OnInit {
3842 3833
   }
3843 3834
   // 获取事件状态
3844 3835
   incidentStateId = undefined;
3845
-  incidentStateList = [];
3836
+  incidentStateList = [
3837
+    {name: '全部', value: 0},
3838
+    {name: '待受理', value: 'accept,storage'},
3839
+    {name: '处理中', value: 'pending,handler,reassign'},
3840
+    {name: '待评价', value: 'close0', hasWxdegree: 0},
3841
+    {name: '已关闭', value: 'close1', hasWxdegree: 1},
3842
+    {name: '不受理', value: 'reject'},
3843
+    {name: '撤销', value: 'cancel'},
3844
+  ];
3846 3845
   // getIncidentState() {
3847 3846
   //   let postData = { type: "list", key: "wxincident_state" };
3848 3847
   //   this.iLoading = true;
@@ -3862,45 +3861,41 @@ export class HushijiandanComponent implements OnInit {
3862 3861
   bxlbParentSearchInp: string = ""; //患者信息搜索
3863 3862
   processing: number = 0; //处理中的数量
3864 3863
   bxlbLoading = false;
3864
+  repairIncidentTypeList = [];//科室报修或公共报修
3865 3865
   getBxlb(idx, isInitState = false) {
3866 3866
     // 获取事件状态
3867
-    let postData = { type: "list", key: "incident_status" };
3868 3867
     this.iLoading = true;
3869 3868
     this.bxlbLoading = true;
3870
-    this.mainService.getDictionaryByITSM(postData).subscribe((data: any) => {
3869
+    this.mainService.getDictionary('list', 'repair_incident_type').subscribe((data: any) => {
3871 3870
       this.iLoading = false;
3872
-      if (data.status == 200) {
3873
-        let incidentStateList = data.data || [];
3874
-        incidentStateList.unshift({id: 0, name: '全部', value: 0});
3875
-        this.incidentStateList = incidentStateList;
3876
-        if(isInitState){
3877
-          let valueObj2 = this.incidentStateList.find(v => v.value == 0);
3878
-          this.incidentStateId = valueObj2 ? valueObj2.id : undefined;
3879
-        }
3871
+      this.repairIncidentTypeList = data || [];
3872
+      if(isInitState){
3873
+        let valueObj2 = this.incidentStateList.find(v => v.value == 0);
3874
+        this.incidentStateId = valueObj2 ? valueObj2.value : undefined;
3875
+      }
3880 3876
 
3881
-        // 报修列表查询表格数据
3882
-        if (idx) {
3883
-          this.bxlbPageIndex = 1;
3884
-        }
3885
-        let current = JSON.parse(localStorage.getItem("user"));
3886
-        this.mainService
3887
-          .listWxIncident({
3888
-            idx: this.bxlbPageIndex - 1,
3889
-            sum: this.bxlbPageSize,
3890
-            incident: {
3891
-              // assignee: current.user.account,
3892
-              statusId: this.incidentStateId || undefined,
3893
-              department: { pcode: current.user.dept.pcode },
3894
-            }
3895
-          })
3896
-          .subscribe((data: any) => {
3897
-            this.bxlbLoading = false;
3898
-            this.bxlbList = data.list || [];
3899
-            this.bxlbListLength = data.totalNum || 0;
3900
-            this.processing = data.totalNum || 0;
3901
-          });
3877
+      // 报修列表查询表格数据
3878
+      if (idx) {
3879
+        this.bxlbPageIndex = 1;
3902 3880
       }
3903
-    });
3881
+      let current = JSON.parse(localStorage.getItem("user"));
3882
+      this.mainService
3883
+        .getFetchDataList("simple/data", "incident", {
3884
+          idx: this.bxlbPageIndex - 1,
3885
+          sum: this.bxlbPageSize,
3886
+          incident: {
3887
+            repairIncidentType: { id: this.repairIncidentTypeList.find(v => v.value === 'dept').id },
3888
+            statesValues: this.incidentStateId || undefined,
3889
+            department: { id: current.user.dept.id },
3890
+          }
3891
+        })
3892
+        .subscribe((data: any) => {
3893
+          this.bxlbLoading = false;
3894
+          this.bxlbList = data.list || [];
3895
+          this.bxlbListLength = data.totalNum || 0;
3896
+          this.processing = data.totalNum || 0;
3897
+        });
3898
+    })
3904 3899
   }
3905 3900
 
3906 3901
   //快速报修列表
@@ -4065,7 +4060,7 @@ export class HushijiandanComponent implements OnInit {
4065 4060
   reqModal: boolean = false;
4066 4061
   extraData:any = {};
4067 4062
   showReqModal() {
4068
-    this.extraData.place = this.floors.find(v => v.id == this.validateBxForm.value.floor);
4063
+    this.extraData.floor = this.floors.find(v => v.id == this.validateBxForm.value.floor);
4069 4064
     // this.reqModal = true;
4070 4065
     this.confirmBxNext(0);
4071 4066
   }
@@ -4279,9 +4274,9 @@ export class HushijiandanComponent implements OnInit {
4279 4274
   appraiseModalBx: boolean = false;
4280 4275
   starNumBx: number = 5; //评价星
4281 4276
   appraiseContentBx: string = ""; //评级
4282
-  appraiseIdBx: number;
4283
-  showAppraiseBx(id) {
4284
-    this.appraiseIdBx = id;
4277
+  appraiseDataBx: any;
4278
+  showAppraiseBx(data) {
4279
+    this.appraiseDataBx = data;
4285 4280
     this.appraiseModalBx = true;
4286 4281
     this.starNumBx = 5;
4287 4282
     this.appraiseContentBx = "";
@@ -4293,12 +4288,14 @@ export class HushijiandanComponent implements OnInit {
4293 4288
     this.btnLoading = true;
4294 4289
     let id = this.degrees.find(v=>v.value == this.starNumBx).id;
4295 4290
     let postData = {
4296
-      degree: id,
4297
-      degreeRemark: this.appraiseContentBx,
4298
-      id: this.appraiseIdBx,
4291
+      incident: {
4292
+        ...this.appraiseDataBx,
4293
+        wxdegree: { id },
4294
+        wxdegreeremark: this.appraiseContentBx,
4295
+      }
4299 4296
     };
4300 4297
     this.mainService
4301
-      .degree(postData)
4298
+      .flowPost("incident/task/resolve", postData)
4302 4299
       .subscribe((data:any) => {
4303 4300
         this.hideAppraiseBx();
4304 4301
         if (data.state == 200) {