Browse Source

公司定制金融方案

master
yunuo970428 2 years ago
parent
commit
bd7e9d69d0
  1. 191
      anrui-riskcenter-ui/src/components/publicPage/financialscheme.vue
  2. 21
      anrui-riskcenter-ui/src/views/customizedfinancialsolutions/customizedfinancialsolutionsAdd.vue

191
anrui-riskcenter-ui/src/components/publicPage/financialscheme.vue

@ -26,10 +26,10 @@
<el-form-item prop="mainVehicleAmount">
<div class="addinputInfo">
<span><span class="icon">*</span>主车发票价<el-input v-model="finance.mainVehicleAmount" @input="financingProject" clearable style="width: 100px" placeholder="" @keyup.native="finance.mainVehicleAmount = oninput(finance.mainVehicleAmount, 0)"/></span>
<span style="padding-left: 5px"><el-checkbox v-model="finance.accessoriesAmountCb" style="padding-right: 5px"/>融资票据<el-input :disabled="!finance.accessoriesAmountCb" v-model="finance.accessoriesAmount" @input="financingProject" clearable style="width: 100px" placeholder="" @keyup.native="finance.accessoriesAmount = oninput(finance.accessoriesAmount, 0)"/></span>
<span style="padding-left: 5px"><el-checkbox v-model="finance.trailerAmountCb" style="padding-right: 5px"/>挂车<el-input :disabled="!finance.trailerAmountCb" v-model="finance.trailerAmount" @input="financingProject" clearable style="width: 100px" placeholder="" @keyup.native="finance.trailerAmount = oninput(finance.trailerAmount, 0)"/></span>
<span style="padding-left: 5px"><el-checkbox v-model="finance.premiumCb" style="padding-right: 5px"/>保险<el-input :disabled="!finance.premiumCb" v-model="finance.premium" @input="financingProject" clearable style="width: 100px" placeholder="" @keyup.native="finance.premium = oninput(finance.premium, 0)"/></span>
<span style="padding-left: 5px"><el-checkbox v-model="finance.purchaseTaxCb" style="padding-right: 5px"/>购置税<el-input :disabled="!finance.purchaseTaxCb" v-model="finance.purchaseTax" @input="financingProject" clearable style="width: 100px" placeholder="" @keyup.native="finance.purchaseTax = oninput(finance.purchaseTax, 0)"/></span>
<span style="padding-left: 5px"><el-checkbox v-model="finance.accessoriesAmountCb" style="padding-right: 5px"/>配件<el-input v-model="finance.accessoriesAmount" @input="financingProject" clearable style="width: 100px" placeholder="" @keyup.native="finance.accessoriesAmount = oninput(finance.accessoriesAmount, 0)"/></span>
<span style="padding-left: 5px"><el-checkbox v-model="finance.trailerAmountCb" style="padding-right: 5px"/>挂车<el-input v-model="finance.trailerAmount" @input="financingProject" clearable style="width: 100px" placeholder="" @keyup.native="finance.trailerAmount = oninput(finance.trailerAmount, 0)"/></span>
<span style="padding-left: 5px"><el-checkbox v-model="finance.premiumCb" :disabled="finance.isPack == '0'" style="padding-right: 5px"/>保险<el-input v-model="finance.premium" @input="financingProject" clearable style="width: 100px" placeholder="" @keyup.native="finance.premium = oninput(finance.premium, 0)"/></span>
<span style="padding-left: 5px"><el-checkbox v-model="finance.purchaseTaxCb" :disabled="finance.isPack == '0'" style="padding-right: 5px"/>购置税<el-input v-model="finance.purchaseTax" @input="financingProject" clearable style="width: 100px" placeholder="" @keyup.native="finance.purchaseTax = oninput(finance.purchaseTax, 0)"/></span>
</div>
</el-form-item>
</el-col>
@ -80,7 +80,7 @@
<el-col :span="6">
<div class="span-sty"><span class="icon">*</span>厂家贴息</div>
<el-form-item prop="factoryDiscount">
<el-input class="addinputw" v-model="finance.factoryDiscount" placeholder="" clearable @keyup.native="finance.factoryDiscount = oninput(finance.factoryDiscount, 0)"/>
<el-input class="addinputw" v-model="finance.factoryDiscount" placeholder="" @input="factoryDiscountInput" clearable @keyup.native="finance.factoryDiscount = oninput(finance.factoryDiscount, 0)"/>
</el-form-item>
</el-col>
<el-col :span="6">
@ -100,7 +100,7 @@
</el-form-item>
</el-col>
<el-col :span="6">
<div class="span-sty"><span class="icon">*</span>月还金额</div>
<div class="span-sty">月还金额</div>
<el-form-item>
<span class="addinputInfo">{{ finance.loanPayMoney }}</span>
</el-form-item>
@ -139,8 +139,8 @@
</el-form-item>
</el-col>
<el-col :span="6">
<div class="span-sty"><span class="icon">*</span>期数</div>
<el-form-item prop="otherPolicyPeriod">
<div class="span-sty">期数</div>
<el-form-item>
<span class="addinputInfo">{{ finance.otherPolicyPeriod }}</span>
</el-form-item>
</el-col>
@ -153,7 +153,7 @@
</el-form-item>
</el-col>
<el-col :span="6">
<div class="span-sty"><span class="icon">*</span>月还金额</div>
<div class="span-sty">月还金额</div>
<el-form-item>
<span class="addinputInfo">{{ finance.otherPolicyMonthlyRepay }}</span>
</el-form-item>
@ -292,7 +292,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="finance.dealWayKey == '01'">
<el-row v-if="finance.dealWayKey == '01' && finance.isPack == '0' ">
<el-col :span="6">
<div class="span-sty">代收费用合计</div>
<el-form-item>
@ -320,7 +320,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="finance.dealWayKey == '02'">
<el-row v-if="finance.dealWayKey == '02' && finance.isPack == '1'">
<el-col :span="6">
<div class="span-sty">抵顶费用合计</div>
<el-form-item>
@ -352,7 +352,8 @@
<el-col :span="24">
<div class="span-sty">车辆总价</div>
<el-form-item>
<el-input class="addinputw" v-model="finance.vehTotalPrice" placeholder="" clearable @keyup.native="finance.vehTotalPrice = oninput(finance.vehTotalPrice, 0)"/>
<span class="addinputInfo">{{ vehTotalPrice() }}</span>
<!-- <el-input class="addinputw" v-model="finance.vehTotalPrice" placeholder="" clearable @keyup.native="finance.vehTotalPrice = oninput(finance.vehTotalPrice, 0)"/>-->
</el-form-item>
</el-col>
</el-row>
@ -446,7 +447,6 @@ export default {
},
//
isPackChange() {
console.log(this.financeshi, 888888)
selectList({ orgPath: window.sessionStorage.getItem('defaultOrgPath'), userSid: window.sessionStorage.getItem('defaultOrgPath'), isPack: this.finance.isPack }).then((resp) => {
if (resp.success) {
this.policy_list = resp.data
@ -466,6 +466,9 @@ export default {
this.finance.loanPeriod = choose[0].period
// --
this.finance.bondRatio = choose[0].bondRatio + '%'
//
this.finance.factoryDiscountUse = '抵利息'
this.finance.factoryDiscountUseKey = '02'
selectListByOther({ orgPath: window.sessionStorage.getItem('defaultOrgPath'), userSid: window.sessionStorage.getItem('defaultOrgPath'), sid: choose[0].sid }).then((res) => {
if (res.success) {
this.other_list = res.data
@ -478,18 +481,30 @@ export default {
// --
financingProject() {
if (this.finance.mainVehicleAmount !== '') {
this.finance.loanTotal = parseInt(this.arguments(this.finance.mainVehicleAmount)) + parseInt(this.arguments(this.finance.accessoriesAmount)) + parseInt(this.arguments(this.finance.trailerAmount)) + parseInt(this.arguments(this.finance.premium)) + parseInt(this.arguments(this.finance.purchaseTax))
this.finance.loanTotal = parseInt(this.arguments(this.finance.mainVehicleAmount))
if (this.finance.mainVehicleAmount !== '' && this.finance.accessoriesAmountCb) {
this.finance.loanTotal = parseInt(this.arguments(this.finance.mainVehicleAmount)) + parseInt(this.arguments(this.finance.accessoriesAmount))
}
if (this.finance.mainVehicleAmount !== '' && this.finance.accessoriesAmountCb && this.finance.trailerAmountCb) {
this.finance.loanTotal = parseInt(this.arguments(this.finance.mainVehicleAmount)) + parseInt(this.arguments(this.finance.accessoriesAmount)) + parseInt(this.arguments(this.finance.trailerAmount))
}
if (this.finance.mainVehicleAmount !== '' && this.finance.accessoriesAmountCb && this.finance.trailerAmountCb && this.finance.premiumCb) {
this.finance.loanTotal = parseInt(this.arguments(this.finance.mainVehicleAmount)) + parseInt(this.arguments(this.finance.accessoriesAmount)) + parseInt(this.arguments(this.finance.trailerAmount)) + parseInt(this.arguments(this.finance.premium))
}
if (this.finance.mainVehicleAmount !== '' && this.finance.accessoriesAmountCb && this.finance.trailerAmountCb && this.finance.premiumCb && this.finance.purchaseTaxCb) {
this.finance.loanTotal = parseInt(this.arguments(this.finance.mainVehicleAmount)) + parseInt(this.arguments(this.finance.accessoriesAmount)) + parseInt(this.arguments(this.finance.trailerAmount)) + parseInt(this.arguments(this.finance.premium)) + parseInt(this.arguments(this.finance.purchaseTax))
}
} else {
this.finance.loanTotal = ''
}
//
if (this.finance.loanTotal !== '') {
// --
this.finance.downPayAmount = parseInt(this.arguments(this.finance.loanTotal)) * parseFloat(this.arguments(this.finance.downPayRatio)) / 100
this.finance.downPayAmount = (parseInt(this.arguments(this.finance.loanTotal)) * parseFloat(this.arguments(this.finance.downPayRatio)) / 100).toFixed(0)
// --
this.finance.loanAmount = parseInt(this.arguments(this.finance.loanTotal)) - parseInt(this.arguments(this.finance.downPayAmount))
// --
this.finance.bondAmount = parseFloat(this.arguments(this.finance.bondRatio)) * parseInt(this.arguments(this.finance.loanAmount)) / 100
this.finance.bondAmount = (parseFloat(this.arguments(this.finance.bondRatio)) * parseInt(this.arguments(this.finance.loanAmount)) / 100).toFixed(0)
// --
this.monthlyPayment(this.finance.policyYearRatio, this.finance.loanPeriod, this.finance.loanAmount, 0, 0)
}
@ -502,7 +517,7 @@ export default {
//
this.finance.loanAmount = parseInt(this.arguments(this.finance.loanTotal)) - parseInt(this.arguments(this.finance.downPayAmount))
// --
this.finance.bondAmount = parseFloat(this.arguments(this.finance.bondRatio)) * parseInt(this.arguments(this.finance.loanAmount)) / 100
this.finance.bondAmount = (parseFloat(this.arguments(this.finance.bondRatio)) * parseInt(this.arguments(this.finance.loanAmount)) / 100).toFixed(0)
// --
this.monthlyPayment(this.finance.policyYearRatio, this.finance.loanPeriod, this.finance.loanAmount, 0, 0)
}
@ -516,7 +531,7 @@ export default {
// --
monthlyPayment(rate, nperiod, pv, fv, type) {
var pmt = ''
rate = parseFloat(parseInt(rate) / 100) / 12
rate = parseFloat(parseFloat(rate) / 100) / 12
if (pv !== '') {
if (!fv) fv = 0
if (!type) type = 0
@ -527,10 +542,56 @@ export default {
pmt /= (1 + rate)
}
}
this.finance.loanPayMoney = pmt
this.finance.loanPayMoney = parseFloat(pmt).toFixed(0)
// --
this.finance.loanInterest = parseInt(this.finance.loanPayMoney) * parseInt(nperiod) - parseInt(pv)
},
// -- (0)
factoryDiscountInput() {
if (this.finance.factoryDiscount !== '' && this.finance.factoryDiscount != '0' && this.finance.factoryDiscountUseKey === '02') {
//
this.finance.loanInterest = parseInt(this.finance.loanInterest) - parseInt(this.finance.factoryDiscount)
//
this.finance.loanPayMoney = (parseInt(this.finance.loanPayMoney) - parseInt(this.finance.factoryDiscount)) / parseInt(this.finance.loanPeriod)
//
this.finance.policyYearRatio = (parseFloat(this.rate(this.finance.loanPeriod, this.finance.loanPayMoney, this.finance.loanAmount, 0, 0, 0.01)) * 12).toFixed(2) + '%'
}
},
// -- (0)
rate(paymentsPerYear, paymentAmount, presentValue, futureValue, dueEndOrBeginning, interest) {
if (interest == null) interest = 0.01
if (futureValue == null) futureValue = 0
if (dueEndOrBeginning == null) dueEndOrBeginning = 0
var FINANCIAL_MAX_ITERATIONS = 128
var FINANCIAL_PRECISION = 0.0000001
var y, y0, y1, x0, x1 = 0, f = 0, i = 0
var rate = interest
if (Math.abs(rate) < FINANCIAL_PRECISION) {
y = presentValue * (1 + paymentsPerYear * rate) + paymentAmount * (1 + rate * dueEndOrBeginning) * paymentsPerYear + futureValue
} else {
f = Math.exp(paymentsPerYear * Math.log(1 + rate))
y = presentValue * f + paymentAmount * (1 / rate + dueEndOrBeginning) * (f - 1) + futureValue
}
y0 = presentValue + paymentAmount * paymentsPerYear + futureValue
y1 = presentValue * f + paymentAmount * (1 / rate + dueEndOrBeginning) * (f - 1) + futureValue
i = x0 = 0.0
x1 = rate
while ((Math.abs(y0 - y1) > FINANCIAL_PRECISION) && (i < FINANCIAL_MAX_ITERATIONS)) {
rate = (y1 * x0 - y0 * x1) / (y1 - y0)
x0 = x1
x1 = rate
if (Math.abs(rate) < FINANCIAL_PRECISION) {
y = presentValue * (1 + paymentsPerYear * rate) + paymentAmount * (1 + rate * dueEndOrBeginning) * paymentsPerYear + futureValue
} else {
f = Math.exp(paymentsPerYear * Math.log(1 + rate))
y = presentValue * f + paymentAmount * (1 / rate + dueEndOrBeginning) * (f - 1) + futureValue
}
y0 = y1
y1 = y
++i
}
return rate
},
// --
changeFactoryDiscountUse(value) {
const choose = this.factoryDiscountUse_list.filter((item) => item.dictValue === value)
@ -539,6 +600,9 @@ export default {
} else {
this.finance.factoryDiscountUseKey = ''
}
if (this.finance.factoryDiscountUseKey === '02') {
this.factoryDiscountInput()
}
},
// --
changeOtherPolicy(value) {
@ -558,7 +622,7 @@ export default {
// --
otherMonthlyPayment(rate, nperiod, pv, fv, type) {
var pmt = ''
rate = parseInt(parseInt(rate) / 100) / 12
rate = parseFloat(parseFloat(rate) / 100) / 12
if (pv !== '') {
if (!fv) fv = 0
if (!type) type = 0
@ -569,7 +633,7 @@ export default {
pmt /= (1 + rate)
}
}
this.finance.otherPolicyMonthlyRepay = pmt
this.finance.otherPolicyMonthlyRepay = parseFloat(pmt).toFixed(0)
// --
this.finance.otherPolicyInterest = parseInt(this.arguments(this.finance.otherPolicyMonthlyRepay)) * parseInt(nperiod) - parseInt(this.arguments(pv))
},
@ -723,6 +787,18 @@ export default {
}
return this.finance.realTotal
},
// --
vehTotalPrice() {
if (this.finance.serviceAmount !== '') {
this.finance.receivableTotal = parseInt(this.arguments(this.finance.downPayAmounts)) + parseInt(this.arguments(this.finance.serviceAmount)) + parseInt(this.arguments(this.finance.proxyAccidentPremium)) + parseInt(this.arguments(this.finance.registerAmount)) + parseInt(this.arguments(this.finance.operationAmount)) + parseInt(this.arguments(this.finance.vehOtherPrice)) + parseInt(this.arguments(this.finance.otherAmount)) + parseInt(parseInt(this.finance.loanPayMoney) * parseInt(this.finance.loanPeriod)) + parseInt(parseInt(this.finance.otherPolicyMonthlyRepay) * parseInt(this.finance.otherPolicyPeriod))
if (!this.finance.premiumCb) {
this.finance.receivableTotal = parseInt(this.arguments(this.finance.downPayAmounts)) + parseInt(this.arguments(this.finance.serviceAmount)) + parseInt(this.arguments(this.finance.proxyAccidentPremium)) + parseInt(this.arguments(this.finance.registerAmount)) + parseInt(this.arguments(this.finance.operationAmount)) + parseInt(this.arguments(this.finance.vehOtherPrice)) + parseInt(this.arguments(this.finance.otherAmount)) + parseInt(parseInt(this.finance.loanPayMoney) * parseInt(this.finance.loanPeriod)) + parseInt(parseInt(this.finance.otherPolicyMonthlyRepay) * parseInt(this.finance.otherPolicyPeriod)) + parseInt(this.finance.premium)
}
if (!this.finance.purchaseTaxCb) {
this.finance.receivableTotal = parseInt(this.arguments(this.finance.downPayAmounts)) + parseInt(this.arguments(this.finance.serviceAmount)) + parseInt(this.arguments(this.finance.proxyAccidentPremium)) + parseInt(this.arguments(this.finance.registerAmount)) + parseInt(this.arguments(this.finance.operationAmount)) + parseInt(this.arguments(this.finance.vehOtherPrice)) + parseInt(this.arguments(this.finance.otherAmount)) + parseInt(parseInt(this.finance.loanPayMoney) * parseInt(this.finance.loanPeriod)) + parseInt(parseInt(this.finance.otherPolicyMonthlyRepay) * parseInt(this.finance.otherPolicyPeriod)) + parseInt(this.finance.premium) + parseInt(this.finance.purchaseTax)
}
}
},
arguments(val) {
if (val === '' || val === undefined) {
val = 0
@ -731,77 +807,8 @@ export default {
return val
}
},
handleReturn() {
this.finance = {
saleOrderSid: '',
isPack: '',
policyName: '',
mainVehicleAmount: '',
accessoriesAmount: '',
trailerAmount: '',
purchaseTax: '',
premium: '',
loanTotal: '',
accessoriesAmountCb: false,
trailerAmountCb: false,
purchaseTaxCb: false,
premiumCb: false,
downPayRatio: '',
downPayAmount: '',
loanAmount: '',
loanPeriod: '',
bondRatio: '',
bondAmount: '',
factoryDiscount: '',
factoryDiscountUse: '',
policyYearRatio: '',
loanPayMoney: '',
loanInterest: '',
otherPolicyState: false,
otherPolicyName: '',
otherPolicyAmount: '',
otherPolicyPeriod: '',
otherPolicyMonthlyRepay: '',
otherPolicyInterest: '',
otherPolicyYearRatio: '',
loanDownPay: '',
downPayAmountsRatio: '',
loanAmountTotal: '',
period: '',
monthlyRepay: '',
interest: '',
returnTime: '',
downPayAmounts: '',
bondAmounts: '',
depositPremium: '',
depositSettle: '',
serviceAmount: '',
proxyAccidentPremium: '',
registerAmount: '',
operationAmount: '',
vehOtherPrice: '',
otherAmount: '',
otherAmountRemark: '',
dealWay: '',
dealWayKey: '',
proxyPremium: '',
proxyPurchasetax: '',
offsetPremium: '',
offsetPurchasetax: '',
offsetTotal: '',
receivableTotal: '',
realTotal: '',
vehTotalPrice: '',
nominalPrice: ''
}
this.$refs['form_obj'].resetFields()
this.$emit('doback')
backData() {
this.$emit('backData', this.finance)
}
}
}

21
anrui-riskcenter-ui/src/views/customizedfinancialsolutions/customizedfinancialsolutionsAdd.vue

@ -175,7 +175,7 @@
<div class="title">
<div>消贷金融方案<span style="margin-left: 10px">(说明融资项目中保险为预估费用必须小于保险发票票面金额预估金额精确到百位购置税=主车发票价/11.3舍到个位不足金额需要客户线下补交)</span></div>
</div>
<financialscheme ref="divJRFA" :params="this.formobj.loanTemplateSolutions"/>
<financialscheme ref="divJRFA" :params="this.formobj.loanTemplateSolutions" @backData="backData"/>
</el-form>
</div>
</div>
@ -399,6 +399,7 @@ export default {
bondAmount: '',
factoryDiscount: '',
factoryDiscountUse: '',
factoryDiscountUseKey: '',
policyYearRatio: '',
loanPayMoney: '',
loanInterest: '',
@ -536,10 +537,17 @@ export default {
vehTrailerRemark: ''
}
},
//
backData(value) {
this.formobj.loanTemplateSolutions = value
},
saveOrUpdate() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.$refs['divJRFA'].backData()
this.getUrl()
this.submitdisabled = true
console.log(this.formobj)
req.saveOrUpdate(this.formobj).then((res) => {
if (res.success) {
this.$message({ showClose: true, type: 'success', message: '保存成功' })
@ -557,6 +565,17 @@ export default {
resetState() {
this.viewState = 1
},
getUrl() {
if (this.image_list.length > 0) {
const aa = []
for (var i = 0; i < this.image_list.length; i++) {
aa.push(this.image_list[i].url)
}
this.formobj.loanTemplateTrailer.vehTrailerCertificateFile = aa
} else {
this.formobj.loanTemplateTrailer.vehTrailerCertificateFile = []
}
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {

Loading…
Cancel
Save