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 356d66c2
authored
Dec 20, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加分页
1 parent
323601ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
34 deletions
src/views/storeCredit/add.vue
src/views/storeCredit/add.vue
View file @
356d66c
...
...
@@ -85,10 +85,13 @@
<
div
class
=
"table-box"
>
<
div
class
=
"table"
>
<
GLTable
:
tableData
=
"importObject.detailList"
:
tableData
=
"importObject.detailList
[pageNum - 1]
"
:
tableParams
=
"tableParams"
:
hasPage
=
"false"
ref
=
"listRef"
:
pageConf
=
"pageConf"
:
tableTotal
=
"totalForm.customerTotal"
:
pageSizes
=
"[50]"
@
refreshTable
=
"refreshTable"
>
<
template
slot
=
"cashBackValue"
...
...
@@ -290,6 +293,7 @@ export default {
return
{
NP
,
loading
:
false
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
}
,
relateStoreVisible
:
false
,
rule
:
{
merchantId
:
[{
required
:
true
,
message
:
'请选择商户'
,
trigger
:
'change'
}
],
...
...
@@ -297,8 +301,10 @@ export default {
required
:
true
,
trigger
:
'change'
,
validator
:
(
rule
,
value
,
callback
)
=>
{
const
{
detailList
}
=
this
.
importObject
if
(
detailList
&&
detailList
.
length
)
{
detailList
.
map
(
e
=>
{
if
(
e
.
cashBackValue
<
1
&&
e
.
buyValue
<
1
)
callback
(
new
Error
(
'返现金额和商品兑换积分二者至少需填写一个正整数的数值'
))
detailList
.
map
(
i
=>
{
i
.
map
(
e
=>
{
if
(
e
.
cashBackValue
<
1
&&
e
.
buyValue
<
1
)
callback
(
new
Error
(
'返现金额和商品兑换积分二者至少需填写一个正整数的数值'
))
}
)
}
)
callback
()
}
else
callback
(
new
Error
(
'请导入充值人群'
))
...
...
@@ -450,7 +456,8 @@ export default {
chargeObject
:
{
gasCardServiceCharge
:
0
,
passageServiceCharge
:
0
}
}
,
pageNum
:
1
}
}
,
mounted
()
{
...
...
@@ -458,6 +465,9 @@ export default {
if
(
id
)
this
.
getDetail
(
id
,
type
)
}
,
methods
:
{
refreshTable
({
pageNum
}
)
{
this
.
pageNum
=
pageNum
}
,
async
getDetail
(
id
,
type
)
{
try
{
this
.
loading
=
true
...
...
@@ -482,10 +492,12 @@ export default {
passageServiceCharge
:
res
.
integralRate
}
)
this
.
totalForm
.
customerTotal
=
detailList
.
length
const
list
=
this
.
splitArray
(
detailList
,
50
)
this
.
importObject
=
{
detailList
detailList
:
list
}
this
.
loading
=
false
this
.
pageNum
=
1
this
.
setTableHeight
(
detailList
)
}
catch
(
error
)
{
this
.
loading
=
false
...
...
@@ -502,32 +514,34 @@ export default {
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
list
.
map
(
i
=>
{
i
.
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
e
.
couponList
?.
map
(
c
=>
{
couponList
.
push
({
couponId
:
c
.
couponId
,
amount
:
c
.
amount
,
couponName
:
c
.
couponName
}
)
}
)
detailList
.
push
({
policyNo
:
e
.
policyNo
,
customerName
:
e
.
customerName
,
customerPhone
:
e
.
customerPhone
,
idCardNo
:
e
.
idCardNo
,
cashBackValue
:
e
.
cashBackValue
||
0
,
buyValue
:
e
.
buyValue
||
0
,
oilList
,
couponList
}
)
}
)
detailList
.
push
({
policyNo
:
e
.
policyNo
,
customerName
:
e
.
customerName
,
customerPhone
:
e
.
customerPhone
,
idCardNo
:
e
.
idCardNo
,
cashBackValue
:
e
.
cashBackValue
||
0
,
buyValue
:
e
.
buyValue
||
0
,
oilList
,
couponList
}
)
}
)
let
params
=
{
...
...
@@ -577,8 +591,9 @@ export default {
detailList
.
map
((
row
,
index
)
=>
{
this
.
updateTotal
(
row
,
index
)
}
)
const
list
=
this
.
splitArray
(
detailList
,
50
)
this
.
importObject
=
{
detailList
,
detailList
:
list
,
name
:
file
.
name
}
this
.
$message
({
...
...
@@ -586,6 +601,7 @@ export default {
type
:
'success'
}
)
this
.
totalForm
.
customerTotal
=
detailList
.
length
this
.
pageNum
=
1
this
.
validateField
(
'table'
)
this
.
setTableHeight
(
detailList
)
}
else
this
.
importObj
=
{
...
...
@@ -605,9 +621,7 @@ export default {
}
}
,
setTableHeight
(
detailList
=
[])
{
const
{
listRef
}
=
this
.
$refs
,
{
id
}
=
this
.
pageObject
,
height
=
id
?
56
:
67.39
const
{
listRef
}
=
this
.
$refs
if
(
listRef
)
{
let
length
=
detailList
.
length
listRef
.
tableHeightValues
=
`${(length > 10 ? 10 : length) * 56 + 56
}
px`
...
...
@@ -722,6 +736,14 @@ export default {
return
name
==
'oilList'
?
`${i.aliasName
}
*${i.amount
}
(${NP.times(i.amount, i.faceValue)
}
积分)`
:
`${i.couponName
}
*${i.amount
}
`
}
)
||
[]
}
,
splitArray
(
arr
,
size
)
{
let
result
=
[],
newArr
=
JSON
.
parse
(
JSON
.
stringify
(
arr
))
for
(
let
i
=
0
;
i
<
newArr
.
length
;
i
+=
size
)
{
result
.
push
(
newArr
.
slice
(
i
,
i
+
size
))
}
return
result
}
}
}
...
...
@@ -873,4 +895,13 @@ export default {
color
:
#
5850
ff
;
cursor
:
pointer
;
}
/deep/
.
el
-
pagination__sizes
{
width
:
88
px
;
.
el
-
select
{
width
:
100
%
;
.
el
-
input
{
width
:
100
%
;
}
}
}
<
/style
>
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