|
|
@ -47,7 +47,7 @@ |
|
|
|
<el-option v-for="(item, i) in Util.creditTerms" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
<el-option v-for="(item, i) in Util.creditTerms" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</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-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-option v-for="(item, i) in Util.loanTerms" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
@ -69,7 +69,7 @@ |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="贷款金额"> |
|
|
|
<el-form-item label="贷款金额"> |
|
|
|
<el-input v-model="form.loanAmount" /> |
|
|
|
<el-input v-model="form.loanAmount" @input="loanAmountInput" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
@ -117,7 +117,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { addOperation, loanApplicationInput, loanApplicationDetails } from '@/api/http' |
|
|
|
import { addOperation, loanApplicationInput, loanApplicationDetails, loanApplicationInterestCalculation } from '@/api/http' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import { mapMutations, mapState } from 'vuex' |
|
|
|
import { mapMutations, mapState } from 'vuex' |
|
|
|
export default { |
|
|
|
export default { |
|
|
@ -125,6 +125,7 @@ export default { |
|
|
|
return { |
|
|
|
return { |
|
|
|
Util, |
|
|
|
Util, |
|
|
|
step1: {}, |
|
|
|
step1: {}, |
|
|
|
|
|
|
|
timer: null, |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
valueDate: '', |
|
|
|
valueDate: '', |
|
|
|
creditTermTwo: 231, |
|
|
|
creditTermTwo: 231, |
|
|
@ -205,6 +206,25 @@ export default { |
|
|
|
date.setMonth(date.getMonth() + loanTerm) |
|
|
|
date.setMonth(date.getMonth() + loanTerm) |
|
|
|
this.form.expirationDate = Util.formatDate('yyyy-MM-dd', date) |
|
|
|
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 () { |
|
|
|
async beforeSubmit () { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -227,7 +247,7 @@ export default { |
|
|
|
const preId = '285,' + this.$store.state.system.businessSelect[this.$store.state.system.businessKey].id + ',766,768' |
|
|
|
const preId = '285,' + this.$store.state.system.businessSelect[this.$store.state.system.businessKey].id + ',766,768' |
|
|
|
const rule = [ |
|
|
|
const rule = [ |
|
|
|
{ answerId: 824, emptyOne: 137, emptyTwo: 240, operationIds: preId + ',824', type: 1 }, |
|
|
|
{ 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: 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: 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 }, |
|
|
|
{ answerId: 827, emptyOne: 125, emptyTwo: form.expirationDate, operationIds: preId + ',827', type: 3 }, |
|
|
|