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 d2324703
authored
Dec 12, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
89ef5ac1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
38 deletions
src/views/storeCredit/add.vue
src/views/storeCredit/components/selectStore.vue
src/views/storeCredit/add.vue
View file @
d232470
...
...
@@ -35,7 +35,7 @@
<
el
-
button
size
=
"small"
@
click
=
"relateStoreVisible = true"
:
disabled
=
"pageObject.
disable
d"
:
disabled
=
"pageObject.
i
d"
>
<
i
class
=
"el-icon-plus"
><
/i
>
选择商户
...
...
@@ -75,13 +75,13 @@
target
=
"_blank"
>
下载模板
<
/a
>
<
/div
>
<
div
class
=
"file-info flex"
>
<
template
v
-
if
=
"importObject.name"
>
<
div
class
=
"el-icon-success"
><
/div
>
文件格式正确(
{{
importObject
.
name
}}
)
<
/template
>
<
/div
>
<
template
v
-
if
=
"importObject.detailList"
>
<
div
class
=
"file-info flex"
>
<
template
v
-
if
=
"importObject.name"
>
<
div
class
=
"el-icon-success"
><
/div
>
文件格式正确(
{{
importObject
.
name
}}
)
<
/template
>
<
/div
>
<
div
class
=
"table-box"
>
<
GLTable
:
tableData
=
"importObject.detailList"
...
...
@@ -95,8 +95,8 @@
<
template
v
-
if
=
"!pageObject.disabled"
>
<
el
-
input
v
-
model
.
number
.
trim
=
"scope.scope.cashBackValue"
:
disabled
=
"pageObject.disabled
"
@
blur
=
"updateTotal(scope.scope, scope.index)
"
@
blur
=
"updateTotal(scope.scope, scope.index, 'cashBackValue')
"
maxLength
=
"6
"
><
/el-input
>
<
/template
>
<
template
v
-
else
>
...
...
@@ -110,7 +110,8 @@
<
template
v
-
if
=
"!pageObject.disabled"
>
<
el
-
input
v
-
model
.
number
.
trim
=
"scope.scope.buyValue"
@
blur
=
"updateTotal(scope.scope, scope.index)"
@
blur
=
"updateTotal(scope.scope, scope.index,'buyValue')"
maxLength
=
"6"
><
/el-input
>
<
/template
>
<
template
v
-
else
>
...
...
@@ -201,7 +202,10 @@
class
=
"item flex"
>
<
div
class
=
"label"
>
{{
i
.
label
}}
:
<
/div
>
<
div
class
=
"value"
>
<
div
class
=
"value"
:
ref
=
"
`value-${index
}
`"
>
<template v-if="
i
.
formatter
"
>
{{
i
.
formatter
(
totalForm
)
}}
<
/template
>
...
...
@@ -234,7 +238,7 @@
<
select
-
store
:
dialogVisible
.
sync
=
"relateStoreVisible"
:
storeSelected
=
"selectedList"
:
merchantInfo
=
"configForm
.merchantId
"
:
merchantInfo
=
"configForm"
@
handleRelateStoreConfirm
=
"handleRelateStoreConfirm"
@
handleRelateStoreClose
=
"handleRelateStoreClose"
/>
...
...
@@ -320,8 +324,10 @@ export default {
name
:
'passageServiceCharge'
,
formatter
:
(
cell
)
=>
{
const
{
passageService
}
=
cell
,
{
passageServiceCharge
}
=
chargeObject
return
NP
.
times
(
passageService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
passageServiceCharge
).
toFixed
(
2
)
{
passageServiceCharge
}
=
chargeObject
,
passageSum
=
passageService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
sum
=
NP
.
times
(
passageSum
,
passageServiceCharge
).
toFixed
(
2
)
return
`${passageSum
}
*${passageServiceCharge
}
%=${sum
}
`
}
}
,
{
...
...
@@ -329,8 +335,10 @@ export default {
name
:
'gasCardServiceCharge'
,
formatter
:
(
cell
)
=>
{
const
{
gasService
}
=
cell
,
{
gasCardServiceCharge
}
=
chargeObject
return
NP
.
times
(
gasService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
gasCardServiceCharge
).
toFixed
(
2
)
{
gasCardServiceCharge
}
=
chargeObject
,
gasCardSum
=
gasService
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
),
sum
=
NP
.
times
(
gasCardSum
,
gasCardServiceCharge
).
toFixed
(
2
)
return
`${gasCardSum
}
*${gasCardServiceCharge
}
%=${sum
}
`
}
}
,
{
...
...
@@ -431,6 +439,7 @@ export default {
methods
:
{
async
getDetail
(
id
,
type
)
{
try
{
this
.
loading
=
true
const
res
=
await
this
.
$apis
.
points
.
getIntegralDetail
({
id
}
),
{
detailList
}
=
res
detailList
.
map
((
row
,
index
)
=>
{
...
...
@@ -452,7 +461,9 @@ export default {
this
.
importObject
=
{
detailList
}
this
.
loading
=
false
}
catch
(
error
)
{
this
.
loading
=
false
setTimeout
(()
=>
this
.
$router
.
go
(
-
1
),
1
e3
)
}
}
,
...
...
@@ -462,11 +473,27 @@ export default {
this
.
$refs
.
fromRef
.
$refs
.
formRef
.
validate
(
async
valid
=>
{
if
(
valid
)
{
try
{
this
.
$loading
()
this
.
loading
=
true
const
{
merchantId
,
merchantName
}
=
this
.
configForm
,
list
=
this
.
importObject
.
detailList
let
detailList
=
[]
list
.
map
(
e
=>
{
let
oilList
=
[],
couponList
=
[]
e
.
oilList
?.
map
(
o
=>
{
oilList
.
push
({
oilCouponId
:
o
.
oilCouponId
,
amount
:
o
.
amount
,
faceValue
:
o
.
faceValue
,
aliasName
:
o
.
aliasName
}
)
}
)
e
.
couponList
?.
map
(
c
=>
{
couponList
.
push
({
couponId
:
c
.
couponId
,
amount
:
c
.
amount
,
couponName
:
c
.
couponName
}
)
}
)
detailList
.
push
({
policyNo
:
e
.
policyNo
,
customerName
:
e
.
customerName
,
...
...
@@ -474,8 +501,8 @@ export default {
idCardNo
:
e
.
idCardNo
,
cashBackValue
:
e
.
cashBackValue
,
buyValue
:
e
.
buyValue
,
oilList
:
e
.
oilList
||
[]
,
couponList
:
e
.
couponList
||
[]
oilList
,
couponList
}
)
}
)
let
params
=
{
...
...
@@ -486,16 +513,16 @@ export default {
if
(
id
)
params
.
id
=
id
const
res
=
await
this
.
$apis
.
points
.
updateCustomerIntegral
(
params
)
if
(
res
)
{
this
.
$loading
().
close
()
this
.
$message
({
message
:
id
?
'编辑成功'
:
'创建成功'
,
type
:
'success'
}
)
setTimeout
(()
=>
this
.
$router
.
go
(
-
1
),
1
e3
)
}
else
throw
'创建失败'
}
this
.
loading
=
false
}
catch
(
error
)
{
this
.
$loading
().
close
()
if
(
error
)
this
.
$message
.
error
(
error
)
this
.
loading
=
false
this
.
$message
.
error
(
error
||
'操作失败'
)
}
}
}
)
...
...
@@ -570,7 +597,7 @@ export default {
chargeObject
[
e
.
name
]
=
val
}
}
)
this
.
totalKey
=
Date
.
no
w
()
this
.
updateVie
w
()
}
}
catch
(
error
)
{
if
(
error
)
this
.
$message
.
error
(
error
)
...
...
@@ -593,7 +620,7 @@ export default {
oilList
&&
oilList
.
map
(
i
=>
total
+=
NP
.
times
((
i
.
amount
||
0
),
(
i
.
faceValue
||
0
)))
row
.
total
=
total
this
.
totalForm
.
total
[
index
]
=
total
this
.
totalKey
=
Date
.
no
w
()
this
.
updateVie
w
()
}
,
changeRowConfig
({
oilList
,
...
...
@@ -612,7 +639,7 @@ export default {
const
{
cashBackValue
,
buyValue
}
=
row
,
passageService
=
NP
.
plus
((
cashBackValue
||
0
),
(
buyValue
||
0
))
this
.
totalForm
.
passageService
[
index
]
=
passageService
this
.
totalKey
=
Date
.
no
w
()
this
.
updateVie
w
()
}
,
setGasService
(
row
,
index
)
{
const
{
oilList
}
=
row
...
...
@@ -621,12 +648,32 @@ export default {
total
+=
NP
.
times
((
i
.
amount
||
0
),
(
i
.
faceValue
||
0
))
}
)
this
.
totalForm
.
gasService
[
index
]
=
total
this
.
totalKey
=
Date
.
no
w
()
this
.
updateVie
w
()
}
,
updateTotal
(
row
,
index
)
{
updateTotal
(
row
,
index
,
key
)
{
if
(
key
&&
!
/^
[
0-9
]\d
*$/
.
test
(
row
[
key
]))
row
[
key
]
=
''
this
.
setRowTotal
(
row
,
index
)
this
.
setPassageService
(
row
,
index
)
this
.
setGasService
(
row
,
index
)
}
,
updateView
()
{
this
.
totalKey
=
Date
.
now
()
const
REF
=
this
.
$refs
,
refLength
=
this
.
totalFormData
.
length
this
.
$nextTick
(()
=>
{
let
widthList
=
[]
for
(
let
i
=
0
;
i
<
refLength
;
i
++
)
{
let
[
item
]
=
REF
[
`value-${i
}
`
]
||
[]
if
(
item
)
widthList
.
push
(
item
.
offsetWidth
)
}
if
(
widthList
.
length
)
{
const
width
=
Math
.
max
.
apply
(
null
,
widthList
)
for
(
let
i
=
0
;
i
<
refLength
;
i
++
)
{
let
[
item
]
=
REF
[
`value-${i
}
`
]
||
[]
if
(
item
)
item
.
style
.
width
=
`${width
}
px`
}
}
}
)
}
}
...
...
@@ -766,6 +813,7 @@ export default {
}
.
value
{
min
-
width
:
90
px
;
color
:
#
333333
;
}
}
}
...
...
src/views/storeCredit/components/selectStore.vue
View file @
d232470
...
...
@@ -159,28 +159,24 @@ export default {
},
methods
:
{
init
()
{
this
.
merchantId
=
this
.
merchantInfo
this
.
merchantId
=
String
(
this
.
merchantInfo
.
merchantId
)
this
.
merchantName
=
this
.
merchantInfo
.
merchantName
this
.
getList
()
},
getList
(
pageCon
)
{
console
.
log
(
pageCon
,
'pageCon'
)
pageCon
&&
(
this
.
pageConfig
=
pageCon
)
var
params
=
{
merchantId
:
this
.
merchantId
,
...
this
.
searchForm
,
...
this
.
pageConfig
}
console
.
log
(
this
.
$apis
)
this
.
$apis
.
common
.
getMerchantList
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
storeList
=
res
.
list
this
.
total
=
res
.
total
let
nowIndex
=
this
.
pageConfig
.
pageSize
*
(
this
.
pageConfig
.
currentPage
-
1
)
console
.
log
(
nowIndex
)
this
.
storeList
.
forEach
((
item
,
index
)
=>
{
item
.
idx
=
index
+
1
+
nowIndex
})
console
.
log
(
this
.
storeList
)
})
},
getTable
()
{
...
...
@@ -192,7 +188,6 @@ export default {
this
.
$refs
.
staffRef
.
tableHeightValues
=
'460px'
},
handleClick
(
val
)
{
console
.
log
(
val
)
this
.
merchantId
=
val
.
merchantNo
this
.
merchantName
=
val
.
merchantName
},
...
...
@@ -204,10 +199,12 @@ export default {
this
.
$emit
(
'handleRelateStoreClose'
)
},
handleConfirm
()
{
this
.
$emit
(
'handleRelateStoreConfirm'
,
{
merchantId
:
this
.
merchantId
,
merchantName
:
this
.
merchantName
const
{
merchantId
,
merchantName
}
=
this
if
(
merchantId
&&
merchantName
)
this
.
$emit
(
'handleRelateStoreConfirm'
,
{
merchantId
,
merchantName
})
else
this
.
handleClose
()
}
}
}
...
...
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