importedCredit.vue
26.5 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
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item label="授信申请单号">
<a-input placeholder="输入授信申请单号" v-model="queryParam.applyNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="客户类型">
<a-select v-model="queryParam.customerType" placeholder="请选择">
<a-select-option v-for="(item, index) in customerType" :key="index" :value="item.value">
{{ item.label }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<a-form-item label="审批类型">
<a-select v-model="queryParam.strategyType" placeholder="请选择">
<a-select-option v-for="(val, key) in applyWayStatus" :key="key" :value="key">
{{ val }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="审批类型编号">
<a-input placeholder="输入审批类型编号" v-model="queryParam.strategyNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="申请时间" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
<a-date-picker
style="width: 100%"
:disabledDate="disabledStartDate"
:format="dateFormat"
v-model="queryParam.createTimeFrom"
@change="onChangeApplyDateStart"
/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="至" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
<a-date-picker
style="width: 100%"
:disabledDate="disabledEndDate"
:format="dateFormat"
v-model="queryParam.createTimeTo"
@change="onChangeApplyDateEnd"
/>
</a-form-item>
</a-col>
</template>
<a-col :md="6" :sm="8">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button @click="searchResetTime" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:scroll="{ x: 1800 }"
@change="handleTableChange"
>
<!-- 字符串超长截取省略号显示-->
<span slot="esContent" slot-scope="text">
<j-ellipsis :value="text" :length="10" />
</span>
<span slot="action" slot-scope="text, record">
<a-button
type="link"
size="small"
v-has="'importedCredit:look'"
@click="handleDetailBai(record)"
icon="search"
style="font-size: 12px"
>查看</a-button
>
<span
v-show="
record.lockStatus === 'UNLOCK' || (record.lockStatus === 'LOCK' && record.lockUserId === currentUserID)
"
v-has="'importedCredit:look'"
>
<!-- <span> -->
<a-divider type="vertical" />
<a-button
type="link"
size="small"
@click="handleApply(record)"
icon="safety-certificate"
style="font-size: 12px"
>审批</a-button
>
<a-divider type="vertical" v-show="record.lockStatus === 'LOCK'" />
<a-button
type="link"
size="small"
v-show="record.lockStatus === 'LOCK'"
@click="handleRelease(record)"
icon="rocket"
style="font-size: 12px"
>释放</a-button
>
</span>
</span>
</a-table>
</div>
<!-- table区域-end -->
<personal-information-list-modal v-show="typeFlag == 1" ref="modalForm" :dai.sync="dai" />
<CompanyInformationListModal ref="modalForm2" v-show="typeFlag === 2" :dai.sync="dai" />
<shenpiModal ref="shenpi" @getModle="getModle"></shenpiModal>
<div>
<a-modal
:destroyOnClose="true"
title="授信审批"
:width="1000"
:centered="true"
:maskClosable="false"
v-model="visible"
@ok="handleOk"
>
<a-form :form="form">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="审批结果" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
@change="examine"
v-decorator="[
'approvalResult',
{
initialValue: validatorRules ? validatorRules.approvalResult : '',
rules: [{ required: true, message: '请选择审批结果' }],
},
]"
>
<a-radio :value="1">通过</a-radio>
<a-radio :value="2">拒绝</a-radio>
<a-radio :value="3">退件待补</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
<a-card class="card" :title="table" :bordered="false">
<div v-if="examineNum == 1">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="审批额度(元)" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number
v-decorator="[
'approvalAmount',
{
initialValue: validatorRules ? validatorRules.approvalAmount : '',
rules: [{ required: true, message: '请输入审批额度' }],
},
]"
placeholder="请输入审批额度"
:min="1"
:precision="0"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="审批年化利率(%)" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number
v-decorator="[
'interestRate',
{
initialValue: validatorRules ? validatorRules.interestRate : '',
rules: [{ required: true, message: '请输入审批年化利率' }],
},
]"
placeholder="请输入审批年化利率"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="审批年化逾期利率(%)" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number
v-decorator="[
'penaltyRate',
{
initialValue: validatorRules ? validatorRules.penaltyRate : '',
rules: [{ required: true, message: '请输入审批年化逾期利率' }],
},
]"
placeholder="请输入审批年化逾期利率"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="账单期限" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number
v-decorator="[
'term',
{
initialValue: validatorRules ? validatorRules.term : '',
rules: [{ required: true, message: '请输入账单期限' }],
},
]"
placeholder="请输入账单期限"
:min="1"
:precision="0"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="账单期限类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
v-decorator="[
'termType',
{
initialValue: validatorRules ? validatorRules.termType : '',
rules: [{ required: true, message: '请输入账单期限类型' }],
},
]"
>
<a-select-option :value="1">日</a-select-option>
<a-select-option :value="2">月</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="还款方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择"
v-decorator="[
'repaymentType',
{
initialValue: validatorRules ? validatorRules.repaymentType : '',
rules: [{ required: true, message: '请输入还款方式' }],
},
]"
>
<a-select-option v-for="item in repaymentTypeDict" :key="item.name" :value="item.name">
{{ item.title }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="还款日" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择"
v-decorator="[
'repaymentDayType',
{
initialValue: validatorRules ? validatorRules.repaymentDayType : '',
rules: [{ required: true, message: '请输入还款日' }],
},
]"
@change="handleSelectChange"
>
<a-select-option v-for="item in repaymentDayTypeDict" :key="item.label" :value="item.value">
{{ item.label }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col v-if="repaymentDayFlag == 3" :span="3">
<a-form-item label="" :labelCol="{ span: 0 }" :wrapperCol="{ span: 24 }">
<a-input-number
v-decorator="[
'repaymentDay',
{
initialValue: validatorRules ? validatorRules.repaymentDay : '',
rules: [{ required: true, message: '请输入还款日' }],
},
]"
:min="1"
:precision="0"
:max="31"
/>
</a-form-item>
</a-col>
<a-col v-if="repaymentDayFlag == 3" :span="2">
<div class="repaymentDay">日</div>
</a-col>
</a-row>
</div>
<a-row :gutter="24">
<a-col :span="24">
<a-form-item label="审批意见" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }" hasFeedback>
<a-textarea
v-decorator="[
'approvalNote',
{
initialValue: validatorRules ? validatorRules.approvalNote : '',
rules: [{ required: true, message: '请输入审批意见' }],
},
]"
placeholder="审批结果为退件待补时,需要在审批意见中说明要补成的资料或信息"
/>
</a-form-item>
</a-col>
</a-row>
</a-card>
</a-form>
<template slot="footer">
<a-button key="back" @click="visible = false"> 取消 </a-button>
<a-button key="save" @click="saveOrUpdateApprovalTransTemp"> 暂存审批 </a-button>
<a-button key="submit" type="primary" :loading="confirmLoading" @click="handleOk"> 确定 </a-button>
</template>
</a-modal>
</div>
</a-card>
</template>
<script>
import PersonalInformationListModal from '../unified-into-manage/modules/PersonalInformationListModal'
import CompanyInformationListModal from '../unified-into-manage/modules/CompanyInformationListModal'
import shenpiModal from './modules/shenpiModal'
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import {
Personaldetail4Approval,
Enterprisedetail4Approval,
legalPersondetail4Approval,
queryWaitApprovalTrans,
submitApprovalTrans,
saveOrUpdateApprovalTransTemp,
queryApprovalTrans,
getInputStreamByApplyNo,
getInputStreamByTransNo,
unlockApprovalTransTemp,
lockApprovalTrans,
} from '@/api/insys'
import { queryCollPersonalApplyDetail, collEnterpriseApplyDetail } from '@/api/configApi'
import { customerType } from '@/data/params'
import { USER_INFO } from '@/store/mutation-types'
import Vue from 'vue'
const applyWayStatus = {
1: '授信',
2: '用信',
}
export default {
name: 'inportedCreadit',
mixins: [JeecgListMixin],
components: {
PersonalInformationListModal,
CompanyInformationListModal,
shenpiModal,
},
data() {
return {
importExcelUrl: `${window._CONFIG['domianURL']}/test/jeecgDemo/importExcel`,
description: '这是用户管理页面',
queryParam: {
strategyType: '1',
},
applyNo: '',
transNo: '',
dai: 1,
labelCol: {
span: 8,
},
wrapperCol: {
span: 16,
},
examineNum: 1,
form: this.$form.createForm(this),
validatorRules: {},
customerType: customerType,
applyWayStatus,
visible: false,
typeFlag: false,
dateFormat: 'YYYY-MM-DD 00:00:00',
verification: true,
table: '授信审批信息',
value: [],
columns: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 55,
customRender: function (t, r, index) {
return parseInt(index) + 1
},
},
{
title: '授信申请单号',
align: 'center',
dataIndex: 'applyNo',
width: 300,
},
{
title: '业务交易号',
align: 'center',
dataIndex: 'transNo',
width: 300,
},
{
title: '客户类型',
align: 'center',
dataIndex: 'customerType',
width: 120,
customRender: function (t, r, index) {
for (var i = 0; i < customerType.length; i++) {
if (t === customerType[i].value) {
return customerType[i].label
}
}
},
},
{
title: '审批类型',
align: 'center',
width: 120,
dataIndex: 'strategyType',
customRender: (t, r, index) => applyWayStatus[t],
},
{
title: '审批类型编号',
align: 'center',
dataIndex: 'strategyNo',
width: 260,
},
{
title: '审批类型名称',
align: 'center',
dataIndex: 'strategyName',
width: 200,
},
{
title: '产品编号',
align: 'center',
dataIndex: 'productNo',
width: 180,
},
{
title: '产品名称',
align: 'center',
dataIndex: 'productName',
width: 180,
},
{
title: '申请时间',
align: 'center',
dataIndex: 'createTime',
width: 180,
},
{
title: '更新时间',
align: 'center',
dataIndex: 'updateTime',
width: 180,
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 180,
fixed: 'right',
},
],
url: {
list: '/approval/admin/queryWaitApprovalTrans',
},
applyDateStart: undefined,
applyDateEnd: undefined,
repaymentDayFlag: false,
currentUserID: Vue.ls.get(USER_INFO) ? Vue.ls.get(USER_INFO).id : null, // 当前用户id
currentItem: {}, // 当前审批任务信息
confirmLoading: false, // 审批提交loading
//repaymentTypeDict: JSON.parse(sessionStorage.getItem('REPAYMENT_TYPE')), // 还款方式枚举
repaymentTypeDict: [
{ title: '等额本息', name: 1 },
{ title: '先息后本', name: 2 },
{ title: '到期还本付息(算头算尾)', name: 3 },
{ title: '到期还本付息(算头不算尾)', name: 4 },
{ title: '等额本金', name: 5 },
],
repaymentDayTypeDict: [
// 还款日枚举
{ label: '放款日对日(29/30/31统一设为28号)', value: 1 },
{ label: '放款日对日(若无对日统一设为月末)', value: 2 },
{ label: '固定日', value: 3 },
],
}
},
computed: {},
methods: {
handleSelectChange(value) {
this.repaymentDayFlag = value
},
examine(value) {
this.examineNum = value.target.value
if (value.target.value == 2 || value.target.value == 3) {
this.table = ''
} else {
this.table = '授信审批信息'
}
},
// 获取信息
getModle() {
this.loadData()
},
getAvatarView: function (avatar) {
return this.url.imgerver + '/' + avatar
},
// 列表查看进件信息
handleDetailBai: function (record) {
this.typeFlag = record.customerType
let _p = { applyNo: record.applyNo }
localStorage.setItem('dh', record.applyNo)
if (record.customerType == 1) {
this.dai = 2
this.$refs.modalForm.titles = '查看个人进件信息'
this.$refs.modalForm.disableSubmit = true
this.$refs.modalForm.onlyread = true
queryCollPersonalApplyDetail(_p).then((res) => {
if (res.status.statusCode == 0) {
this.$refs.modalForm.edit(
res.result,
record.applyNo,
record.organizationId,
record.productNo,
record.businessChannelNo
)
this.$refs.modalForm.up1()
this.$refs.modalForm.up2()
this.$refs.modalForm.up3()
this.$refs.modalForm.up4()
this.$refs.modalForm.up5()
} else {
this.$message.warning(res.status.statusReason)
}
})
} else if (record.customerType === 2) {
this.dai = 2
this.$refs.modalForm2.titles = '查看企业进件信息'
this.$refs.modalForm2.disableSubmit = true
this.$refs.modalForm2.onlyread = true
collEnterpriseApplyDetail(_p).then((res) => {
if (res.status.statusCode == 0) {
this.$refs.modalForm2.edit(
res.result,
record.applyNo,
record.organizationId,
record.productNo,
record.businessChannelNo
)
this.$refs.modalForm2.up1()
this.$refs.modalForm2.up2()
this.$refs.modalForm2.up3()
this.$refs.modalForm2.up4()
this.$refs.modalForm2.up5()
} else {
this.$message.warning(res.status.statusReason)
}
})
}
},
// 列表审批操作
handleApply(record) {
if (record.lockStatus === 'UNLOCK') {
// 第一次执行审批,提示
this.$confirm({
title: '审批确认',
content: '你确定要审批该笔申请?确认后其他人无权审批该笔申请。',
onOk: () => {
return new Promise((resolve, reject) => {
this.applyNo = record.applyNo
this.transNo = record.transNo
this.currentItem = record
queryApprovalTrans({ transNo: record.transNo }).then((res) => {
if (res.status.statusCode == 0) {
this.$refs.shenpi.edit(record, res.result, 1)
this.validatorRules = res.result
this.repaymentDayFlag = res.result.repaymentDayType
// this.form.setFieldsValue(res.result)
} else {
this.$message.warning(res.status.statusReason)
}
})
saveOrUpdateApprovalTransTemp({ applyNo: record.applyNo, transNo: record.transNo }).then((res) => {
if (res.status.statusCode == 0) {
// this.$message.success('审批信息暂存成功')
} else {
this.$message.warning(res.status.statusReason)
}
})
lockApprovalTrans({
applyNo: record.applyNo,
transNo: record.transNo,
})
.then((res) => {
if (res.status.statusCode == 0) {
// this.visible = true;
// console.log(record)
// this.applyNo = record.applyNo
// this.transNo = record.transNo
// this.currentItem = record
// this.repaymentDayFlag = record.repaymentDayType
// this.validatorRules.approvalAmount = record.transAmount;
this.loadData() // 更新列表状态
resolve()
} else {
this.$message.warning(res.status.statusReason)
reject()
}
})
.catch(reject)
})
},
onCancel() {},
})
} else {
// this.visible = true;
this.applyNo = record.applyNo
this.transNo = record.transNo
this.currentItem = record
queryApprovalTrans({ transNo: record.transNo }).then((res) => {
if (res.status.statusCode == 0) {
this.$refs.shenpi.edit(record, res.result, 2)
this.validatorRules = res.result
this.repaymentDayFlag = res.result.repaymentDayType
} else {
this.$message.warning(res.status.statusReason)
}
})
saveOrUpdateApprovalTransTemp({ applyNo: record.applyNo, transNo: record.transNo }).then((res) => {
if (res.status.statusCode == 0) {
// this.$message.success('审批信息暂存成功')
} else {
this.$message.warning(res.status.statusReason)
}
})
}
},
// 释放审批操作
handleRelease(record) {
this.$confirm({
title: '审批释放确认',
content: '你确定要释放当前记录不再审批,释放完成后其他人员可审批该笔申请。',
onOk: () => {
return new Promise((resolve, reject) => {
unlockApprovalTransTemp({
applyNo: record.applyNo,
transNo: record.transNo,
})
.then((res) => {
if (res.status.statusCode == 0) {
this.loadData() // 更新列表状态
resolve()
} else {
this.$message.warning(res.status.statusReason)
reject()
}
})
.catch(reject)
})
},
onCancel() {},
})
},
// 暂存审批信息
saveOrUpdateApprovalTransTemp() {
this.form.validateFields((err, values) => {
if (!err) {
let param = {
...values,
applyNo: this.applyNo,
transNo: this.transNo,
}
if (param.repaymentDay) {
param.repaymentDay = Number(param.repaymentDay)
}
saveOrUpdateApprovalTransTemp(param).then((res) => {
if (res.status.statusCode == 0) {
this.$message.success('审批信息暂存成功')
} else {
this.$message.warning(res.status.statusReason)
}
})
}
})
},
// 审批提交
handleOk(e) {
this.form.validateFields((err, values) => {
console.log(err)
if (!err) {
this.confirmLoading = true
let param = {
...values,
id: this.currentItem.id,
}
if (param.repaymentDay) {
param.repaymentDay = Number(param.repaymentDay)
}
submitApprovalTrans(param)
.then((res) => {
if (res.status.statusCode == 0) {
this.$message.success(res.status.statusReason)
this.visible = false
this.loadData() // 更新列表状态
} else {
this.$message.warning(res.status.statusReason)
}
})
.finally(() => {
this.confirmLoading = false
})
}
})
},
},
}
</script>
<style scoped>
@import '~@assets/less/common.less';
form .ant-input-number {
width: 100%;
}
.repaymentDay {
line-height: 40px;
}
</style>