Commit 0bd7a13a by kyle

规划参数对接

parent 0e335c28
......@@ -123,7 +123,7 @@
<view>
规划参数
</view>
<view class="view" @click="paramsSelected=dialogIsShow=true;isLoanSelected = false;">
<view class="view" @click="viewPlanningParams()">
查看
</view>
</view>
......@@ -138,7 +138,7 @@
</view>
</form>
<!--测算结果-- v-show="resultFlag"-->
<view class="result_wrapper">
<view class="result_wrapper" v-if="resultFlag">
<view class="suggestInfo">
<view class="title">
<view>
......@@ -197,7 +197,7 @@
<!--旧房贷款余额组件-->
<loanBalance v-if="isLoanSelected" :a="accumulationFundParams" :b="commercialLoansParams" :loanType="1" @getData="getData"></loanBalance>
<!--规划参数组件-->
<planningParameters v-if="paramsSelected" @getData="getPlanParams"></planningParameters>
<planningParameters v-if="paramsSelected" :cityInfo="cityInfo" @getData="getPlanParams"></planningParameters>
</view>
</view>
</template>
......@@ -216,6 +216,7 @@
export default{
data(){
return{
cityInfo:{},
isEditFlag:false,
dataLists:null,
dialogIsShow:false,//弹窗显示与隐藏
......@@ -255,6 +256,7 @@
},
housePurchasePrices:[],
resultFlag:false,
planningParams:{}
}
},
components:{
......@@ -267,8 +269,22 @@
this.provCityQry();
},
methods:{
viewPlanningParams(){
// 查看规划参数
this.paramsSelected=this.dialogIsShow=true;
this.isLoanSelected = false;
this.cityInfo['isNew'] = '1';
if(this.housePurchaseInfo.preOrderSize <= 90){
this.cityInfo['area'] = '1'
}else if(this.housePurchaseInfo.preOrderSize <= 144){
this.cityInfo['area'] = '2'
}else{
this.cityInfo['area'] = '3'
}
},
getPlanParams(e){
console.log(e)
console.log('规划参数子组件传过来的====',e)
this.planningParams = e;
// 从规划参数弹窗获取数据
this.closeBtn()
},
......@@ -289,7 +305,12 @@
onchange(e) {
const value = e.detail.value
},
onnodeclick(node) {},
onnodeclick(node) {
this.cityInfo = {
cityId: node.value,
provinceId:node.parent_value ? node.parent_value : null,
}
},
drawLine() {
// 基于准备好的dom,初始化echarts实例
this.myChart = echarts.init(document.getElementById('myEcharts'));
......@@ -298,11 +319,11 @@
const list1 = this.housePurchasePrices.filter((item)=>{
return item.priceType == 3
})[0];
this.downPaymentList = this.downPaymentList.concat(list1.pvPriceRealization,list1.pvPriceDesired,list1.pvDifference)
this.downPaymentList = [].concat(list1.pvPriceRealization,list1.pvPriceDesired,list1.pvDifference)
const list2 = this.housePurchasePrices.filter((item)=>{
return item.priceType == 4
})[0];
this.totalLoanList = this.totalLoanList.concat(list2.fvPriceRealization,list2.fvPriceDesired,list2.fvDifference)
this.totalLoanList = [].concat(list2.fvPriceRealization,list2.fvPriceDesired,list2.fvDifference)
}
this.myChart.setOption({
legend: {
......@@ -391,8 +412,21 @@
common.errorDialog(1,'请填写年预备还房贷资金总额')
return false;
}
// 规划参数默认值
const palnningParamsDefault = {
acceptableLossRate: 10,
downPaymentMin: 30,
houseDepreciationRate: 2,
housePriceGrowthRate: 6.25,
incomeRate: "3",
interestRate: 4.9,
tnvestmentRate: 3.74
}
const param = {
...palnningParamsDefault,
...this.housePurchaseInfo,
...this.planningParams,
interestRate:this.housePurchaseInfo.interestRate / 100,
houseLoanOldList:this.houseLoanOldList,
// businessNo: uni.getStorageSync('businessNo'),
businessNo:'businessNo20220829000000001',
......@@ -403,7 +437,7 @@
this.resultFlag = true;
this.resultInfos = res['data'];
this.housePurchasePrices = res['data']['housePurchasePrices'];
this.drawLine()
setTimeout(()=>{this.drawLine()});
}else{
common.errorDialog(2,res['message'])
}
......@@ -447,7 +481,7 @@
},
},
mounted(){
this.drawLine();
// this.drawLine();
}
}
</script>
......
......@@ -11,7 +11,7 @@
<div class="dataSelect">
<div v-if="item.type==='data-picker'">
<view>
<uni-data-picker :localdata="provinceList" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
<uni-data-picker v-model="cityId" :localdata="provinceList" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
</view>
</div>
</div>
......@@ -28,9 +28,11 @@
import api from '../../api/api';
import common from '../../common/common'
export default{
props:['cityInfo'],
emits:['getData'],
data(){
return {
cityId:null,
paramsLists:[
{id:'01',name:'房价增长率',value:6.25,type:'data-picker',remark:'',alias:'housePriceGrowthRate' },
{id:'02',name:'房屋折旧率',value:2,type:'number',remark:'',alias:'houseDepreciationRate'},
......@@ -42,7 +44,6 @@
],
editParamLists:[],
provinceList:[],
cityInfo:null
}
},
......@@ -54,10 +55,11 @@
},
setup(props,content){
const cityInfo = props.cityInfo ? props.cityInfo : null;
const sendData = (e) =>{
content.emit('getData',e);
}
return {sendData}
return {sendData,cityInfo}
},
methods:{
onchange(e) {
......@@ -66,12 +68,11 @@
onnodeclick(node) {
// console.log(node);
this.cityInfo = {
provinceId: node.value,
cityId:node.parent_value ? node.parent_value : null,
area:1,
isNew:1
...this.cityInfo,
cityId: node.value,
provinceId:node.parent_value ? node.parent_value : null,
}
this.queryCommercialHousingPrice(this.cityInfo)
this.queryCommercialHousingPrice()
},
resetParams(){
this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists))
......@@ -96,7 +97,8 @@
this.sendData(params)
},
// 获取房价增长率
queryCommercialHousingPrice(provinceId,cityId){
queryCommercialHousingPrice(){
console.log(this.cityInfo)
api.queryCommercialHousingPrice(this.cityInfo).then(res=>{
if(res['success']){
this.editParamLists.find(item=>item.alias==='housePriceGrowthRate')['value'] = res['data']['priceInfo']['rateB'];
......@@ -107,6 +109,8 @@
mounted() {
this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists));
this.provCityQry();
this.cityId = this.cityInfo.cityId;
this.queryCommercialHousingPrice()
}
}
</script>
......
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