|
|
|
@ -47,7 +47,7 @@ |
|
|
|
|
<el-option v-for="(item, i) in Util.creditTerms" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="贷款期限" prop="loanTerm"> |
|
|
|
|
<el-form-item label="贷款期限" prop="loanTerm" @change="interestCalc"> |
|
|
|
|
<el-select v-model="form.loanTerm" placeholder="请选择" @change="maturityDateCalc"> |
|
|
|
|
<el-option v-for="(item, i) in Util.loanTerms" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
@ -69,7 +69,7 @@ |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="贷款金额"> |
|
|
|
|
<el-input v-model="form.loanAmount" /> |
|
|
|
|
<el-input v-model="form.loanAmount" @input="loanAmountInput" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-form> |
|
|
|
@ -117,7 +117,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import { addOperation, loanApplicationInput, loanApplicationDetails } from '@/api/http' |
|
|
|
|
import { addOperation, loanApplicationInput, loanApplicationDetails, loanApplicationInterestCalculation } from '@/api/http' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
|
import { mapMutations, mapState } from 'vuex' |
|
|
|
|
export default { |
|
|
|
@ -125,6 +125,7 @@ export default { |
|
|
|
|
return { |
|
|
|
|
Util, |
|
|
|
|
step1: {}, |
|
|
|
|
timer: null, |
|
|
|
|
form: { |
|
|
|
|
valueDate: '', |
|
|
|
|
creditTermTwo: 231, |
|
|
|
@ -205,6 +206,25 @@ export default { |
|
|
|
|
date.setMonth(date.getMonth() + loanTerm) |
|
|
|
|
this.form.expirationDate = Util.formatDate('yyyy-MM-dd', date) |
|
|
|
|
} |
|
|
|
|
this.interestCalc() |
|
|
|
|
}, |
|
|
|
|
// 贷款金额input事件回调 |
|
|
|
|
loanAmountInput () { |
|
|
|
|
clearTimeout(this.timer); |
|
|
|
|
this.timer = setTimeout(() => { |
|
|
|
|
this.interestCalc() |
|
|
|
|
}, 500) |
|
|
|
|
}, |
|
|
|
|
// 计算利息总额 |
|
|
|
|
async interestCalc () { |
|
|
|
|
const { form } = this |
|
|
|
|
if (form.loanAmount && form.valueDate) { |
|
|
|
|
const { data } = await loanApplicationInterestCalculation({ |
|
|
|
|
...this.creditIds, |
|
|
|
|
...form, |
|
|
|
|
}) |
|
|
|
|
form.totalInterestAmount = data.totalInterestAmount || '' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async beforeSubmit () { |
|
|
|
|
try { |
|
|
|
@ -227,7 +247,7 @@ export default { |
|
|
|
|
const preId = '285,' + this.$store.state.system.businessSelect[this.$store.state.system.businessKey].id + ',766,768' |
|
|
|
|
const rule = [ |
|
|
|
|
{ answerId: 824, emptyOne: 137, emptyTwo: 240, operationIds: preId + ',824', type: 1 }, |
|
|
|
|
{ answerId: 825, emptyOne: 138, emptyTwo: 241, operationIds: preId + ',825', type: 1 }, |
|
|
|
|
{ answerId: 825, emptyOne: 134, emptyTwo: form.creditTermTwo, operationIds: preId + ',825', type: 1 }, |
|
|
|
|
{ answerId: 826, emptyOne: 125, emptyTwo: form.valueDate, operationIds: preId + ',826', type: 3 }, |
|
|
|
|
{ answerId: 846, emptyOne: 141, emptyTwo: Util.loanTerms.find(e => e.id === form.loanTerm).pointId, operationIds: preId + ',846', type: 1 }, |
|
|
|
|
{ answerId: 827, emptyOne: 125, emptyTwo: form.expirationDate, operationIds: preId + ',827', type: 3 }, |
|
|
|
|