|
@@ -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": {
|