|
@@ -1,90 +1,77 @@
|
1
|
|
-import { Component, OnInit, ViewChild } from '@angular/core';
|
2
|
|
-import { ActivatedRoute, Router } from "@angular/router"
|
3
|
|
-import { FormBuilder, Validators, FormGroup } from '@angular/forms';
|
|
1
|
+import { Component, OnInit, ViewChild } from "@angular/core";
|
|
2
|
+import { Router } from "@angular/router";
|
|
3
|
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
|
4
|
4
|
|
5
|
5
|
import { MainService } from "../../services/main.service";
|
6
|
|
-import { MyServiceService } from "../../services/my-service.service";
|
|
6
|
+// import { MyServiceService } from "../../services/my-service.service";
|
|
7
|
+import { WebsocketIndexService } from "../../services/websocket-index.service";
|
7
|
8
|
import http from "../../../assets/js/http";
|
8
|
|
-import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
|
9
|
|
-import { ToolService } from '../../services/tool.service';
|
10
|
|
-
|
|
9
|
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
|
|
10
|
+import { ToolService } from "../../services/tool.service";
|
11
|
11
|
|
12
|
12
|
@Component({
|
13
|
|
- selector: 'app-home',
|
14
|
|
- templateUrl: './home.component.html',
|
15
|
|
- styleUrls: ['./home.component.less']
|
|
13
|
+ selector: "app-home",
|
|
14
|
+ templateUrl: "./home.component.html",
|
|
15
|
+ styleUrls: ["./home.component.less"],
|
16
|
16
|
})
|
17
|
17
|
export class HomeComponent implements OnInit {
|
18
|
|
- @ViewChild('osComponentRef1', { read: OverlayScrollbarsComponent, static: false })
|
|
18
|
+ @ViewChild("osComponentRef1", {
|
|
19
|
+ read: OverlayScrollbarsComponent,
|
|
20
|
+ static: false,
|
|
21
|
+ })
|
19
|
22
|
osComponentRef1: OverlayScrollbarsComponent;
|
20
|
|
- @ViewChild('osComponentRef2', { read: OverlayScrollbarsComponent, static: false })
|
|
23
|
+ @ViewChild("osComponentRef2", {
|
|
24
|
+ read: OverlayScrollbarsComponent,
|
|
25
|
+ static: false,
|
|
26
|
+ })
|
21
|
27
|
osComponentRef2: OverlayScrollbarsComponent;
|
22
|
|
- constructor(private fb: FormBuilder, private route: ActivatedRoute, private router: Router, private mainService: MainService, private myService: MyServiceService, private tool: ToolService) {
|
23
|
|
- }
|
|
28
|
+ constructor(
|
|
29
|
+ private fb: FormBuilder,
|
|
30
|
+ private router: Router,
|
|
31
|
+ private mainService: MainService,
|
|
32
|
+ // private myService: MyServiceService,
|
|
33
|
+ private myService: WebsocketIndexService,
|
|
34
|
+ private tool: ToolService
|
|
35
|
+ ) {}
|
24
|
36
|
|
25
|
37
|
ngOnInit() {
|
26
|
38
|
let that = this;
|
27
|
|
- that.initForm()
|
28
|
|
- that.getAllHos()
|
29
|
|
- that.connectWs()
|
|
39
|
+ that.initForm();
|
|
40
|
+ that.getAllHos();
|
|
41
|
+ // that.connectWs();
|
|
42
|
+ this.getWebsocketIndex();
|
30
|
43
|
}
|
31
|
44
|
|
32
|
|
- ws: WebSocket;//定义websocket
|
33
|
|
- validateForm: FormGroup;//新增/编辑表单
|
34
|
|
-
|
35
|
|
- promptContent: string;//操作提示框提示信息
|
36
|
|
- ifSuccess: boolean;//操作成功/失败
|
37
|
|
- promptInfo: string;//操作结果提示信息
|
38
|
|
- promptModalShow: boolean;//操作提示框是否展示
|
39
|
|
-
|
40
|
|
-
|
41
|
|
- //socket连接
|
42
|
|
- wsData;//socket返回的数据
|
43
|
|
- groupOrders = [];//当前各小组工单执行情况
|
44
|
|
- userSituation: any = {};//用户信息
|
45
|
|
- orderSituation: any = {};//工单信息
|
46
|
|
- connectWs() {
|
47
|
|
- if (this.ws != null) { this.ws.close() };
|
48
|
|
- this.ws = new WebSocket(http.homeWs);
|
49
|
|
- let that = this;
|
50
|
|
- this.ws.onopen = function (event) {
|
51
|
|
- //socket 开启后执行,可以向后端传递信息
|
52
|
|
- var data = JSON.stringify({ hosIds: that.hosIds })
|
53
|
|
- that.ws.send(data);
|
54
|
|
- }
|
55
|
|
- this.ws.onmessage = function (event) {
|
56
|
|
- //socket 获取后端传递到前端的信息
|
57
|
|
- if (event.data && event.data.length > 1) {
|
58
|
|
- that.wsData = JSON.parse(event.data)
|
59
|
|
- if (that.wsData.groupOrders && that.wsData.groupOrders.status == 200) {
|
60
|
|
- that.groupOrders = that.wsData.groupOrders.data;
|
|
45
|
+ validateForm: FormGroup; //新增/编辑表单
|
|
46
|
+
|
|
47
|
+ promptContent: string; //操作提示框提示信息
|
|
48
|
+ ifSuccess: boolean; //操作成功/失败
|
|
49
|
+ promptInfo: string; //操作结果提示信息
|
|
50
|
+ promptModalShow: boolean; //操作提示框是否展示
|
|
51
|
+ //连接ws
|
|
52
|
+ groupOrders = []; //当前各小组工单执行情况
|
|
53
|
+ userSituation: any = {}; //用户信息
|
|
54
|
+ orderSituation: any = {}; //工单信息
|
|
55
|
+ getWebsocketIndex() {
|
|
56
|
+ this.myService
|
|
57
|
+ .connectWs(http.homeWs, { hosIds: this.hosIds })
|
|
58
|
+ .subscribe((result) => {
|
|
59
|
+ console.log(result);
|
|
60
|
+ if (result.groupOrders && result.groupOrders.status == 200) {
|
|
61
|
+ this.groupOrders = result.groupOrders.data;
|
61
|
62
|
}
|
62
|
|
- if (that.wsData.userSituation) {
|
63
|
|
- that.userSituation = that.wsData.userSituation;
|
|
63
|
+ if (result.userSituation) {
|
|
64
|
+ this.userSituation = result.userSituation;
|
64
|
65
|
}
|
65
|
|
- if (that.wsData.orderSituation) {
|
66
|
|
- that.orderSituation = that.wsData.orderSituation;
|
|
66
|
+ if (result.orderSituation) {
|
|
67
|
+ this.orderSituation = result.orderSituation;
|
67
|
68
|
}
|
68
|
|
- }
|
69
|
|
- }
|
70
|
|
-
|
71
|
|
- this.ws.onerror = function (event) {
|
72
|
|
- //socket error信息
|
73
|
|
- console.log('error')
|
74
|
|
- }
|
75
|
|
- this.ws.onclose = function () {
|
76
|
|
- //socket 关闭后执行
|
77
|
|
- setTimeout(() => {
|
78
|
|
- that.connectWs();
|
79
|
|
- }, 15000);
|
80
|
|
- }
|
|
69
|
+ });
|
81
|
70
|
}
|
82
|
|
-
|
83
|
71
|
ngOnDestroy() {
|
84
|
|
- clearInterval(this.moveId)
|
85
|
|
- clearInterval(this.moveId1)
|
86
|
|
- console.log('首页关闭')
|
87
|
|
- this.ws.close()
|
|
72
|
+ clearInterval(this.moveId);
|
|
73
|
+ clearInterval(this.moveId1);
|
|
74
|
+ this.myService.closeWs(true);
|
88
|
75
|
}
|
89
|
76
|
// 小组好评
|
90
|
77
|
groupInfo = [];
|
|
@@ -95,18 +82,20 @@ export class HomeComponent implements OnInit {
|
95
|
82
|
hosIds: that.hosIds,
|
96
|
83
|
};
|
97
|
84
|
this.loading1 = true;
|
98
|
|
- that.mainService.postCustom('index', 'groupEvaTop', postData).subscribe(data => {
|
99
|
|
- this.loading1 = false;
|
100
|
|
- that.groupInfo = data.data || []
|
101
|
|
- if (data.data && data.data.length) {
|
102
|
|
- data.data.forEach(e => {
|
103
|
|
- e.value = e.percent
|
104
|
|
- });
|
105
|
|
- this.groupChart(data.data)
|
106
|
|
- } else {
|
107
|
|
- this.groupChart([])
|
108
|
|
- }
|
109
|
|
- })
|
|
85
|
+ that.mainService
|
|
86
|
+ .postCustom("index", "groupEvaTop", postData)
|
|
87
|
+ .subscribe((data) => {
|
|
88
|
+ this.loading1 = false;
|
|
89
|
+ that.groupInfo = data.data || [];
|
|
90
|
+ if (data.data && data.data.length) {
|
|
91
|
+ data.data.forEach((e) => {
|
|
92
|
+ e.value = e.percent;
|
|
93
|
+ });
|
|
94
|
+ this.groupChart(data.data);
|
|
95
|
+ } else {
|
|
96
|
+ this.groupChart([]);
|
|
97
|
+ }
|
|
98
|
+ });
|
110
|
99
|
}
|
111
|
100
|
// 好评Echarts
|
112
|
101
|
groupOption;
|
|
@@ -114,12 +103,12 @@ export class HomeComponent implements OnInit {
|
114
|
103
|
let labels = [];
|
115
|
104
|
let nums = [];
|
116
|
105
|
if (datas.length) {
|
117
|
|
- datas.forEach(e => {
|
118
|
|
- labels.push(e.name)
|
119
|
|
- nums.push(e.percent - 0)
|
|
106
|
+ datas.forEach((e) => {
|
|
107
|
+ labels.push(e.name);
|
|
108
|
+ nums.push(e.percent - 0);
|
120
|
109
|
});
|
121
|
110
|
}
|
122
|
|
- console.log(labels, nums)
|
|
111
|
+ console.log(labels, nums);
|
123
|
112
|
var dataShadow = [];
|
124
|
113
|
|
125
|
114
|
for (var i = 0; i < datas.length; i++) {
|
|
@@ -127,140 +116,137 @@ export class HomeComponent implements OnInit {
|
127
|
116
|
}
|
128
|
117
|
this.groupOption = {
|
129
|
118
|
grid: {
|
130
|
|
- left: '10',
|
131
|
|
- right: '100',
|
132
|
|
- top: '0',
|
133
|
|
- bottom: '0',
|
134
|
|
- containLabel: true
|
|
119
|
+ left: "10",
|
|
120
|
+ right: "100",
|
|
121
|
+ top: "0",
|
|
122
|
+ bottom: "0",
|
|
123
|
+ containLabel: true,
|
135
|
124
|
},
|
136
|
125
|
xAxis: {
|
137
|
|
- show: ''
|
|
126
|
+ show: "",
|
138
|
127
|
},
|
139
|
128
|
yAxis: {
|
140
|
|
- type: 'category',
|
|
129
|
+ type: "category",
|
141
|
130
|
data: labels,
|
142
|
131
|
axisLabel: {
|
143
|
132
|
margin: 15,
|
144
|
133
|
textStyle: {
|
145
|
|
- color: '#666'
|
146
|
|
- }
|
|
134
|
+ color: "#666",
|
|
135
|
+ },
|
147
|
136
|
},
|
148
|
137
|
axisTick: {
|
149
|
138
|
lineStyle: {
|
150
|
|
- color: '#fff'
|
151
|
|
- }
|
|
139
|
+ color: "#fff",
|
|
140
|
+ },
|
152
|
141
|
},
|
153
|
142
|
axisLine: {
|
154
|
143
|
lineStyle: {
|
155
|
|
- color: '#fff'
|
156
|
|
- }
|
157
|
|
- }
|
|
144
|
+ color: "#fff",
|
|
145
|
+ },
|
|
146
|
+ },
|
158
|
147
|
},
|
159
|
148
|
series: [
|
160
|
|
- { // For shadow
|
161
|
|
- type: 'bar',
|
|
149
|
+ {
|
|
150
|
+ // For shadow
|
|
151
|
+ type: "bar",
|
162
|
152
|
itemStyle: {
|
163
|
|
- color: 'rgba(0,0,0,0.04)'
|
|
153
|
+ color: "rgba(0,0,0,0.04)",
|
164
|
154
|
},
|
165
|
|
- barGap: '-100%',
|
166
|
|
- barCategoryGap: '26',
|
167
|
|
- barWidth: '26',
|
|
155
|
+ barGap: "-100%",
|
|
156
|
+ barCategoryGap: "26",
|
|
157
|
+ barWidth: "26",
|
168
|
158
|
data: dataShadow,
|
169
|
|
- animation: false
|
|
159
|
+ animation: false,
|
170
|
160
|
},
|
171
|
161
|
{
|
172
|
|
- name: '建单总数',
|
173
|
|
- type: 'bar',
|
|
162
|
+ name: "建单总数",
|
|
163
|
+ type: "bar",
|
174
|
164
|
data: nums,
|
175
|
165
|
label: {
|
176
|
166
|
show: true,
|
177
|
|
- position: 'right',
|
178
|
|
- formatter: '{c} % '
|
|
167
|
+ position: "right",
|
|
168
|
+ formatter: "{c} % ",
|
179
|
169
|
},
|
180
|
170
|
itemStyle: {
|
181
|
171
|
normal: {
|
182
|
172
|
//每根柱子颜色设置
|
183
|
|
- color: '#49b856'
|
184
|
|
- }
|
|
173
|
+ color: "#49b856",
|
|
174
|
+ },
|
185
|
175
|
},
|
186
|
|
- barCategoryGap: '26',
|
187
|
|
- barWidth: '26'
|
188
|
|
- }
|
189
|
|
- ]
|
|
176
|
+ barCategoryGap: "26",
|
|
177
|
+ barWidth: "26",
|
|
178
|
+ },
|
|
179
|
+ ],
|
190
|
180
|
};
|
191
|
181
|
}
|
192
|
182
|
|
193
|
|
-
|
194
|
183
|
// 近一周异常工单
|
195
|
184
|
abOrders: Array<any> = [];
|
196
|
185
|
loading2 = false;
|
197
|
186
|
getAbnormityOrders() {
|
198
|
187
|
let that = this;
|
199
|
188
|
this.loading2 = true;
|
200
|
|
- that.mainService.postCustom('index', 'abnormityOrders', { hosIds: that.hosIds }).subscribe(data => {
|
201
|
|
- this.loading2 = false;
|
202
|
|
- that.abOrders = data.data || [];
|
203
|
|
- })
|
|
189
|
+ that.mainService
|
|
190
|
+ .postCustom("index", "abnormityOrders", { hosIds: that.hosIds })
|
|
191
|
+ .subscribe((data) => {
|
|
192
|
+ this.loading2 = false;
|
|
193
|
+ that.abOrders = data.data || [];
|
|
194
|
+ });
|
204
|
195
|
}
|
205
|
196
|
|
206
|
197
|
// 工单详情
|
207
|
198
|
// 查看
|
208
|
199
|
orderDetail(id) {
|
209
|
|
- this.router.navigateByUrl('/main/home/orderDetail/' + id);
|
|
200
|
+ this.router.navigateByUrl("/main/home/orderDetail/" + id);
|
210
|
201
|
}
|
211
|
202
|
|
212
|
|
-
|
213
|
|
-
|
214
|
203
|
// swiper 轮播图
|
215
|
|
- swiperArr = []
|
|
204
|
+ swiperArr = [];
|
216
|
205
|
swiperTop: number = 0;
|
217
|
206
|
moveId: any;
|
218
|
207
|
index: number = 0;
|
219
|
208
|
startSwiper(length) {
|
220
|
209
|
let that = this;
|
221
|
|
- clearInterval(that.moveId)
|
|
210
|
+ clearInterval(that.moveId);
|
222
|
211
|
setInterval(() => {
|
223
|
212
|
that.index++;
|
224
|
|
- clearInterval(that.moveId)
|
|
213
|
+ clearInterval(that.moveId);
|
225
|
214
|
that.moveId = setInterval(() => {
|
226
|
|
- if (that.swiperTop > (-32 * that.index)) {
|
|
215
|
+ if (that.swiperTop > -32 * that.index) {
|
227
|
216
|
that.swiperTop--;
|
228
|
217
|
}
|
229
|
|
- if (that.swiperTop <= length * (-32)) {
|
230
|
|
- that.swiperTop = 0
|
231
|
|
- that.index = 0
|
232
|
|
- clearInterval(that.moveId)
|
|
218
|
+ if (that.swiperTop <= length * -32) {
|
|
219
|
+ that.swiperTop = 0;
|
|
220
|
+ that.index = 0;
|
|
221
|
+ clearInterval(that.moveId);
|
233
|
222
|
}
|
234
|
223
|
}, 20);
|
235
|
224
|
}, 2000);
|
236
|
|
-
|
237
|
225
|
}
|
238
|
226
|
|
239
|
|
- swiperArr1 = [1, 2, 3]
|
|
227
|
+ swiperArr1 = [1, 2, 3];
|
240
|
228
|
swiperTop1: number = 0;
|
241
|
229
|
moveId1: any;
|
242
|
230
|
index1: number = 0;
|
243
|
231
|
startSwiper1(length) {
|
244
|
232
|
let that = this;
|
245
|
|
- clearInterval(that.moveId1)
|
|
233
|
+ clearInterval(that.moveId1);
|
246
|
234
|
setInterval(() => {
|
247
|
235
|
that.index1++;
|
248
|
|
- clearInterval(that.moveId1)
|
|
236
|
+ clearInterval(that.moveId1);
|
249
|
237
|
that.moveId1 = setInterval(() => {
|
250
|
|
- if (that.swiperTop1 > (-32 * that.index1)) {
|
|
238
|
+ if (that.swiperTop1 > -32 * that.index1) {
|
251
|
239
|
that.swiperTop1--;
|
252
|
240
|
}
|
253
|
|
- if (that.swiperTop1 <= length * (-32)) {
|
254
|
|
- that.swiperTop1 = 0
|
255
|
|
- that.index1 = 0
|
256
|
|
- clearInterval(that.moveId1)
|
|
241
|
+ if (that.swiperTop1 <= length * -32) {
|
|
242
|
+ that.swiperTop1 = 0;
|
|
243
|
+ that.index1 = 0;
|
|
244
|
+ clearInterval(that.moveId1);
|
257
|
245
|
}
|
258
|
246
|
}, 20);
|
259
|
247
|
}, 2000);
|
260
|
|
-
|
261
|
248
|
}
|
262
|
249
|
|
263
|
|
-
|
264
|
250
|
// 切换工单差评/最新意见
|
265
|
251
|
thisTab = 1;
|
266
|
252
|
checkTab(tab) {
|
|
@@ -272,7 +258,7 @@ export class HomeComponent implements OnInit {
|
272
|
258
|
|
273
|
259
|
// 展开收起
|
274
|
260
|
isOpen: boolean = false;
|
275
|
|
- coopOpenId;//当前展开/收起id
|
|
261
|
+ coopOpenId; //当前展开/收起id
|
276
|
262
|
more(id) {
|
277
|
263
|
if (this.coopOpenId == id) {
|
278
|
264
|
this.isOpen = !this.isOpen;
|
|
@@ -283,37 +269,36 @@ export class HomeComponent implements OnInit {
|
283
|
269
|
}
|
284
|
270
|
|
285
|
271
|
// 获取当前登录人所有院区
|
286
|
|
- hosIds: string = '';//院区id
|
287
|
|
- hosName: string = '';//当前院区名称
|
|
272
|
+ hosIds: string = ""; //院区id
|
|
273
|
+ hosName: string = ""; //当前院区名称
|
288
|
274
|
getAllHos() {
|
289
|
275
|
let hos: any = this.tool.getCurrentHospital();
|
290
|
276
|
this.hosName = hos.hosName;
|
291
|
|
- this.hosIds = hos.id + '';
|
292
|
|
- this.refreshList()
|
293
|
|
- this.getGroupCount()
|
294
|
|
- this.getAbnormityOrders()
|
|
277
|
+ this.hosIds = hos.id + "";
|
|
278
|
+ this.refreshList();
|
|
279
|
+ this.getGroupCount();
|
|
280
|
+ this.getAbnormityOrders();
|
295
|
281
|
}
|
296
|
282
|
|
297
|
|
-
|
298
|
283
|
// 翻页获取当前列表
|
299
|
284
|
getPageList() {
|
300
|
285
|
if (this.thisTab == 1) {
|
301
|
|
- this.getBadList()
|
|
286
|
+ this.getBadList();
|
302
|
287
|
} else if (this.thisTab == 2) {
|
303
|
|
- this.getAdviceList()
|
|
288
|
+ this.getAdviceList();
|
304
|
289
|
}
|
305
|
290
|
}
|
306
|
291
|
// 刷新页面右侧列表
|
307
|
292
|
refreshList() {
|
308
|
|
- this.getAdviceList()
|
309
|
|
- this.getBadList()
|
|
293
|
+ this.getAdviceList();
|
|
294
|
+ this.getBadList();
|
310
|
295
|
}
|
311
|
296
|
// 差评表格数据
|
312
|
297
|
listIdx = 1;
|
313
|
298
|
listLength = 0;
|
314
|
|
- badNum = 0;//差评数量
|
315
|
|
- badList = [];//差评列表
|
316
|
|
- Loading: boolean = true;//差评loading
|
|
299
|
+ badNum = 0; //差评数量
|
|
300
|
+ badList = []; //差评列表
|
|
301
|
+ Loading: boolean = true; //差评loading
|
317
|
302
|
getBadList() {
|
318
|
303
|
var that = this;
|
319
|
304
|
that.Loading = true;
|
|
@@ -322,40 +307,41 @@ export class HomeComponent implements OnInit {
|
322
|
307
|
sum: 10,
|
323
|
308
|
badEvaluationHandle: {
|
324
|
309
|
hosIds: that.hosIds,
|
325
|
|
- handleStatus: { id: "286" }//未调解
|
|
310
|
+ handleStatus: { id: "286" }, //未调解
|
326
|
311
|
},
|
327
|
|
- }
|
328
|
|
- that.mainService.getFetchDataList('adviceCollection', 'badEvaluationHandle', data).subscribe(data => {
|
329
|
|
- that.badList = data.list;
|
330
|
|
- that.Loading = false;
|
331
|
|
- that.listLength = that.badNum = data.totalNum;
|
332
|
|
- })
|
333
|
|
-
|
|
312
|
+ };
|
|
313
|
+ that.mainService
|
|
314
|
+ .getFetchDataList("adviceCollection", "badEvaluationHandle", data)
|
|
315
|
+ .subscribe((data) => {
|
|
316
|
+ that.badList = data.list;
|
|
317
|
+ that.Loading = false;
|
|
318
|
+ that.listLength = that.badNum = data.totalNum;
|
|
319
|
+ });
|
334
|
320
|
}
|
335
|
321
|
|
336
|
|
-
|
337
|
322
|
// 意见列表
|
338
|
323
|
adviceList = [];
|
339
|
|
- adviceNum = 0;//意见数量
|
|
324
|
+ adviceNum = 0; //意见数量
|
340
|
325
|
getAdviceList() {
|
341
|
326
|
this.Loading = true;
|
342
|
327
|
let data = {
|
343
|
328
|
idx: this.listIdx - 1,
|
344
|
329
|
sum: 10,
|
345
|
330
|
advice: {
|
346
|
|
- replaceFlag: 0,//未回复
|
347
|
|
- hosIds: this.hosIds
|
|
331
|
+ replaceFlag: 0, //未回复
|
|
332
|
+ hosIds: this.hosIds,
|
348
|
333
|
},
|
349
|
|
- }
|
|
334
|
+ };
|
350
|
335
|
|
351
|
|
- this.mainService.getFetchDataList('adviceCollection', 'advice', data).subscribe(data => {
|
352
|
|
- this.adviceList = data.list;
|
353
|
|
- this.Loading = false;
|
354
|
|
- this.listLength = this.adviceNum = data.totalNum;
|
355
|
|
- })
|
|
336
|
+ this.mainService
|
|
337
|
+ .getFetchDataList("adviceCollection", "advice", data)
|
|
338
|
+ .subscribe((data) => {
|
|
339
|
+ this.adviceList = data.list;
|
|
340
|
+ this.Loading = false;
|
|
341
|
+ this.listLength = this.adviceNum = data.totalNum;
|
|
342
|
+ });
|
356
|
343
|
}
|
357
|
344
|
|
358
|
|
-
|
359
|
345
|
// 初始化新增form表单
|
360
|
346
|
initForm() {
|
361
|
347
|
this.validateForm = this.fb.group({
|
|
@@ -375,31 +361,28 @@ export class HomeComponent implements OnInit {
|
375
|
361
|
badEvaluationHandle: {
|
376
|
362
|
id: that.coopId,
|
377
|
363
|
mediationUser: { id: that.validateForm.value.user },
|
378
|
|
- }
|
379
|
|
- }
|
380
|
|
- that.mainService.postCustom('adviceCollection', 'updData/badEvaluationHandle', postData).subscribe(data => {
|
381
|
|
- that.hideDesModal()
|
382
|
|
- that.btnLoading = false;
|
383
|
|
- if (data.status == 200) {
|
384
|
|
- that.showPromptModal('指派', true, '');
|
385
|
|
- that.initForm()
|
386
|
|
- that.listIdx = 1;
|
387
|
|
-
|
388
|
|
- that.getBadList()
|
389
|
|
- } else {
|
390
|
|
- that.showPromptModal('指派', false, data.msg);
|
391
|
|
- }
|
392
|
|
- })
|
393
|
|
-
|
394
|
|
-
|
|
364
|
+ },
|
|
365
|
+ };
|
|
366
|
+ that.mainService
|
|
367
|
+ .postCustom("adviceCollection", "updData/badEvaluationHandle", postData)
|
|
368
|
+ .subscribe((data) => {
|
|
369
|
+ that.hideDesModal();
|
|
370
|
+ that.btnLoading = false;
|
|
371
|
+ if (data.status == 200) {
|
|
372
|
+ that.showPromptModal("指派", true, "");
|
|
373
|
+ that.initForm();
|
|
374
|
+ that.listIdx = 1;
|
|
375
|
+
|
|
376
|
+ that.getBadList();
|
|
377
|
+ } else {
|
|
378
|
+ that.showPromptModal("指派", false, data.msg);
|
|
379
|
+ }
|
|
380
|
+ });
|
395
|
381
|
}
|
396
|
382
|
|
397
|
|
-
|
398
|
|
-
|
399
|
|
-
|
400
|
383
|
// 回复弹框
|
401
|
|
- modal: boolean = false;//回复模态框
|
402
|
|
- replyCon: any;//意见内容
|
|
384
|
+ modal: boolean = false; //回复模态框
|
|
385
|
+ replyCon: any; //意见内容
|
403
|
386
|
reply(data) {
|
404
|
387
|
this.modal = true;
|
405
|
388
|
this.replyCon = data;
|
|
@@ -408,14 +391,15 @@ export class HomeComponent implements OnInit {
|
408
|
391
|
this.modal = false;
|
409
|
392
|
}
|
410
|
393
|
|
411
|
|
-
|
412
|
394
|
// 指派人员
|
413
|
|
- allDesUser: any = [];//所有支助人员
|
|
395
|
+ allDesUser: any = []; //所有支助人员
|
414
|
396
|
getAllDesUser(id) {
|
415
|
397
|
let that = this;
|
416
|
|
- that.mainService.getHosUser('getUsersByPermission', id).subscribe(data => {
|
417
|
|
- that.allDesUser = data.data || []
|
418
|
|
- })
|
|
398
|
+ that.mainService
|
|
399
|
+ .getHosUser("getUsersByPermission", id)
|
|
400
|
+ .subscribe((data) => {
|
|
401
|
+ that.allDesUser = data.data || [];
|
|
402
|
+ });
|
419
|
403
|
}
|
420
|
404
|
|
421
|
405
|
// 指派
|
|
@@ -424,7 +408,7 @@ export class HomeComponent implements OnInit {
|
424
|
408
|
designate(id, hosId) {
|
425
|
409
|
this.desModal = true;
|
426
|
410
|
this.coopId = id;
|
427
|
|
- this.getAllDesUser(hosId)
|
|
411
|
+ this.getAllDesUser(hosId);
|
428
|
412
|
}
|
429
|
413
|
hideDesModal() {
|
430
|
414
|
this.desModal = false;
|
|
@@ -432,12 +416,13 @@ export class HomeComponent implements OnInit {
|
432
|
416
|
|
433
|
417
|
// 调解
|
434
|
418
|
detail(id) {
|
435
|
|
- this.router.navigate(['/main/home/appraiseDetail/' + id], { fragment: 'tj' });
|
|
419
|
+ this.router.navigate(["/main/home/appraiseDetail/" + id], {
|
|
420
|
+ fragment: "tj",
|
|
421
|
+ });
|
436
|
422
|
}
|
437
|
423
|
|
438
|
|
-
|
439
|
424
|
// 回复
|
440
|
|
- adviceSubContent: string;//回复内容
|
|
425
|
+ adviceSubContent: string; //回复内容
|
441
|
426
|
btnLoading: boolean = false;
|
442
|
427
|
submitReplyForm() {
|
443
|
428
|
let that = this;
|
|
@@ -447,30 +432,32 @@ export class HomeComponent implements OnInit {
|
447
|
432
|
advice: {
|
448
|
433
|
id: that.replyCon.id,
|
449
|
434
|
replyUser: { id: that.replyCon.createUser.id },
|
450
|
|
- replyContent: that.adviceSubContent
|
451
|
|
- }
|
452
|
|
- }
|
453
|
|
- that.mainService.postCustom('adviceCollection', 'updData/advice', postData).subscribe(data => {
|
454
|
|
- that.btnLoading = false;
|
455
|
|
- that.adviceSubContent = '';
|
456
|
|
- if (data.status == 200) {
|
457
|
|
- that.showPromptModal('回复', true, '');
|
458
|
|
- that.hideModal()
|
459
|
|
- that.listIdx = 1;
|
460
|
|
- that.getAdviceList()
|
461
|
|
- } else {
|
462
|
|
- that.showPromptModal('回复', false, data.msg);
|
463
|
|
- }
|
464
|
|
- })
|
|
435
|
+ replyContent: that.adviceSubContent,
|
|
436
|
+ },
|
|
437
|
+ };
|
|
438
|
+ that.mainService
|
|
439
|
+ .postCustom("adviceCollection", "updData/advice", postData)
|
|
440
|
+ .subscribe((data) => {
|
|
441
|
+ that.btnLoading = false;
|
|
442
|
+ that.adviceSubContent = "";
|
|
443
|
+ if (data.status == 200) {
|
|
444
|
+ that.showPromptModal("回复", true, "");
|
|
445
|
+ that.hideModal();
|
|
446
|
+ that.listIdx = 1;
|
|
447
|
+ that.getAdviceList();
|
|
448
|
+ } else {
|
|
449
|
+ that.showPromptModal("回复", false, data.msg);
|
|
450
|
+ }
|
|
451
|
+ });
|
465
|
452
|
}
|
466
|
453
|
|
467
|
454
|
// 跳转到指定页面
|
468
|
455
|
toMenu(type, title) {
|
469
|
|
- if (type == 'orderManagement') {
|
470
|
|
- this.router.navigate(['/main/' + type], { fragment: 'yc' })
|
|
456
|
+ if (type == "orderManagement") {
|
|
457
|
+ this.router.navigate(["/main/" + type], { fragment: "yc" });
|
471
|
458
|
return;
|
472
|
459
|
}
|
473
|
|
- this.router.navigateByUrl('/main/' + type);
|
|
460
|
+ this.router.navigateByUrl("/main/" + type);
|
474
|
461
|
}
|
475
|
462
|
|
476
|
463
|
// 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
|