Browse Source

报修类型

seimin 4 months ago
parent
commit
f846722a30

+ 13 - 3
src/app/components/incidentManagement/incident-create/incident-create.component.html

@@ -22,7 +22,7 @@
22
             </nz-option>
22
             </nz-option>
23
           </nz-select>
23
           </nz-select>
24
         </div>
24
         </div>
25
-        <div class="newTopItem">
25
+        <div class="newTopItem" [hidden]="incidentModel.repairIncidentType === 'public'">
26
           <span class="grayFont required">申请科室:</span>
26
           <span class="grayFont required">申请科室:</span>
27
           <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeInp('itsm', $event)" nzPlaceHolder="请选择申请科室" [(ngModel)]="incidentModel.department" (ngModelChange)="changeApplyDept($event)" nzAllowClear (nzOpenChange)="openChangeApplyDept($event)">
27
           <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeInp('itsm', $event)" nzPlaceHolder="请选择申请科室" [(ngModel)]="incidentModel.department" (ngModelChange)="changeApplyDept($event)" nzAllowClear (nzOpenChange)="openChangeApplyDept($event)">
28
             <ng-container *ngFor="let option of applicationDeptList">
28
             <ng-container *ngFor="let option of applicationDeptList">
@@ -34,7 +34,7 @@
34
           </nz-select>
34
           </nz-select>
35
         </div>
35
         </div>
36
         <div class="newTopItem">
36
         <div class="newTopItem">
37
-          <span class="grayFont">申请人:</span>
37
+          <span class="grayFont" [ngClass]="{'required': incidentModel.repairIncidentType === 'public'}">申请人:</span>
38
           <ng-container *ngIf="buildType === '报修转事件'">{{incidentMsg.requesterName}}</ng-container>
38
           <ng-container *ngIf="buildType === '报修转事件'">{{incidentMsg.requesterName}}</ng-container>
39
           <ng-container *ngIf="buildType !== '报修转事件'">
39
           <ng-container *ngIf="buildType !== '报修转事件'">
40
             <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('requester', $event)" nzPlaceHolder="请选择申请人" [(ngModel)]="incidentModel.requester" (ngModelChange)="changeApplyRequester($event)" nzAllowClear (nzOpenChange)="openChangeApplyRequester($event)">
40
             <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('requester', $event)" nzPlaceHolder="请选择申请人" [(ngModel)]="incidentModel.requester" (ngModelChange)="changeApplyRequester($event)" nzAllowClear (nzOpenChange)="openChangeApplyRequester($event)">
@@ -45,9 +45,19 @@
45
                 <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
45
                 <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
46
               </nz-option>
46
               </nz-option>
47
             </nz-select>
47
             </nz-select>
48
-            <label nz-checkbox [(ngModel)]="isRelatedDepartment" (ngModelChange)="changeApplyRelatedDepartment($event)" class="ml8">关联查</label>
48
+            <label [hidden]="incidentModel.repairIncidentType === 'public'" nz-checkbox [(ngModel)]="isRelatedDepartment" (ngModelChange)="changeApplyRelatedDepartment($event)" class="ml8">关联查</label>
49
           </ng-container>
49
           </ng-container>
50
         </div>
50
         </div>
51
+        <div class="newTopItem" *ngIf="incidentModel.incomingPhone">
52
+          <span class="grayFont">来电电话:{{incidentModel.incomingPhone}}</span>
53
+        </div>
54
+        <div class="newTopItem">
55
+          <span class="grayFont">
56
+            <nz-radio-group [(ngModel)]="incidentModel.repairIncidentType" (ngModelChange)="changeRepairIncidentType($event)">
57
+              <label nz-radio [nzValue]="item.value" *ngFor="let item of repairIncidentTypeList">{{item.name}}</label>
58
+            </nz-radio-group>
59
+          </span>
60
+        </div>
51
       </div>
61
       </div>
52
     </div>
62
     </div>
53
     <div nz-row class="content">
63
     <div nz-row class="content">

+ 5 - 2
src/app/components/incidentManagement/incident-create/incident-create.component.less

@@ -2105,10 +2105,13 @@
2105
         font-size: 14px;
2105
         font-size: 14px;
2106
         .name{
2106
         .name{
2107
           font-weight: bold;
2107
           font-weight: bold;
2108
-          margin-right: 48px;
2108
+          margin-right: 24px;
2109
         }
2109
         }
2110
         .newTopItem{
2110
         .newTopItem{
2111
-          margin-right: 24px;
2111
+          margin-right: 16px;
2112
+          &:last-of-type{
2113
+            margin-right: 0;
2114
+          }
2112
         }
2115
         }
2113
       }
2116
       }
2114
     }
2117
     }

+ 43 - 5
src/app/components/incidentManagement/incident-create/incident-create.component.ts

@@ -97,6 +97,7 @@ export class IncidentCreateComponent implements OnInit {
97
     incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
97
     incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
98
     incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
98
     incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
99
     incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
99
     incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
100
+    incidentModel.repairIncidentType && (incidentModel.repairIncidentType = incidentModel.repairIncidentType.value);
100
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
101
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
101
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
102
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
102
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
103
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
@@ -604,6 +605,19 @@ export class IncidentCreateComponent implements OnInit {
604
       this.applicationSourceList = data || [];
605
       this.applicationSourceList = data || [];
605
     });
606
     });
606
   }
607
   }
608
+  // 报修类型列表
609
+  repairIncidentTypeList:any[] = [];
610
+  getRepairIncidentType() {
611
+    this.mainService.getDictionary("list", "repair_incident_type").subscribe((data) => {
612
+      this.repairIncidentTypeList = data || [];
613
+    });
614
+  }
615
+  // 选择报修类型
616
+  changeRepairIncidentType(value){
617
+    this.incidentModel.department = undefined;
618
+    this.isRelatedDepartment = false;
619
+    this.changeApplyRelatedDepartment(this.isRelatedDepartment);
620
+  }
607
   // 楼栋列表
621
   // 楼栋列表
608
   applicationBuildingList:any[] = [];
622
   applicationBuildingList:any[] = [];
609
   searchApplicationBuilding(keyWord?, buildingId?) {
623
   searchApplicationBuilding(keyWord?, buildingId?) {
@@ -823,6 +837,11 @@ export class IncidentCreateComponent implements OnInit {
823
   maskFlag:any = false;
837
   maskFlag:any = false;
824
   // 运维-直接解决
838
   // 运维-直接解决
825
   directOrder(){
839
   directOrder(){
840
+    if(this.incidentModel.repairIncidentType === 'public' && !this.incidentModel.requester){
841
+      this.msg.warning('请选择申请人!');
842
+      return;
843
+    }
844
+
826
     if(!this.incidentModel.category){
845
     if(!this.incidentModel.category){
827
       this.msg.warning('请选择故障现象!');
846
       this.msg.warning('请选择故障现象!');
828
       return;
847
       return;
@@ -834,7 +853,7 @@ export class IncidentCreateComponent implements OnInit {
834
       return;
853
       return;
835
     }
854
     }
836
 
855
 
837
-    if(!this.incidentModel.department){
856
+    if(this.incidentModel.repairIncidentType === 'dept' && !this.incidentModel.department){
838
       this.msg.warning('请选择申请科室!');
857
       this.msg.warning('请选择申请科室!');
839
       return;
858
       return;
840
     }
859
     }
@@ -881,6 +900,7 @@ export class IncidentCreateComponent implements OnInit {
881
         "deleteFlag": 0,
900
         "deleteFlag": 0,
882
         "duty": this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
901
         "duty": this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
883
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
902
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
903
+        "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
884
         "alarmType": false,
904
         "alarmType": false,
885
         "department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
905
         "department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
886
         "contactsInformation": this.incidentModel.contactsInformation,
906
         "contactsInformation": this.incidentModel.contactsInformation,
@@ -951,6 +971,11 @@ export class IncidentCreateComponent implements OnInit {
951
   }
971
   }
952
   // 运维-建单并派单
972
   // 运维-建单并派单
953
   assignOrder(){
973
   assignOrder(){
974
+    if(this.incidentModel.repairIncidentType === 'public' && !this.incidentModel.requester){
975
+      this.msg.warning('请选择申请人!');
976
+      return;
977
+    }
978
+
954
     if(!this.incidentModel.category){
979
     if(!this.incidentModel.category){
955
       this.msg.warning('请选择故障现象!');
980
       this.msg.warning('请选择故障现象!');
956
       return;
981
       return;
@@ -962,7 +987,7 @@ export class IncidentCreateComponent implements OnInit {
962
       return;
987
       return;
963
     }
988
     }
964
 
989
 
965
-    if(!this.incidentModel.department){
990
+    if(this.incidentModel.repairIncidentType === 'dept' && !this.incidentModel.department){
966
       this.msg.warning('请选择申请科室!');
991
       this.msg.warning('请选择申请科室!');
967
       return;
992
       return;
968
     }
993
     }
@@ -1011,6 +1036,7 @@ export class IncidentCreateComponent implements OnInit {
1011
         "description": this.incidentModel.description,
1036
         "description": this.incidentModel.description,
1012
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
1037
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
1013
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
1038
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
1039
+        "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
1014
         "acceptUser": { id: this.tool.getCurrentUserId() },
1040
         "acceptUser": { id: this.tool.getCurrentUserId() },
1015
         "callID": this.incidentModel.callID || undefined,
1041
         "callID": this.incidentModel.callID || undefined,
1016
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
1042
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
@@ -1085,6 +1111,7 @@ export class IncidentCreateComponent implements OnInit {
1085
         "description": this.incidentModel.description,
1111
         "description": this.incidentModel.description,
1086
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
1112
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
1087
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
1113
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
1114
+        "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
1088
         "acceptUser": { id: this.tool.getCurrentUserId() },
1115
         "acceptUser": { id: this.tool.getCurrentUserId() },
1089
         "callID": this.incidentModel.callID || undefined,
1116
         "callID": this.incidentModel.callID || undefined,
1090
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
1117
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
@@ -1132,6 +1159,11 @@ export class IncidentCreateComponent implements OnInit {
1132
   buildType;
1159
   buildType;
1133
   editOrder;
1160
   editOrder;
1134
   saveOrder(){
1161
   saveOrder(){
1162
+    if(this.incidentModel.repairIncidentType === 'public' && !this.incidentModel.requester){
1163
+      this.msg.warning('请选择申请人!');
1164
+      return;
1165
+    }
1166
+
1135
     if(!this.incidentModel.category){
1167
     if(!this.incidentModel.category){
1136
       this.msg.warning('请选择故障现象!');
1168
       this.msg.warning('请选择故障现象!');
1137
       return;
1169
       return;
@@ -1143,7 +1175,7 @@ export class IncidentCreateComponent implements OnInit {
1143
       return;
1175
       return;
1144
     }
1176
     }
1145
 
1177
 
1146
-    if(!this.incidentModel.department){
1178
+    if(this.incidentModel.repairIncidentType === 'dept' && !this.incidentModel.department){
1147
       this.msg.warning('请选择申请科室!');
1179
       this.msg.warning('请选择申请科室!');
1148
       return;
1180
       return;
1149
     }
1181
     }
@@ -1187,6 +1219,7 @@ export class IncidentCreateComponent implements OnInit {
1187
         "description": this.incidentModel.description,
1219
         "description": this.incidentModel.description,
1188
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
1220
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
1189
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
1221
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
1222
+        "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
1190
         "acceptUser": { id: this.tool.getCurrentUserId() },
1223
         "acceptUser": { id: this.tool.getCurrentUserId() },
1191
         "callID": this.incidentModel.callID || undefined,
1224
         "callID": this.incidentModel.callID || undefined,
1192
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
1225
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
@@ -1328,7 +1361,11 @@ export class IncidentCreateComponent implements OnInit {
1328
   resetOrderData2(){
1361
   resetOrderData2(){
1329
     this.fileList = [];
1362
     this.fileList = [];
1330
     this.repairImgs = [];
1363
     this.repairImgs = [];
1331
-    this.isRelatedDepartment = true;
1364
+    if(this.incidentModel.repairIncidentType === 'public'){
1365
+      this.isRelatedDepartment = false;
1366
+    }else{
1367
+      this.isRelatedDepartment = true;
1368
+    }
1332
   }
1369
   }
1333
 
1370
 
1334
   // 打开新建工单
1371
   // 打开新建工单
@@ -1343,13 +1380,14 @@ export class IncidentCreateComponent implements OnInit {
1343
     this.searchApplicationCategory();
1380
     this.searchApplicationCategory();
1344
     this.searchApplicationPriority();
1381
     this.searchApplicationPriority();
1345
     this.searchApplicationSource();
1382
     this.searchApplicationSource();
1383
+    this.getRepairIncidentType();
1346
     isInit ? this.searchApplicationDepartment('itsm', undefined, undefined, undefined, true) : this.searchApplicationDepartment('itsm');
1384
     isInit ? this.searchApplicationDepartment('itsm', undefined, undefined, undefined, true) : this.searchApplicationDepartment('itsm');
1347
     isInit && ((this.isRelatedDepartment && this.incidentModel.department) || (!this.isRelatedDepartment && this.incidentModel.hosId) || this.buildType === '报修转事件' ) && this.incidentModel.hosId && this.searchApplicationBuilding();
1385
     isInit && ((this.isRelatedDepartment && this.incidentModel.department) || (!this.isRelatedDepartment && this.incidentModel.hosId) || this.buildType === '报修转事件' ) && this.incidentModel.hosId && this.searchApplicationBuilding();
1348
     isInit && this.incidentModel.area && this.searchApplicationFloor();
1386
     isInit && this.incidentModel.area && this.searchApplicationFloor();
1349
 
1387
 
1350
     this.currentRTab = 0;
1388
     this.currentRTab = 0;
1351
     this.rightTitle_tab = [];
1389
     this.rightTitle_tab = [];
1352
-    this.incidentModel = isInit ? this.incidentModel : {};
1390
+    this.incidentModel = isInit ? this.incidentModel : { repairIncidentType: 'dept' };
1353
     this.incidentMsg = isInit ? this.incidentMsg : {};
1391
     this.incidentMsg = isInit ? this.incidentMsg : {};
1354
     this.isBuildOrderAgagin = false;
1392
     this.isBuildOrderAgagin = false;
1355
     this.incidentModel.department = isInit ? this.incidentModel.department : null;
1393
     this.incidentModel.department = isInit ? this.incidentModel.department : null;

+ 11 - 4
src/app/views/fuwutai/fuwutai.component.html

@@ -988,7 +988,7 @@
988
               </nz-option>
988
               </nz-option>
989
             </nz-select>
989
             </nz-select>
990
           </div>
990
           </div>
991
-          <div class="newTopItem">
991
+          <div class="newTopItem" [hidden]="incidentModel.repairIncidentType === 'public'">
992
             <span class="grayFont required">申请科室:</span>
992
             <span class="grayFont required">申请科室:</span>
993
             <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeInp('itsm', $event)" nzPlaceHolder="请选择申请科室" [(ngModel)]="incidentModel.department" (ngModelChange)="changeApplyDept($event)" nzAllowClear (nzOpenChange)="openChangeApplyDept($event)">
993
             <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeInp('itsm', $event)" nzPlaceHolder="请选择申请科室" [(ngModel)]="incidentModel.department" (ngModelChange)="changeApplyDept($event)" nzAllowClear (nzOpenChange)="openChangeApplyDept($event)">
994
               <ng-container *ngFor="let option of applicationDeptList">
994
               <ng-container *ngFor="let option of applicationDeptList">
@@ -1000,7 +1000,7 @@
1000
             </nz-select>
1000
             </nz-select>
1001
           </div>
1001
           </div>
1002
           <div class="newTopItem">
1002
           <div class="newTopItem">
1003
-            <span class="grayFont">申请人:</span>
1003
+            <span class="grayFont" [ngClass]="{'required': incidentModel.repairIncidentType === 'public'}">申请人:</span>
1004
             <ng-container *ngIf="buildType === '报修转事件'">{{incidentMsg.requesterName}}</ng-container>
1004
             <ng-container *ngIf="buildType === '报修转事件'">{{incidentMsg.requesterName}}</ng-container>
1005
             <ng-container *ngIf="buildType !== '报修转事件'">
1005
             <ng-container *ngIf="buildType !== '报修转事件'">
1006
               <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('requester', $event)" nzPlaceHolder="请选择申请人" [(ngModel)]="incidentModel.requester" (ngModelChange)="changeApplyRequester($event)" nzAllowClear (nzOpenChange)="openChangeApplyRequester($event)">
1006
               <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('requester', $event)" nzPlaceHolder="请选择申请人" [(ngModel)]="incidentModel.requester" (ngModelChange)="changeApplyRequester($event)" nzAllowClear (nzOpenChange)="openChangeApplyRequester($event)">
@@ -1011,12 +1011,19 @@
1011
                   <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1011
                   <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
1012
                 </nz-option>
1012
                 </nz-option>
1013
               </nz-select>
1013
               </nz-select>
1014
-              <label nz-checkbox [(ngModel)]="isRelatedDepartment" (ngModelChange)="changeApplyRelatedDepartment($event)" class="ml8">关联查</label>
1014
+              <label [hidden]="incidentModel.repairIncidentType === 'public'" nz-checkbox [(ngModel)]="isRelatedDepartment" (ngModelChange)="changeApplyRelatedDepartment($event)" class="ml8">关联查</label>
1015
             </ng-container>
1015
             </ng-container>
1016
           </div>
1016
           </div>
1017
-          <div class="newTopItem" *ngIf="buildType !== '编辑事件'">
1017
+          <div class="newTopItem" *ngIf="incidentModel.incomingPhone">
1018
             <span class="grayFont">来电电话:{{incidentModel.incomingPhone}}</span>
1018
             <span class="grayFont">来电电话:{{incidentModel.incomingPhone}}</span>
1019
           </div>
1019
           </div>
1020
+          <div class="newTopItem">
1021
+            <span class="grayFont">
1022
+              <nz-radio-group [(ngModel)]="incidentModel.repairIncidentType" (ngModelChange)="changeRepairIncidentType($event)">
1023
+                <label nz-radio [nzValue]="item.value" *ngFor="let item of repairIncidentTypeList">{{item.name}}</label>
1024
+              </nz-radio-group>
1025
+            </span>
1026
+          </div>
1020
         </div>
1027
         </div>
1021
       </div>
1028
       </div>
1022
       <div nz-row class="content">
1029
       <div nz-row class="content">

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

@@ -2140,10 +2140,13 @@
2140
           font-size: 14px;
2140
           font-size: 14px;
2141
           .name{
2141
           .name{
2142
             font-weight: bold;
2142
             font-weight: bold;
2143
-            margin-right: 48px;
2143
+            margin-right: 24px;
2144
           }
2144
           }
2145
           .newTopItem{
2145
           .newTopItem{
2146
-            margin-right: 24px;
2146
+            margin-right: 16px;
2147
+            &:last-of-type{
2148
+              margin-right: 0;
2149
+            }
2147
           }
2150
           }
2148
         }
2151
         }
2149
       }
2152
       }

+ 50 - 10
src/app/views/fuwutai/fuwutai.component.ts

@@ -1040,7 +1040,7 @@ export class FuwutaiComponent implements OnInit {
1040
     //呼入回调函数
1040
     //呼入回调函数
1041
     TLWSA.onCallin = function (jso) {
1041
     TLWSA.onCallin = function (jso) {
1042
       console.log(jso);
1042
       console.log(jso);
1043
-      _this.incidentModel = {};
1043
+      _this.incidentModel = { repairIncidentType: 'dept' };
1044
       _this.callNumber = _this.incidentModel.incomingPhone = jso.caller;//来电的电话
1044
       _this.callNumber = _this.incidentModel.incomingPhone = jso.caller;//来电的电话
1045
       _this.incidentModel.callID = jso.crs;//来电的话机id
1045
       _this.incidentModel.callID = jso.crs;//来电的话机id
1046
       if (jso) {
1046
       if (jso) {
@@ -1426,20 +1426,20 @@ export class FuwutaiComponent implements OnInit {
1426
         // 200签入 201摘机 202来电
1426
         // 200签入 201摘机 202来电
1427
         if (data.status == 200 && data.phone) {
1427
         if (data.status == 200 && data.phone) {
1428
           this.incomingService.setPhoneNumber(phoneNumber);
1428
           this.incomingService.setPhoneNumber(phoneNumber);
1429
-          this.incidentModel = {};
1429
+          this.incidentModel = { repairIncidentType: 'dept' };
1430
           this.incidentMsg = {};
1430
           this.incidentMsg = {};
1431
           this.incidentModel.callID = data.callId || undefined;
1431
           this.incidentModel.callID = data.callId || undefined;
1432
           this.msg.info('签入成功');
1432
           this.msg.info('签入成功');
1433
           this.cancelBindExtensionNumber();
1433
           this.cancelBindExtensionNumber();
1434
         } else if (data.status == 201 && data.phone) {
1434
         } else if (data.status == 201 && data.phone) {
1435
-          this.incidentModel = {};
1435
+          this.incidentModel = { repairIncidentType: 'dept' };
1436
           this.incidentMsg = {};
1436
           this.incidentMsg = {};
1437
           this.incidentModel.callID = data.callId || undefined;
1437
           this.incidentModel.callID = data.callId || undefined;
1438
 
1438
 
1439
           this.incidentModel.incomingPhone = this.callNumber = this.incidentModel.contactsInformation = data.phone;
1439
           this.incidentModel.incomingPhone = this.callNumber = this.incidentModel.contactsInformation = data.phone;
1440
           this.searchBxDept();
1440
           this.searchBxDept();
1441
         } else if (data.status == 201 && data.phone === "") {
1441
         } else if (data.status == 201 && data.phone === "") {
1442
-          this.incidentModel = {};
1442
+          this.incidentModel = { repairIncidentType: 'dept' };
1443
           this.incidentMsg = {};
1443
           this.incidentMsg = {};
1444
           this.incidentModel.callID = data.callId || undefined;
1444
           this.incidentModel.callID = data.callId || undefined;
1445
           //没绑定科室
1445
           //没绑定科室
@@ -2382,7 +2382,11 @@ export class FuwutaiComponent implements OnInit {
2382
   resetOrderData2(){
2382
   resetOrderData2(){
2383
     this.fileList = [];
2383
     this.fileList = [];
2384
     this.repairImgs = [];
2384
     this.repairImgs = [];
2385
-    this.isRelatedDepartment = true;
2385
+    if(this.incidentModel.repairIncidentType === 'public'){
2386
+      this.isRelatedDepartment = false;
2387
+    }else{
2388
+      this.isRelatedDepartment = true;
2389
+    }
2386
   }
2390
   }
2387
   // 打开新建工单
2391
   // 打开新建工单
2388
   deathTasktypeId; //获取这个写死的任务类型的id,送病人回病房
2392
   deathTasktypeId; //获取这个写死的任务类型的id,送病人回病房
@@ -2405,6 +2409,7 @@ export class FuwutaiComponent implements OnInit {
2405
       this.searchApplicationCategory();
2409
       this.searchApplicationCategory();
2406
       this.searchApplicationPriority();
2410
       this.searchApplicationPriority();
2407
       this.searchApplicationSource();
2411
       this.searchApplicationSource();
2412
+      this.getRepairIncidentType();
2408
       isInit ? this.searchApplicationDepartment('itsm', undefined, undefined, undefined, true) : this.searchApplicationDepartment('itsm');
2413
       isInit ? this.searchApplicationDepartment('itsm', undefined, undefined, undefined, true) : this.searchApplicationDepartment('itsm');
2409
       isInit && ((this.isRelatedDepartment && this.incidentModel.department) || (!this.isRelatedDepartment && this.incidentModel.hosId) || this.buildType === '报修转事件' ) && this.incidentModel.hosId && this.searchApplicationBuilding();
2414
       isInit && ((this.isRelatedDepartment && this.incidentModel.department) || (!this.isRelatedDepartment && this.incidentModel.hosId) || this.buildType === '报修转事件' ) && this.incidentModel.hosId && this.searchApplicationBuilding();
2410
       isInit && this.incidentModel.area && this.searchApplicationFloor();
2415
       isInit && this.incidentModel.area && this.searchApplicationFloor();
@@ -2415,7 +2420,7 @@ export class FuwutaiComponent implements OnInit {
2415
         this.fixedTab = "newOrder";
2420
         this.fixedTab = "newOrder";
2416
         this.currentRTab = 0;
2421
         this.currentRTab = 0;
2417
         this.rightTitle_tab = [];
2422
         this.rightTitle_tab = [];
2418
-        this.incidentModel = isInit ? this.incidentModel : {};
2423
+        this.incidentModel = isInit ? this.incidentModel : { repairIncidentType: 'dept' };
2419
         this.incidentMsg = isInit ? this.incidentMsg : {};
2424
         this.incidentMsg = isInit ? this.incidentMsg : {};
2420
         this.isBuildOrderAgagin = false;
2425
         this.isBuildOrderAgagin = false;
2421
         this.applyDept = null;
2426
         this.applyDept = null;
@@ -2457,7 +2462,7 @@ export class FuwutaiComponent implements OnInit {
2457
     this.fixedTab = "newOrder";
2462
     this.fixedTab = "newOrder";
2458
     this.currentRTab = 0;
2463
     this.currentRTab = 0;
2459
     this.rightTitle_tab = [];
2464
     this.rightTitle_tab = [];
2460
-    this.incidentModel = isInit ? this.incidentModel : {};
2465
+    this.incidentModel = isInit ? this.incidentModel : { repairIncidentType: 'dept' };
2461
     this.incidentMsg = isInit ? this.incidentMsg : {};
2466
     this.incidentMsg = isInit ? this.incidentMsg : {};
2462
     this.isBuildOrderAgagin = false;
2467
     this.isBuildOrderAgagin = false;
2463
     this.applyDept = null;
2468
     this.applyDept = null;
@@ -2854,6 +2859,7 @@ export class FuwutaiComponent implements OnInit {
2854
         "deleteFlag": 0,
2859
         "deleteFlag": 0,
2855
         "duty": this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
2860
         "duty": this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
2856
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
2861
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
2862
+        "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
2857
         "alarmType": false,
2863
         "alarmType": false,
2858
         "department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
2864
         "department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
2859
         "contactsInformation": this.incidentModel.contactsInformation,
2865
         "contactsInformation": this.incidentModel.contactsInformation,
@@ -3129,6 +3135,19 @@ export class FuwutaiComponent implements OnInit {
3129
       this.applicationSourceList = data || [];
3135
       this.applicationSourceList = data || [];
3130
     });
3136
     });
3131
   }
3137
   }
3138
+  // 报修类型列表
3139
+  repairIncidentTypeList:any[] = [];
3140
+  getRepairIncidentType() {
3141
+    this.mainService.getDictionary("list", "repair_incident_type").subscribe((data) => {
3142
+      this.repairIncidentTypeList = data || [];
3143
+    });
3144
+  }
3145
+  // 选择报修类型
3146
+  changeRepairIncidentType(value){
3147
+    this.incidentModel.department = undefined;
3148
+    this.isRelatedDepartment = false;
3149
+    this.changeApplyRelatedDepartment(this.isRelatedDepartment);
3150
+  }
3132
   // 楼栋列表
3151
   // 楼栋列表
3133
   applicationBuildingList:any[] = [];
3152
   applicationBuildingList:any[] = [];
3134
   searchApplicationBuilding(keyWord?, buildingId?) {
3153
   searchApplicationBuilding(keyWord?, buildingId?) {
@@ -3504,6 +3523,11 @@ export class FuwutaiComponent implements OnInit {
3504
   maskFlag:any = false;
3523
   maskFlag:any = false;
3505
   // 运维-直接解决
3524
   // 运维-直接解决
3506
   directOrder(){
3525
   directOrder(){
3526
+    if(this.incidentModel.repairIncidentType === 'public' && !this.incidentModel.requester){
3527
+      this.msg.warning('请选择申请人!');
3528
+      return;
3529
+    }
3530
+
3507
     if(!this.incidentModel.category){
3531
     if(!this.incidentModel.category){
3508
       this.msg.warning('请选择故障现象!');
3532
       this.msg.warning('请选择故障现象!');
3509
       return;
3533
       return;
@@ -3515,7 +3539,7 @@ export class FuwutaiComponent implements OnInit {
3515
       return;
3539
       return;
3516
     }
3540
     }
3517
 
3541
 
3518
-    if(!this.incidentModel.department){
3542
+    if(this.incidentModel.repairIncidentType === 'dept' && !this.incidentModel.department){
3519
       this.msg.warning('请选择申请科室!');
3543
       this.msg.warning('请选择申请科室!');
3520
       return;
3544
       return;
3521
     }
3545
     }
@@ -3549,6 +3573,11 @@ export class FuwutaiComponent implements OnInit {
3549
   }
3573
   }
3550
   // 运维-建单并派单
3574
   // 运维-建单并派单
3551
   assignOrder(){
3575
   assignOrder(){
3576
+    if(this.incidentModel.repairIncidentType === 'public' && !this.incidentModel.requester){
3577
+      this.msg.warning('请选择申请人!');
3578
+      return;
3579
+    }
3580
+
3552
     if(!this.incidentModel.category){
3581
     if(!this.incidentModel.category){
3553
       this.msg.warning('请选择故障现象!');
3582
       this.msg.warning('请选择故障现象!');
3554
       return;
3583
       return;
@@ -3561,7 +3590,7 @@ export class FuwutaiComponent implements OnInit {
3561
       return;
3590
       return;
3562
     }
3591
     }
3563
 
3592
 
3564
-    if(!this.incidentModel.department){
3593
+    if(this.incidentModel.repairIncidentType === 'dept' && !this.incidentModel.department){
3565
       this.msg.warning('请选择申请科室!');
3594
       this.msg.warning('请选择申请科室!');
3566
       return;
3595
       return;
3567
     }
3596
     }
@@ -3610,6 +3639,7 @@ export class FuwutaiComponent implements OnInit {
3610
         "description": this.incidentModel.description,
3639
         "description": this.incidentModel.description,
3611
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3640
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3612
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
3641
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
3642
+        "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
3613
         "acceptUser": { id: this.tool.getCurrentUserId() },
3643
         "acceptUser": { id: this.tool.getCurrentUserId() },
3614
         "callID": this.incidentModel.callID || undefined,
3644
         "callID": this.incidentModel.callID || undefined,
3615
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
3645
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
@@ -3684,6 +3714,7 @@ export class FuwutaiComponent implements OnInit {
3684
         "description": this.incidentModel.description,
3714
         "description": this.incidentModel.description,
3685
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3715
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3686
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
3716
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
3717
+        "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
3687
         "acceptUser": { id: this.tool.getCurrentUserId() },
3718
         "acceptUser": { id: this.tool.getCurrentUserId() },
3688
         "callID": this.incidentModel.callID || undefined,
3719
         "callID": this.incidentModel.callID || undefined,
3689
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
3720
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
@@ -3730,6 +3761,11 @@ export class FuwutaiComponent implements OnInit {
3730
 
3761
 
3731
   // 运维-保存
3762
   // 运维-保存
3732
   saveOrder(){
3763
   saveOrder(){
3764
+    if(this.incidentModel.repairIncidentType === 'public' && !this.incidentModel.requester){
3765
+      this.msg.warning('请选择申请人!');
3766
+      return;
3767
+    }
3768
+
3733
     if(!this.incidentModel.category){
3769
     if(!this.incidentModel.category){
3734
       this.msg.warning('请选择故障现象!');
3770
       this.msg.warning('请选择故障现象!');
3735
       return;
3771
       return;
@@ -3741,7 +3777,7 @@ export class FuwutaiComponent implements OnInit {
3741
       return;
3777
       return;
3742
     }
3778
     }
3743
 
3779
 
3744
-    if(!this.incidentModel.department){
3780
+    if(this.incidentModel.repairIncidentType === 'dept' && !this.incidentModel.department){
3745
       this.msg.warning('请选择申请科室!');
3781
       this.msg.warning('请选择申请科室!');
3746
       return;
3782
       return;
3747
     }
3783
     }
@@ -3784,6 +3820,7 @@ export class FuwutaiComponent implements OnInit {
3784
         "description": this.incidentModel.description,
3820
         "description": this.incidentModel.description,
3785
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3821
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3786
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
3822
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
3823
+        "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
3787
         "acceptUser": { id: this.tool.getCurrentUserId() },
3824
         "acceptUser": { id: this.tool.getCurrentUserId() },
3788
         "callID": this.incidentModel.callID || undefined,
3825
         "callID": this.incidentModel.callID || undefined,
3789
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
3826
         "incomingPhone": this.incidentModel.incomingPhone || undefined,
@@ -4936,6 +4973,7 @@ export class FuwutaiComponent implements OnInit {
4936
     incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
4973
     incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
4937
     incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
4974
     incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
4938
     incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
4975
     incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
4976
+    incidentModel.repairIncidentType && (incidentModel.repairIncidentType = incidentModel.repairIncidentType.value);
4939
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
4977
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
4940
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
4978
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
4941
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
4979
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
@@ -4966,6 +5004,7 @@ export class FuwutaiComponent implements OnInit {
4966
     incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
5004
     incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
4967
     incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
5005
     incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
4968
     incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
5006
     incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
5007
+    incidentModel.repairIncidentType && (incidentModel.repairIncidentType = incidentModel.repairIncidentType.value);
4969
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
5008
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
4970
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
5009
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
4971
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
5010
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
@@ -5064,6 +5103,7 @@ export class FuwutaiComponent implements OnInit {
5064
     incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
5103
     incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
5065
     incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
5104
     incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
5066
     incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
5105
     incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
5106
+    incidentModel.repairIncidentType && (incidentModel.repairIncidentType = incidentModel.repairIncidentType.value);
5067
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
5107
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
5068
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
5108
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
5069
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
5109
     incidentModel.place && (incidentModel.place = incidentModel.place.id);