accountsDetail.vue
19 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
<!-- 汇通分账-详情 -->
<template>
<v-layout>
<template slot="breadcrumb">
<el-breadcrumb-item>对账单详情</el-breadcrumb-item>
</template>
<template slot="main">
<div class="ibox accountsDetail">
<div
class="ibox-main"
v-for="(item, index) in orderForm"
:key="index"
>
<div class="ibox-title">
<h3 class="pull-left">{{item.title}}</h3>
</div>
<div class="ibox-content">
<el-row>
<el-col
v-for="(subItem, subIndex) in item.rowForm"
:key="subIndex"
:span="!item.isRow ? 8 : 24"
class="form-col"
><span class="col-title">{{subItem.label}}</span>
<span class="col-txt">
<span :style="{'width': subItem.width || '100%', 'display': 'inline-block'}" v-if="orderInfo[item.infoArrName][subItem.attrName]" :title="subItem.attrName === 'shopName' ? orderInfo[item.infoArrName][subItem.attrName] : ''">
<template v-if="!subItem.tag">
{{orderInfo[item.infoArrName][subItem.attrName]}}
<span>{{subItem.addSymbol}}</span>
</template>
<template v-else>
<el-tag :type="subItem.tag[orderInfo[item.infoArrName][subItem.attrName]]">
{{orderInfo[item.infoArrName][subItem.attrName]}}
<span>{{subItem.addSymbol}}</span>
</el-tag>
</template>
</span>
<span v-else>--</span>
<template v-if="subItem.attrName2">
{{orderInfo[item.infoArrName][subItem.attrName2] ? orderInfo[item.infoArrName][subItem.attrName2] : '--'}}
<span>{{subItem.addSymbol2}}</span>
</template>
</span>
</el-col>
</el-row>
<!-- 正常 - 2 - 对账信息 - 确认按钮 -->
<template v-if="reconcileBtn">
<el-button
class="btn"
v-if="item.infoArrName == 'reconcile' && orderStatus"
:disabled="orderInfo[item.infoArrName].status"
type="primary"
size="small"
@click="handleReconcile"
>财务确认</el-button>
</template>
<template v-else-if="item.infoArrName == 'reconcile' && !reconcileBtn && orderStatus">
<el-button
class="btn"
type="primary"
size="small"
:disabled="true"
>财务确认</el-button>
</template>
<!-- 正常 - 3 - SP分润明细 - 确认按钮 -->
<template v-if="spProfitBtn">
<el-button
class="btn"
v-if="item.infoArrName == 'spProfit' && orderStatus"
:disabled="orderInfo[item.infoArrName].status || !orderInfo.reconcile.status"
type="primary"
size="small"
@click="handleSpProfit"
>财务确认</el-button>
</template>
<template v-else-if="item.infoArrName == 'spProfit' && !spProfitBtn && orderStatus">
<el-button
class="btn"
type="primary"
size="small"
:disabled="true"
>财务确认</el-button>
</template>
<!-- 取消 - 2 - 对账信息 - 确认按钮 -->
<template v-if="reconcileBtn">
<el-button
class="btn"
v-if="item.infoArrName == 'reconcile' && !orderStatus"
:disabled="orderInfo[item.infoArrName].status || !orderInfo.spProfit.status"
type="primary"
size="small"
@click="handleCancelReconcile"
>财务确认退款</el-button>
</template>
<template v-else-if="item.infoArrName == 'reconcile' && !reconcileBtn && !orderStatus">
<el-button
class="btn"
type="primary"
size="small"
:disabled="true"
>财务确认退款</el-button>
</template>
<!-- 取消 - 3 - SP分润明细 - 确认按钮 -->
<template v-if="spProfitBtn">
<el-button
class="btn"
v-if="item.infoArrName == 'spProfit' && !orderStatus"
:disabled="orderInfo[item.infoArrName].status"
type="primary"
size="small"
@click="handleCancelSpProfit"
>财务确认退款</el-button>
</template>
<template v-else-if="item.infoArrName == 'spProfit' && !spProfitBtn && !orderStatus">
<el-button
class="btn"
type="primary"
size="small"
:disabled="true"
>财务确认退款</el-button>
</template>
</div>
</div>
<div>
<div class="ibox-title">
<h3 class="pull-left">变更记录</h3>
</div>
<!-- <el-timeline :reverse="reverse">
<el-timeline-item
v-for="(activity, index) in orderInfo.oplogs"
:key="index"
:timestamp="activity.createTime"
>
{{activity.explains}}
</el-timeline-item>
</el-timeline> -->
<div class="ibox-content">
<el-row>
<el-col
v-for="(item, index) in orderInfo.oplogs"
:key="index"
>
{{item.createTime}} {{item.explains}}
</el-col>
</el-row>
</div>
</div>
</div>
<!-- sp打款弹窗 -->
<el-dialog
title="确认打款"
:visible.sync="spConfirmVisible"
:before-close="handleCancelDialog"
width="600px"
:close-on-click-modal="false"
>
<el-form
ref="form"
label-width="110px"
:model="form"
:rules="rules"
:inline="false"
>
<el-form-item
prop="paidAmount"
label="打款金额:"
>
<el-input
:size="size"
maxlength="20"
type="number"
v-model="form.paidAmount"
placeholder="请输入"
>
<template slot="append">元</template>
</el-input>
</el-form-item>
<el-form-item
prop="bankBillNo"
label="流水号:"
>
<el-input
:size="size"
maxlength="17"
v-model="form.bankBillNo"
placeholder="请输入"
></el-input>
</el-form-item>
<el-row>
<el-col>
<el-form-item
label="打款时间:"
prop="paidTime"
>
<el-date-picker
v-model="form.paidTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm"
placeholder="选择日期时间"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span
slot="footer"
class="dialog-footer"
>
<el-button
:size="size"
@click="handleCancelDialog"
>取 消</el-button>
<el-button
:size="size"
type="primary"
:loading="dialogLoading"
@click="handleConfirmDialog"
>确 定</el-button>
</span>
</el-dialog>
</template>
</v-layout>
</template>
<script>
import { services } from '../../api'
const accountsService = services.accounts
export default {
name: 'accountsDetail',
data() {
let checkPaidAmount = (rule, vaule, cb) => {
if (this.form.paidAmount) {
if ((this.form.paidAmount < 0) || (this.form.paidAmount > 1000000)) {
cb('请输入0-100万以内的金额')
}
}
cb()
}
return {
size: 'small',
orderId: '',
reverse: true,
// 正常-1;取消-0
orderStatus: 1,
order: {
"orderId": '',
"orderNo": "",
"customerName": "",
"periods": '',
"packages": "",
"shopProperty": "",
"shopName": "",
"settleAmount": '',
"baseProfit": '',
"crAmount": '',
"financialProducts": '',
"status": 1,
"statusDesc": ""
},
reconcile: {
"orderNo": "",
"bankBillNo": "",
"totalAmount": '',
"notifyTime": "",
"packages": "",
"orderCnt": '',
"status": 0,
"statusDesc": "",
"paidAmount": '',
"totalMatch": "",
"confirmTime": ""
},
spProfit: {
"orderNo": "",
"invoiceProfit": '',
"noInvoiceProfit": '',
"crAmount": '',
"status": 0,
"statusDesc": "",
"paidAmount": null,
"bankBillNo": null,
"paidTime": null
},
oplogs: [],
reconcileBtn: true,
spProfitBtn: true,
orderInfo: {},
orderForm: [{
title: '订单信息',
infoArrName: 'order',
rowForm: [{
label: '申请单号',
attrName: 'orderNo'
}, {
label: '客户姓名',
attrName: 'customerName'
}, {
label: '合同期限',
attrName: 'periods',
addSymbol: '期'
}, {
label: '产品方案',
attrName: 'packages'
}, {
label: '店面名称',
attrName: 'shopName'
}, {
label: '合同状态',
attrName: 'statusDesc'
}, {
label: '结算金额',
attrName: 'settleAmount',
addSymbol: '元'
}, {
label: '金融产品',
attrName: 'financialProductName'
}, {
label: '创建时间',
attrName: 'createTime'
}]
}, {
title: '对账信息',
infoArrName: 'reconcile',
rowForm: [{
label: '打款流水号',
attrName: 'bankBillNo'
}, {
label: '打款总金额',
attrName: 'totalAmount',
addSymbol: '元'
}, {
label: '通知时间',
attrName: 'notifyTime'
}, {
label: '产品方案',
attrName: 'packages'
}, {
label: '包含订单数',
attrName: 'orderCnt',
addSymbol: '笔'
}, {
label: '对账状态',
attrName: 'statusDesc'
}, {
label: '订单结算金额',
attrName: 'paidAmount',
addSymbol: '元'
}, {
label: '总额匹配',
attrName: 'totalMatch',
tag: {
'匹配': 'success',
'不匹配': 'danger'
}
}, {
label: '确认时间',
attrName: 'confirmTime'
}]
}, {
title: 'SP分润明细',
infoArrName: 'spProfit',
isRow: true,
rowForm: [{
label: '基础利润',
width: '150px',
attrName: 'invoiceProfit',
attrName2: 'noInvoiceProfit',
addSymbol: '元(开票)',
addSymbol2: '元(不开票)',
}, {
label: '超融金额',
width: '150px',
attrName: 'crAmount',
attrName2: 'noInvoiceCrAmount',
addSymbol: '元(开票)',
addSymbol2: '元(不开票)',
}, {
label: 'SP总利润',
width: '150px',
attrName: 'invoiceTotalProfit',
attrName2: 'noInvoiceTotalProfit',
addSymbol: '元(开票)',
addSymbol2: '元(不开票)',
}, {
label: '打款状态',
attrName: 'statusDesc'
}, {
label: '实际打款金额',
attrName: 'paidAmount',
addSymbol: '元'
}, {
label: '账单流水号',
attrName: 'bankBillNo'
}, {
label: '确认打款时间',
attrName: 'paidTime'
}]
}],
// 弹窗
spConfirmVisible: false,
dialogLoading: false,
form: {
paidAmount: '',
bankBillNo: '',
paidTime: ''
},
rules: {
paidAmount: [
{ required: true, message: '请输入打款金额', trigger: 'blur' },
{ validator: checkPaidAmount, trigger: 'blur' }
],
bankBillNo: [
{ required: true, message: '请输入流水号', trigger: 'blur' }
],
paidTime: [
{ required: true, message: '请选择打款时间', trigger: 'blur' }
]
}
}
},
// watch: {
// 'form.paidAmount'(val, oldValue) {
// if (val!==oldValue) {
// this.limitPrice('paidAmount', val, oldValue, 6, 2)
// }
// }
// },
created() {
},
mounted() {
this.orderId = this.$route.query.orderId
this.orderInfo = {
order: this.order,
reconcile: this.reconcile,
spProfit: this.spProfit,
oplogs: []
}
this.getOrderInfo()
},
methods: {
// 属性名,新值,旧值,整数部分位数,小数部分位数
// limitPrice(objName, newValue, oldValue, intergerDigit, pointDigit, regRule) {
// var regRuleName = regRule || 'priceReg'
// const reg = {
// priceReg: /^\d[\d\.]*$/,
// numReg: /^[1-9]\d*$/
// }
// if (newValue && reg[regRuleName].test(newValue + '')) {
// if ((/\./).test(newValue)) {
// var newValueString = newValue + ''
// var interger = newValueString.split('.')[0]
// var point = newValue.split('.')[1]
// var intergerNum = interger.length > intergerDigit ? oldValue.split('.')[0] : interger
// var pointNum = point.length > pointDigit ? point.slice(0, pointDigit) : point
// newValue = pointDigit ? intergerNum + '.' + pointNum : newValue.split('.')[0]
// } else {
// newValue = newValue.length > intergerDigit ? oldValue.slice(0, intergerDigit) : newValue
// }
// this.form[objName] = newValue
// } else {
// this.form[objName] = newValue ? oldValue : ''
// }
// // console.log(this.form[objName])
// },
getOrderInfo() {
accountsService.getOrderInfo({
id: this.orderId
}).then(res => {
// console.log(res.data)
let keys = Object.keys(res.data)
keys.forEach(item => {
if (!res.data[item]) {
res.data[item] = this[item]
this[item + 'Btn'] = false
}
})
this.orderInfo = res.data
this.orderStatus = res.data.order.status
})
},
successTips() {
this.$message({
type: 'success',
message: '操作成功'
})
},
errorTips() {
this.$message({
type: 'error',
message: '操作失败'
})
},
msgBoxTips(title, apiName, apiParams) {
const h = this.$createElement;
this.$msgbox({
title: '',
message: h('p', null, [
h('p', null, title),
h('i', { style: 'font-style:normal; color: #d93a49' }, '才能进行确认操作'),
h('span', null, ',你还要继续吗? ')
]),
showCancelButton: true,
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
instance.confirmButtonLoading = true;
instance.confirmButtonText = '处理中...';
accountsService[apiName](apiParams).then(res => {
if (res.returnCode == 0) {
done();
instance.confirmButtonLoading = false;
this.successTips()
this.getOrderInfo()
} else {
instance.confirmButtonLoading = false;
instance.confirmButtonText = '继续';
this.errorTips()
}
})
} else {
done();
instance.confirmButtonLoading = false;
}
}
}).then(action => {
}).catch(() => { })
},
// 正常 - 2 - 对账信息 - 确认按钮
handleReconcile() {
this.msgBoxTips('核对流水号及金额与实际收款无误后', 'confirmHT', { orderId: this.orderId })
},
// 正常 - 3 - SP分润明细 - 确认按钮
handleSpProfit() {
(this.$refs.form && this.$refs.form.resetFields())
// let date = new Date()
// this.form.paidTime = date.toLocaleDateString().replace(/\//g, '-') + ' ' + date.getHours() + ':' + date.getMinutes()
this.spConfirmVisible = true
},
handleCancelDialog() {
this.spConfirmVisible = false
},
handleConfirmDialog() {
this.$refs.form.validate(valid => {
if (valid) {
// console.log(this.form)
this.dialogLoading = true
this.form.paidTime = this.form.paidTime + ':00'
let params = {
orderId: this.orderId,
...this.form
}
accountsService.confirmSP(JSON.stringify(params)).then(res => {
if (res.returnCode == 0) {
this.dialogLoading = false
this.spConfirmVisible = false
this.successTips()
this.getOrderInfo()
} else {
this.dialogLoading = false
this.errorTips()
}
}).catch(() => {
this.dialogLoading = false
this.errorTips()
})
}
})
},
// 取消 - 2 - 对账信息 - 确认按钮
handleCancelReconcile() {
this.msgBoxTips('请确认已向汇通退款指定金额后', 'refundConfirmHT', { orderId: this.orderId })
},
// 取消 - 3 - SP分润明细 - 确认按钮
handleCancelSpProfit() {
this.msgBoxTips('核对SP已退回指定金额后', 'refundConfirmSP', { orderId: this.orderId })
}
}
}
</script>
<style>
.accountsDetail {
font-size: 14px;
min-width: 825px;
}
.ibox .ibox-title h3 {
font-size: 16px;
}
.ibox .ibox-title {
padding-bottom: 0;
}
.ibox .ibox-main {
border-bottom: 1px solid #e7eaec;
}
.ibox .ibox-main:last-child {
border-bottom: 0;
padding-bottom: 10px;
}
.ibox .ibox-content {
position: relative;
border-top: 0;
padding: 5px 40px 20px;
}
.accountsDetail .form-col {
margin-bottom: 6px;
}
.accountsDetail .col-title {
display: inline-block;
width: 85px;
overflow: hidden;
padding-right: 10px;
}
.accountsDetail .col-txt {
display: inline-block;
width: 60%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
.accountsDetail .btn {
position: absolute;
right: 20px;
bottom: 20px;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
margin: 0;
}
</style>