Commit 97aef16c by Chao Sun

Merge branch 'master' of http://139.224.139.2:9091/Sweet/sfp-program into master

parents 920bdeea f7f61ed9
...@@ -108,10 +108,11 @@ ...@@ -108,10 +108,11 @@
<view class="title"> <view class="title">
<view class="radioButton" :class="{'selected':isDisplace }" <view class="radioButton" :class="{'selected':isDisplace }"
@click="openLoan()"></view> @click="openLoan()"></view>
<text style="margin-left: 10rpx;">是否置换旧房{{isDisplace}}</text> <text style="margin-left: 10rpx;">是否置换旧房</text>
</view>
<view v-if="dataLists">
<loanBalance :isReadonly="true" :a="accumulationFundParams" :b="commercialLoansParams" @getData="getData"></loanBalance>
</view> </view>
<loanBalance :isShowTab="false" :commercialLoansParams="commercialLoansParams"
:accumulationFundParams="accumulationFundParams"></loanBalance>
</view> </view>
<!--规划参数--> <!--规划参数-->
<view class="parametersInfo"> <view class="parametersInfo">
...@@ -191,7 +192,7 @@ ...@@ -191,7 +192,7 @@
<svg t="1663922894848" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2545" width="26" height="26"><path d="M557.311759 513.248864l265.280473-263.904314c12.54369-12.480043 12.607338-32.704421 0.127295-45.248112-12.512727-12.576374-32.704421-12.607338-45.248112-0.127295L512.127295 467.904421 249.088241 204.063755c-12.447359-12.480043-32.704421-12.54369-45.248112-0.063647-12.512727 12.480043-12.54369 32.735385-0.063647 45.280796l262.975407 263.775299-265.151458 263.744335c-12.54369 12.480043-12.607338 32.704421-0.127295 45.248112 6.239161 6.271845 14.463432 9.440452 22.687703 9.440452 8.160624 0 16.319527-3.103239 22.560409-9.311437l265.216826-263.807983 265.440452 266.240344c6.239161 6.271845 14.432469 9.407768 22.65674 9.407768 8.191587 0 16.352211-3.135923 22.591372-9.34412 12.512727-12.480043 12.54369-32.704421 0.063647-45.248112L557.311759 513.248864z" p-id="2546"></path></svg> <svg t="1663922894848" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2545" width="26" height="26"><path d="M557.311759 513.248864l265.280473-263.904314c12.54369-12.480043 12.607338-32.704421 0.127295-45.248112-12.512727-12.576374-32.704421-12.607338-45.248112-0.127295L512.127295 467.904421 249.088241 204.063755c-12.447359-12.480043-32.704421-12.54369-45.248112-0.063647-12.512727 12.480043-12.54369 32.735385-0.063647 45.280796l262.975407 263.775299-265.151458 263.744335c-12.54369 12.480043-12.607338 32.704421-0.127295 45.248112 6.239161 6.271845 14.463432 9.440452 22.687703 9.440452 8.160624 0 16.319527-3.103239 22.560409-9.311437l265.216826-263.807983 265.440452 266.240344c6.239161 6.271845 14.432469 9.407768 22.65674 9.407768 8.191587 0 16.352211-3.135923 22.591372-9.34412 12.512727-12.480043 12.54369-32.704421 0.063647-45.248112L557.311759 513.248864z" p-id="2546"></path></svg>
</div> </div>
<!--旧房贷款余额组件--> <!--旧房贷款余额组件-->
<loanBalance :sendChildLoanInfo="getChildLoanInfo" v-if="isLoanSelected" :isShowTab="true"></loanBalance> <loanBalance v-if="isLoanSelected" :loanType="1" @getData="getData"></loanBalance>
<!--规划参数组件--> <!--规划参数组件-->
<planningParameters v-if="paramsSelected"></planningParameters> <planningParameters v-if="paramsSelected"></planningParameters>
</view> </view>
...@@ -199,6 +200,7 @@ ...@@ -199,6 +200,7 @@
</template> </template>
<script> <script>
import {toRefs} from "vue";
import loanBalance from './loanBalance.vue'; import loanBalance from './loanBalance.vue';
import planningParameters from './planningParameters.vue'; import planningParameters from './planningParameters.vue';
import head from '../header/header.vue'; import head from '../header/header.vue';
...@@ -211,6 +213,8 @@ ...@@ -211,6 +213,8 @@
export default{ export default{
data(){ data(){
return{ return{
dataLists:null,
loanType:1,
dialogIsShow:false,//弹窗显示与隐藏 dialogIsShow:false,//弹窗显示与隐藏
isDisplace:false, isDisplace:false,
isLoanSelected:false, isLoanSelected:false,
...@@ -296,6 +300,15 @@ ...@@ -296,6 +300,15 @@
this.provCityQry(); this.provCityQry();
}, },
methods:{ methods:{
getData(e){
this.dataLists = toRefs(e);
this.accumulationFundParams = this.dataLists.a;
this.commercialLoansParams = this.dataLists.b;
this.dialogIsShow = false;
console.log('父组件拿到值了',e);
console.log('父组件拿到值了',this.accumulationFundParams);
console.log('父组件拿到值了',this.commercialLoansParams);
},
onchange(e) { onchange(e) {
const value = e.detail.value const value = e.detail.value
}, },
......
<template> <template>
<div class="mortgageCalculatorContainer"> <div class="mortgageCalculatorContainer">
<view class="tabTitle" v-if="isShowTab"> <view class="tabTitle" v-if="!isReadonly">
<view v-for="item of loanTypeLists"> <view v-for="item of loanTypeLists">
<text :class="{ actived: item.value===loanType }" @click="selectLoanType(item.value)">{{item.text}}</text> <text :class="{ actived: item.value===loanType }" @click="selectLoanType(item.value)">{{item.text}}</text>
</view> </view>
</view> </view>
<view> <view>
<!-- 公积金贷款 --> <!-- 公积金贷款 -->
<view class="accumulationFundContainer" v-if="loanType===2 || loanType===3"> <view class="accumulationFundContainer" v-if="loanType==2 || loanType==3">
<h5>公积金</h5> <h5 v-if="!isReadonly">公积金</h5>
<ul> <ul>
<li v-for="item of accumulationFundParams" :key="item.id"> <li v-for="item of accumulationFundParams" :key="item.id">
<div>{{item.text}}</div> <div>{{item.text}}</div>
<div v-if="item.type==='number' || item.type==='digit'"> <div v-if="item.type==='number' || item.type==='digit'">
<input class="uni-input" type="{{item.type}}" v-model="item.value" placeholder="请输入"/> <input class="uni-input" type="{{item.type}}" v-model="item.value" placeholder="请输入" :disabled="isReadonly"/>
<span>{{item.unit}}</span> <span>{{item.unit}}</span>
</div> </div>
<div v-else-if="item.type==='select'" style="width:30%"> <div v-else-if="item.type==='select'" style="width:30%">
...@@ -24,51 +24,52 @@ ...@@ -24,51 +24,52 @@
</view> </view>
<!-- 商业贷款 --> <!-- 商业贷款 -->
<view class="commercialLoans" v-if="loanType===1|| loanType===3"> <view class="commercialLoans" v-if="loanType==1|| loanType==3">
<h5>商业贷款</h5> <h5 v-if="!isReadonly">商业贷款</h5>
<ul> <ul>
<li v-for="item of commercialLoansParams" :key="item.id"> <li v-for="item of commercialLoansParams" :key="item.id">
<div>{{item.text}}</div> <div>{{item.text}}</div>
<div v-if="item.type==='number' || item.type==='digit'"> <div v-if="item.type==='number' || item.type==='digit'">
<input class="uni-input" type="{{item.type}}" v-model="item.value" placeholder="请输入"/> <input class="uni-input" type="{{item.type}}" v-model="item.value" placeholder="请输入" :disabled="isReadonly"/>
<span>{{item.unit}}</span> <span>{{item.unit}}</span>
</div> </div>
<div v-else-if="item.type==='select'" style="width:30%"> <div v-else-if="item.type==='select'" style="width:30%">
<uni-data-select v-model="item.value" :localdata="repaymentMethodLists"></uni-data-select> <uni-data-select v-model="item.value" :localdata="repaymentMethodLists" :disable="isReadonly"></uni-data-select>
</div> </div>
</li> </li>
</ul> </ul>
</view> </view>
</view> </view>
<view class="footer"> <view class="footer" v-if="!isReadonly">
<view @click="save()">保存</view> <view @click="save()">保存</view>
</view> </view>
</div> </div>
</template> </template>
<script> <script>
import { ref,toRefs } from "vue";
export default{ export default{
props: ['sendChildLoanInfo','isShowTab','commercialLoansParams','accumulationFundParams'], props: ['isReadonly','loanType','a','b'],
emits:['getData'],
data(){ data(){
return{ return{
// accumulationFundParams : [ accumulationFundParams:[
// {id:'00',text:'公积金贷款余额',value:null,type:'digit',unit:'元',alias:'oldHouseLoanBalance'}, {id:'00',text:'公积金贷款余额',value:null,type:'digit',unit:'元',alias:'oldHouseLoanBalance'},
// {id:'01',text:'公积金还款方式',value:null,type:'select',unit:'',alias:'oldCalcuteType'}, {id:'01',text:'公积金还款方式',value:null,type:'select',unit:'',alias:'oldCalcuteType'},
// {id:'02',text:'剩余月份',value:null,type:'number',unit:'月',alias:'oldHouseRepaymentMonth'}, {id:'02',text:'剩余月份',value:null,type:'number',unit:'月',alias:'oldHouseRepaymentMonth'},
// {id:'03',text:'年利率',value:null,type:'digit',unit:'%',alias:'oldInterestRate'}, {id:'03',text:'年利率',value:null,type:'digit',unit:'%',alias:'oldInterestRate'},
// ], ],
// commercialLoansParams : [ commercialLoansParams:[
// {id:'00',text:'商业贷款余额',value:null,type:'digit',unit:'元',alias:'oldHouseLoanBalance'}, {id:'00',text:'商业贷款余额',value:null,type:'digit',unit:'元',alias:'oldHouseLoanBalance'},
// {id:'01',text:'商业还款方式',value:null,type:'select',unit:'',alias:'oldCalcuteType'}, {id:'01',text:'商业还款方式',value:null,type:'select',unit:'',alias:'oldCalcuteType'},
// {id:'02',text:'剩余月份',value:null,type:'number',unit:'月',alias:'oldHouseRepaymentMonth'}, {id:'02',text:'剩余月份',value:null,type:'number',unit:'月',alias:'oldHouseRepaymentMonth'},
// {id:'03',text:'年利率',value:null,type:'digit',unit:'%',alias:'oldInterestRate'}, {id:'03',text:'年利率',value:null,type:'digit',unit:'%',alias:'oldInterestRate'},
// ], ],
loanTypeLists:[ loanTypeLists:[
{id:'00',text:'商业贷款',value:1}, {id:'00',text:'商业贷款',value:1},
{id:'01',text:'公积金贷款',value:2}, {id:'01',text:'公积金贷款',value:2},
{id:'02',text:'组合贷款',value:3} {id:'02',text:'组合贷款',value:3}
], ],
loanType:1,// 默认选择商业贷款
repaymentMethodLists:[{id:'00',text:'等额本金',value:1},{id:'01',text:'等额本息',value:2}], repaymentMethodLists:[{id:'00',text:'等额本金',value:1},{id:'01',text:'等额本息',value:2}],
houseLoanOldList:[], houseLoanOldList:[],
loadInfo:{ loadInfo:{
...@@ -86,21 +87,30 @@ ...@@ -86,21 +87,30 @@
components:{ components:{
}, },
onLoad(){ setup(props,content) {
console.log(this.isShowTab) console.log('子组件拿到值了',props);
if(this.isShowTab){ const a = toRefs(props.a);
this.accumulationFundParams = [ const b = toRefs(props.b);
{id:'00',text:'公积金贷款余额',value:null,type:'digit',unit:'元',alias:'oldHouseLoanBalance'}, const loanType = ref(props.loanType);
{id:'01',text:'公积金还款方式',value:null,type:'select',unit:'',alias:'oldCalcuteType'}, const isReadonly = ref(props.isReadonly);
{id:'02',text:'剩余月份',value:null,type:'number',unit:'月',alias:'oldHouseRepaymentMonth'}, const sendData = (e) =>{
{id:'03',text:'年利率',value:null,type:'digit',unit:'%',alias:'oldInterestRate'}, content.emit('getData',e);
]; }
this.commercialLoansParams = [ return {loanType,sendData,a,b,isReadonly}
{id:'00',text:'商业贷款余额',value:null,type:'digit',unit:'元',alias:'oldHouseLoanBalance'}, },
{id:'01',text:'商业还款方式',value:null,type:'select',unit:'',alias:'oldCalcuteType'}, mounted(){
{id:'02',text:'剩余月份',value:null,type:'number',unit:'月',alias:'oldHouseRepaymentMonth'}, if(JSON.stringify(this.a) != '{}'){
{id:'03',text:'年利率',value:null,type:'digit',unit:'%',alias:'oldInterestRate'}, this.accumulationFundParams = JSON.parse(JSON.stringify(this.a))[0]._object
]; }
if(JSON.stringify(this.b) != '{}'){
this.commercialLoansParams = JSON.parse(JSON.stringify(this.b))[0]._object;
}
if(this.accumulationFundParams){
this.loanType = 1;
}else if(this.commercialLoansParams){
this.loanType = 2;
}else{
this.loanType = 3;
} }
}, },
methods:{ methods:{
...@@ -249,13 +259,13 @@ ...@@ -249,13 +259,13 @@
} }
// 旧房贷款信息集合 // 旧房贷款信息集合
console.log(this.houseLoanOldList) // console.log(this.houseLoanOldList)
this.sendChildLoanInfo(this.houseLoanOldList,this.commercialLoansParams,this.accumulationFundParams); const ab = {
a:this.accumulationFundParams,
b:this.commercialLoansParams
}
this.sendData(ab)
}, },
// closeBlan(){
// //向父组件发送关闭弹窗
// this.$emit('closeLoan')
// }
} }
} }
......
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