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
7f2b4dfc
Commit
7f2b4dfc
authored
Jul 10, 2023
by
14699
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
融资试算公式调整
parent
172f19b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
detail.vue
src/modules/calculator/views/detail.vue
+16
-4
No files found.
src/modules/calculator/views/detail.vue
View file @
7f2b4dfc
...
...
@@ -157,12 +157,24 @@ const getResult = (formValueObj) => {
let
monthRate
=
contractRate
/
12
;
let
temp
=
(
1
+
monthRate
);
let
cashflow
=
[]
let
outstandingPrincipal
=
financeAmount
;
// 剩余本金
for
(
let
i
=
1
;
i
<=
term
;
i
++
)
{
// 每月应还利息,每月应还本金,月供, 还款日
let
interest
=
(
financeAmount
*
monthRate
*
(
temp
**
term
-
temp
**
(
i
-
1
))
/
(
temp
**
term
-
1
)).
toFixed
(
2
)
let
principal
=
(
financeAmount
*
monthRate
*
temp
**
(
i
-
1
)
/
(
temp
**
term
-
1
)).
toFixed
(
2
)
let
dueAmount
=
(
financeAmount
*
monthRate
*
temp
**
term
/
(
temp
**
term
-
1
)).
toFixed
(
2
)
// let interest = (financeAmount * monthRate * (temp ** term - temp ** (i - 1)) / (temp ** term - 1)).toFixed(2)
// let principal = (financeAmount * monthRate * temp ** (i - 1) / (temp ** term - 1)).toFixed(2)
// let dueAmount = (financeAmount * monthRate * temp ** term / (temp ** term - 1)).toFixed(2)
let
interest
=
(
outstandingPrincipal
*
monthRate
).
toFixed
(
2
)
if
(
i
==
1
){
interest
=
0
;
}
let
dueAmount
=
(
financeAmount
*
monthRate
*
temp
**
(
term
-
1
)
/
(
temp
**
term
-
1
)).
toFixed
(
2
)
let
principal
=
dueAmount
-
interest
if
(
i
==
term
){
principal
=
outstandingPrincipal
interest
=
dueAmount
-
principal
}
outstandingPrincipal
=
outstandingPrincipal
-
principal
let
chargeDueDate
=
moment
(
firstRentDay
).
add
(
i
-
1
,
'month'
).
format
(
'YYYY-MM-DD'
)
cashflow
.
push
({
interest
,
principal
,
dueAmount
,
times
:
i
+
""
,
chargeDueDate
})
}
...
...
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