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 8f58bfc8
authored
Dec 15, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复
1 parent
8d94f76a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
31 deletions
src/views/storeCredit/add.vue
src/views/storeCredit/components/detailDialog.vue
src/views/storeCredit/index.vue
src/views/storeCredit/add.vue
View file @
8f58bfc
...
...
@@ -76,17 +76,19 @@
>
下载模板
<
/a
>
<
/div
>
<
template
v
-
if
=
"importObject.detailList"
>
<
div
class
=
"file-info flex"
>
<
template
v
-
if
=
"importObject.name"
>
<
div
class
=
"file-info flex"
>
<
div
class
=
"el-icon-success"
><
/div
>
文件格式正确(
{{
importObject
.
name
}}
)
<
/template
>
<
/div
>
<
/template
>
<
div
class
=
"table-box"
>
<
div
class
=
"table"
>
<
GLTable
:
tableData
=
"importObject.detailList"
:
tableParams
=
"tableParams"
:
hasPage
=
"false"
ref
=
"listRef"
>
<
template
slot
=
"cashBackValue"
...
...
@@ -191,6 +193,7 @@
<
/template
>
<
/template
>
<
/GLTable
>
<
/div
>
<
div
class
=
"total"
:
key
=
"totalKey"
...
...
@@ -257,10 +260,6 @@ import NP from 'number-precision'
import
selectStore
from
'./components/selectStore'
import
pointsConfig
from
'./components/pointsConfig.vue'
import
importErrDialog
from
'./components/importErrDialog.vue'
let
chargeObject
=
{
gasCardServiceCharge
:
0
,
passageServiceCharge
:
0
}
export
default
{
components
:
{
selectStore
,
...
...
@@ -324,9 +323,9 @@ export default {
name
:
'passageServiceCharge'
,
formatter
:
(
cell
)
=>
{
const
{
passageService
}
=
cell
,
{
passageServiceCharge
}
=
chargeObject
,
{
passageServiceCharge
}
=
this
.
chargeObject
,
passageSum
=
passageService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
sum
=
NP
.
times
(
passageSum
,
NP
.
divide
(
passageServiceCharge
,
100
)
).
toFixed
(
2
)
sum
=
NP
.
times
(
passageSum
,
passageServiceCharge
,
0.01
).
toFixed
(
2
)
return
`${passageSum
}
*${passageServiceCharge
}
%=${sum
}
`
}
}
,
...
...
@@ -335,9 +334,9 @@ export default {
name
:
'gasCardServiceCharge'
,
formatter
:
(
cell
)
=>
{
const
{
gasService
}
=
cell
,
{
gasCardServiceCharge
}
=
chargeObject
,
{
gasCardServiceCharge
}
=
this
.
chargeObject
,
gasCardSum
=
gasService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
sum
=
NP
.
times
(
gasCardSum
,
NP
.
divide
(
gasCardServiceCharge
,
100
)
).
toFixed
(
2
)
sum
=
NP
.
times
(
gasCardSum
,
gasCardServiceCharge
,
0.01
).
toFixed
(
2
)
return
`${gasCardSum
}
*${gasCardServiceCharge
}
%=${sum
}
`
}
}
,
...
...
@@ -346,9 +345,9 @@ export default {
name
:
'sum'
,
formatter
:
(
cell
)
=>
{
const
{
total
,
gasService
,
passageService
}
=
cell
,
{
gasCardServiceCharge
,
passageServiceCharge
}
=
chargeObject
,
gasPrice
=
NP
.
times
(
gasService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
NP
.
divide
(
gasCardServiceCharge
,
100
)
),
passagePrice
=
NP
.
times
(
passageService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
NP
.
divide
(
passageServiceCharge
,
100
)
),
{
gasCardServiceCharge
,
passageServiceCharge
}
=
this
.
chargeObject
,
gasPrice
=
NP
.
times
(
gasService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
gasCardServiceCharge
,
0.01
),
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
)
...
...
@@ -360,7 +359,7 @@ export default {
{
label
:
'保单号'
,
prop
:
'policyNo'
,
minWidth
:
1
00
minWidth
:
2
00
}
,
{
label
:
'用户姓名'
,
...
...
@@ -370,7 +369,7 @@ export default {
{
label
:
'身份证号'
,
prop
:
'idCardNo'
,
minWidth
:
1
00
minWidth
:
2
00
}
,
{
label
:
'用户手机号'
,
...
...
@@ -379,13 +378,13 @@ export default {
}
,
{
label
:
'返现金额'
,
minWidth
:
200
,
minWidth
:
128
,
addHtml
:
'cashBackValue'
,
}
,
{
label
:
'商品兑换积分'
,
addHtml
:
'buyValue'
,
minWidth
:
200
minWidth
:
128
}
,
{
label
:
'赠送油券'
,
...
...
@@ -414,7 +413,7 @@ export default {
{
label
:
'商户名称'
,
prop
:
'merchantName'
,
minWidth
:
1
00
minWidth
:
3
00
}
,
]
}
,
...
...
@@ -429,6 +428,10 @@ export default {
disabled
:
false
,
batchNo
:
''
,
status
:
''
}
,
chargeObject
:
{
gasCardServiceCharge
:
0
,
passageServiceCharge
:
0
}
}
}
,
...
...
@@ -462,6 +465,7 @@ export default {
detailList
}
this
.
loading
=
false
this
.
setTableHeight
(
detailList
)
}
catch
(
error
)
{
this
.
loading
=
false
setTimeout
(()
=>
this
.
$router
.
go
(
-
1
),
1
e3
)
...
...
@@ -534,12 +538,14 @@ export default {
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
async
event
=>
{
this
.
loading
=
true
this
.
$refs
.
file
.
value
=
''
const
imgFile
=
event
.
target
.
result
,
[,
arrBase64
]
=
imgFile
.
split
(
','
),
splitStr
=
file
.
name
.
split
(
'.'
),
fileUrl
=
splitStr
.
at
(
-
1
)
+
'@'
+
arrBase64
,
{
code
,
message
,
data
}
=
await
this
.
$apis
.
points
.
importCustomerIntegral
({
file
:
fileUrl
}
)
this
.
loading
=
false
if
(
code
==
0
)
{
const
{
importStatue
,
detailList
,
...
...
@@ -560,6 +566,7 @@ export default {
}
)
this
.
totalForm
.
customerTotal
=
detailList
.
length
this
.
validateField
(
'table'
)
this
.
setTableHeight
(
detailList
)
}
else
this
.
importObj
=
{
errorCount
,
errorUrl
,
...
...
@@ -567,14 +574,25 @@ export default {
show
:
true
}
}
else
th
row
message
||
''
else
th
is
.
$message
.
error
(
message
)
}
}
catch
(
error
)
{
this
.
loading
=
false
this
.
$refs
.
file
.
value
=
''
if
(
error
)
this
.
$message
.
error
(
error
)
}
}
,
setTableHeight
(
detailList
=
[])
{
const
{
listRef
}
=
this
.
$refs
if
(
listRef
)
{
let
length
=
detailList
.
length
listRef
.
tableHeightValues
=
`${(length > 10 ? 10 : length) * 56 + 48
}
px`
}
else
setTimeout
(()
=>
{
this
.
setTableHeight
(
detailList
)
}
,
100
)
}
,
// 选择门店
handleRelateStoreClose
()
{
this
.
relateStoreVisible
=
false
...
...
@@ -592,10 +610,12 @@ export default {
if
(
res
)
{
this
.
totalFormData
.
map
(
e
=>
{
if
([
'gasCardServiceCharge'
,
'passageServiceCharge'
].
includes
(
e
.
name
))
{
e
.
label
=
e
.
label
.
replace
(
/
\d
+/g
,
res
[
e
.
name
]
||
0
)
chargeObject
[
e
.
name
]
=
res
[
e
.
name
]
||
0
const
val
=
res
[
e
.
name
]
||
0
e
.
label
=
e
.
label
.
replace
(
/
\d
+/g
,
val
)
this
.
chargeObject
[
e
.
name
]
=
val
}
}
)
console
.
log
(
this
.
totalFormData
)
this
.
updateView
()
}
}
catch
(
error
)
{
...
...
@@ -775,20 +795,24 @@ export default {
margin
-
top
:
10
px
;
}
.
file
-
info
{
height
:
32
px
;
height
:
20
px
;
font
-
size
:
14
px
;
color
:
#
999999
;
align
-
items
:
center
;
margin
-
top
:
10
px
;
.
el
-
icon
-
success
{
color
:
#
67
c23a
;
line
-
height
:
32
px
;
line
-
height
:
20
px
;
margin
-
right
:
4
px
;
}
}
.
table
-
box
{
width
:
864
px
;
min
-
width
:
864
px
;
max
-
width
:
calc
(
100
vw
-
446
px
);
background
:
#
f9f9f9
;
border
-
radius
:
4
px
;
padding
:
20
px
;
margin
-
top
:
10
px
;
/deep/
.
el
-
input
{
width
:
100
%
;
}
...
...
src/views/storeCredit/components/detailDialog.vue
View file @
8f58bfc
...
...
@@ -94,7 +94,7 @@ export default {
{
label
:
'保单号'
,
prop
:
'policyNo'
,
minWidth
:
1
00
minWidth
:
2
00
},
{
label
:
'用户姓名'
,
...
...
@@ -103,7 +103,7 @@ export default {
},
{
label
:
'身份证号'
,
minWidth
:
1
00
,
minWidth
:
2
00
,
prop
:
'idCardNo'
,
},
{
...
...
@@ -150,7 +150,7 @@ export default {
methods
:
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
this
.
searchForm
.
batchNo
=
this
.
detailObj
.
batchNo
this
.
searchForm
.
recordId
=
this
.
detailObj
.
recordId
this
.
loading
=
false
resolve
()
})
...
...
src/views/storeCredit/index.vue
View file @
8f58bfc
...
...
@@ -13,8 +13,9 @@
type=
"default"
plain
@
click=
"jump"
size=
"small"
>
门店客户积分充值
</el-button>
<el-button
@
click=
"handleExport"
>
导出
<el-button
@
click=
"handleExport"
size=
"small"
>
导出
</el-button>
</div>
<div
class=
"tabelList"
>
...
...
@@ -31,7 +32,7 @@
>
<div
class=
"link"
@
click=
"openDetail(scope.scope.
batchNo
)"
@
click=
"openDetail(scope.scope.
id
)"
>
{{
scope
.
scope
.
customerNumber
}}
</div>
</
template
>
<
template
...
...
@@ -282,10 +283,10 @@ export default {
}
}
)
}
,
openDetail
(
batchNo
)
{
openDetail
(
recordId
)
{
this
.
detailObj
=
{
show
:
true
,
batchNo
recordId
}
}
,
editForm
(
row
,
type
=
''
)
{
...
...
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