index.vue
21.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
<template>
<div class="app-container">
<!-- 表格数据 -->
<el-table v-loading="loading" :data="policyList">
<el-table-column label="序号" width="55" type="index" />
<el-table-column label="登记时间" width="160" align="center">
<template #default="{ row }">
<span>{{ row.initialRegistration || row.createTime }}</span>
</template>
</el-table-column>
<el-table-column
label="车牌号"
prop="licensePlateNumber"
width="150"
align="center"
/>
<el-table-column
label="车架号"
width="180"
prop="frameNumber"
align="center"
:show-overflow-tooltip="true"
/>
<el-table-column
label="车主姓名"
prop="name"
width="100"
align="center"
/>
<el-table-column
label="联系电话"
prop="phone"
width="180"
align="center"
/>
<el-table-column
label="上年承保公司"
prop="sysDeptName"
width="150"
align="center"
/>
<el-table-column
v-show="hasCompanyadmin"
label="分配机制"
prop="distributionMechanism"
width="150"
align="center"
/>
<el-table-column
label="订单分配时间"
prop="distributionTime"
width="160"
align="center"
/>
<el-table-column
label="保单进度"
prop="orderProgress"
width="150"
align="center"
/>
<el-table-column
label="承接时间"
prop="companyEmployeeUndertakeTime"
width="160"
align="center"
/>
<el-table-column
v-show="hasCompanyadmin"
label="分配人"
prop="associationEmployeeUserName"
width="150"
align="center"
/>
<el-table-column
v-show="hasCompanyadmin"
label="承接人"
prop="companyEmployeeUserName"
width="150"
align="center"
/>
<el-table-column
label="操作"
align="center"
min-width="380"
fixed="right"
>
<template #default="{ row }">
<el-button
type="primary"
v-hasPermi="['policy:pending:continue']"
@click.stop="handleContinue(row)"
>{{
row.orderProgress === "已承接" ? "承接回馈" : "承接"
}}</el-button
>
<el-button
type="primary"
v-show="
row.policyStatus !== '疑难件' && row.orderProgress === '已承接'
"
v-hasPermi="['policy:pending:troubleshooting']"
@click.stop="handleTroubleshooting(row.taskId)"
>疑难件</el-button
>
<el-button
type="primary"
v-hasPermi="['policy:pending:sharing']"
@click.stop="handleSharing(row.taskId)"
>分配</el-button
>
<el-button
type="primary"
v-show="row.orderProgress !== '已承接'"
v-hasPermi="['policy:pending:transfer']"
@click.stop="handleSharing(row.taskId)"
>转办</el-button
>
<el-button
type="primary"
v-show="hasRole"
@click.stop="handleSuccess('0', row.taskId)"
>通过</el-button
>
<el-button
type="primary"
v-show="hasRole"
@click.stop="handleFallback('1', row.taskId)"
>退回</el-button
>
<el-button
type="primary"
v-show="hasRole"
@click.stop="handleUpdate(row)"
>修改</el-button
>
<el-button
type="primary"
v-show="hasRole"
@click.stop="handleVoid('2', row.taskId)"
>作废</el-button
>
<el-button
type="primary"
v-show="hasRole"
@click.stop="handleAuthCompany('0', row.taskId)"
>分配</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 表单作废对话框 -->
<el-dialog
v-model="deprecatedShow"
title="温馨提示:该保单作废后车牌号、车架号在本自然年度无法重新提交"
width="500"
append-to-body
>
<QuillEditor
:value="deprecatedForm.deprecatedReason"
@updateValue="getReason"
/>
<template #footer>
<div class="dialog-footer">
<el-button @click="deprecatedShow = false">取消</el-button>
<el-button type="primary" @click="sunmitDeprecated">确定</el-button>
</div>
</template>
</el-dialog>
<!-- 分配承保公司对话框 -->
<el-dialog
v-model="companyShow"
title="分配承保公司:"
width="500"
append-to-body
>
<div class="company_box">
<div class="header_top">
<el-input
v-model="companyQueryParams.deptName"
style="width: 380px"
placeholder="请输入承保公司名称(支持模糊查询)"
prefix-icon="Search"
/>
<el-button type="primary" @click="getDeptList">查询</el-button>
</div>
<el-radio-group v-model="companyForm.deptId">
<el-radio
v-for="item in deptOptions"
:key="item.deptId"
:label="item.deptId"
>{{ item.deptName }}</el-radio
>
</el-radio-group>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="companyShow = false">取消</el-button>
<el-button type="primary" @click="submitForm">确定</el-button>
</div>
</template>
</el-dialog>
<!-- 转办分配对话框 -->
<el-dialog
v-model="transferShow"
title="请选择人员:"
width="500"
append-to-body
>
<div class="company_box">
<el-radio-group v-model="transferForm.username">
<el-radio
v-for="item in transferOptions"
:key="item.userName"
:label="item.userName"
>{{ item.userName }}</el-radio
>
</el-radio-group>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="companyShow = false">取消</el-button>
<el-button type="primary" @click="submitTransfer">确定</el-button>
</div>
</template>
</el-dialog>
<!-- 承接回馈对话框 -->
<el-dialog
v-model="showFeedback"
title="填写承接回馈"
width="500"
append-to-body
>
<el-form :model="FeedbackForm" ref="policyRef" label-width="100px">
<el-form-item label="保单回馈" prop="progress">
<el-input
v-model="FeedbackForm.policynumber"
placeholder="请输入保单号"
:disabled="hasRole"
/>
</el-form-item>
<el-form-item label="保单回馈" prop="progress">
<QuillEditor :value="FeedbackForm.message" @updateValue="getMsg" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="showFeedback = false">取消</el-button>
<el-button type="primary" @click="submit">提交回馈</el-button>
</div>
</template>
</el-dialog>
<!-- 编辑对话框 -->
<el-dialog v-model="open" title="保单信息" width="700" append-to-body>
<el-form :model="form" ref="policyRef" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="车牌号" prop="licensePlateNumber">
<el-input
v-model="form.licensePlateNumber"
placeholder="请输入车牌号"
:disabled="!hasRole"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车架号" prop="frameNumber">
<el-input
v-model="form.frameNumber"
:disabled="!hasRole"
placeholder="请输入车架号"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="车主姓名" prop="name">
<el-input
v-model="form.name"
:disabled="!hasRole"
placeholder="请输入车主姓名"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="phone">
<el-input
v-model="form.phone"
:disabled="!hasRole"
placeholder="请输入联系电话"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="车辆类型" prop="vehicleType">
<el-select
v-model="form.vehicleTypeId"
:disabled="!hasRole"
style="width: 230px"
>
<el-option
v-for="item in carTypeOption"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆使用性质" prop="vehicleNature">
<el-select
v-model="form.vehicleNatureId"
:disabled="!hasRole"
style="width: 230px"
>
<el-option
v-for="item in carNatureOption"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="核定载客数" prop="passengersNumber">
<el-input
v-model="form.passengersNumber"
:disabled="!hasRole"
placeholder="请输入核定载客数"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="核定载质量" prop="passengerCapacity">
<el-input
v-model="form.passengerCapacity"
:disabled="!hasRole"
placeholder="请输入核定载质量"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="排量毫升" prop="emissions">
<el-input
v-model="form.emissions"
:disabled="!hasRole"
placeholder="请输入排量毫升"
/>
</el-form-item>
</el-col>
<el-col v-if="isCustom" :span="12">
<el-form-item label="中文品牌" prop="vehicleBrand">
<el-select
v-model="form.vehicleBrandId"
:disabled="!hasRole"
style="width: 230px"
>
<el-option
v-for="item in carBrandOption"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col v-else :span="12">
<el-form-item label="中文品牌" prop="vehicleBrand">
<el-input
v-model="form.customizeVehicleBrand"
:disabled="!hasRole"
placeholder="中文品牌"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="车辆型号" prop="customizeVehicleModel">
<el-input
v-model="form.customizeVehicleModel"
:disabled="!hasRole"
placeholder="请输入车辆型号"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="准牵引准质量" prop="tractionMass">
<el-input
v-model="form.tractionMass"
:disabled="!hasRole"
placeholder="请输入准牵引准质量"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="号牌种类" prop="customizeVehicleModel">
<el-select
v-model="form.lincensePlateTypeId"
:disabled="!hasRole"
style="width: 230px"
>
<el-option
v-for="item in carNumOption"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保险需求" prop="requirements">
<el-select
v-model="form.requirementsId"
:disabled="!hasRole"
style="width: 230px"
>
<el-option
v-for="item in needOption"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="open = false">取消</el-button>
<el-button type="primary" @click="submitUpdate">提交修改</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import {
queryMyList,
disposeUser,
transfer,
getUserList,
updateCarInfo,
getCarDetail,
} from "@/api/policy/index";
import { queryCarType } from "@/api/configurationCenter/carType.js";
import { queryCarNature } from "@/api/configurationCenter/carNature.js";
import { queryCarBrand } from "@/api/configurationCenter/carBrand.js";
import { queryCarNum } from "@/api/configurationCenter/carNum.js";
import { queryNeed } from "@/api/configurationCenter/need.js";
import { listDept } from "@/api/system/dept";
import { ref } from "vue";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const total = ref(0);
const isCustom = ref(false);
const open = ref(false);
const timer = ref(null);
const timerReason = ref(null);
const form = ref({});
const showFeedback = ref(false);
const transferShow = ref(false);
const transferForm = ref({});
const FeedbackForm = ref({});
const getParams = reactive({
pageNum: 1,
pageSize: 100,
});
const companyShow = ref(false);
const deptOptions = ref([]);
const transferOptions = ref([]);
const deprecatedShow = ref(false);
const deprecatedForm = ref({});
const companyForm = ref({});
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
});
const companyQueryParams = reactive({
deptName: undefined,
status: undefined,
});
const policyList = ref([]);
// 判断是否有权限
const hasRole = computed(() => {
return proxy.$auth.hasRole("associationemployee");
});
const hasCompanyadmin = computed(() => {
return proxy.$auth.hasRole("companyadmin");
});
// 号牌种类
const carNumOption = ref([]);
const getCarNumOption = async () => {
const { data } = await queryCarNum(getParams);
carNumOption.value = data.records;
};
getCarNumOption();
// 车辆类型
const carTypeOption = ref([]);
const getCarTypeOption = async () => {
const { data } = await queryCarType(getParams);
carTypeOption.value = data.records;
};
getCarTypeOption();
// 车辆使用性质
const carNatureOption = ref([]);
const getcarNatureOption = async () => {
const { data } = await queryCarNature(getParams);
carNatureOption.value = data.records;
};
getcarNatureOption();
// 中文品牌
const carBrandOption = ref([]);
const getCarBrandOption = async () => {
const { data } = await queryCarBrand(getParams);
carBrandOption.value = data.records;
};
getCarBrandOption();
// 保险需求
const needOption = ref([]);
const getNeedOption = async () => {
const { data } = await queryNeed(getParams);
needOption.value = data.records;
};
getNeedOption();
const getList = async () => {
loading.value = true;
const { data } = await queryMyList(queryParams);
policyList.value = data.rows;
total.value = data.total;
loading.value = false;
};
// 承接
const handleContinue = (row) => {
if (row.orderProgress === "待承接") {
proxy.$modal
.confirm("是否要承接该保单")
.then(function () {})
.then(() => {
disposeUser({}, row.taskId).then((res) => {
proxy.$modal.msgSuccess("承接成功");
getList();
});
})
.catch(() => {
proxy.$modal.msg("已取消");
});
} else {
reset();
FeedbackForm.value.taskId = row.taskId;
showFeedback.value = true;
}
};
// 疑难件
const handleTroubleshooting = (taskId) => {
const data = {
policystatus: "1",
};
disposeUser(data, taskId).then((res) => {
getList();
proxy.$modal.msgSuccess("处理成功");
});
};
// 通过保单
const handleSuccess = (associationapprove, taskId) => {
proxy.$modal
.confirm("是否通过该保单")
.then(function () {})
.then(() => {
disposeUser({ associationapprove }, taskId).then((res) => {
proxy.$modal.msgSuccess("保单已通过");
getList();
});
})
.catch(() => {
proxy.$modal.msg("取消通过");
});
};
// 退回保单
const handleFallback = (associationapprove, taskId) => {
proxy.$modal
.confirm("是否退回该保单")
.then(function () {})
.then(() => {
disposeUser({ associationapprove }, taskId).then((res) => {
proxy.$modal.msgSuccess("保单已退回");
getList();
});
})
.catch(() => {
proxy.$modal.msg("已取消");
});
};
// 作废保单
const handleVoid = (associationapprove, taskId) => {
deprecatedForm.value = {
associationapprove,
taskId,
};
deprecatedShow.value = true;
};
// 提交作废表单
const sunmitDeprecated = () => {
const data = {
associationapprove: deprecatedForm.value.associationapprove,
comment: deprecatedForm.value.deprecatedReason,
};
const taskId = deprecatedForm.value.taskId;
disposeUser(data, taskId).then((res) => {
getList();
deprecatedShow.value = false;
proxy.$modal.msgSuccess("保单已作废");
});
};
// 分配承保公司
const handleAuthCompany = (associationapprove, taskId) => {
companyForm.value = {
associationapprove,
taskId,
};
companyShow.value = true;
getDeptList();
};
// 获取人员列表
const getUser = async () => {
const { data } = await getUserList();
transferOptions.value = data;
};
// 转办或分配
const handleSharing = (id) => {
transferForm.value.taskId = id;
getUser();
transferShow.value = true;
};
/** 查询部门列表 */
const getDeptList = () => {
loading.value = true;
listDept(companyQueryParams).then((response) => {
deptOptions.value = response.data.filter((item) => item.parentId === 100);
loading.value = false;
});
};
/** 重置操作表单 */
function reset() {
form.value = {
policyId: undefined,
createTime: undefined,
carNum: undefined,
frameNum: undefined,
name: undefined,
phone: undefined,
company: undefined,
};
proxy.resetForm("policyRef");
}
/** 修改按钮操作 */
const handleUpdate = async (row) => {
reset();
const { data } = await getCarDetail(row.businessKey);
form.value = data;
isCustom.value = data.isCustomizeBrandAndModel == "0";
open.value = true;
};
/** 提交通过分配承保公司 */
function submitForm() {
const data = {
associationapprove: companyForm.value.associationapprove,
deptid: companyForm.value.deptId.toString(),
};
const taskId = companyForm.value.taskId;
disposeUser(data, taskId).then((res) => {
companyShow.value = false;
getList();
proxy.$modal.msgSuccess("保单已分配成功");
});
}
/** 提交通过分配转办人员 */
function submitTransfer() {
const data = {
username: transferForm.value.username,
};
const taskId = transferForm.value.taskId;
transfer(data, taskId).then((res) => {
transferShow.value = false;
getList();
proxy.$modal.msgSuccess("保单已分配成功");
});
}
// 提交承接回馈
const submit = () => {
const data = {
policystatus: "2",
message: FeedbackForm.value.comment,
policynumber: FeedbackForm.value.policynumber,
};
disposeUser(data, FeedbackForm.value.taskId).then((res) => {
getList();
proxy.$modal.msgSuccess("回馈成功");
showFeedback.value = false;
});
};
const getMsg = (val) => {
clearTimeout(timer.value);
timer.value = setTimeout(() => {
FeedbackForm.value.comment = val;
}, 1000);
};
// 获取作废原因
const getReason = (val) => {
clearTimeout(timerReason.value);
timerReason.value = setTimeout(() => {
deprecatedForm.value.deprecatedReaso = val;
}, 1000);
};
// 提交修改
const submitUpdate = () => {
updateCarInfo(form.value).then((response) => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
};
getList();
</script>
<style lang="scss" scoped>
::v-deep(.el-radio-group) {
align-items: start;
flex-direction: column;
}
.header_top {
display: flex;
align-items: center;
gap: 30px;
margin-bottom: 20px;
}
</style>