Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-task
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 b9144992
authored
Dec 09, 2022
by
xuyl
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加防抖
1 parent
2ce9ce8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
41 deletions
src/utils/debounce.js
src/views/profitManagement/profitList/index.vue
src/views/withdrawalManagement/withdrawalList/components/WithdrawalDialog.vue
src/utils/debounce.js
0 → 100644
View file @
b914499
export
default
function
debounce
(
fn
,
delay
)
{
var
t
=
null
return
function
()
{
if
(
t
)
{
clearTimeout
(
t
)
}
t
=
setTimeout
(()
=>
{
fn
.
apply
(
this
,
arguments
)
},
delay
)
}
}
src/views/profitManagement/profitList/index.vue
View file @
b914499
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
</div>
</div>
<span
slot=
'footer'
class=
'dialog-footer'
>
<span
slot=
'footer'
class=
'dialog-footer'
>
<el-button
@
click=
'dialogVisible = false'
>
取 消
</el-button>
<el-button
@
click=
'dialogVisible = false'
>
取 消
</el-button>
<el-button
type=
'primary'
@
click=
'
comfirmDialog
'
<el-button
type=
'primary'
@
click=
'
handleDebounce
'
>
确 定
</el-button
>
确 定
</el-button
>
>
</span>
</span>
...
@@ -63,9 +63,9 @@
...
@@ -63,9 +63,9 @@
<
script
>
<
script
>
import
ProfitSearch
from
'@/views/profitManagement/profitList/cpns/ProfitSearch'
import
ProfitSearch
from
'@/views/profitManagement/profitList/cpns/ProfitSearch'
import
debounce
from
'@/utils/debounce'
import
{
profitApi
}
from
'@/api/profitManagement'
import
{
profitApi
}
from
'@/api/profitManagement'
import
{
withdrawalApi
}
from
'@/api/withdrawalManagement'
export
default
{
export
default
{
name
:
'WithdrawalSearch'
,
name
:
'WithdrawalSearch'
,
...
@@ -85,7 +85,7 @@ export default {
...
@@ -85,7 +85,7 @@ export default {
dialogVisible
:
false
,
dialogVisible
:
false
,
totalScore
:
''
,
totalScore
:
''
,
choiceData
:
[],
choiceData
:
[],
choiceDataBack
:[],
choiceDataBack
:
[],
pageConf
:
{
pageConf
:
{
pageSize
:
'pageSize'
,
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
pageNum
:
'pageNum'
,
...
@@ -154,7 +154,8 @@ export default {
...
@@ -154,7 +154,8 @@ export default {
prop
:
'exchangeStaff'
prop
:
'exchangeStaff'
}
}
]
]
}
},
timeout
:
null
}
}
},
},
methods
:
{
methods
:
{
...
@@ -169,7 +170,7 @@ export default {
...
@@ -169,7 +170,7 @@ export default {
}
}
this
.
verificationWriteOff
=
this
.
choiceData
.
every
(
item
=>
{
this
.
verificationWriteOff
=
this
.
choiceData
.
every
(
item
=>
{
if
(
!
item
.
isWithdrawal
||
item
.
isWithdrawal
==
'1'
||
item
.
exchangeStatus
==
'1'
)
{
if
(
!
item
.
isWithdrawal
||
item
.
isWithdrawal
==
'1'
||
item
.
exchangeStatus
==
'1'
)
{
return
false
return
false
}
else
{
}
else
{
return
true
return
true
}
}
...
@@ -206,23 +207,26 @@ export default {
...
@@ -206,23 +207,26 @@ export default {
return
{
exchangeStatus
,
staffPhone
,
merchantName
,
isWithdrawal
,
rewardScore
,
id
}
return
{
exchangeStatus
,
staffPhone
,
merchantName
,
isWithdrawal
,
rewardScore
,
id
}
})
})
},
},
async
comfirmDialog
()
{
handleDebounce
:
debounce
(
let
arr
=
[]
async
function
(){
this
.
choiceDataBack
&&
this
.
choiceDataBack
.
forEach
(
item
=>
arr
.
push
(
item
.
id
))
let
arr
=
[]
const
params
=
{
idList
:
arr
}
this
.
choiceDataBack
&&
this
.
choiceDataBack
.
forEach
(
item
=>
arr
.
push
(
item
.
id
))
await
profitApi
.
verificationPoints
({
...
params
}).
then
(
res
=>
{
const
params
=
{
idList
:
arr
}
if
(
res
.
code
==
'0'
)
{
await
profitApi
.
verificationPoints
({
...
params
}).
then
(
res
=>
{
this
.
$message
.
success
(
'积分核销成功'
)
if
(
res
.
code
==
'0'
)
{
this
.
dialogVisible
=
false
this
.
$message
.
success
(
'积分核销成功'
)
this
.
$refs
.
profitSearch
.
reset
()
this
.
dialogVisible
=
false
}
else
{
this
.
$refs
.
profitSearch
.
reset
()
this
.
$message
.
error
(
'积分核销失败'
)
}
else
{
}
this
.
$message
.
error
(
'积分核销失败'
)
}).
catch
(
err
=>
{
}
this
.
$message
.
error
(
err
)
}).
catch
(
err
=>
{
})
this
.
$message
.
error
(
err
)
this
.
dialogVisible
=
false
})
},
this
.
dialogVisible
=
false
},
1000
),
// 导出
// 导出
handleOutput
()
{
handleOutput
()
{
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
profitSearchForm
))
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
profitSearchForm
))
...
@@ -262,7 +266,7 @@ export default {
...
@@ -262,7 +266,7 @@ export default {
},
500
)
},
500
)
},
},
reset
()
{
reset
()
{
if
(
this
.
choiceData
){
if
(
this
.
choiceData
)
{
this
.
$refs
.
profitTable
.
mutiSelectArr
.
list
=
[]
this
.
$refs
.
profitTable
.
mutiSelectArr
.
list
=
[]
this
.
$refs
.
profitTable
.
$children
[
0
].
clearSelection
()
this
.
$refs
.
profitTable
.
$children
[
0
].
clearSelection
()
}
}
...
...
src/views/withdrawalManagement/withdrawalList/components/WithdrawalDialog.vue
View file @
b914499
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
v-html=
'textTooltip'
></div>
<div
v-html=
'textTooltip'
></div>
<span
slot=
'footer'
class=
'dialog-footer'
>
<span
slot=
'footer'
class=
'dialog-footer'
>
<el-button
@
click=
'dialogVisible = false'
>
取 消
</el-button>
<el-button
@
click=
'dialogVisible = false'
>
取 消
</el-button>
<el-button
type=
'primary'
@
click=
'
comfirmDialog()
'
<el-button
type=
'primary'
@
click=
'
handleDebounce
'
>
确 定
</el-button
>
确 定
</el-button
>
>
</span>
</span>
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
<
script
>
<
script
>
import
{
withdrawalApi
}
from
'@/api/withdrawalManagement'
import
{
withdrawalApi
}
from
'@/api/withdrawalManagement'
import
debounce
from
'@/utils/debounce'
import
{
profitApi
}
from
'@/api/profitManagement'
export
default
{
export
default
{
name
:
'WithdrawalDialog'
,
name
:
'WithdrawalDialog'
,
...
@@ -22,24 +24,27 @@ export default {
...
@@ -22,24 +24,27 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
async
comfirmDialog
()
{
handleDebounce
:
debounce
(
const
params
=
{
async
function
(){
...
JSON
.
parse
(
JSON
.
stringify
(
const
params
=
{
{
idList
:
this
.
auditId
}
...
JSON
.
parse
(
JSON
.
stringify
(
))
{
idList
:
this
.
auditId
}
}
))
await
withdrawalApi
.
batchWithdrawal
(
params
).
then
(
res
=>
{
if
(
res
.
code
!==
'0'
){
this
.
$message
.
error
(
'审核失败'
)
}
else
{
this
.
$message
.
success
(
'审核成功'
)
}
}
}).
catch
(
err
=>
{
await
withdrawalApi
.
batchWithdrawal
(
params
).
then
(
res
=>
{
this
.
$message
.
error
(
err
)
if
(
res
.
code
!==
'0'
){
}
this
.
$message
.
error
(
'审核失败'
)
)
}
else
{
this
.
dialogVisible
=
false
this
.
$message
.
success
(
'审核成功'
)
}
}
}).
catch
(
err
=>
{
this
.
$message
.
error
(
err
)
}
)
this
.
dialogVisible
=
false
},
1000
),
}
}
}
}
</
script
>
</
script
>
...
...
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