소스 검색

事件编辑

seimin 5 달 전
부모
커밋
8abc33fba5

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

@@ -13,7 +13,7 @@
13 13
         <div class="name">故障工单编辑</div>
14 14
         <div class="newTopItem">
15 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 17
             <ng-container *ngFor="let option of applicationHospitalList">
18 18
               <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
19 19
             </ng-container>
@@ -105,6 +105,9 @@
105 105
                     <span class="name">报修人电话:</span>
106 106
                     <ng-container *ngIf="incidentMsg.requesterPhone">{{incidentMsg.requesterPhone}}<em (click)="importPhone(incidentMsg.requesterPhone)">引入</em></ng-container>
107 107
                   </div>
108
+                  <div class="col">
109
+
110
+                  </div>
108 111
                 </div>
109 112
 
110 113
                 <div class="row gap8">
@@ -149,7 +152,7 @@
149 152
                 <div class="row gap8">
150 153
                   <div class="col">
151 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 156
                       <nz-option [nzValue]="item.id" [nzLabel]="item.name" *ngFor="let item of applicationPriorityList"></nz-option>
154 157
                     </nz-select>
155 158
                   </div>

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

@@ -100,17 +100,8 @@ export class IncidentCreateComponent implements OnInit {
100 100
     incidentModel.source && (incidentModel.source = incidentModel.source.id);
101 101
     incidentModel.area && (incidentModel.area = incidentModel.area.id);
102 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 106
     this.incidentModel = incidentModel;
116 107
     this.incidentMsg = incidentMsg;
@@ -206,7 +197,7 @@ export class IncidentCreateComponent implements OnInit {
206 197
     this.incidentModel.duty = undefined;
207 198
 
208 199
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
209
-    if(this.incidentModel.category && e){
200
+    if(this.incidentModel.category && e && this.buildType !== '编辑事件'){
210 201
       let postData = {
211 202
         idx: 0,
212 203
         sum: 9999,
@@ -292,16 +283,11 @@ export class IncidentCreateComponent implements OnInit {
292 283
   // 故障现象列表
293 284
   applicationCategoryList:any[] = [];
294 285
   searchApplicationCategory(keyWord?) {
295
-    let { hospital, type } = this.tool.getHospitalOrDuty();
296 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 291
     let postData = {
306 292
       category: {
307 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 327
       let postData = {
342 328
         idx: 0,
343 329
         sum: 9999,
@@ -776,7 +762,7 @@ export class IncidentCreateComponent implements OnInit {
776 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 766
       let postData = {
781 767
         idx: 0,
782 768
         sum: 9999,
@@ -1117,15 +1103,41 @@ export class IncidentCreateComponent implements OnInit {
1117 1103
   buildType;
1118 1104
   editOrder;
1119 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 1137
     this.maskFlag = this.msg.loading("正在加载中..", {
1121 1138
       nzDuration: 0,
1122 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 1141
     let postData:any = {
1130 1142
       solutionId: this.solutionId,
1131 1143
       "incident": {

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

@@ -1168,7 +1168,7 @@
1168 1168
           <div class="name">来电咨询</div>
1169 1169
           <div class="newTopItem">
1170 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 1172
               <ng-container *ngFor="let option of applicationHospitalList">
1173 1173
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
1174 1174
               </ng-container>
@@ -1892,9 +1892,11 @@
1892 1892
                       <span class="name">报修人电话:</span>
1893 1893
                       <ng-container *ngIf="incidentMsg.requesterPhone">{{incidentMsg.requesterPhone}}<em (click)="importPhone(incidentMsg.requesterPhone)">引入</em></ng-container>
1894 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 1900
                     </div>
1899 1901
                   </div>
1900 1902
 
@@ -1940,7 +1942,7 @@
1940 1942
                   <div class="row gap8">
1941 1943
                     <div class="col">
1942 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 1946
                         <nz-option [nzValue]="item.id" [nzLabel]="item.name" *ngFor="let item of applicationPriorityList"></nz-option>
1945 1947
                       </nz-select>
1946 1948
                     </div>

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

@@ -2559,7 +2559,7 @@ export class FuwutaiComponent implements OnInit {
2559 2559
     this.incidentModel.duty = undefined;
2560 2560
 
2561 2561
     // 根据院区和故障现象带出责任部门,优先级,维修人/组
2562
-    if(this.incidentModel.category && e){
2562
+    if(this.incidentModel.category && e && this.buildType !== '编辑事件'){
2563 2563
       let postData = {
2564 2564
         idx: 0,
2565 2565
         sum: 9999,
@@ -2645,12 +2645,18 @@ export class FuwutaiComponent implements OnInit {
2645 2645
   // 故障现象列表
2646 2646
   applicationCategoryList:any[] = [];
2647 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 2654
     let postData = {
2649 2655
       category: {
2650 2656
         category: keyWord,
2651 2657
         selectType: 'mutlQuery',
2652 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 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 2690
       let postData = {
2685 2691
         idx: 0,
2686 2692
         sum: 9999,
@@ -3248,7 +3254,7 @@ export class FuwutaiComponent implements OnInit {
3248 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 3258
       let postData = {
3253 3259
         idx: 0,
3254 3260
         sum: 9999,
@@ -3600,15 +3606,40 @@ export class FuwutaiComponent implements OnInit {
3600 3606
 
3601 3607
   // 运维-保存
3602 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 3639
     this.maskFlag = this.msg.loading("正在加载中..", {
3604 3640
       nzDuration: 0,
3605 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 3643
     let postData:any = {
3613 3644
       solutionId: this.solutionId,
3614 3645
       "incident": {