Browse Source

报修及图片优化

seimin 1 year ago
parent
commit
3f0b78d2b1

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

@@ -515,8 +515,8 @@ export class MainService {
515 515
     });
516 516
   }
517 517
   //获取附件图片
518
-  wechatRequesterIncident(id) {
519
-    return this.http.get(host.host + "/itsm/common/listAttachment/wechatRequesterIncident/" + id, {
518
+  listAttachment(type, id) {
519
+    return this.http.get(host.host + "/itsm/common/listAttachment/" + type + "/" + id, {
520 520
       headers: this.headers,
521 521
     });
522 522
   }

+ 7 - 9
src/app/share/detail-bx/detail-bx.component.html

@@ -13,15 +13,14 @@
13 13
           <div nz-col nzSpan="8">报修地址:<ng-container *ngIf="orderInfo.place">{{ orderInfo.place.area.area }} {{ orderInfo.place.place }} {{ orderInfo.address }}</ng-container></div>
14 14
           <div nz-col nzSpan="24">报修内容:{{orderInfo.incidentDescription}}</div>
15 15
           <div nz-col nzSpan="24">报修图片:
16
-            <!-- <div class="imgViewHelp">
17
-              <ul id="ljImgViewerId" class="list">
18
-                <img class="mr8" *ngFor="let img of imgs;let i = index;" width="100px" [src]="img" alt="" />
19
-              </ul>
20
-            </div> -->
21
-            <app-image-viewer [imageUrl]="imgs" *ngIf="imgs.length"></app-image-viewer>
16
+            <app-image-viewer [imageUrl]="imgs_wechatRequesterIncident" *ngIf="imgs_wechatRequesterIncident.length"></app-image-viewer>
17
+          </div>
18
+          <div nz-col nzSpan="24">处理图片:
19
+            <app-image-viewer [imageUrl]="imgs_incident" *ngIf="imgs_incident.length"></app-image-viewer>
22 20
           </div>
23 21
           <div nz-col nzSpan="8">维修人:<ng-container *ngIf="orderInfo.incident&&orderInfo.incident.handlingPersonnelUser">{{ orderInfo.incident.handlingPersonnelUser.name }}</ng-container></div>
24 22
           <div nz-col nzSpan="8">维修人电话:<ng-container *ngIf="orderInfo.incident&&orderInfo.incident.handlingPersonnelUser">{{ orderInfo.incident.handlingPersonnelUser.phone }}</ng-container></div>
23
+          <div nz-col nzSpan="8" *ngIf="orderInfo.incident&&orderInfo.incident.repairSummaryDTO">维修总金额:{{ orderInfo.incident.repairSummaryDTO.totalMaintenancePrice }}元</div>
25 24
           <div nz-col nzSpan="24" *ngIf="processData == '已撤回'">撤回原因:{{ orderInfo.retractReason }}</div>
26 25
           <div nz-col nzSpan="24" *ngIf="processData == '不受理'">不受理原因:{{ orderInfo.rejectRemark }}</div>
27 26
         </div>
@@ -142,7 +141,7 @@
142 141
                   "
143 142
                 >
144 143
                   <div class="status"></div>
145
-                  <div class="conents">{{ item.opValue }}</div>
144
+                  <div class="conents"><span *ngIf="item.repairType && item.expectedDate">{{item.repairType.name}}{{item.expectedDate|date:'MM月dd日前完成'}}</span> {{ item.opValue }}</div>
146 145
                 </div>
147 146
               </div>
148 147
             </ng-container>
@@ -289,7 +288,7 @@
289 288
     <button class=" btn cancel" nz-button nzType="default" (click)="close()">取消</button>
290 289
   </div>
291 290
 </div>
292
-  
291
+
293 292
 <!-- 撤回工单 -->
294 293
 <div class="recallOrder" *ngIf="recallOrderShow">
295 294
   <div class="modalBody">
@@ -328,4 +327,3 @@
328 327
 </app-prompt-modal>
329 328
 <!-- 遮罩 -->
330 329
 <app-mask *ngIf="maskFlag"></app-mask>
331
-  

+ 25 - 9
src/app/share/detail-bx/detail-bx.component.ts

@@ -27,7 +27,8 @@ export class DetailBxComponent implements OnInit {
27 27
   processTime = [];
28 28
   processData = "";
29 29
   processMessage = [];
30
-  imgs = [];
30
+  imgs_wechatRequesterIncident = [];
31
+  imgs_incident = [];
31 32
 
32 33
   id: number; //工单id
33 34
   orderInfo: any; //工单详情信息
@@ -69,12 +70,16 @@ export class DetailBxComponent implements OnInit {
69 70
       this.orderInfo = res[1]["data"];
70 71
       this.getProcessTime();
71 72
       this.getProcessMessageData();
72
-      this.getImgsData();
73
-      if (this.orderInfo.incident && !this.orderInfo.incident.handlerLogs) {
74
-        this.orderInfo.incident.handlerLogs = [];
75
-      } else {
76
-        this.orderInfo.incident.handlerLogs.reverse();
73
+      this.getImgsData('wechatRequesterIncident');
74
+      this.getImgsData('incident');
75
+      if(this.orderInfo.incident){
76
+        if (!this.orderInfo.incident.handlerLogs) {
77
+          this.orderInfo.incident.handlerLogs = [];
78
+        } else {
79
+          this.orderInfo.incident.handlerLogs.reverse();
80
+        }
77 81
       }
82
+
78 83
       if (this.orderInfo.incident && this.orderInfo.incident.repeat) {
79 84
         this.processData = "重复事件";
80 85
       } else if (this.orderInfo.incidentState.name == "不受理") {
@@ -94,13 +99,24 @@ export class DetailBxComponent implements OnInit {
94 99
   }
95 100
 
96 101
   // 获取图片信息
97
-  getImgsData() {
102
+  getImgsData(type) {
103
+    let id;
104
+    if(type === 'wechatRequesterIncident'){
105
+      id = this.orderInfo.id;
106
+    } else if(type === 'incident'){
107
+      if(this.orderInfo.incident){
108
+        id = this.orderInfo.incident.processInstanceId;
109
+      } else {
110
+        this['imgs_' + type] = [];
111
+        return;
112
+      }
113
+    }
98 114
     this.mainService
99
-      .wechatRequesterIncident(this.orderInfo.id)
115
+      .listAttachment(type, id)
100 116
       .subscribe((res:any)=> {
101 117
         // this.imgs = ['https://img2.woyaogexing.com/2022/08/19/1f5e056b1d076920!400x400.jpg','https://img2.woyaogexing.com/2022/08/19/359346943c3c489f!400x400.jpg']
102 118
         for (var i = 0; i < res.data.length; i++) {
103
-          this.imgs.push(res.data[i].previewUrl);
119
+          this['imgs_' + type].push(location.origin + '/file' + res.data[i].relativeFilePath);
104 120
         }
105 121
       });
106 122
   }

+ 2 - 2
src/app/views/hushijiandan/hushijiandan.component.html

@@ -2102,8 +2102,8 @@
2102 2102
                         [(ngModel)]="incidentStateId"
2103 2103
                       >
2104 2104
                         <nz-option
2105
-                          nzLabel="{{ data.name }}"
2106
-                          nzValue="{{ data.id }}"
2105
+                          [nzLabel]="data.name"
2106
+                          [nzValue]="data.id"
2107 2107
                           *ngFor="let data of incidentStateList"
2108 2108
                         ></nz-option>
2109 2109
                       </nz-select>

+ 46 - 33
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -1125,19 +1125,7 @@ export class HushijiandanComponent implements OnInit {
1125 1125
       }
1126 1126
     });
1127 1127
   }
1128
-  // 获取事件状态
1129
-  incidentStateId = undefined;
1130
-  incidentStateList = [];
1131
-  getIncidentState() {
1132
-    let postData = { type: "list", key: "wxincident_state" };
1133
-    this.iLoading = true;
1134
-    this.mainService.getDictionaryByITSM(postData).subscribe((data: any) => {
1135
-      this.iLoading = false;
1136
-      if (data.status == 200) {
1137
-        this.incidentStateList = data.data || [];
1138
-      }
1139
-    });
1140
-  }
1128
+
1141 1129
   // 获取星级
1142 1130
   degrees = [];
1143 1131
   getDegrees() {
@@ -3384,7 +3372,7 @@ export class HushijiandanComponent implements OnInit {
3384 3372
       this.getHistoryDrugsbag();
3385 3373
     } else if (type === "bxlb" && this.isShowBx && this.coopBtns.repairList) {
3386 3374
       this.getBxlb();
3387
-      this.getIncidentState();
3375
+      // this.getIncidentState();
3388 3376
       this.getDegrees();
3389 3377
     } else if (type === "kjbx" && this.isShowBx && this.coopBtns.quickReportForRepair) {
3390 3378
       // this.getQuickBxlb();
@@ -3598,6 +3586,19 @@ export class HushijiandanComponent implements OnInit {
3598 3586
         this.historyDrugsbagListLength = data.totalNum || 0;
3599 3587
       });
3600 3588
   }
3589
+  // 获取事件状态
3590
+  incidentStateId = undefined;
3591
+  incidentStateList = [];
3592
+  // getIncidentState() {
3593
+  //   let postData = { type: "list", key: "wxincident_state" };
3594
+  //   this.iLoading = true;
3595
+  //   this.mainService.getDictionaryByITSM(postData).subscribe((data: any) => {
3596
+  //     this.iLoading = false;
3597
+  //     if (data.status == 200) {
3598
+  //       this.incidentStateList = data.data || [];
3599
+  //     }
3600
+  //   });
3601
+  // }
3601 3602
   // 报修列表查询表格数据
3602 3603
   bxlbList: any = [];
3603 3604
   bxlbPageIndex: number = 1; //表格当前页码
@@ -3608,25 +3609,37 @@ export class HushijiandanComponent implements OnInit {
3608 3609
   processing: number = 0; //处理中的数量
3609 3610
   bxlbLoading = false;
3610 3611
   getBxlb(idx?) {
3611
-    if (idx) {
3612
-      this.bxlbPageIndex = 1;
3613
-    }
3614
-    let current = JSON.parse(localStorage.getItem("user"));
3615
-    this.bxlbLoading = true;
3616
-    this.mainService
3617
-      .listWxIncident({
3618
-        deptId: current.user.dept.id,
3619
-        // assignee: current.user.account,
3620
-        state: this.incidentStateId?parseInt(this.incidentStateId):undefined,
3621
-        idx: this.bxlbPageIndex - 1,
3622
-        sum: this.bxlbPageSize,
3623
-      })
3624
-      .subscribe((data: any) => {
3625
-        this.bxlbLoading = false;
3626
-        this.bxlbList = data.data || [];
3627
-        this.bxlbListLength = data.resultCount || 0;
3628
-        this.processing = data.resultCount || 0;
3629
-      });
3612
+    // 获取事件状态
3613
+    let postData = { type: "list", key: "wxincident_state" };
3614
+    this.iLoading = true;
3615
+    this.mainService.getDictionaryByITSM(postData).subscribe((data: any) => {
3616
+      this.iLoading = false;
3617
+      if (data.status == 200) {
3618
+        this.incidentStateList = data.data || [];
3619
+        let valueObj2 = this.incidentStateList.find(v => v.value == 2);
3620
+        this.incidentStateId = valueObj2 ? valueObj2.id : undefined;
3621
+        // 报修列表查询表格数据
3622
+        if (idx) {
3623
+          this.bxlbPageIndex = 1;
3624
+        }
3625
+        let current = JSON.parse(localStorage.getItem("user"));
3626
+        this.bxlbLoading = true;
3627
+        this.mainService
3628
+          .listWxIncident({
3629
+            deptId: current.user.dept.id,
3630
+            // assignee: current.user.account,
3631
+            state: this.incidentStateId ? this.incidentStateId : undefined,
3632
+            idx: this.bxlbPageIndex - 1,
3633
+            sum: this.bxlbPageSize,
3634
+          })
3635
+          .subscribe((data: any) => {
3636
+            this.bxlbLoading = false;
3637
+            this.bxlbList = data.data || [];
3638
+            this.bxlbListLength = data.resultCount || 0;
3639
+            this.processing = data.resultCount || 0;
3640
+          });
3641
+      }
3642
+    });
3630 3643
   }
3631 3644
 
3632 3645
   //快速报修列表

+ 1 - 1
src/app/views/nucleic-acid-collection/nucleic-acid-collection.component.ts

@@ -44,7 +44,7 @@ export class NucleicAcidCollectionComponent implements OnInit {
44 44
       this.isPreview = false;
45 45
       this.mainService.getPreviewImage('specimenPhotos', data.id).subscribe((result:any)=>{
46 46
         if (result.status == 200) {
47
-          this.imgs = result.data.map((v) => v.previewUrl);
47
+          this.imgs = result.data.map((v) => location.origin + '/file' + v.relativeFilePath);
48 48
           this.isPreview = true;
49 49
         } else {
50 50
           this.imgs = [];