Browse Source

事件编辑

seimin 5 months ago
parent
commit
8abc33fba5

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

@@ -13,7 +13,7 @@
13
         <div class="name">故障工单编辑</div>
13
         <div class="name">故障工单编辑</div>
14
         <div class="newTopItem">
14
         <div class="newTopItem">
15
           <span class="grayFont required">院区:</span>
15
           <span class="grayFont required">院区:</span>
16
-          <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择院区" [(ngModel)]="incidentModel.hosId" (ngModelChange)="changeApplyHospital($event)" nzAllowClear>
16
+          <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择院区" [(ngModel)]="incidentModel.hosId" (ngModelChange)="changeApplyHospital($event)" nzAllowClear [nzDisabled]="buildType === '编辑事件'">
17
             <ng-container *ngFor="let option of applicationHospitalList">
17
             <ng-container *ngFor="let option of applicationHospitalList">
18
               <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
18
               <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
19
             </ng-container>
19
             </ng-container>
@@ -105,6 +105,9 @@
105
                     <span class="name">报修人电话:</span>
105
                     <span class="name">报修人电话:</span>
106
                     <ng-container *ngIf="incidentMsg.requesterPhone">{{incidentMsg.requesterPhone}}<em (click)="importPhone(incidentMsg.requesterPhone)">引入</em></ng-container>
106
                     <ng-container *ngIf="incidentMsg.requesterPhone">{{incidentMsg.requesterPhone}}<em (click)="importPhone(incidentMsg.requesterPhone)">引入</em></ng-container>
107
                   </div>
107
                   </div>
108
+                  <div class="col">
109
+
110
+                  </div>
108
                 </div>
111
                 </div>
109
 
112
 
110
                 <div class="row gap8">
113
                 <div class="row gap8">
@@ -149,7 +152,7 @@
149
                 <div class="row gap8">
152
                 <div class="row gap8">
150
                   <div class="col">
153
                   <div class="col">
151
                     <span class="name required">优先级:</span>
154
                     <span class="name required">优先级:</span>
152
-                    <nz-select class="w100" [(ngModel)]="incidentModel.priorityId" nzAllowClear nzPlaceHolder="请选择优先级">
155
+                    <nz-select class="w100" [(ngModel)]="incidentModel.priorityId" nzAllowClear nzPlaceHolder="请选择优先级" [nzDisabled]="buildType === '编辑事件'">
153
                       <nz-option [nzValue]="item.id" [nzLabel]="item.name" *ngFor="let item of applicationPriorityList"></nz-option>
156
                       <nz-option [nzValue]="item.id" [nzLabel]="item.name" *ngFor="let item of applicationPriorityList"></nz-option>
154
                     </nz-select>
157
                     </nz-select>
155
                   </div>
158
                   </div>

+ 39 - 27
src/app/components/incidentManagement/incident-create/incident-create.component.ts

@@ -100,17 +100,8 @@ export class IncidentCreateComponent implements OnInit {
100
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
100
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
101
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
101
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
102
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
102
     incidentModel.place && (incidentModel.place = incidentModel.place.id);
103
-
104
-    let { hospital, type } = this.tool.getHospitalOrDuty();
105
-    if(type === 'duty'){
106
-      // 当前的所属责任部门
107
-      incidentModel.category && (this.applicationCategoryList = [cloneDeep(incidentModel.category)]);
108
-      incidentModel.category && (incidentModel.category = incidentModel.category.id);
109
-    }else{
110
-      // 当前的所属院区
111
-      incidentModel.category && (this.applicationCategoryList = []);//故障现象列表为空,不要问,问就是设计如此
112
-      incidentModel.category && (incidentModel.category = undefined);
113
-    }
103
+    incidentModel.category && (this.applicationCategoryList = [cloneDeep(incidentModel.category)]);
104
+    incidentModel.category && (incidentModel.category = incidentModel.category.id);
114
 
105
 
115
     this.incidentModel = incidentModel;
106
     this.incidentModel = incidentModel;
116
     this.incidentMsg = incidentMsg;
107
     this.incidentMsg = incidentMsg;
@@ -206,7 +197,7 @@ export class IncidentCreateComponent implements OnInit {
206
     this.incidentModel.duty = undefined;
197
     this.incidentModel.duty = undefined;
207
 
198
 
208
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
199
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
209
-    if(this.incidentModel.category && e){
200
+    if(this.incidentModel.category && e && this.buildType !== '编辑事件'){
210
       let postData = {
201
       let postData = {
211
         idx: 0,
202
         idx: 0,
212
         sum: 9999,
203
         sum: 9999,
@@ -292,16 +283,11 @@ export class IncidentCreateComponent implements OnInit {
292
   // 故障现象列表
283
   // 故障现象列表
293
   applicationCategoryList:any[] = [];
284
   applicationCategoryList:any[] = [];
294
   searchApplicationCategory(keyWord?) {
285
   searchApplicationCategory(keyWord?) {
295
-    let { hospital, type } = this.tool.getHospitalOrDuty();
296
     let dutyIds;
286
     let dutyIds;
297
-    if(type === 'duty'){
298
-      // 当前的所属责任部门
299
-      dutyIds = hospital.id.toString();
300
-    }else{
301
-      // 当前的所属院区
302
-      this.applicationCategoryList = [];//故障现象列表为空,不要问,问就是设计如此
303
-      return;
287
+    if(this.buildType === '编辑事件'){
288
+      dutyIds = this.incidentModel.duty.id.toString();
304
     }
289
     }
290
+
305
     let postData = {
291
     let postData = {
306
       category: {
292
       category: {
307
         category: keyWord,
293
         category: keyWord,
@@ -337,7 +323,7 @@ export class IncidentCreateComponent implements OnInit {
337
       }
323
       }
338
     }
324
     }
339
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
325
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
340
-    if(this.incidentModel.hosId && e){
326
+    if(this.incidentModel.hosId && e && this.buildType !== '编辑事件'){
341
       let postData = {
327
       let postData = {
342
         idx: 0,
328
         idx: 0,
343
         sum: 9999,
329
         sum: 9999,
@@ -776,7 +762,7 @@ export class IncidentCreateComponent implements OnInit {
776
     this.searchApplicationRequester();
762
     this.searchApplicationRequester();
777
 
763
 
778
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
764
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
779
-    if(this.incidentModel.category && this.incidentModel.hosId){
765
+    if(this.incidentModel.category && this.incidentModel.hosId && this.buildType !== '编辑事件'){
780
       let postData = {
766
       let postData = {
781
         idx: 0,
767
         idx: 0,
782
         sum: 9999,
768
         sum: 9999,
@@ -1117,15 +1103,41 @@ export class IncidentCreateComponent implements OnInit {
1117
   buildType;
1103
   buildType;
1118
   editOrder;
1104
   editOrder;
1119
   saveOrder(){
1105
   saveOrder(){
1106
+    if(!this.incidentModel.category){
1107
+      this.msg.warning('请选择故障现象!');
1108
+      return;
1109
+    }
1110
+
1111
+    let category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
1112
+    if(!this.incidentModel.duty){
1113
+      this.msg.warning(`故障现象【${category.mutiCategory}】没有设置责任部门!`);
1114
+      return;
1115
+    }
1116
+
1117
+    if(!this.incidentModel.department){
1118
+      this.msg.warning('请选择申请科室!');
1119
+      return;
1120
+    }
1121
+
1122
+    if(!this.incidentModel.contactsInformation){
1123
+      this.msg.warning('请填写联系电话!');
1124
+      return;
1125
+    }
1126
+
1127
+    if(!this.incidentModel.priorityId){
1128
+      this.msg.warning('请选择优先级!');
1129
+      return;
1130
+    }
1131
+
1132
+    if(!this.incidentModel.description){
1133
+      this.msg.warning('请选择故障描述!');
1134
+      return;
1135
+    }
1136
+
1120
     this.maskFlag = this.msg.loading("正在加载中..", {
1137
     this.maskFlag = this.msg.loading("正在加载中..", {
1121
       nzDuration: 0,
1138
       nzDuration: 0,
1122
     }).messageId;
1139
     }).messageId;
1123
 
1140
 
1124
-    let category;
1125
-    if(this.incidentModel.category){
1126
-      category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
1127
-    }
1128
-
1129
     let postData:any = {
1141
     let postData:any = {
1130
       solutionId: this.solutionId,
1142
       solutionId: this.solutionId,
1131
       "incident": {
1143
       "incident": {

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

@@ -1168,7 +1168,7 @@
1168
           <div class="name">来电咨询</div>
1168
           <div class="name">来电咨询</div>
1169
           <div class="newTopItem">
1169
           <div class="newTopItem">
1170
             <span class="grayFont required">院区:</span>
1170
             <span class="grayFont required">院区:</span>
1171
-            <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择院区" [(ngModel)]="incidentModel.hosId" (ngModelChange)="changeApplyHospital($event)" nzAllowClear>
1171
+            <nz-select style="width: 160px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzPlaceHolder="请选择院区" [(ngModel)]="incidentModel.hosId" (ngModelChange)="changeApplyHospital($event)" nzAllowClear [nzDisabled]="buildType === '编辑事件'">
1172
               <ng-container *ngFor="let option of applicationHospitalList">
1172
               <ng-container *ngFor="let option of applicationHospitalList">
1173
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1173
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1174
               </ng-container>
1174
               </ng-container>
@@ -1892,9 +1892,11 @@
1892
                       <span class="name">报修人电话:</span>
1892
                       <span class="name">报修人电话:</span>
1893
                       <ng-container *ngIf="incidentMsg.requesterPhone">{{incidentMsg.requesterPhone}}<em (click)="importPhone(incidentMsg.requesterPhone)">引入</em></ng-container>
1893
                       <ng-container *ngIf="incidentMsg.requesterPhone">{{incidentMsg.requesterPhone}}<em (click)="importPhone(incidentMsg.requesterPhone)">引入</em></ng-container>
1894
                     </div>
1894
                     </div>
1895
-                    <div class="col" *ngIf="buildType !== '编辑事件'">
1896
-                      <span class="name">来电电话:</span>
1897
-                      <ng-container *ngIf="incidentModel.incomingPhone">{{incidentModel.incomingPhone}}<em (click)="importPhone(incidentModel.incomingPhone)">引入</em></ng-container>
1895
+                    <div class="col">
1896
+                      <ng-container *ngIf="buildType !== '编辑事件'">
1897
+                        <span class="name">来电电话:</span>
1898
+                        <ng-container *ngIf="incidentModel.incomingPhone">{{incidentModel.incomingPhone}}<em (click)="importPhone(incidentModel.incomingPhone)">引入</em></ng-container>
1899
+                      </ng-container>
1898
                     </div>
1900
                     </div>
1899
                   </div>
1901
                   </div>
1900
 
1902
 
@@ -1940,7 +1942,7 @@
1940
                   <div class="row gap8">
1942
                   <div class="row gap8">
1941
                     <div class="col">
1943
                     <div class="col">
1942
                       <span class="name required">优先级:</span>
1944
                       <span class="name required">优先级:</span>
1943
-                      <nz-select class="w100" [(ngModel)]="incidentModel.priorityId" nzAllowClear nzPlaceHolder="请选择优先级">
1945
+                      <nz-select class="w100" [(ngModel)]="incidentModel.priorityId" nzAllowClear nzPlaceHolder="请选择优先级" [nzDisabled]="buildType === '编辑事件'">
1944
                         <nz-option [nzValue]="item.id" [nzLabel]="item.name" *ngFor="let item of applicationPriorityList"></nz-option>
1946
                         <nz-option [nzValue]="item.id" [nzLabel]="item.name" *ngFor="let item of applicationPriorityList"></nz-option>
1945
                       </nz-select>
1947
                       </nz-select>
1946
                     </div>
1948
                     </div>

+ 40 - 9
src/app/views/fuwutai/fuwutai.component.ts

@@ -2559,7 +2559,7 @@ export class FuwutaiComponent implements OnInit {
2559
     this.incidentModel.duty = undefined;
2559
     this.incidentModel.duty = undefined;
2560
 
2560
 
2561
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
2561
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
2562
-    if(this.incidentModel.category && e){
2562
+    if(this.incidentModel.category && e && this.buildType !== '编辑事件'){
2563
       let postData = {
2563
       let postData = {
2564
         idx: 0,
2564
         idx: 0,
2565
         sum: 9999,
2565
         sum: 9999,
@@ -2645,12 +2645,18 @@ export class FuwutaiComponent implements OnInit {
2645
   // 故障现象列表
2645
   // 故障现象列表
2646
   applicationCategoryList:any[] = [];
2646
   applicationCategoryList:any[] = [];
2647
   searchApplicationCategory(keyWord?) {
2647
   searchApplicationCategory(keyWord?) {
2648
+    let dutyIds;
2649
+    if(this.buildType === '编辑事件'){
2650
+      dutyIds = this.incidentModel.duty.id.toString();
2651
+    }else{
2652
+      dutyIds = this.itsmData.checkedHos.length ? (this.itsmData.checkedHos.map(v => v.id).toString() || undefined) : undefined;
2653
+    }
2648
     let postData = {
2654
     let postData = {
2649
       category: {
2655
       category: {
2650
         category: keyWord,
2656
         category: keyWord,
2651
         selectType: 'mutlQuery',
2657
         selectType: 'mutlQuery',
2652
         hierarchy: 3,//只差有三级的故障现象列表
2658
         hierarchy: 3,//只差有三级的故障现象列表
2653
-        dutyIds: this.itsmData.checkedHos.length ? (this.itsmData.checkedHos.map(v => v.id).toString() || undefined) : undefined,
2659
+        dutyIds,
2654
       },
2660
       },
2655
     };
2661
     };
2656
     console.log(postData);
2662
     console.log(postData);
@@ -2680,7 +2686,7 @@ export class FuwutaiComponent implements OnInit {
2680
       }
2686
       }
2681
     }
2687
     }
2682
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
2688
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
2683
-    if(this.incidentModel.hosId && e){
2689
+    if(this.incidentModel.hosId && e && this.buildType !== '编辑事件'){
2684
       let postData = {
2690
       let postData = {
2685
         idx: 0,
2691
         idx: 0,
2686
         sum: 9999,
2692
         sum: 9999,
@@ -3248,7 +3254,7 @@ export class FuwutaiComponent implements OnInit {
3248
     this.searchApplicationRequester();
3254
     this.searchApplicationRequester();
3249
 
3255
 
3250
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
3256
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
3251
-    if(this.incidentModel.category && this.incidentModel.hosId){
3257
+    if(this.incidentModel.category && this.incidentModel.hosId && this.buildType !== '编辑事件'){
3252
       let postData = {
3258
       let postData = {
3253
         idx: 0,
3259
         idx: 0,
3254
         sum: 9999,
3260
         sum: 9999,
@@ -3600,15 +3606,40 @@ export class FuwutaiComponent implements OnInit {
3600
 
3606
 
3601
   // 运维-保存
3607
   // 运维-保存
3602
   saveOrder(){
3608
   saveOrder(){
3609
+    if(!this.incidentModel.category){
3610
+      this.msg.warning('请选择故障现象!');
3611
+      return;
3612
+    }
3613
+
3614
+    let category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
3615
+    if(!this.incidentModel.duty){
3616
+      this.msg.warning(`故障现象【${category.mutiCategory}】没有设置责任部门!`);
3617
+      return;
3618
+    }
3619
+
3620
+    if(!this.incidentModel.department){
3621
+      this.msg.warning('请选择申请科室!');
3622
+      return;
3623
+    }
3624
+
3625
+    if(!this.incidentModel.contactsInformation){
3626
+      this.msg.warning('请填写联系电话!');
3627
+      return;
3628
+    }
3629
+
3630
+    if(!this.incidentModel.priorityId){
3631
+      this.msg.warning('请选择优先级!');
3632
+      return;
3633
+    }
3634
+
3635
+    if(!this.incidentModel.description){
3636
+      this.msg.warning('请选择故障描述!');
3637
+      return;
3638
+    }
3603
     this.maskFlag = this.msg.loading("正在加载中..", {
3639
     this.maskFlag = this.msg.loading("正在加载中..", {
3604
       nzDuration: 0,
3640
       nzDuration: 0,
3605
     }).messageId;
3641
     }).messageId;
3606
 
3642
 
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 = {
3643
     let postData:any = {
3613
       solutionId: this.solutionId,
3644
       solutionId: this.solutionId,
3614
       "incident": {
3645
       "incident": {