Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
komatsu-lease-app
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
komatsu
komatsu-lease-app
Commits
9ed4a7ea
Commit
9ed4a7ea
authored
Jan 29, 2023
by
胡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 对金钱进行格式化
parent
d1a5bbc0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
435 additions
and
432 deletions
+435
-432
index.vue
src/modules/intention/views/index.vue
+93
-92
index.vue
src/modules/repayPlan/views/index.vue
+102
-100
plan.vue
src/modules/repayPlan/views/plan.vue
+240
-240
No files found.
src/modules/intention/views/index.vue
View file @
9ed4a7ea
<
template
>
<div
class=
"container"
>
<NavBar
title=
"融资意向"
left-arrow
@
click-left=
"goBack"
/>
<section
class=
"list"
>
<PullRefresh
v-model=
"refreshing"
@
refresh=
"getList"
class=
"scroll"
>
<List
:finished=
"finished"
finished-text=
"没有更多了"
>
<Empty
v-if=
"!listValue.length"
description=
"无记录"
/>
<ListItem
v-for=
"item in listValue"
:other_title=
"item.other_title"
:title=
"item.title"
:values=
"item.values"
@
click=
"jump(item.intentionId)"
/>
</List>
</PullRefresh>
</section>
<Plus
@
click=
"jump('')"
/>
</div>
</
template
>
<
script
setup
>
import
{
goBack
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Empty
}
from
"vant"
;
import
ListItem
from
'@/components/ListItem.vue'
import
Plus
from
'@/components/Plus.vue'
import
api
from
"../api"
;
import
{
useRouter
}
from
"vue-router"
;
import
{
useIntention
}
from
'../store/index'
const
formStore
=
useIntention
()
const
listValue
=
$ref
([])
const
getList
=
async
()
=>
{
let
res
=
await
api
.
getlist
()
if
(
res
.
success
&&
res
.
rows
.
length
)
{
listValue
=
res
.
rows
.
map
(
item
=>
{
return
{
title
:
item
.
intentionNumber
,
other_title
:
item
.
creationDate
,
values
:
[[
"合同金额"
,
"状态"
],
[
"¥ "
+
(
item
.
contractAmount
||
'0.00'
),
item
.
intentionStatusN
]],
intentionId
:
item
.
intentionId
}
})
}
else
{
listValue
=
[]
}
refreshing
=
false
;
}
getList
()
const
refreshing
=
$ref
(
true
);
const
finished
=
$ref
(
true
);
const
router
=
useRouter
();
const
jump
=
async
(
intentionId
=
''
)
=>
{
if
(
intentionId
)
{
let
res
=
await
api
.
getDetail
({
intentionId
:
intentionId
+
''
})
if
(
res
.
success
&&
res
.
rows
.
length
)
{
formStore
.
intentionData
=
res
.
rows
[
0
];
router
.
push
({
name
:
'intention-views-intentionForm'
})
}
}
else
{
router
.
push
({
name
:
'intention-views-intentionForm'
})
}
}
</
script
>
<
style
scoped
lang=
"less"
>
.list {
box-sizing: border-box;
height: calc(100vh - var(--van-nav-bar-height));
display: flex;
flex-direction: column;
justify-content: space-between;
padding-top: 8px;
padding-bottom: 10px;
}
.scroll {
box-sizing: border-box;
height: 100%;
overflow-y: auto;
}
</
style
>
<route>
{
meta: {
title: '融资意向'
}
}
</route>
<
template
>
<div
class=
"container"
>
<NavBar
title=
"融资意向"
left-arrow
@
click-left=
"goBack"
/>
<section
class=
"list"
>
<PullRefresh
v-model=
"refreshing"
@
refresh=
"getList"
class=
"scroll"
>
<List
:finished=
"finished"
finished-text=
"没有更多了"
>
<Empty
v-if=
"!listValue.length"
description=
"无记录"
/>
<ListItem
v-for=
"item in listValue"
:other_title=
"item.other_title"
:title=
"item.title"
:values=
"item.values"
@
click=
"jump(item.intentionId)"
/>
</List>
</PullRefresh>
</section>
<Plus
@
click=
"jump('')"
/>
</div>
</
template
>
<
script
setup
>
import
{
goBack
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Empty
}
from
"vant"
;
import
ListItem
from
'@/components/ListItem.vue'
import
Plus
from
'@/components/Plus.vue'
import
api
from
"../api"
;
import
{
useRouter
}
from
"vue-router"
;
import
{
useIntention
}
from
'../store/index'
import
{
currency
}
from
'@/utils/textFormat'
const
formStore
=
useIntention
()
const
listValue
=
$ref
([])
const
getList
=
async
()
=>
{
let
res
=
await
api
.
getlist
()
if
(
res
.
success
&&
res
.
rows
.
length
)
{
listValue
=
res
.
rows
.
map
(
item
=>
{
return
{
title
:
item
.
intentionNumber
,
other_title
:
item
.
creationDate
.
split
(
' '
)[
0
],
values
:
[[
"合同金额"
,
"状态"
],
[
"¥ "
+
(
currency
(
item
.
contractAmount
)
||
'0.00'
),
item
.
intentionStatusN
]],
intentionId
:
item
.
intentionId
}
})
}
else
{
listValue
=
[]
}
refreshing
=
false
;
}
getList
()
const
refreshing
=
$ref
(
true
);
const
finished
=
$ref
(
true
);
const
router
=
useRouter
();
const
jump
=
async
(
intentionId
=
''
)
=>
{
if
(
intentionId
)
{
let
res
=
await
api
.
getDetail
({
intentionId
:
intentionId
+
''
})
if
(
res
.
success
&&
res
.
rows
.
length
)
{
formStore
.
intentionData
=
res
.
rows
[
0
];
router
.
push
({
name
:
'intention-views-intentionForm'
})
}
}
else
{
router
.
push
({
name
:
'intention-views-intentionForm'
})
}
}
</
script
>
<
style
scoped
lang=
"less"
>
.list {
box-sizing: border-box;
height: calc(100vh - var(--van-nav-bar-height));
display: flex;
flex-direction: column;
justify-content: space-between;
padding-top: 8px;
padding-bottom: 10px;
}
.scroll {
box-sizing: border-box;
height: 100%;
overflow-y: auto;
}
</
style
>
<route>
{
meta: {
title: '融资意向'
}
}
</route>
src/modules/repayPlan/views/index.vue
View file @
9ed4a7ea
<
template
>
<div
class=
"container"
>
<NavBar
title=
"还款计划"
left-arrow
@
click-left=
"goBack"
/>
<section
class=
"list"
>
<Search
v-model=
"searchVal"
placeholder=
"请输入项目编号/融资金额"
/>
<Notice
detail=
"只可对已关联的项目还款"
/>
<PullRefresh
v-model=
"refreshing"
@
refresh=
"getList"
class=
"scroll"
>
<List
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"loadApproval"
>
<ListItem
v-for=
"item in listValue"
:other_title=
"item.other_title"
:title=
"item.title"
:values=
"item.values"
@
click=
"jump"
/>
</List>
</PullRefresh>
</section>
</div>
</
template
>
<
script
setup
>
import
{
goBack
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Search
}
from
"vant"
;
import
Notice
from
'@/components/Notice.vue'
import
ListItem
from
'@/components/ListItem.vue'
import
api
from
"../api"
;
import
{
useRouter
}
from
"vue-router"
;
const
searchVal
=
$ref
(
''
);
let
listValue
=
$ref
([
// {
// title: '202204-DB001-001',
// other_title: "2022-07-18",
// values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
// },
// {
// title: '202204-DB001-001',
// other_title: "2022-07-18",
// values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
// },
])
let
refreshing
=
$ref
(
true
);
const
finished
=
$ref
(
true
);
const
getList
=
async
()
=>
{
// 下拉重置参数,重新加载
let
res
=
await
api
.
getRepayPlantList
({
userId
:
window
.
localStorage
.
getItem
(
'userId'
)});
let
list
=
[]
if
(
res
.
success
){
list
=
res
.
rows
.
map
(
item
=>
({
...
item
,
title
:
item
.
contractNumber
,
other_title
:
item
.
applyDate
?.
split
(
' '
)[
0
],
values
:
[[
"剩余应还金额"
,
"状态"
,
"融资金额"
],
[
item
.
residueAmount
,
item
.
contractStatusN
,
item
.
financeAmount
]]
}))
}
else
{
list
=
[];
}
listValue
=
list
;
refreshing
=
false
;
};
getList
();
const
loadApproval
=
()
=>
{
}
const
router
=
useRouter
();
const
jump
=
()
=>
{
router
.
push
({
name
:
'repayPlan-views-plan'
})
}
</
script
>
<
style
scoped
lang=
"less"
>
.list {
box-sizing: border-box;
height: calc(100vh - var(--van-nav-bar-height));
display: flex;
flex-direction: column;
justify-content: space-between;
padding-bottom: 10px;
}
.scroll {
box-sizing: border-box;
height: calc(100vh - 30vw);
overflow-y: auto;
}
</
style
>
<route>
{
meta: {
title: '还款计划查询'
}
}
</route>
<
template
>
<div
class=
"container"
>
<NavBar
title=
"还款计划"
left-arrow
@
click-left=
"goBack"
/>
<section
class=
"list"
>
<Search
v-model=
"searchVal"
placeholder=
"请输入项目编号/融资金额"
/>
<Notice
detail=
"只可对已关联的项目还款"
/>
<PullRefresh
v-model=
"refreshing"
@
refresh=
"getList"
class=
"scroll"
>
<List
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"loadApproval"
>
<ListItem
v-for=
"item in listValue"
:other_title=
"item.other_title"
:title=
"item.title"
:values=
"item.values"
@
click=
"jump"
/>
</List>
</PullRefresh>
</section>
</div>
</
template
>
<
script
setup
>
import
{
goBack
}
from
"@/utils/globalFun"
import
{
NavBar
,
List
,
PullRefresh
,
Search
}
from
"vant"
;
import
Notice
from
'@/components/Notice.vue'
import
ListItem
from
'@/components/ListItem.vue'
import
api
from
"../api"
;
import
{
useRouter
}
from
"vue-router"
;
import
{
currency
}
from
'@/utils/textFormat'
const
searchVal
=
$ref
(
''
);
let
listValue
=
$ref
([
// {
// title: '202204-DB001-001',
// other_title: "2022-07-18",
// values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
// },
// {
// title: '202204-DB001-001',
// other_title: "2022-07-18",
// values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
// },
])
let
refreshing
=
$ref
(
true
);
const
finished
=
$ref
(
true
);
const
getList
=
async
()
=>
{
// 下拉重置参数,重新加载
let
res
=
await
api
.
getRepayPlantList
({
userId
:
window
.
localStorage
.
getItem
(
'userId'
)});
let
list
=
[]
if
(
res
.
success
){
list
=
res
.
rows
.
map
(
item
=>
({
...
item
,
title
:
item
.
contractNumber
,
other_title
:
item
.
applyDate
?.
split
(
' '
)[
0
],
values
:
[[
"剩余应还金额"
,
"状态"
,
"融资金额"
],
[
currency
(
item
.
residueAmount
),
item
.
contractStatusN
,
currency
(
item
.
financeAmount
)]]
}))
}
else
{
list
=
[];
}
listValue
=
list
;
refreshing
=
false
;
};
getList
();
const
loadApproval
=
()
=>
{
}
const
router
=
useRouter
();
const
jump
=
()
=>
{
router
.
push
({
name
:
'repayPlan-views-plan'
})
}
</
script
>
<
style
scoped
lang=
"less"
>
.list {
box-sizing: border-box;
height: calc(100vh - var(--van-nav-bar-height));
display: flex;
flex-direction: column;
justify-content: space-between;
padding-bottom: 10px;
}
.scroll {
box-sizing: border-box;
height: calc(100vh - 30vw);
overflow-y: auto;
}
</
style
>
<route>
{
meta: {
title: '还款计划查询'
}
}
</route>
src/modules/repayPlan/views/plan.vue
View file @
9ed4a7ea
<
template
>
<RepayPlan
navTitle=
"还款计划"
:currencyObj=
"currencyObj"
>
<template
#
list
>
<div
class=
"repay_list"
>
<div
class=
"left"
>
<div
class=
"times-box"
v-for=
"i in currencyObj.times"
>
<div
class=
"times"
>
{{
i
}}
期
</div>
</div>
</div>
<div
class=
"right"
>
<div
class=
"item"
v-for=
"item in cashflow"
>
<div
class=
"left-item"
>
<span>
租金
</span>
<span>
{{
item
.
chargeDueDate
}}
</span>
</div>
<div
class=
"center-item"
>
<p>
<span>
应付
金额
</span>
<span>
¥9,000.00
</span>
</p>
<p>
<span>
待付
金额
</span>
<span>
¥0.00
</span>
</p>
</div>
<div
class=
"right-item"
>
<span>
明细
</span>
<span
class=
"flag-button overtime"
>
<Icon
style=
"margin-right: 1px;"
name=
"info-o"
/>
{{
item
.
writeOffFlagN
}}
</span>
</div>
</div>
</div>
</div>
</
template
>
<
template
#
footer
>
</
template
>
</RepayPlan>
</template>
<
script
setup
>
import
RepayPlan
from
'@/components/RepayPlan.vue'
import
{
Icon
}
from
'vant'
import
{
useRoute
}
from
'vue-router'
import
api
from
"../api"
;
let
currencyObj
=
$ref
({
// financingCurrency: '200,000.00',
// headerCurrency: '5,000.00',
// fristCurrency: '10,000.00',
// times: '12'
})
let
cashflow
=
[]
//writeOffFlag: "NOT"
// writeOffFlagN: "待付"
const
getRepayPlanInfo
=
async
()
=>
{
const
result
=
await
api
.
getRepaymentDetails
({
"contractId"
:
"777"
})
if
(
result
.
message
===
'请求成功'
){
const
rows
=
result
.
rows
[
0
];
currencyObj
=
{
financingCurrency
:
rows
.
financeAmount
,
headerCurrency
:
rows
.
firstGold
,
fristCurrency
:
rows
.
firstRentGold
,
times
:
rows
.
cashflow
.
length
}
// rows.cashflow = rows.cashflow.map(item => { item.chargeDueDate = item.chargeDueDate.split(" ")[0]; return item })
cashflow
=
rows
.
cashflow
console
.
log
(
cashflow
);
}
}
getRepayPlanInfo
()
</
script
>
<
style
lang=
"less"
scoped
>
@lineColr: #dcdddf;
.repay_list {
display: flex;
width: 100%;
height: 98%;
overflow-y: auto;
scrollbar-width: none;
/* firefox */
}
.repay_list::-webkit-scrollbar {
display: none;
/* Chrome Safari */
}
@leftW: 45px;
.left {
flex: 0 1 @leftW;
}
.times-box {
display: flex;
height: 100px;
flex-direction: column;
justify-content: center;
background-image: linear-gradient(@lineColr 0%, @lineColr 16%, transparent 16%, transparent 33%, @lineColr 33%, @lineColr 83%, transparent 83%, transparent 100%);
/* 35%设置虚线点y轴上的长度 */
background-position: 50% 50%;
/* right配置右边框位置的虚线 */
background-size: 1px 20px;
/* 第一个参数设置虚线点x轴上的长度;第二个参数设置虚线点的间距 */
background-repeat: repeat-y;
}
.times-box:nth-child(1) {
margin-top: 25px;
height: 70px;
justify-content: flex-start;
}
.times-box:nth-last-child(1) {
// bottom: 80px;
height: 70px;
justify-content: flex-end;
}
.times {
height: @leftW;
width: @leftW;
display: flex;
justify-content: center;
line-height: @leftW;
color: #fff;
background-color: #019ae5;
border-radius: 5px;
}
.right {
flex: 1 0 auto;
padding-left: 20px;
}
.item {
display: flex;
justify-content: space-around;
box-sizing: border-box;
margin-top: 15px;
margin-bottom: 30px;
width: 98%;
height: 70px;
border: 1px solid #dedede;
background-color: #eef5fd;
border-radius: 5px;
padding: 10px 5px 3px 10px;
font-size: 13px;
&>div {
display: flex;
flex-direction: column;
justify-content: space-around;
}
}
.left-item {
flex: 1 0 30%;
span:nth-child(1) {
font-weight: 600;
}
span:nth-child(2) {
color: gray;
}
}
.center-item {
flex: 1 0 45%;
p {
color: gray;
display: flex;
justify-content: space-between;
span:nth-child(2) {
font-weight: 600;
}
}
&>p:nth-child(1) span:nth-child(2) {
color: #019ae5;
}
}
.right-item {
flex: 1 0 25%;
text-align: center;
span:nth-child(1) {
color: #019ae5;
}
span:nth-child(2) {
color: gray;
}
}
.flag-button {
display: flex;
justify-content: center;
align-items: center;
width: 80%;
margin: 0 auto;
height: 40%;
border-radius: 10px;
font-size: 12px;
}
.overtime {
background-color: #eeeeee;
color: orange !important;
border: 1px solid #e2e3e4;
}
.nopay {
background-color: #bec2c5;
color: white !important;
border: 1px solid #bec2c5;
}
.pay {
background-color: #f0f0f0;
color: gray !important;
border: 1px solid #eaeaea;
}
</
style
>
<
template
>
<RepayPlan
navTitle=
"还款计划"
:currencyObj=
"currencyObj"
>
<template
#
list
>
<div
class=
"repay_list"
>
<div
class=
"left"
>
<div
class=
"times-box"
v-for=
"i in currencyObj.times"
>
<div
class=
"times"
>
{{
i
}}
期
</div>
</div>
</div>
<div
class=
"right"
>
<div
class=
"item"
v-for=
"item in cashflow"
>
<div
class=
"left-item"
>
<span>
租金
</span>
<span>
{{
item
.
chargeDueDate
}}
</span>
</div>
<div
class=
"center-item"
>
<p>
<span>
应付
</span>
<span>
¥9,000.00
</span>
</p>
<p>
<span>
待付
</span>
<span>
¥0.00
</span>
</p>
</div>
<div
class=
"right-item"
>
<span>
明细
</span>
<span
class=
"flag-button overtime"
>
<Icon
style=
"margin-right: 1px;"
name=
"info-o"
/>
{{
item
.
writeOffFlagN
}}
</span>
</div>
</div>
</div>
</div>
</
template
>
<
template
#
footer
>
</
template
>
</RepayPlan>
</template>
<
script
setup
>
import
RepayPlan
from
'@/components/RepayPlan.vue'
import
{
Icon
}
from
'vant'
import
{
useRoute
}
from
'vue-router'
import
api
from
"../api"
;
let
currencyObj
=
$ref
({
// financingCurrency: '200,000.00',
// headerCurrency: '5,000.00',
// fristCurrency: '10,000.00',
// times: '12'
})
let
cashflow
=
[]
//writeOffFlag: "NOT"
// writeOffFlagN: "待付"
const
getRepayPlanInfo
=
async
()
=>
{
const
result
=
await
api
.
getRepaymentDetails
({
"contractId"
:
"777"
})
if
(
result
.
message
===
'请求成功'
){
const
rows
=
result
.
rows
[
0
];
currencyObj
=
{
financingCurrency
:
rows
.
financeAmount
,
headerCurrency
:
rows
.
firstGold
,
fristCurrency
:
rows
.
firstRentGold
,
times
:
rows
.
cashflow
.
length
}
// rows.cashflow = rows.cashflow.map(item => { item.chargeDueDate = item.chargeDueDate.split(" ")[0]; return item })
cashflow
=
rows
.
cashflow
console
.
log
(
cashflow
);
}
}
getRepayPlanInfo
()
</
script
>
<
style
lang=
"less"
scoped
>
@lineColr: #dcdddf;
.repay_list {
display: flex;
width: 100%;
height: 98%;
overflow-y: auto;
scrollbar-width: none;
/* firefox */
}
.repay_list::-webkit-scrollbar {
display: none;
/* Chrome Safari */
}
@leftW: 45px;
.left {
flex: 0 1 @leftW;
}
.times-box {
display: flex;
height: 100px;
flex-direction: column;
justify-content: center;
background-image: linear-gradient(@lineColr 0%, @lineColr 16%, transparent 16%, transparent 33%, @lineColr 33%, @lineColr 83%, transparent 83%, transparent 100%);
/* 35%设置虚线点y轴上的长度 */
background-position: 50% 50%;
/* right配置右边框位置的虚线 */
background-size: 1px 20px;
/* 第一个参数设置虚线点x轴上的长度;第二个参数设置虚线点的间距 */
background-repeat: repeat-y;
}
.times-box:nth-child(1) {
margin-top: 25px;
height: 70px;
justify-content: flex-start;
}
.times-box:nth-last-child(1) {
// bottom: 80px;
height: 70px;
justify-content: flex-end;
}
.times {
height: @leftW;
width: @leftW;
display: flex;
justify-content: center;
line-height: @leftW;
color: #fff;
background-color: #019ae5;
border-radius: 5px;
}
.right {
flex: 1 0 auto;
padding-left: 20px;
}
.item {
display: flex;
justify-content: space-around;
box-sizing: border-box;
margin-top: 15px;
margin-bottom: 30px;
width: 98%;
height: 70px;
border: 1px solid #dedede;
background-color: #eef5fd;
border-radius: 5px;
padding: 10px 5px 3px 10px;
font-size: 13px;
&>div {
display: flex;
flex-direction: column;
justify-content: space-around;
}
}
.left-item {
flex: 1 0 30%;
span:nth-child(1) {
font-weight: 600;
}
span:nth-child(2) {
color: gray;
}
}
.center-item {
flex: 1 0 45%;
p {
color: gray;
display: flex;
justify-content: space-between;
span:nth-child(2) {
font-weight: 600;
}
}
&>p:nth-child(1) span:nth-child(2) {
color: #019ae5;
}
}
.right-item {
flex: 1 0 25%;
text-align: center;
span:nth-child(1) {
color: #019ae5;
}
span:nth-child(2) {
color: gray;
}
}
.flag-button {
display: flex;
justify-content: center;
align-items: center;
width: 80%;
margin: 0 auto;
height: 40%;
border-radius: 10px;
font-size: 12px;
}
.overtime {
background-color: #eeeeee;
color: orange !important;
border: 1px solid #e2e3e4;
}
.nopay {
background-color: #bec2c5;
color: white !important;
border: 1px solid #bec2c5;
}
.pay {
background-color: #f0f0f0;
color: gray !important;
border: 1px solid #eaeaea;
}
</
style
>
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