Sfoglia il codice sorgente

服务台编辑事件

seimin 5 mesi fa
parent
commit
fcf3f12763

+ 14 - 7
src/app/views/fuwutai/fuwutai.component.html

@@ -454,6 +454,7 @@
454 454
                   </div>
455 455
                 </div>
456 456
                 <div class="right_bots display_flex col-flex align-items_center justify-content_flex-center gap8">
457
+                  <input type="button" *ngIf="data.computedEditFlag" class="top_bot" value="编辑" (click)="edit(data.data)" />
457 458
                   <input type="button" *ngIf="data.computedSubstitutionFlag" class="top_bot" value="换人处理" (click)="substitution(data.data)" />
458 459
                   <input type="button" *ngIf="data.computedReceiveFlag" class="top_bot" value="接单" (click)="showDelModal($event, data.data,'您确认要接单吗?','接单','receive')" />
459 460
                   <input type="button" *ngIf="coopBtns.del" class="btm_bot" value="删除" (click)="openDelModal(data.data.id, 'itsm')" />
@@ -658,6 +659,7 @@
658 659
                   </div>
659 660
                 </div>
660 661
                 <div class="right_bots display_flex col-flex align-items_center justify-content_flex-center gap8">
662
+                  <input type="button" *ngIf="data.computedEditFlag" class="top_bot" value="编辑" (click)="edit(data.data)" />
661 663
                   <input type="button" *ngIf="data.computedSubstitutionFlag" class="top_bot" value="换人处理" (click)="substitution(data.data)" />
662 664
                   <input type="button" *ngIf="data.computedHandleFlag" class="top_bot" value="处理" (click)="handle(data.data)" />
663 665
                   <input type="button" *ngIf="coopBtns.del" class="btm_bot" value="删除" (click)="openDelModal(data.data.id, 'itsm')" />
@@ -1190,7 +1192,7 @@
1190 1192
             <span class="grayFont">申请人:</span>
1191 1193
             <ng-container *ngIf="buildType === '报修转事件'">{{incidentMsg.requesterName}}</ng-container>
1192 1194
             <ng-container *ngIf="buildType !== '报修转事件'">
1193
-              <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('requester', $event)" nzPlaceHolder="请选择申请人" [(ngModel)]="incidentModel.requester" (ngModelChange)="changeApplyRequester($event)" nzAllowClear>
1195
+              <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('requester', $event)" nzPlaceHolder="请选择申请人" [(ngModel)]="incidentModel.requester" (ngModelChange)="changeApplyRequester($event)" nzAllowClear (nzOpenChange)="openChangeApplyRequester($event)">
1194 1196
                 <ng-container *ngFor="let option of applicationRequesterList">
1195 1197
                   <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
1196 1198
                 </ng-container>
@@ -1201,7 +1203,7 @@
1201 1203
               <label nz-checkbox [(ngModel)]="isRelatedDepartment" (ngModelChange)="changeApplyRelatedDepartment($event)" class="ml8">关联查</label>
1202 1204
             </ng-container>
1203 1205
           </div>
1204
-          <div class="newTopItem">
1206
+          <div class="newTopItem" *ngIf="buildType !== '编辑事件'">
1205 1207
             <span class="grayFont">来电电话:{{incidentModel.incomingPhone}}</span>
1206 1208
           </div>
1207 1209
         </div>
@@ -1212,7 +1214,7 @@
1212 1214
             <div class="tabs__inner" #tab>
1213 1215
               <div class="tabs__wrap" [style.transform]="'translateX(' + disX + 'px)'">
1214 1216
                 <ng-container *ngFor="let item of workTypesArrange | keyvalue">
1215
-                  <div [ngClass]="{ tab: true, checked: currentTabIndex == item.key}" (click)="tabClick(item.key)">
1217
+                  <div [ngClass]="{ tab: true, checked: currentTabIndex == item.key}" (click)="tabClick(item.key)" *ngIf="buildType !== '编辑事件' || (buildType === '编辑事件' && item.key == 99999)">
1216 1218
                     {{ item.value[0].associationTypeName }}
1217 1219
                   </div>
1218 1220
                 </ng-container>
@@ -1890,7 +1892,7 @@
1890 1892
                       <span class="name">报修人电话:</span>
1891 1893
                       <ng-container *ngIf="incidentMsg.requesterPhone">{{incidentMsg.requesterPhone}}<em (click)="importPhone(incidentMsg.requesterPhone)">引入</em></ng-container>
1892 1894
                     </div>
1893
-                    <div class="col">
1895
+                    <div class="col" *ngIf="buildType !== '编辑事件'">
1894 1896
                       <span class="name">来电电话:</span>
1895 1897
                       <ng-container *ngIf="incidentModel.incomingPhone">{{incidentModel.incomingPhone}}<em (click)="importPhone(incidentModel.incomingPhone)">引入</em></ng-container>
1896 1898
                     </div>
@@ -1914,7 +1916,7 @@
1914 1916
                   <div class="row gap8">
1915 1917
                     <div class="col">
1916 1918
                       <span class="name required">故障现象:</span>
1917
-                      <nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('category', $event)" nzPlaceHolder="请选择故障现象" [(ngModel)]="incidentModel.category" (ngModelChange)="changeApplyCategory($event)">
1919
+                      <nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('category', $event)" nzPlaceHolder="请选择故障现象" [(ngModel)]="incidentModel.category" (ngModelChange)="changeApplyCategory($event)" (nzOpenChange)="openChangeApplyCategory($event)">
1918 1920
                         <ng-container *ngFor="let option of applicationCategoryList">
1919 1921
                           <nz-option *ngIf="!isLoading" [nzLabel]="option.mutiCategory" [nzValue]="option.id"></nz-option>
1920 1922
                         </ng-container>
@@ -1977,7 +1979,7 @@
1977 1979
                     </div>
1978 1980
                   </div>
1979 1981
 
1980
-                  <div class="row gap8">
1982
+                  <div class="row gap8" *ngIf="buildType !== '编辑事件'">
1981 1983
                     <div class="col">
1982 1984
                       <span class="name required">处理组:</span>
1983 1985
                       <nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('group', $event)" nzPlaceHolder="请选择处理组" [(ngModel)]="incidentModel.group" (ngModelChange)="changeApplyGroup($event)" (nzOpenChange)="openChangeApplyGroup($event)">
@@ -2252,7 +2254,7 @@
2252 2254
             {{isYyInspect ? '预约建单' :'直接建单'}}
2253 2255
           </button>
2254 2256
         </ng-container>
2255
-        <ng-container *ngIf="currentTabIndex === '99999'">
2257
+        <ng-container *ngIf="currentTabIndex === '99999' && buildType !== '编辑事件'">
2256 2258
           <label nz-checkbox [(ngModel)]="isBuildOrderAgagin" *ngIf="buildType !== '报修转事件' && buildType !== '留言转事件'">是否连续建单</label>
2257 2259
           <button nz-button class="btn" nzType="primary" (click)="directOrder()">
2258 2260
             直接解决
@@ -2264,6 +2266,11 @@
2264 2266
             暂存
2265 2267
           </button>
2266 2268
         </ng-container>
2269
+        <ng-container *ngIf="currentTabIndex === '99999' && buildType === '编辑事件'">
2270
+          <button nz-button class="btn" nzType="primary" (click)="saveOrder()">
2271
+            保存
2272
+          </button>
2273
+        </ng-container>
2267 2274
         <button class="btn cancel" nz-button nzType="default" (click)="newOrderCancel()">
2268 2275
           取消
2269 2276
         </button>

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

@@ -2013,6 +2013,7 @@ export class FuwutaiComponent implements OnInit {
2013 2013
             if(item.type === 'mdv2'){
2014 2014
               item.computedSubstitutionFlag = this.computedSubstitution(item.data)
2015 2015
               item.computedReceiveFlag = this.computedReceive(item.data)
2016
+              item.computedEditFlag = this.computedEdit(item.data)
2016 2017
             }
2017 2018
           });
2018 2019
           this.arriveList = arriveList;
@@ -2027,6 +2028,7 @@ export class FuwutaiComponent implements OnInit {
2027 2028
             if(item.type === 'mdv2'){
2028 2029
               item.computedSubstitutionFlag = this.computedSubstitution(item.data)
2029 2030
               item.computedHandleFlag = this.computedHandle(item.data)
2031
+              item.computedEditFlag = this.computedEdit(item.data)
2030 2032
             }
2031 2033
           });
2032 2034
           this.executionList = executionList;
@@ -2299,7 +2301,7 @@ export class FuwutaiComponent implements OnInit {
2299 2301
     }
2300 2302
     this.buildType = buildType;
2301 2303
     if(this.itsmData.mdv2Switch){
2302
-      this.resetOrderData();
2304
+      this.buildType !== '编辑事件' && this.resetOrderData();
2303 2305
       this.searchApplicationHospital();
2304 2306
       this.searchApplicationCategory();
2305 2307
       this.searchApplicationPriority();
@@ -2760,7 +2762,7 @@ export class FuwutaiComponent implements OnInit {
2760 2762
         "directProcess": 1,
2761 2763
         "handleDescription": this.incidentModel.handleDescription,
2762 2764
         "handlingPersonnelUser": {id: this.tool.getCurrentUserId()},
2763
-        "yyTime": this.incidentModel.yyTime ? format(this.incidentModel.yyTime, 'yyyy-MM-dd HH:mm:ss') : undefined,
2765
+        "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
2764 2766
         "closecode": this.incidentModel.closecode ? { id: this.incidentModel.closecode } : undefined,
2765 2767
         "acceptUser": { id: this.tool.getCurrentUserId() },
2766 2768
         "callID": this.incidentModel.callID || undefined,
@@ -3164,6 +3166,12 @@ export class FuwutaiComponent implements OnInit {
3164 3166
   openChangeApplyDept(flag){
3165 3167
     flag && this.searchApplicationDepartment('itsm');
3166 3168
   }
3169
+  openChangeApplyRequester(flag){
3170
+    flag && this.searchApplicationRequester();
3171
+  }
3172
+  openChangeApplyCategory(flag){
3173
+    flag && this.searchApplicationCategory();
3174
+  }
3167 3175
   openChangeApplyGroup(flag){
3168 3176
     flag && this.searchApplicationGroup()
3169 3177
   }
@@ -3452,7 +3460,7 @@ export class FuwutaiComponent implements OnInit {
3452 3460
       return;
3453 3461
     }
3454 3462
 
3455
-    if(!this.incidentModel.group){
3463
+    if(!this.incidentModel.group && this.buildType !== '编辑事件'){
3456 3464
       this.msg.warning('请选择处理组!');
3457 3465
       return;
3458 3466
     }
@@ -3479,7 +3487,7 @@ export class FuwutaiComponent implements OnInit {
3479 3487
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
3480 3488
         "title": category.mutiCategory,
3481 3489
         "description": this.incidentModel.description,
3482
-        "yyTime": this.incidentModel.yyTime ? format(this.incidentModel.yyTime, 'yyyy-MM-dd HH:mm:ss') : undefined,
3490
+        "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3483 3491
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
3484 3492
         "acceptUser": { id: this.tool.getCurrentUserId() },
3485 3493
         "callID": this.incidentModel.callID || undefined,
@@ -3549,7 +3557,7 @@ export class FuwutaiComponent implements OnInit {
3549 3557
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
3550 3558
         "title": category ? category.mutiCategory : '',
3551 3559
         "description": this.incidentModel.description,
3552
-        "yyTime": this.incidentModel.yyTime ? format(this.incidentModel.yyTime, 'yyyy-MM-dd HH:mm:ss') : undefined,
3560
+        "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3553 3561
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
3554 3562
         "acceptUser": { id: this.tool.getCurrentUserId() },
3555 3563
         "callID": this.incidentModel.callID || undefined,
@@ -3590,6 +3598,71 @@ export class FuwutaiComponent implements OnInit {
3590 3598
       });
3591 3599
   }
3592 3600
 
3601
+  // 运维-保存
3602
+  saveOrder(){
3603
+    this.maskFlag = this.msg.loading("正在加载中..", {
3604
+      nzDuration: 0,
3605
+    }).messageId;
3606
+
3607
+    let category;
3608
+    if(this.incidentModel.category){
3609
+      category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
3610
+    }
3611
+
3612
+    let postData:any = {
3613
+      solutionId: this.solutionId,
3614
+      "incident": {
3615
+        "id": this.incidentModel.id || undefined,
3616
+        "deleteFlag": 0,
3617
+        "duty": this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
3618
+        "department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
3619
+        "contactsInformation": this.incidentModel.contactsInformation,
3620
+        "contacts": this.incidentModel.contacts,
3621
+        "hosId": this.incidentModel.hosId || undefined,
3622
+        "area": this.incidentModel.area ? { id: this.incidentModel.area } : undefined,
3623
+        "place": this.incidentModel.place ? { id: this.incidentModel.place } : undefined,
3624
+        "houseNumber": this.incidentModel.houseNumber,
3625
+        "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
3626
+        "priorityId": this.incidentModel.priorityId || undefined,
3627
+        "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
3628
+        "title": category ? category.mutiCategory : '',
3629
+        "description": this.incidentModel.description,
3630
+        "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3631
+        "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
3632
+        "acceptUser": { id: this.tool.getCurrentUserId() },
3633
+        "callID": this.incidentModel.callID || undefined,
3634
+        "incomingPhone": this.incidentModel.incomingPhone || undefined,
3635
+        "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
3636
+      }
3637
+    };
3638
+    if(this.buildType){
3639
+      postData.incident = Object.assign({}, this.editOrder, postData.incident);
3640
+    }
3641
+    console.log(postData);
3642
+    // return;
3643
+
3644
+    this.mainService
3645
+      .flowPost("incident/task/edit", postData)
3646
+      .subscribe((result) => {
3647
+        this.msg.remove(this.maskFlag);
3648
+        this.maskFlag = false;
3649
+
3650
+        if (result.state == 200) {
3651
+          // 图片上传
3652
+          if(this.fileList.length){
3653
+            console.log(this.fileList.map(v => v.originFileObj));
3654
+            this.fileList.map(v => v.originFileObj).forEach(async file => {
3655
+              await this.uploadImages(file, result.data.id);
3656
+            })
3657
+          }
3658
+          // this.msg.success('编辑成功');
3659
+          this.isBuildOrderAgaginFn();
3660
+        } else {
3661
+          this.msg.error('编辑失败');
3662
+        }
3663
+      });
3664
+  }
3665
+
3593 3666
   // 是否连续建单
3594 3667
   isBuildOrderAgaginFn(){
3595 3668
     if(this.isBuildOrderAgagin){
@@ -4726,6 +4799,35 @@ export class FuwutaiComponent implements OnInit {
4726 4799
     });
4727 4800
   }
4728 4801
 
4802
+  // 编辑-弹窗
4803
+  edit(data){
4804
+    this.editOrder = cloneDeep(data);
4805
+    let incidentModel = cloneDeep(data);
4806
+    let incidentMsg:any = {};
4807
+    console.log('data:', data)
4808
+    incidentModel.department && (incidentMsg.deptManyPhone = incidentModel.department.manyPhone);
4809
+    incidentModel.department && (incidentMsg.deptName = incidentModel.department.dept);
4810
+    incidentModel.department && (incidentModel.department = incidentModel.department.id);
4811
+    incidentModel.requester && (this.applicationRequesterList = [cloneDeep(incidentModel.requester)]);
4812
+    incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
4813
+    incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
4814
+    incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
4815
+    incidentModel.source && (incidentModel.source = incidentModel.source.id);
4816
+    incidentModel.area && (incidentModel.area = incidentModel.area.id);
4817
+    incidentModel.place && (incidentModel.place = incidentModel.place.id);
4818
+    incidentModel.category && (this.applicationCategoryList = [cloneDeep(incidentModel.category)]);
4819
+    incidentModel.category && (incidentModel.category = incidentModel.category.id);
4820
+    this.incidentModel = incidentModel;
4821
+    this.incidentMsg = incidentMsg;
4822
+    console.log('this.applicationRequesterList:', this.applicationRequesterList)
4823
+    console.log('this.applicationDeptList:', this.applicationDeptList)
4824
+    console.log('incidentModel:', incidentModel)
4825
+    this.showNewOrder('', '', true, '编辑事件');
4826
+
4827
+    // 查询报修图片
4828
+    this.getRepairImgs(data.id);
4829
+  }
4830
+
4729 4831
   // 换人处理-弹窗
4730 4832
   substitutionModalShow = false; //弹窗开关
4731 4833
   substitution(data) {
@@ -4763,6 +4865,11 @@ export class FuwutaiComponent implements OnInit {
4763 4865
     return (data.state.value === 'pending' || data.state.value === 'handler' || (data.state.value === 'reassign' && this.coopBtns.assign)) && data.deleteFlag !== 1;
4764 4866
   }
4765 4867
 
4868
+  // 是否显示编辑按钮
4869
+  computedEdit(data){
4870
+    return (data.state.value === 'pending' || data.state.value === 'reassign' || data.state.value === 'handler' || data.state.value === 'close') && this.coopBtns.edit && data.deleteFlag !== 1;
4871
+  }
4872
+
4766 4873
   // 是否显示处理按钮
4767 4874
   computedHandle(data){
4768 4875
     return this.coopBtns.handle && data.state.value === 'handler' && data.handlingPersonnelUser && data.handlingPersonnelUser.id == this.tool.getCurrentUserId() && data.deleteFlag !== 1;