|
@@ -1,90 +1,121 @@
|
1
|
|
-import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
2
|
|
-import { ActivatedRoute } from '@angular/router';
|
3
|
|
-import { FormBuilder, Validators, FormGroup, FormControl } from '@angular/forms';
|
4
|
|
-import { MainService } from '../../services/main.service';
|
5
|
|
-import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
|
6
|
|
-import { NzMessageService } from 'ng-zorro-antd';
|
7
|
|
-import { forkJoin } from 'rxjs';
|
|
1
|
+import { Component, OnInit, OnDestroy, ViewChild } from "@angular/core";
|
|
2
|
+import { ActivatedRoute } from "@angular/router";
|
|
3
|
+import {
|
|
4
|
+ FormBuilder,
|
|
5
|
+ Validators,
|
|
6
|
+ FormGroup,
|
|
7
|
+ FormControl,
|
|
8
|
+} from "@angular/forms";
|
|
9
|
+import { MainService } from "../../services/main.service";
|
|
10
|
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
|
|
11
|
+import { NzMessageService } from "ng-zorro-antd";
|
|
12
|
+import { forkJoin } from "rxjs";
|
8
|
13
|
@Component({
|
9
|
|
- selector: 'app-order-detail',
|
10
|
|
- templateUrl: './order-detail.component.html',
|
11
|
|
- styleUrls: ['./order-detail.component.less']
|
|
14
|
+ selector: "app-order-detail",
|
|
15
|
+ templateUrl: "./order-detail.component.html",
|
|
16
|
+ styleUrls: ["./order-detail.component.less"],
|
12
|
17
|
})
|
13
|
18
|
export class OrderDetailComponent implements OnInit {
|
14
|
|
- @ViewChild('osComponentRef1', { read: OverlayScrollbarsComponent, static: false })
|
|
19
|
+ @ViewChild("osComponentRef1", {
|
|
20
|
+ read: OverlayScrollbarsComponent,
|
|
21
|
+ static: false,
|
|
22
|
+ })
|
15
|
23
|
osComponentRef1: OverlayScrollbarsComponent;
|
16
|
|
- @ViewChild('osComponentRef2', { read: OverlayScrollbarsComponent, static: false })
|
|
24
|
+ @ViewChild("osComponentRef2", {
|
|
25
|
+ read: OverlayScrollbarsComponent,
|
|
26
|
+ static: false,
|
|
27
|
+ })
|
17
|
28
|
osComponentRef2: OverlayScrollbarsComponent;
|
18
|
|
- @ViewChild('osComponentRef3', { read: OverlayScrollbarsComponent, static: false })
|
|
29
|
+ @ViewChild("osComponentRef3", {
|
|
30
|
+ read: OverlayScrollbarsComponent,
|
|
31
|
+ static: false,
|
|
32
|
+ })
|
19
|
33
|
osComponentRef3: OverlayScrollbarsComponent;
|
20
|
|
- @ViewChild('osComponentRef4', { read: OverlayScrollbarsComponent, static: false })
|
|
34
|
+ @ViewChild("osComponentRef4", {
|
|
35
|
+ read: OverlayScrollbarsComponent,
|
|
36
|
+ static: false,
|
|
37
|
+ })
|
21
|
38
|
osComponentRef4: OverlayScrollbarsComponent;
|
22
|
|
- @ViewChild('osComponentRef5', { read: OverlayScrollbarsComponent, static: false })
|
|
39
|
+ @ViewChild("osComponentRef5", {
|
|
40
|
+ read: OverlayScrollbarsComponent,
|
|
41
|
+ static: false,
|
|
42
|
+ })
|
23
|
43
|
osComponentRef5: OverlayScrollbarsComponent;
|
24
|
|
- @ViewChild('osComponentRef6', { read: OverlayScrollbarsComponent, static: false })
|
|
44
|
+ @ViewChild("osComponentRef6", {
|
|
45
|
+ read: OverlayScrollbarsComponent,
|
|
46
|
+ static: false,
|
|
47
|
+ })
|
25
|
48
|
osComponentRef6: OverlayScrollbarsComponent;
|
26
|
|
- @ViewChild('osComponentRef7', { read: OverlayScrollbarsComponent, static: false })
|
|
49
|
+ @ViewChild("osComponentRef7", {
|
|
50
|
+ read: OverlayScrollbarsComponent,
|
|
51
|
+ static: false,
|
|
52
|
+ })
|
27
|
53
|
osComponentRef7: OverlayScrollbarsComponent;
|
28
|
|
- @ViewChild('osComponentRef8', { read: OverlayScrollbarsComponent, static: false })
|
|
54
|
+ @ViewChild("osComponentRef8", {
|
|
55
|
+ read: OverlayScrollbarsComponent,
|
|
56
|
+ static: false,
|
|
57
|
+ })
|
29
|
58
|
osComponentRef8: OverlayScrollbarsComponent;
|
30
|
59
|
constructor(
|
31
|
60
|
private message: NzMessageService,
|
32
|
61
|
private fb: FormBuilder,
|
33
|
62
|
private route: ActivatedRoute,
|
34
|
|
- private mainService: MainService,
|
35
|
|
- ) { }
|
|
63
|
+ private mainService: MainService
|
|
64
|
+ ) {}
|
36
|
65
|
maskFlag: any = false;
|
37
|
|
- id: number;//工单id
|
38
|
|
- orderInfo: any;//工单详情信息
|
39
|
|
- endDepts = '';//工单详情目标科室
|
40
|
|
- showCoop: boolean = true;//是否展示详情页操作按钮
|
41
|
|
-
|
42
|
|
- promptContent: string;//操作提示框提示信息
|
43
|
|
- ifSuccess: boolean;//操作成功/失败
|
44
|
|
- promptInfo: string;//操作结果提示信息
|
45
|
|
- previewImage: string;//操作结果图片预览
|
46
|
|
- promptModalShow: boolean;//是否展示提示框
|
47
|
|
- promptModalShowImg: boolean;//是否展示提示框-图片
|
48
|
|
-
|
49
|
|
- urgentLoading: boolean = false;//确认加急按钮loading状态
|
50
|
|
- recLoading: boolean = false;//撤回并删除按钮loading状态
|
51
|
|
- btnLoading: boolean = false;//确认按钮loading状态
|
52
|
|
-
|
|
66
|
+ id: number; //工单id
|
|
67
|
+ orderInfo: any; //工单详情信息
|
|
68
|
+ endDepts = ""; //工单详情目标科室
|
|
69
|
+ showCoop: boolean = true; //是否展示详情页操作按钮
|
|
70
|
+
|
|
71
|
+ promptContent: string; //操作提示框提示信息
|
|
72
|
+ ifSuccess: boolean; //操作成功/失败
|
|
73
|
+ promptInfo: string; //操作结果提示信息
|
|
74
|
+ previewImage: string; //操作结果图片预览
|
|
75
|
+ promptModalShow: boolean; //是否展示提示框
|
|
76
|
+ promptModalShowImg: boolean; //是否展示提示框-图片
|
|
77
|
+
|
|
78
|
+ urgentLoading: boolean = false; //确认加急按钮loading状态
|
|
79
|
+ recLoading: boolean = false; //撤回并删除按钮loading状态
|
|
80
|
+ btnLoading: boolean = false; //确认按钮loading状态
|
53
|
81
|
|
54
|
82
|
ngOnInit() {
|
55
|
83
|
this.tabType = this.route.snapshot.params.type || 1;
|
56
|
|
- this.getInfo()
|
57
|
|
- this.initForm()
|
58
|
|
- }
|
59
|
|
- ngOnDestroy() {
|
|
84
|
+ this.getInfo();
|
|
85
|
+ this.initForm();
|
60
|
86
|
}
|
|
87
|
+ ngOnDestroy() {}
|
61
|
88
|
|
62
|
89
|
// 获取工单详情
|
63
|
|
- middleDept = [];//中间科室数组
|
|
90
|
+ middleDept = []; //中间科室数组
|
64
|
91
|
getInfo() {
|
65
|
|
- this.id = +this.route.snapshot.paramMap.get('id');
|
66
|
|
- this.maskFlag = this.message.loading('正在加载中..', { nzDuration: 0 }).messageId;
|
67
|
|
- this.mainService.getApiFetchData('workOrder', this.id).subscribe(data => {
|
68
|
|
- this.orderInfo = data.data;
|
69
|
|
- if (data.data.middleDept) {
|
70
|
|
- this.middleDept = data.data.middleDept.map(item => item.dept);
|
71
|
|
- } else {
|
72
|
|
- this.middleDept = [];
|
73
|
|
- }
|
74
|
|
- this.endDepts = data.data.endDepts.map(item => item.dept).join();
|
75
|
|
- let log$ = this.getLog();
|
76
|
|
- let record$ = this.getWorkOrderRecord();
|
77
|
|
- forkJoin(log$, record$).subscribe(res => {
|
78
|
|
- this.message.remove(this.maskFlag);
|
79
|
|
- this.maskFlag = false;
|
80
|
|
- // getLog
|
81
|
|
- this.logList = res[0]['data'];
|
82
|
|
- // getWorkOrderRecord
|
83
|
|
- if (res[1]['status'] == 200) {
|
84
|
|
- this.workOrderRecord = res[1]['data'];
|
|
92
|
+ this.id = +this.route.snapshot.paramMap.get("id");
|
|
93
|
+ this.maskFlag = this.message.loading("正在加载中..", {
|
|
94
|
+ nzDuration: 0,
|
|
95
|
+ }).messageId;
|
|
96
|
+ this.mainService
|
|
97
|
+ .getFetchData("api", "workOrder", this.id)
|
|
98
|
+ .subscribe((data) => {
|
|
99
|
+ this.orderInfo = data.data;
|
|
100
|
+ if (data.data.middleDept) {
|
|
101
|
+ this.middleDept = data.data.middleDept.map((item) => item.dept);
|
|
102
|
+ } else {
|
|
103
|
+ this.middleDept = [];
|
85
|
104
|
}
|
86
|
|
- })
|
87
|
|
- })
|
|
105
|
+ this.endDepts = data.data.endDepts.map((item) => item.dept).join();
|
|
106
|
+ let log$ = this.getLog();
|
|
107
|
+ let record$ = this.getWorkOrderRecord();
|
|
108
|
+ forkJoin(log$, record$).subscribe((res) => {
|
|
109
|
+ this.message.remove(this.maskFlag);
|
|
110
|
+ this.maskFlag = false;
|
|
111
|
+ // getLog
|
|
112
|
+ this.logList = res[0]["data"];
|
|
113
|
+ // getWorkOrderRecord
|
|
114
|
+ if (res[1]["status"] == 200) {
|
|
115
|
+ this.workOrderRecord = res[1]["data"];
|
|
116
|
+ }
|
|
117
|
+ });
|
|
118
|
+ });
|
88
|
119
|
}
|
89
|
120
|
// 预览图片
|
90
|
121
|
previewImageHandler(token) {
|
|
@@ -93,10 +124,10 @@ export class OrderDetailComponent implements OnInit {
|
93
|
124
|
// 获取历史记录
|
94
|
125
|
workOrderRecord: any = [];
|
95
|
126
|
getWorkOrderRecord() {
|
96
|
|
- return this.mainService.getWorkOrderRecord({ "gdid": this.id });
|
|
127
|
+ return this.mainService.getWorkOrderRecord({ gdid: this.id });
|
97
|
128
|
}
|
98
|
129
|
// 切换tab栏
|
99
|
|
- tabType: number = 1;//tab栏
|
|
130
|
+ tabType: number = 1; //tab栏
|
100
|
131
|
checkTab(type) {
|
101
|
132
|
this.tabType = type;
|
102
|
133
|
}
|
|
@@ -110,19 +141,19 @@ export class OrderDetailComponent implements OnInit {
|
110
|
141
|
}
|
111
|
142
|
|
112
|
143
|
// 获取工单历史记录
|
113
|
|
- logList = [];//工单历史记录
|
|
144
|
+ logList = []; //工单历史记录
|
114
|
145
|
getLog() {
|
115
|
146
|
return this.mainService.getWorkOrderLog(this.id);
|
116
|
147
|
}
|
117
|
148
|
|
118
|
149
|
// 初始化新增form表单
|
119
|
|
- validateForm: FormGroup;//新增/编辑表单
|
|
150
|
+ validateForm: FormGroup; //新增/编辑表单
|
120
|
151
|
initForm() {
|
121
|
152
|
this.validateForm = this.fb.group({
|
122
|
153
|
reason: [null, [Validators.required]],
|
123
|
154
|
process: [null, [Validators.required]],
|
124
|
155
|
handleType: [null, [Validators.required]],
|
125
|
|
- improve: [null, [Validators.required]]
|
|
156
|
+ improve: [null, [Validators.required]],
|
126
|
157
|
});
|
127
|
158
|
}
|
128
|
159
|
|
|
@@ -142,41 +173,38 @@ export class OrderDetailComponent implements OnInit {
|
142
|
173
|
mediationProcess: that.validateForm.value.process,
|
143
|
174
|
handleType: { id: that.validateForm.value.handleType },
|
144
|
175
|
advice: that.validateForm.value.improve,
|
145
|
|
- handleStatus: { key: "bad_evaluation_handle_status", value: "2" }
|
146
|
|
- }
|
147
|
|
- }
|
148
|
|
-
|
149
|
|
- that.mainService.postCustom('adviceCollection', 'updData/badEvaluationHandle', postData).subscribe(data => {
|
150
|
|
- that.btnLoading = false;
|
151
|
|
- if (data.status == 200) {
|
152
|
|
- that.showPromptModal('调解', true, '');
|
153
|
|
- that.getInfo()
|
154
|
|
- // that.initForm();
|
155
|
|
- } else {
|
156
|
|
- that.showPromptModal('调解', false, data.msg);
|
157
|
|
- }
|
158
|
|
- })
|
159
|
|
-
|
160
|
|
-
|
|
176
|
+ handleStatus: { key: "bad_evaluation_handle_status", value: "2" },
|
|
177
|
+ },
|
|
178
|
+ };
|
|
179
|
+
|
|
180
|
+ that.mainService
|
|
181
|
+ .postCustom("adviceCollection", "updData/badEvaluationHandle", postData)
|
|
182
|
+ .subscribe((data) => {
|
|
183
|
+ that.btnLoading = false;
|
|
184
|
+ if (data.status == 200) {
|
|
185
|
+ that.showPromptModal("调解", true, "");
|
|
186
|
+ that.getInfo();
|
|
187
|
+ // that.initForm();
|
|
188
|
+ } else {
|
|
189
|
+ that.showPromptModal("调解", false, data.msg);
|
|
190
|
+ }
|
|
191
|
+ });
|
161
|
192
|
}
|
162
|
193
|
|
163
|
|
-
|
164
|
|
-
|
165
|
|
-
|
166
|
194
|
// 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
|
167
|
195
|
showPromptModal(con, success, promptInfo?, previewImage?) {
|
168
|
196
|
this.promptModalShow = false;
|
169
|
197
|
this.promptContent = con;
|
170
|
198
|
this.ifSuccess = success;
|
171
|
199
|
this.promptInfo = promptInfo;
|
172
|
|
- this.previewImage = previewImage ? previewImage : '';
|
|
200
|
+ this.previewImage = previewImage ? previewImage : "";
|
173
|
201
|
setTimeout(() => {
|
174
|
202
|
this.promptModalShow = true;
|
175
|
203
|
}, 100);
|
176
|
204
|
}
|
177
|
205
|
showPromptModalImg(previewImage) {
|
178
|
206
|
this.promptModalShowImg = false;
|
179
|
|
- this.previewImage = previewImage ? previewImage : '';
|
|
207
|
+ this.previewImage = previewImage ? previewImage : "";
|
180
|
208
|
setTimeout(() => {
|
181
|
209
|
this.promptModalShowImg = true;
|
182
|
210
|
}, 100);
|
|
@@ -185,19 +213,19 @@ export class OrderDetailComponent implements OnInit {
|
185
|
213
|
// 格式化时分秒
|
186
|
214
|
// (时间小于一分钟则显示秒,时间大于一分钟则显示分钟数,如超出一小时则显示小时和分钟。)time单位:秒
|
187
|
215
|
formatTime(time) {
|
188
|
|
- let timeStr = '';
|
|
216
|
+ let timeStr = "";
|
189
|
217
|
if (time >= 0 && time < 60) {
|
190
|
218
|
// 秒
|
191
|
|
- timeStr = time + '秒';
|
|
219
|
+ timeStr = time + "秒";
|
192
|
220
|
} else if (time >= 60 && time < 3600) {
|
193
|
221
|
// 分钟
|
194
|
|
- timeStr = Math.floor(time / 60) + '分钟'
|
|
222
|
+ timeStr = Math.floor(time / 60) + "分钟";
|
195
|
223
|
} else if (time >= 3600) {
|
196
|
224
|
// 时 + 分
|
197
|
|
- let h = '';
|
198
|
|
- let m = '';
|
199
|
|
- h = Math.floor(time / 3600) + '小时';
|
200
|
|
- m = (time % 3600) >= 60 ? Math.floor((time % 3600) / 60) + '分钟' : '';
|
|
225
|
+ let h = "";
|
|
226
|
+ let m = "";
|
|
227
|
+ h = Math.floor(time / 3600) + "小时";
|
|
228
|
+ m = time % 3600 >= 60 ? Math.floor((time % 3600) / 60) + "分钟" : "";
|
201
|
229
|
timeStr = h + m;
|
202
|
230
|
}
|
203
|
231
|
return timeStr;
|
|
@@ -207,7 +235,7 @@ export class OrderDetailComponent implements OnInit {
|
207
|
235
|
filterTime(step) {
|
208
|
236
|
// step = [{ difTime: 2 }, { difTime: 6 }]
|
209
|
237
|
let num = 0;
|
210
|
|
- step.forEach(e => {
|
|
238
|
+ step.forEach((e) => {
|
211
|
239
|
num += e.difTime;
|
212
|
240
|
});
|
213
|
241
|
return this.formatTime(num / 1000);
|