writeOffList.vue
18 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
<template>
<div class="writeOff">
<title-tip v-if="$commonData.dirctorAudit != 1">请注意:订单列表还有{{ countData.pendingCount }}单待受理, {{ countData.merchantFailCount }}单 不通过退回处理,{{ countData.toBeSignedCount }}单待客户签名授权。为保障客户权益,请尽快处理哦!</title-tip>
<div class="contain equity-wrap">
<div class="search-wrap">
<glsx-combi-form ref="showSearch" labelWidth="112px" defaultWidth="230px" :formObj="batchListSearch" :formData="writeOffForm">
<span slot="footer" class="footer-btns">
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="handleReset('reset')">重置</el-button>
</span>
</glsx-combi-form>
</div>
<div class="list-wrap">
<div class="operate-wrap">
<span class="title">核赔订单列表</span>
<span>
<el-button size="small" type="primary" @click="handleView({ status: 999 }, 6)">新增核赔</el-button>
<el-button size="small" type="primary" plain @click="handleExport">导出</el-button>
</span>
</div>
<GLTable ref="writeOffTable" :searchForm="searchForm" :tableParams="batchTableParams" :getListApi="getListApi" :pageConf="batchPageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<template v-if="$commonData.dirctorAudit == 1">
<el-button type="text" @click="handleView(scope.scope, 4)">去审核</el-button>
</template>
<template v-else>
<el-button v-if="[1, 3, 6, 9, 12, 29, 30, 31].includes(scope.scope.status) || (scope.scope.status == 7 && scope.scope.statusDesc == '拒赔')" type="text" @click="handleView(scope.scope, 1)">查看</el-button>
<el-button v-if="[5, 8].includes(scope.scope.status)" type="text" @click="handleView(scope.scope, 2)">上传资料</el-button>
<el-button v-if="[10, 13].includes(scope.scope.status) || (scope.scope.status == 7 && scope.scope.statusDesc != '拒赔')" type="text" @click="handleView(scope.scope, 3)">重新提交</el-button>
<el-button v-if="scope.scope.status == 7 && scope.scope.statusDesc == '拒赔'" type="text" @click="uploadExplain(scope.scope)">上传通融说明</el-button>
<el-button v-if="scope.scope.status == 7 && scope.scope.statusDesc == '拒赔'" type="text" @click="downloadExplain(scope.scope)">下载通融说明模板</el-button>
<el-button v-if="[11].includes(scope.scope.status)" type="text" @click="handleView(scope.scope, 5)">签名授权书</el-button>
</template>
</div>
</GLTable>
</div>
</div>
<glsx-dialog class="upload-dialog" title="上传资料" btnSize="small" btnOkLabel="确认" :isVisible.sync="explainObj.fileVisible" width="576px" @confirmDialog="confirmExplainDialog" @closeDialog="cancelExplainDialog">
<div class="upload-wrap">
<label class="label" for="">上传资料:</label>
<div v-if="!explainObj.exceptionImgUrl" class="upload-btn" @click="selectFile">
<img class="img" :src="require('@/assets/add.png')" alt="" />
<span class="name">上传照片</span>
<input type="file" class="file" id="file" ref="input" @change="upload" accept="image/png, image/jpeg, image/gif, image/jpg" />
</div>
<div class="img-wrap" v-else>
<div class="mask">
<i class="del el-icon-delete" @click="handleDel()"></i>
</div>
<el-image :preview-src-list="[explainObj.exceptionImgUrl]" class="img-url" :src="explainObj.exceptionImgUrl" alt=""></el-image>
</div>
<span class="example">
示例
<div class="example-box">
<el-image class="example-img" :preview-src-list="[exampleUrl]" :src="exampleUrl" alt=""></el-image>
</div>
</span>
<span class="download" @click="downloadExplain()">下载通融模板</span>
</div>
</glsx-dialog>
<process-tip ref="processTip"></process-tip>
<pre-img ref="preImgRef"></pre-img>
</div>
</template>
<script type="text/ecmascript-6">
import exampleUrl from '@/assets/explain-example.png'
import signed from '../image/signed.png'
import glsxCombiForm from '@/components/glsx-combi-form'
import glsxDialog from '@/components/glsx-dialog'
import titleTip from '@/components/titleTip'
import util from '@/util/util'
import processTip from './components/processTip'
import preImg from './components/preImg'
const serviceList = [
{
confId: '',
confName: '全部'
},
{
confId: 1,
confName: '待支付'
},
{
confId: 3,
confName: '支付成功'
},
{
confId: 5,
confName: '待受理'
},
{
confId: 6,
confName: '待定损'
},
{
confId: 7,
confName: '定损不通过'
},
{
confId: 8,
confName: '定损通过'
},
// {
// confId: 9,
// confName: '待主管审核'
// },
// {
// confId: 10,
// confName: '主管审核不通过'
// },
{
confId: 11,
confName: '待客户签字授权'
},
{
confId: 12,
confName: '待核赔'
},
{
confId: 13,
confName: '核赔不通过'
},
{
confId: 29,
confName: '已失效'
},
{
confId: 30,
confName: '已删除'
},
{
confId: 31,
confName: '已结束案件'
}
]
export default {
name: 'writeOffList',
data() {
return {
showTip: true,
exampleUrl,
getListApi: this.$apis.beforeSale.getWriteOffList,
batchListSearch: {
searchText: '',
status: '',
activeTime: [],
merchantUpdatedTime: []
},
explainObj: {
fileVisible: false,
exceptionImgUrl: '',
id: ''
},
uploadForm: {
file: ''
},
uploadFormData: [
{
label: '上传资料',
name: 'file',
type: 'upload',
limitSize: 20,
maxPhotoNum: 4,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const targetNameList = file.name.split('.')
const base64 = targetNameList[targetNameList.length - 1] + '@' + imgFile.split(',')[1]
var imgUrl = ''
this.$apis.beforeSale.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.uploadFile(res, targetItem)
})
}
}
],
countData:{},
searchForm: {},
writeOffForm: [
{
label: '搜索内容',
name: 'searchText',
type: 'input',
placeholder: '车主姓名 | 核销码 | 合同号',
isClear: true
},
{
label: '服务状态',
name: 'status',
type: 'select',
optionList: serviceList,
optionId: 'confId',
optionLabel: 'confName'
},
{
label: '提交时间',
name: 'activeTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions',
isClear: true
},
{
label: '门店更新时间',
name: 'merchantUpdatedTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions',
isClear: true
}
],
// 序号、核销码、客户名、合同号、价格区间、门店提交时间、服务名称、操作
batchTableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '核销码',
prop: 'writeOffCode',
width: 120,
formatter: cellValue => {
return cellValue.writeOffCode || '-'
}
},
{
label: '客户名',
prop: 'reporterName',
width: 200,
formatter: cellValue => {
return cellValue.reporterName || '-'
}
},
{
label: '合同号',
prop: 'contractNo',
width: 200,
formatter: cellValue => {
return cellValue.contractNo || '-'
}
},
{
label: '价格区间',
prop: 'priceSection',
width: 200,
formatter: cellValue => {
return cellValue.priceSection || '-'
}
},
{
label: '门店提交时间',
prop: 'commitTime',
width: 200,
formatter: cellValue => {
return cellValue.commitTime ? util.dateFormat(cellValue.commitTime, 'YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '门店更新时间',
prop: 'merchantUpdatedDate',
width: 200,
formatter: cellValue => {
return cellValue.merchantUpdatedDate ? util.dateFormat(cellValue.merchantUpdatedDate, 'YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '服务名称',
prop: 'serviceName',
formatter: cellValue => {
return cellValue.serviceName || '-'
},
width: 200,
line:1
},
{
label: '服务状态',
prop: 'status',
width: 120,
formatter: cellValue => {
return serviceList.map(item => item.confId).includes(cellValue.status) ? serviceList.find(item => item.confId == cellValue.status).confName : '-'
}
},
{
label: '状态描述',
prop: 'statusDesc',
formatter: cellValue => {
return cellValue.statusDesc || '-'
},
width: 200,
line: 1
},
{
label: '支付金额/元',
prop: 'paymentAmount',
formatter: cellValue => {
return cellValue.paymentAmount || '-'
},
align:'right',
width: 120
},
{
label: '操作',
prop: '',
width: '200px',
fixed: 'right',
addHtml: 'table-btns'
}
]
},
batchPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
components: {
glsxCombiForm,
glsxDialog,
titleTip,
processTip,
preImg
},
mounted() {
this.$apis.beforeSale.hasUnsigned({}).then(res => {
if(res?.data && this.$commonData.dirctorAudit!=1){
this.$refs.processTip.openTipDialog(true)
}
})
this.getClaimsCount()
},
methods: {
// 删除通融说明图片
handleDel(){
this.explainObj.exceptionImgUrl = ''
},
downloadExplain(){
try {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', this.$tempUrl)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
} catch (error) {
console.log(error)
}
},
selectFile(){
this.$refs.input.click()
},
upload(e){
const file = e.target.files[0]
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const base64 = file.name.split('.').pop() + '@' + arrBase64[1]
this.$apis.beforeSale.uploadImageApi({ file: base64, fileType: 'image' }).then(res => {
if(res.code == '0' && res.data){
this.explainObj.exceptionImgUrl = res.data
}
}).finally(()=>{
this.$refs.input.value = ''
})
}
},
confirmExplainDialog(){
if(!this.explainObj.exceptionImgUrl) return this.$message.error('请上传通融资料')
const {exceptionImgUrl, id} = this.explainObj
this.$apis.beforeSale.applyPassApi({exceptionImgUrl, id}).then(res => {
if(res) {
this.$message.success('操作成功')
this.handleSearch()
this.cancelExplainDialog()
}
})
},
cancelExplainDialog(){
this.explainObj = {
fileVisible: false,
exceptionImgUrl: '',
id: ''
}
},
uploadExplain(row){
this.explainObj.id = row.id
this.explainObj.fileVisible = true
},
handleView(item, type) {
// type 1-查看 2-上传资料 3-重新提交 4-去审核 5-签名 6-新增
let urlParam = {
pageType: type,
status : item.status
}
if(type!=6){
urlParam.writeOffCode = item.writeOffCode
}
const params = encodeURIComponent(JSON.stringify(urlParam))
if((item.preStatus == 6 && item.status==31) || item.status==5 || item.status==6 || item.status==7 || item.status==29 || item.status==30 || item.status==999){
this.$router.push(`/beforeSale/writeOff/addDamage/${params}/`)
}else if(item.status== 11){
this.$refs.preImgRef.preImage(signed)
}else{
this.$router.push(`/beforeSale/writeOff/addWriteOff/${params}/`)
}
},
getClaimsCount(){
if(this.$commonData.dirctorAudit==1) return;
this.$apis.beforeSale.getClaimsCount({isOss:0}).then(res => {
if(res){
this.countData = res
}
})
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = { ...this.setParams() }
resolve()
})
},
setParams() {
const params = {...this.batchListSearch}
if (Array.isArray(this.batchListSearch.activeTime) && this.batchListSearch.activeTime.length > 0) {
params.commitTimeStart = this.batchListSearch.activeTime[0] + ' 00:00:00'
params.commitTimeEnd = this.batchListSearch.activeTime[1] + ' 23:59:59'
}
if (Array.isArray(this.batchListSearch.merchantUpdatedTime) && this.batchListSearch.merchantUpdatedTime.length > 0){
params.merchantUpdatedStart = this.batchListSearch.merchantUpdatedTime[0] + ' 00:00:00'
params.merchantUpdatedEnd = this.batchListSearch.merchantUpdatedTime[1] + ' 23:59:59'
}
params.isCharge = this.$commonData.dirctorAudit
delete params.activeTime
delete params.merchantUpdatedTime
return params
},
handleExport() {
const parmas = { ...this.setParams() }
this.$apis.beforeSale.exportWriteOffData(parmas).then(({ code, data, message }) => {
if (code == '0') {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', data)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
} else {
this.$message.error(message)
}
})
},
handleSearch() {
this.$refs.writeOffTable.refreshTable()
},
handleReset(type) {
this.batchListSearch = {
searchText: '',
status:'',
activeTime: []
}
if (type === 'reset') {
this.handleSearch()
}
}
}
}
</script>
<style lang="scss" scoped>
.writeOff {
.equity-wrap {
background-color: #fff;
padding: 20px 0;
.el-button--small {
border-radius: 4px;
}
.search-wrap {
/deep/ .el-form-item {
margin-right: 12px;
}
}
.list-wrap {
padding: 0 20px;
.operate-wrap {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
align-items: center;
.title {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #333333;
}
}
}
}
}
.upload-dialog {
/deep/ .el-dialog__header {
height: 60px;
padding: 0 20px;
line-height: 60px;
border-bottom: 1px solid #e5e5e5;
font-weight: 600;
font-size: 20px;
color: #333333;
.el-icon-close {
font-weight: 600;
font-size: 22px;
color: #666666;
}
}
/deep/ .el-dialog__footer {
border-top: 1px solid #e5e5e5;
height: 64px;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
}
.img-url {
width: 104px;
height: 104px;
border: 1px dashed #00000026;
border-radius: 4px;
}
.upload-wrap {
display: flex;
.label {
width: 154px;
text-align: right;
}
.img-wrap {
position: relative;
height: 104px;
&:hover .mask {
display: block;
}
}
.mask {
display: none;
position: absolute;
left: 0;
right: 0;
top: 0;
left: 0;
z-index: 9;
height: 104px;
border-radius: 4px;
background: rgba($color: #000000, $alpha: 0.4);
text-align: center;
line-height: 104px;
.del {
color: #fff;
font-size: 18px;
cursor: pointer;
}
}
.upload-btn {
width: 104px;
height: 104px;
box-sizing: border-box;
background: #0000000a;
border: 1px dashed #00000026;
border-radius: 4px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
.img {
width: 24px;
height: 24px;
}
.name {
margin-top: 10px;
font-weight: 400;
font-size: 14px;
}
.file {
width: 0;
height: 0;
opacity: 0;
}
}
.example {
margin: 0 12px;
position: relative;
height: fit-content;
&:hover {
.example-box {
display: block;
}
}
.example-box {
background: #ffffff;
border: 1px solid #e4e7ed;
box-sizing: border-box;
box-shadow: 0 4px 12px 0 #00000014;
border-radius: 4px;
position: absolute;
padding: 10px;
display: none;
top: 18px;
.example-img {
width: 304px;
height: 340px;
}
}
}
.download,
.example {
cursor: pointer;
color: #20af89;
}
}
}
</style>