Commit 92979b63 authored by 786817560's avatar 786817560

'解决冲突'

parents 5bf94a75 2a0f5606
......@@ -2,7 +2,7 @@
* @Descrip""/>User Settings Edit
* @Author: your name
* @Date: 2019-09-29 20:31:00
* @LastEditTime: 2019-11-05 15:35:42
* @LastEditTime: 2019-11-06 14:58:45
* @LastEditors: Please set LastEditors
-->
<template>
......@@ -54,7 +54,7 @@
<item>
<div slot="name" class="font-color">手续费</div>
<span v-if="!equip_price" slot="content" class="autoColor">手续费金额自动填充</span>
<span v-if="equip_price" slot="content">{{ (equip_price - equip_price*info.down_payment_ratio_n.replace("%","")/100)*(info.lease_charge_ratio_n.replace("%","")/100) | currency }}</span>
<span v-if="equip_price" slot="content">{{ parseFloat((equip_price - equip_price*info.down_payment_ratio_n.replace("%","")/100)*(info.lease_charge_ratio_n.replace("%","")/100)).toFixed(2) | currency }}</span>
</item>
<item>
<div slot="name" class="font-color">保险押金</div>
......@@ -67,7 +67,8 @@
<item>
<div slot="name" class="font-color">首次付款合计</div>
<span v-if="!equip_price" slot="content" class="autoColor">首次付款合计金额自动填充</span>
<span v-if="equip_price" slot="content">{{ equip_price*info.down_payment_ratio_n.replace("%","")/100 + equip_price*info.deposit_ratio_n.replace("%","")/100 + (equip_price - equip_price*info.down_payment_ratio_n.replace("%","")/100)*(info.lease_charge_ratio_n.replace("%","")/100) | currency }}</span>
<!-- 合计 = 首付款+保证金+手续费+GPS费用+保险押金 -->
<span v-if="equip_price" slot="content">{{ parseFloat(equip_price*info.down_payment_ratio_n.replace("%","")/100 + equip_price*info.deposit_ratio_n.replace("%","")/100 + (equip_price - equip_price*info.down_payment_ratio_n.replace("%","")/100)*(info.lease_charge_ratio_n.replace("%","")/100) + Number(gps_fee) + Number(insurance_fee)).toFixed(2) | currency }}</span>
</item>
<item>
<div slot="name" class="font-color">预计付款日</div>
......@@ -75,7 +76,7 @@
<div slot="content" class="autoColor">{{ price_date_to | dateFormat }}</div>
<img src="@/assets/trial/date.png" alt="" class="date-pic" @click="showTime('YYYY-MM-DD')">
</item>
<item>
<item @click.native="periodPull" :show-arrow="true">
<div slot="name" class="font-color">还款周期</div>
<input slot="content" v-model="info.annual_pay_times_n" placeholder="月">
</item>
......@@ -114,50 +115,52 @@
</template>
<script>
export default {
name: 'FinancingDetails',
data() {
return {
info: {},
dates: '',
gps_fee: '', // gps费用
insurance_fee: '', // 保险押金
quotation_id: '', // 试算成功返回id
trial_flag: false, // 检测是否通过试算
equip_price: null,
product_num: '',
price_date_to: '',
product_plan_id: '',
}
},
computed: {},
watch: {
equip_price() {
export default {
name: 'FinancingDetails',
data () {
return {
info: {},
dates: '',
gps_fee: '', // gps费用
insurance_fee: '', // 保险押金
quotation_id: '', // 试算成功返回id
trial_flag: false, // 检测是否通过试算
equip_price: null,
periodLists: [], // 还款周期
product_num: '',
price_date_to: '',
product_plan_id: '',
}
},
computed: {},
watch: {
equip_price () {
},
},
beforeRouteEnter(to, from, next) {
next(vm => {
if (from.name === 'FinancingTrial') {
vm.price_date_to = vm.$route.params.price_date_to // 有效日期
vm.equip_price = vm.$route.params.plan_price // 参考价
if (vm.product_plan_id !== vm.$route.params.product_plan_id) {
vm.product_plan_id = vm.$route.params.product_plan_id
vm.quotation_id = ''
vm.trial_flag = false
}
vm.detailsQuery()
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.name === 'FinancingTrial') {
vm.price_date_to = vm.$route.params.price_date_to // 有效日期
vm.equip_price = vm.$route.params.plan_price // 参考价
if (vm.product_plan_id !== vm.$route.params.product_plan_id) {
vm.product_plan_id = vm.$route.params.product_plan_id
vm.quotation_id = ''
vm.trial_flag = false
vm.insurance_fee = ''
vm.gps_fee = ''
}
})
next()
},
created() {
},
vm.detailsQuery()
vm.repayPeriod()
}
})
next()
},
created () {},
methods:
{
// 还款计划
goRepay() {
{
// 还款计划
goRepay() {
if (this.trial_flag) {
this.$router.push({
name: 'TrialRepayPlan',
......@@ -170,68 +173,108 @@
}
},
// 时间选择
showTime(format) {
let vm = this
hlsPopup.showTime({
nowDate: (new Date()).format('yyyy-MM-dd'),
format: format,
callback: (date) => {
vm.price_date_to = date
},
})
},
// 试算明细查询
detailsQuery() {
let vm = this
let url = $config.basePath + 'finance_detial'
let param = {
product_plan_id: vm.product_plan_id,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.info = res.info
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
// 试算保存
calculationSave() {
if (!this.equip_price) {
hlsPopup.showLongCenter('请输入设备总价')
} else if (!this.price_date_to) {
hlsPopup.showLongCenter('请选择时间')
} else {
let vm = this
let url = $config.basePath + 'prd_calculation_save'
let param = {
'master': {
'product_plan_id': vm.info.product_plan_id,
'equip_price': vm.equip_price,
'down_payment': vm.equip_price * (vm.info.down_payment_ratio_n.replace('%', '') / 100),
'deposit': vm.equip_price * (vm.info.deposit_ratio_n.replace('%', '') / 100),
'lease_charge': vm.equip_price * (vm.info.lease_charge_ratio_n.replace('%', '') / 100),
'due_date': (vm.price_date_to).substr(0, 10),
},
}
vm.hlsPopup.showLoading('试算中,请稍后')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
hlsPopup.showLongCenter('试算成功')
vm.quotation_id = res.quotation_id
vm.trial_flag = true
} else {
hlsPopup.showLongCenter(res.message)
}
})
}
},
},
}
// 时间选择
showTime (format) {
let vm = this
hlsPopup.showTime({
nowDate: (new Date()).format('yyyy-MM-dd'),
format: format,
callback: (date) => {
vm.price_date_to = date
},
})
},
// 还款周期查询
repayPeriod () {
let vm = this
let url = $config.basePath + 'annual_pay_times_query'
let param = {
product_plan_id: vm.product_plan_id,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.periodLists = res.lists.map(item => {
return {
code: item.annual_pay_times,
code_name: item.annual_pay_times_n,
}
})
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
periodPull () {
let vm = this
vm.hlsPopup.selectList({
list: vm.periodLists, // 下拉列表
code: 'bp_type',
object: {},
returnItem: function (index, obj) {
vm.info.annual_pay_times_n = obj.bp_type_n
},
})
},
// 试算明细查询
detailsQuery () {
let vm = this
let url = $config.basePath + 'finance_detial'
let param = {
product_plan_id: vm.product_plan_id,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.info = res.info
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
// 试算保存
calculationSave () {
if (!this.equip_price) {
hlsPopup.showLongCenter('请输入设备总价')
} else if (!this.price_date_to) {
hlsPopup.showLongCenter('请选择时间')
} else {
let vm = this
let url = $config.basePath + 'prd_calculation_save'
let param = {
'master': {
'product_plan_id': vm.info.product_plan_id,
'equip_price': vm.equip_price,
'down_payment': vm.equip_price * (vm.info.down_payment_ratio_n.replace('%', '') / 100),
'deposit': vm.equip_price * (vm.info.deposit_ratio_n.replace('%', '') / 100),
'lease_charge': vm.equip_price * (vm.info.lease_charge_ratio_n.replace('%', '') / 100),
'due_date': (vm.price_date_to).substr(0, 10),
},
}
vm.hlsPopup.showLoading('试算中,请稍后')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
hlsPopup.showLongCenter('试算成功')
vm.quotation_id = res.quotation_id
vm.trial_flag = true
} else {
hlsPopup.showLongCenter(res.message)
}
})
}
},
},
}
</script>
<style lang='less' scoped>
#details1 {
......
......@@ -2,7 +2,7 @@
* @Descrip: 产品明细
* @Author: your name
* @Date: 2019-10-15 14:30:00
* @LastEditTime: 2019-11-06 10:36:40
* @LastEditTime: 2019-11-06 13:56:38
* @LastEditors: Please set LastEditors
-->
<template>
......@@ -23,7 +23,7 @@
<!-- <Tab v-if="slide" :tabNums="tabNum" @getTabNum="getTabNum"/> -->
<!-- 基本信息 -->
<h-content v-swipeup="(e)=>vueTouch('上滑',e)" v-swipedown="(e)=>vueTouch('下滑',e)" class="hcontent">
<scroll class="scrolls">
<scroll class="scrolls" ref="scrolls">
<div id="baseInfo" class="base">
......@@ -155,23 +155,33 @@ export default {
}
},
methods:
{
// tab切换
tabCheck (num) {
let scrollContent = document.getElementsByClassName('scrollContent')[0]
if(num === 0){
this.num = 0
console.log('基本信息',document.getElementsByClassName('base')[0].getBoundingClientRect().top)
this.height = document.getElementsByClassName('base')[0].getBoundingClientRect().top - 83
// console.log(height)
scrollContent.style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
scrollContent.style.transform = 'translate(0px, -' + this.height + 'px) scale(1) translateZ(0px)'
}else if(num === 1){
this.num = 1
console.log('详情信息',document.getElementsByClassName('prodetail')[0].getBoundingClientRect().top)
this.height = document.getElementsByClassName('prodetail')[0].getBoundingClientRect().top - 83
console.log(this.height)
scrollContent.style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
scrollContent.style.transform = 'translate(0px, -' + this.height + 'px) scale(1) translateZ(0px)'
}else{
this.num = 2
console.log('配置信息',document.getElementsByClassName('procnf')[0].getBoundingClientRect().top)
this.height = document.getElementsByClassName('procnf')[0].getBoundingClientRect().top - 83
// console.log(height)
document.getElementsByClassName('scrollContent')[0].style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
document.getElementsByClassName('scrollContent')[0].style.transform = 'translate(0px, -' + this.height + 'px) scale(1) translateZ(0px)'
scrollContent.style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
scrollContent.style.transform = 'translate(0px, -' + this.height + 'px) scale(1) translateZ(0px)'
}
},
returnGo () {
......@@ -183,7 +193,7 @@ export default {
vueTouch: function (s, e) {
// console.log(s, e)
this.slide = true
this.height = 0
// this.height = 0
// document.getElementsByTagName('hcontent')[0].addEventListener('touchmove',function(e){
// console.log("开始滑动了touchstart");
// let a = document.documentElement.scrollTop;
......@@ -194,11 +204,11 @@ export default {
let procnfGather = document.getElementsByClassName('procnf')[0].getBoundingClientRect() // 配置信息元素集合
let detailGather = document.getElementsByClassName('prodetail')[0].getBoundingClientRect() // 详情信息元素集合
let baseGather = document.getElementsByClassName('base')[0].getBoundingClientRect() // 基本信息元素集合
if (clientHeight - procnfGather.top >= procnfGather.height) {
if (clientHeight - procnfGather.top - 83 >= procnfGather.height) {
this.num = 2
} else if (clientHeight - detailGather.top >= detailGather.height) {
} else if (clientHeight - detailGather.top - 83 >= detailGather.height) {
this.num = 1
} else if (clientHeight - baseGather.top >= baseGather.height) {
} else if (clientHeight - baseGather.top - 83 >= baseGather.height) {
this.num = 0
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment