Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-points
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6641eabb
authored
Dec 18, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改样式
1 parent
73eba552
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
src/views/storeCredit/add.vue
src/views/storeCredit/components/detailDialog.vue
src/views/storeCredit/add.vue
View file @
6641eab
...
...
@@ -274,6 +274,11 @@ import NP from 'number-precision'
import
selectStore
from
'./components/selectStore'
import
pointsConfig
from
'./components/pointsConfig.vue'
import
importErrDialog
from
'./components/importErrDialog.vue'
const
truncateDecimal
=
(
number
,
decimalPlaces
=
2
)
=>
{
let
multiplier
=
Math
.
pow
(
10
,
decimalPlaces
),
truncatedNumber
=
Math
.
floor
(
number
*
multiplier
)
/
multiplier
return
truncatedNumber
.
toFixed
(
decimalPlaces
)
}
export
default
{
components
:
{
selectStore
,
...
...
@@ -339,7 +344,7 @@ export default {
const
{
passageService
}
=
cell
,
{
passageServiceCharge
}
=
this
.
chargeObject
,
passageSum
=
passageService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
sum
=
NP
.
times
(
passageSum
,
passageServiceCharge
,
0.01
).
toFixed
(
2
)
sum
=
truncateDecimal
(
NP
.
times
(
passageSum
,
passageServiceCharge
,
0.01
)
)
return
`${passageSum
}
*${passageServiceCharge
}
%=${sum
}
`
}
}
,
...
...
@@ -350,7 +355,7 @@ export default {
const
{
gasService
}
=
cell
,
{
gasCardServiceCharge
}
=
this
.
chargeObject
,
gasCardSum
=
gasService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
sum
=
NP
.
times
(
gasCardSum
,
gasCardServiceCharge
,
0.01
).
toFixed
(
2
)
sum
=
truncateDecimal
(
NP
.
times
(
gasCardSum
,
gasCardServiceCharge
,
0.01
)
)
return
`${gasCardSum
}
*${gasCardServiceCharge
}
%=${sum
}
`
}
}
,
...
...
@@ -364,7 +369,7 @@ export default {
passagePrice
=
NP
.
times
(
passageService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
passageServiceCharge
,
0.01
),
totalPrice
=
total
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
)
return
NP
.
plus
(
gasPrice
,
passagePrice
,
totalPrice
).
toFixed
(
2
)
return
truncateDecimal
(
NP
.
plus
(
gasPrice
,
passagePrice
,
totalPrice
)
)
}
}
,
],
...
...
@@ -402,12 +407,12 @@ export default {
}
,
{
label
:
'赠送油券'
,
minWidth
:
2
0
0
,
minWidth
:
2
6
0
,
addHtml
:
'oilList'
}
,
{
label
:
'赠送自店服务'
,
minWidth
:
2
0
0
,
minWidth
:
2
6
0
,
addHtml
:
'couponList'
}
,
{
...
...
@@ -600,7 +605,7 @@ export default {
setTableHeight
(
detailList
=
[])
{
const
{
listRef
}
=
this
.
$refs
,
{
id
}
=
this
.
pageObject
,
height
=
id
?
56
:
67.39
height
=
id
?
56
:
67.39
if
(
listRef
)
{
let
length
=
detailList
.
length
listRef
.
tableHeightValues
=
`${(length > 10 ? 10 : length) * height + 56
}
px`
...
...
src/views/storeCredit/components/detailDialog.vue
View file @
6641eab
...
...
@@ -133,12 +133,12 @@ export default {
},
{
label
:
'赠送油券'
,
minWidth
:
15
0
,
minWidth
:
26
0
,
addHtml
:
'oilList'
},
{
label
:
'赠送自店服务'
,
minWidth
:
15
0
,
minWidth
:
26
0
,
addHtml
:
'couponList'
},
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment