Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sfp-program
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sweet Zhang
sfp-program
Commits
0bd7a13a
Commit
0bd7a13a
authored
Sep 29, 2022
by
kyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
规划参数对接
parent
0e335c28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
18 deletions
+56
-18
pages/housePurchase/housePurchase.vue
+43
-9
pages/housePurchase/planningParameters.vue
+13
-9
No files found.
pages/housePurchase/housePurchase.vue
View file @
0bd7a13a
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
<view>
<view>
规划参数
规划参数
</view>
</view>
<view
class=
"view"
@
click=
"
paramsSelected=dialogIsShow=true;isLoanSelected = false;
"
>
<view
class=
"view"
@
click=
"
viewPlanningParams()
"
>
查看
查看
</view>
</view>
</view>
</view>
...
@@ -138,7 +138,7 @@
...
@@ -138,7 +138,7 @@
</view>
</view>
</form>
</form>
<!--测算结果-- v-show="resultFlag"-->
<!--测算结果-- v-show="resultFlag"-->
<view
class=
"result_wrapper"
>
<view
class=
"result_wrapper"
v-if=
"resultFlag"
>
<view
class=
"suggestInfo"
>
<view
class=
"suggestInfo"
>
<view
class=
"title"
>
<view
class=
"title"
>
<view>
<view>
...
@@ -197,7 +197,7 @@
...
@@ -197,7 +197,7 @@
<!--旧房贷款余额组件-->
<!--旧房贷款余额组件-->
<loanBalance
v-if=
"isLoanSelected"
:a=
"accumulationFundParams"
:b=
"commercialLoansParams"
:loanType=
"1"
@
getData=
"getData"
></loanBalance>
<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>
</view>
</view>
</
template
>
</
template
>
...
@@ -216,6 +216,7 @@
...
@@ -216,6 +216,7 @@
export
default
{
export
default
{
data
(){
data
(){
return
{
return
{
cityInfo
:{},
isEditFlag
:
false
,
isEditFlag
:
false
,
dataLists
:
null
,
dataLists
:
null
,
dialogIsShow
:
false
,
//弹窗显示与隐藏
dialogIsShow
:
false
,
//弹窗显示与隐藏
...
@@ -255,6 +256,7 @@
...
@@ -255,6 +256,7 @@
},
},
housePurchasePrices
:[],
housePurchasePrices
:[],
resultFlag
:
false
,
resultFlag
:
false
,
planningParams
:{}
}
}
},
},
components
:{
components
:{
...
@@ -267,8 +269,22 @@
...
@@ -267,8 +269,22 @@
this
.
provCityQry
();
this
.
provCityQry
();
},
},
methods
:{
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
){
getPlanParams
(
e
){
console
.
log
(
e
)
console
.
log
(
'规划参数子组件传过来的===='
,
e
)
this
.
planningParams
=
e
;
// 从规划参数弹窗获取数据
// 从规划参数弹窗获取数据
this
.
closeBtn
()
this
.
closeBtn
()
},
},
...
@@ -289,7 +305,12 @@
...
@@ -289,7 +305,12 @@
onchange
(
e
)
{
onchange
(
e
)
{
const
value
=
e
.
detail
.
value
const
value
=
e
.
detail
.
value
},
},
onnodeclick
(
node
)
{},
onnodeclick
(
node
)
{
this
.
cityInfo
=
{
cityId
:
node
.
value
,
provinceId
:
node
.
parent_value
?
node
.
parent_value
:
null
,
}
},
drawLine
()
{
drawLine
()
{
// 基于准备好的dom,初始化echarts实例
// 基于准备好的dom,初始化echarts实例
this
.
myChart
=
echarts
.
init
(
document
.
getElementById
(
'myEcharts'
));
this
.
myChart
=
echarts
.
init
(
document
.
getElementById
(
'myEcharts'
));
...
@@ -298,11 +319,11 @@
...
@@ -298,11 +319,11 @@
const
list1
=
this
.
housePurchasePrices
.
filter
((
item
)
=>
{
const
list1
=
this
.
housePurchasePrices
.
filter
((
item
)
=>
{
return
item
.
priceType
==
3
return
item
.
priceType
==
3
})[
0
];
})[
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
)
=>
{
const
list2
=
this
.
housePurchasePrices
.
filter
((
item
)
=>
{
return
item
.
priceType
==
4
return
item
.
priceType
==
4
})[
0
];
})[
0
];
this
.
totalLoanList
=
this
.
totalLoanList
.
concat
(
list2
.
fvPriceRealization
,
list2
.
fvPriceDesired
,
list2
.
fvDifference
)
this
.
totalLoanList
=
[]
.
concat
(
list2
.
fvPriceRealization
,
list2
.
fvPriceDesired
,
list2
.
fvDifference
)
}
}
this
.
myChart
.
setOption
({
this
.
myChart
.
setOption
({
legend
:
{
legend
:
{
...
@@ -391,8 +412,21 @@
...
@@ -391,8 +412,21 @@
common
.
errorDialog
(
1
,
'请填写年预备还房贷资金总额'
)
common
.
errorDialog
(
1
,
'请填写年预备还房贷资金总额'
)
return
false
;
return
false
;
}
}
// 规划参数默认值
const
palnningParamsDefault
=
{
acceptableLossRate
:
10
,
downPaymentMin
:
30
,
houseDepreciationRate
:
2
,
housePriceGrowthRate
:
6.25
,
incomeRate
:
"3"
,
interestRate
:
4.9
,
tnvestmentRate
:
3.74
}
const
param
=
{
const
param
=
{
...
palnningParamsDefault
,
...
this
.
housePurchaseInfo
,
...
this
.
housePurchaseInfo
,
...
this
.
planningParams
,
interestRate
:
this
.
housePurchaseInfo
.
interestRate
/
100
,
houseLoanOldList
:
this
.
houseLoanOldList
,
houseLoanOldList
:
this
.
houseLoanOldList
,
// businessNo: uni.getStorageSync('businessNo'),
// businessNo: uni.getStorageSync('businessNo'),
businessNo
:
'businessNo20220829000000001'
,
businessNo
:
'businessNo20220829000000001'
,
...
@@ -403,7 +437,7 @@
...
@@ -403,7 +437,7 @@
this
.
resultFlag
=
true
;
this
.
resultFlag
=
true
;
this
.
resultInfos
=
res
[
'data'
];
this
.
resultInfos
=
res
[
'data'
];
this
.
housePurchasePrices
=
res
[
'data'
][
'housePurchasePrices'
];
this
.
housePurchasePrices
=
res
[
'data'
][
'housePurchasePrices'
];
this
.
drawLine
()
setTimeout
(()
=>
{
this
.
drawLine
()});
}
else
{
}
else
{
common
.
errorDialog
(
2
,
res
[
'message'
])
common
.
errorDialog
(
2
,
res
[
'message'
])
}
}
...
@@ -447,7 +481,7 @@
...
@@ -447,7 +481,7 @@
},
},
},
},
mounted
(){
mounted
(){
this
.
drawLine
();
//
this.drawLine();
}
}
}
}
</
script
>
</
script
>
...
...
pages/housePurchase/planningParameters.vue
View file @
0bd7a13a
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<div
class=
"dataSelect"
>
<div
class=
"dataSelect"
>
<div
v-if=
"item.type==='data-picker'"
>
<div
v-if=
"item.type==='data-picker'"
>
<view>
<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>
</view>
</div>
</div>
</div>
</div>
...
@@ -28,9 +28,11 @@
...
@@ -28,9 +28,11 @@
import
api
from
'../../api/api'
;
import
api
from
'../../api/api'
;
import
common
from
'../../common/common'
import
common
from
'../../common/common'
export
default
{
export
default
{
props
:[
'cityInfo'
],
emits
:[
'getData'
],
emits
:[
'getData'
],
data
(){
data
(){
return
{
return
{
cityId
:
null
,
paramsLists
:[
paramsLists
:[
{
id
:
'01'
,
name
:
'房价增长率'
,
value
:
6.25
,
type
:
'data-picker'
,
remark
:
''
,
alias
:
'housePriceGrowthRate'
},
{
id
:
'01'
,
name
:
'房价增长率'
,
value
:
6.25
,
type
:
'data-picker'
,
remark
:
''
,
alias
:
'housePriceGrowthRate'
},
{
id
:
'02'
,
name
:
'房屋折旧率'
,
value
:
2
,
type
:
'number'
,
remark
:
''
,
alias
:
'houseDepreciationRate'
},
{
id
:
'02'
,
name
:
'房屋折旧率'
,
value
:
2
,
type
:
'number'
,
remark
:
''
,
alias
:
'houseDepreciationRate'
},
...
@@ -42,7 +44,6 @@
...
@@ -42,7 +44,6 @@
],
],
editParamLists
:[],
editParamLists
:[],
provinceList
:[],
provinceList
:[],
cityInfo
:
null
}
}
},
},
...
@@ -54,10 +55,11 @@
...
@@ -54,10 +55,11 @@
},
},
setup
(
props
,
content
){
setup
(
props
,
content
){
const
cityInfo
=
props
.
cityInfo
?
props
.
cityInfo
:
null
;
const
sendData
=
(
e
)
=>
{
const
sendData
=
(
e
)
=>
{
content
.
emit
(
'getData'
,
e
);
content
.
emit
(
'getData'
,
e
);
}
}
return
{
sendData
}
return
{
sendData
,
cityInfo
}
},
},
methods
:{
methods
:{
onchange
(
e
)
{
onchange
(
e
)
{
...
@@ -66,12 +68,11 @@
...
@@ -66,12 +68,11 @@
onnodeclick
(
node
)
{
onnodeclick
(
node
)
{
// console.log(node);
// console.log(node);
this
.
cityInfo
=
{
this
.
cityInfo
=
{
provinceId
:
node
.
value
,
...
this
.
cityInfo
,
cityId
:
node
.
parent_value
?
node
.
parent_value
:
null
,
cityId
:
node
.
value
,
area
:
1
,
provinceId
:
node
.
parent_value
?
node
.
parent_value
:
null
,
isNew
:
1
}
}
this
.
queryCommercialHousingPrice
(
this
.
cityInfo
)
this
.
queryCommercialHousingPrice
()
},
},
resetParams
(){
resetParams
(){
this
.
editParamLists
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
paramsLists
))
this
.
editParamLists
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
paramsLists
))
...
@@ -96,7 +97,8 @@
...
@@ -96,7 +97,8 @@
this
.
sendData
(
params
)
this
.
sendData
(
params
)
},
},
// 获取房价增长率
// 获取房价增长率
queryCommercialHousingPrice
(
provinceId
,
cityId
){
queryCommercialHousingPrice
(){
console
.
log
(
this
.
cityInfo
)
api
.
queryCommercialHousingPrice
(
this
.
cityInfo
).
then
(
res
=>
{
api
.
queryCommercialHousingPrice
(
this
.
cityInfo
).
then
(
res
=>
{
if
(
res
[
'success'
]){
if
(
res
[
'success'
]){
this
.
editParamLists
.
find
(
item
=>
item
.
alias
===
'housePriceGrowthRate'
)[
'value'
]
=
res
[
'data'
][
'priceInfo'
][
'rateB'
];
this
.
editParamLists
.
find
(
item
=>
item
.
alias
===
'housePriceGrowthRate'
)[
'value'
]
=
res
[
'data'
][
'priceInfo'
][
'rateB'
];
...
@@ -107,6 +109,8 @@
...
@@ -107,6 +109,8 @@
mounted
()
{
mounted
()
{
this
.
editParamLists
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
paramsLists
));
this
.
editParamLists
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
paramsLists
));
this
.
provCityQry
();
this
.
provCityQry
();
this
.
cityId
=
this
.
cityInfo
.
cityId
;
this
.
queryCommercialHousingPrice
()
}
}
}
}
</
script
>
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment