shenpiModal.vue
17 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
<template>
<a-modal title="授信审批" :width="1000" :centered="false" :visible="visible" :confirmLoading="confirmLoading"
@ok="handleOk" @cancel="handleCancel" cancelText :maskClosable="false" style="top:20px;" class="scope-loan">
<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" :disabled="disabled"
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 style="width:100%;" :disabled="true"
v-decorator="['transAmount', { initialValue: validatorRules ? validatorRules.transAmount : '' }]"
placeholder="请输入审批额度" :min="1" :precision='0' />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="风控建议授信额度(元)" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number style="width:100%;" :disabled="true"
v-decorator="['riskAmount', { initialValue: validatorRules ? validatorRules.riskAmount : '' }]"
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 style="width:100%;" :disabled="disabled"
v-decorator="['approvalAmount', { initialValue: validatorRules ? validatorRules.approvalAmount : '', 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-input-number style="width:100%;" :disabled="disabled"
v-decorator="['interestRate', { initialValue: validatorRules ? validatorRules.interestRate : '', 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 style="width:100%;" :disabled="disabled"
v-decorator="['penaltyRate', { initialValue: validatorRules ? validatorRules.penaltyRate : '', 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 style="width:100%;" :disabled="disabled"
v-decorator="['term', { initialValue: validatorRules ? validatorRules.term : '', 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-select :disabled="disabled" @change="dateType"
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-col :span="12" v-if="dateTypeNum == 2">
<a-form-item label="还款方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择" :disabled="disabled"
v-decorator="['repaymentType', { initialValue: validatorRules ? validatorRules.repaymentType : '', rules: [{ required: true, message: '请输入还款方式' }] }]">
<a-select-option v-for="item in repaymentTypeDict" :key="item.name"
:disabled="disabled" :value="item.name">
{{ item.title }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12" v-if="dateTypeNum == 1">
<a-form-item label="还款方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择" :disabled="disabled"
v-decorator="['repaymentType', { initialValue: validatorRules ? validatorRules.repaymentType : '', rules: [{ required: true, message: '请输入还款方式' }] }]">
<a-select-option v-for="item in repaymentTypeDict2" :key="item.name"
:disabled="disabled" :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="请选择" :disabled="disabled"
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 :disabled="disabled"
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 :disabled="disabled"
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">
<span>
<a-button key="back" @click='visible = false'>
取消
</a-button>
<a-button key="save" @click="saveOrUpdateApprovalTransTemp" :disabled="show">
暂存审批
</a-button>
<a-button key="submit" type="primary" :loading="confirmLoading" @click="handleOk" :disabled="show">
确定
</a-button>
</span>
</template>
</a-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { submitApprovalTrans, saveOrUpdateApprovalTransTemp, queryApprovalTransById } from '@/api/insys'
export default {
name: 'CommonBillListModal',
mixins: [JeecgListMixin],
data() {
return {
visible: false,
confirmLoading: false,
title: '',
disableSubmit: false,
disabled: false,
model: {},
examineNum: 1,
table: '',
repaymentDayFlag: '',
validatorRules: {},
applyNo: '',
transNo: '',
currentItem: '',
show: false,
labelCol: {
span: 8
},
wrapperCol: {
span: 16
},
form: this.$form.createForm(this),
currentItem: {}, // 当前审批任务信息
confirmLoading: false, // 审批提交loading
repaymentTypeDict: [
{ title: '等额本息', name: 1 },
{ title: '先息后本', name: 2 },
{ title: '等额本金', name: 5 },
// { title: '到期还本付息(算头算尾)', name: 3 },
// { title: '到期还本付息(算头不算尾)', name: 4 },
],
repaymentTypeDict2: [
// { title: '等额本息', name: 1 },
// { title: '先息后本', name: 2 },
// { title: '等额本金', name: 5 },
{ title: '到期还本付息(算头算尾)', name: 3 },
{ title: '到期还本付息(算头不算尾)', name: 4 },
],
repaymentDayTypeDict: [ // 还款日枚举
{ label: '放款日对日(29/30/31统一设为28号)', value: 1 },
{ label: '放款日对日(若无对日统一设为月末)', value: 2 },
{ label: '固定日', value: 3 },
{ label: '放款日对前一日', value: 4 },
],
dateTypeNum:''
}
},
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 = "授信审批信息"
}
},
edit(res, lis, num) {
console.log(res)
this.dateTypeNum = lis.termType
if (num == 1) {
this.applyNo = res.applyNo
this.transNo = res.transNo
this.currentItem = res
this.validatorRules = lis
this.repaymentDayFlag = lis.repaymentDayType
} else if (num == 2) {
this.applyNo = res.applyNo
this.transNo = res.transNo
this.currentItem = res;
this.validatorRules = lis
this.repaymentDayFlag = lis.repaymentDayType
}
this.show = false
this.form.resetFields()
this.visible = true
this.$nextTick(() => { })
},
look(lis) {
console.log(lis)
this.show = true
this.form.resetFields()
this.visible = true
this.disabled = true
queryApprovalTransById({ id: lis.id }).then(res => {
if (res.status.statusCode == 0) {
this.validatorRules = res.result
this.dateTypeNum = res.result.termType
this.repaymentDayFlag = res.result.repaymentDayType
} else {
this.$message.warning(res.status.statusReason)
}
})
this.$nextTick(() => { })
},
close() {
this.$emit('close')
this.visible = false
this.disableSubmit = false
this.selectedRole = []
},
handleCancel() {
this.close()
},
handleSubmit() {
},
dateType(val){
this.dateTypeNum = val
},
// 暂存审批信息
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.$emit('getModle')
} else {
this.$message.warning(res.status.statusReason)
}
})
.finally(() => {
this.confirmLoading = false
})
}
})
},
// tabs 回调
callback(key) {
if (key == 2) {
this.$refs.msg.loadData()
} else if (key == 3) {
this.$refs.backMsg.loadData()
}
},
}
}
</script>
<style>
.scope-loan .ant-form-item {
margin-bottom: 12px;
}
.scope-loan .ant-card-body {
padding: 20px 24px 0;
}
.scope-loan .c189 {
color: #1890ff;
}
.scope-loan .fw {
font-weight: bold;
}
.repaymentDay{
line-height: 40px;
margin-left: -20px;
}
</style>