Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-app-operator-master
Commits
21d16e8f
Commit
21d16e8f
authored
Aug 28, 2024
by
chenwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
member system status control
parent
9337fa34
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
506 additions
and
496 deletions
+506
-496
memberManagement.js
src/api/ecw/memberManagement.js
+147
-130
en_US.json
src/i18n/languages/en_US.json
+3
-2
index.vue
src/views/ecw/giftManagement/index.vue
+157
-180
index.vue
src/views/ecw/memberManagement/integrationRule/index.vue
+199
-184
No files found.
src/api/ecw/memberManagement.js
View file @
21d16e8f
import
request
from
"
@/utils/request
"
;
//操作积分
import
request
from
'
@/utils/request
'
//
操作积分
export
function
operateMemberScore
(
data
)
{
return
request
({
url
:
"
/member/user-score/operate
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/member/user-score/operate
'
,
method
:
'
post
'
,
data
:
data
})
}
//积分记录分页
//
积分记录分页
export
function
queryMemberScoreRecord
(
data
)
{
return
request
({
url
:
"
/member/user-score-log/page
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/member/user-score-log/page
'
,
method
:
'
post
'
,
data
:
data
})
}
//兑换记录分页
//
兑换记录分页
export
function
queryMemberExchangeRecord
(
data
)
{
return
request
({
url
:
"
/reward/redeem/record/page
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/reward/redeem/record/page
'
,
method
:
'
post
'
,
data
:
data
})
}
//批量核销按钮
//
批量核销按钮
export
function
batchVerifyAPI
(
data
)
{
return
request
({
url
:
"
/reward/redeem/record/batch/verify
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/reward/redeem/record/batch/verify
'
,
method
:
'
post
'
,
data
:
data
})
}
//兑换记录导出
//
兑换记录导出
export
function
batchRecordExport
(
data
)
{
return
request
({
url
:
"
/reward/redeem/record/export
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/reward/redeem/record/export
'
,
method
:
'
post
'
,
data
:
data
})
}
//兑换记录导入
//
兑换记录导入
export
function
batchRecordImport
(
data
)
{
return
request
({
url
:
"
/reward/redeem/record/import
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/reward/redeem/record/import
'
,
method
:
'
post
'
,
data
:
data
})
}
//兑换记录导入模板下载
//
兑换记录导入模板下载
export
function
batchRecordImportTemplate
()
{
return
request
({
url
:
"
/reward/redeem/record/import/template
"
,
method
:
"
post
"
,
responseType
:
"
blob
"
,
})
;
url
:
'
/reward/redeem/record/import/template
'
,
method
:
'
post
'
,
responseType
:
'
blob
'
})
}
//撤销 操作
//
撤销 操作
export
function
rewardCancelQuery
(
data
)
{
return
request
({
url
:
"
/reward/redeem/record/cancel
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/reward/redeem/record/cancel
'
,
method
:
'
post
'
,
data
:
data
})
}
//获取记录详情
//
获取记录详情
export
function
getRewardDetailQuery
(
data
)
{
return
request
({
url
:
"
/reward/redeem/record/detail
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/reward/redeem/record/detail
'
,
method
:
'
post
'
,
data
:
data
})
}
//更新兑换记录
//
更新兑换记录
export
function
updatedRewardsDetails
(
data
)
{
return
request
({
url
:
"
/reward/redeem/record/update
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/reward/redeem/record/update
'
,
method
:
'
post
'
,
data
:
data
})
}
//核销回退
//
核销回退
export
function
verifyRollback
(
data
)
{
return
request
({
url
:
"
/reward/redeem/record/verify-back
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/reward/redeem/record/verify-back
'
,
method
:
'
post
'
,
data
:
data
})
}
//核销 操作
//
核销 操作
export
function
verifyRedeem
(
data
)
{
return
request
({
url
:
"
/reward/redeem/record/verify
"
,
method
:
"
post
"
,
data
:
data
,
})
;
url
:
'
/reward/redeem/record/verify
'
,
method
:
'
post
'
,
data
:
data
})
}
//获取积分规则记录
//
获取积分规则记录
export
function
getScoreRecordList
(
data
)
{
return
request
({
url
:
"
/member/score-rule/page
"
,
method
:
"
post
"
,
url
:
'
/member/score-rule/page
'
,
method
:
'
post
'
,
params
:
{
page
:
data
.
page
,
rows
:
data
.
rows
,
rows
:
data
.
rows
},
data
,
})
;
data
})
}
//会员积分等级列表
//
会员积分等级列表
export
function
getMemberLevelList
(
data
)
{
return
request
({
url
:
"
/member/user-level/page
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/user-level/page
'
,
method
:
'
post
'
,
data
})
}
//新增会员等级设置
//
新增会员等级设置
export
function
addNewMemberLevel
(
data
)
{
return
request
({
url
:
"
/member/user-level/add
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/user-level/add
'
,
method
:
'
post
'
,
data
})
}
//删除会员等级
//
删除会员等级
export
function
delMemberLevel
(
data
)
{
return
request
({
url
:
"
/member/user-level/delete
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/user-level/delete
'
,
method
:
'
post
'
,
data
})
}
//edit member level
//
edit member level
export
function
editMemberLevel
(
data
)
{
return
request
({
url
:
"
/member/user-level/update
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/user-level/update
'
,
method
:
'
post
'
,
data
})
}
//获得目的国、目的城市、目的仓列表
//
获得目的国、目的城市、目的仓列表
export
function
getRegionTreeList
()
{
return
request
({
url
:
"
/member/score-rule/warehouse-tree-region-list
"
,
method
:
"
get
"
,
})
;
url
:
'
/member/score-rule/warehouse-tree-region-list
'
,
method
:
'
get
'
})
}
//获取渠道列表
//
获取渠道列表
export
function
getChannelList
()
{
return
request
({
url
:
"
/ecw/channel/list-all-simple
"
,
method
:
"
get
"
,
})
;
url
:
'
/ecw/channel/list-all-simple
'
,
method
:
'
get
'
})
}
//积分规则创建
//
积分规则创建
export
function
createIntegralRule
(
data
)
{
return
request
({
url
:
"
/member/score-rule/create
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/score-rule/create
'
,
method
:
'
post
'
,
data
})
}
//启用关闭 积分规则
//
启用关闭 积分规则
export
function
integralRuleStatus
(
data
)
{
return
request
({
url
:
"
/member/score-rule/status
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/score-rule/status
'
,
method
:
'
post
'
,
data
})
}
//复制积分规则
//
复制积分规则
export
function
integralRuleCopy
(
data
)
{
return
request
({
url
:
"
/member/score-rule/copy
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/score-rule/copy
'
,
method
:
'
post
'
,
data
})
}
//延期积分规则
//
延期积分规则
export
function
integralRuleDelay
(
data
)
{
return
request
({
url
:
"
/member/score-rule/delay
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/score-rule/delay
'
,
method
:
'
post
'
,
data
})
}
//删除积分规则
//
删除积分规则
export
function
integralRuleDelete
(
data
)
{
return
request
({
url
:
"
/member/score-rule/delete
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/score-rule/delete
'
,
method
:
'
post
'
,
data
})
}
//获取积分规则详情
//
获取积分规则详情
export
function
integralRuleDetails
(
data
)
{
return
request
({
url
:
"
/member/score-rule/get
"
,
method
:
"
post
"
,
data
,
})
;
url
:
'
/member/score-rule/get
'
,
method
:
'
post
'
,
data
})
}
//编辑积分规则
//
编辑积分规则
export
function
integralRuleUpdated
(
data
)
{
return
request
({
url
:
"
/member/score-rule/update
"
,
method
:
"
post
"
,
data
,
});
url
:
'
/member/score-rule/update
'
,
method
:
'
post
'
,
data
})
}
// 获取会员功能开关
export
function
switchRuleGet
()
{
return
request
({
url
:
'
/member/score-rule/switch/get
'
,
method
:
'
get
'
})
}
// 设置会员工能开关
export
function
switchRuleSet
(
data
)
{
return
request
({
url
:
'
/member/score-rule/switch/set
'
,
method
:
'
post
'
,
data
})
}
src/i18n/languages/en_US.json
View file @
21d16e8f
...
...
@@ -4689,6 +4689,7 @@
"发货评估"
:
"Delivery evaluation"
,
"财务资料"
:
"Finance Information"
,
"特殊设置"
:
"Special setting"
,
"已卸柜/已到仓时间"
:
"Unloaded/arrived Time"
"已卸柜/已到仓时间"
:
"Unloaded/arrived Time"
,
"开启会员积分系统"
:
"Enable member points system"
,
"是否确认{val}会员积分系统"
:
"Confirm whether to {val} the member points system"
}
src/views/ecw/giftManagement/index.vue
View file @
21d16e8f
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams
"
v-show=
"showSearch
"
ref=
"queryForm"
:model=
"queryParams"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
:label=
"$t('礼品名称')"
>
...
...
@@ -13,40 +13,38 @@
v-model.trim=
"queryParams.title"
:placeholder=
"$t('请输入礼品名称')"
clearable
@
keyup.enter.native=
"handleQuery"
onkeyup=
"this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item
:label=
"$t('兑换积分')"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"8"
>
<dict-selector
v-model=
"queryParams.pointsRequireSymbol"
clearable
:type=
"DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model=
"queryParams.pointsRequireSymbol"
@
change=
"handleQuery"
>
</dict-selector>
/>
</el-col>
<el-col
:span=
"16"
>
<el-input
v-model.trim=
"queryParams.pointsRequire"
:placeholder=
"$t('请输入数字')"
clearable
@
keyup.enter.native=
"handleQuery"
onkeyup=
"this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@
keyup.enter.native=
"handleQuery"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item
:label=
"$t('领取方式')"
prop=
"level"
>
<dict-selector
v-model=
"queryParams.pickMethod"
clearable
:type=
"DICT_TYPE.WAY_OF_RECEIVING"
v-model=
"queryParams.pickMethod"
@
change=
"handleQuery"
>
</dict-selector>
/>
</el-form-item>
<el-form-item
:label=
"$t('兑换网点')"
prop=
"level"
>
...
...
@@ -68,50 +66,48 @@
<el-form-item
:label=
"$t('状态')"
prop=
"level"
>
<dict-selector
v-model=
"queryParams.status"
clearable
:type=
"DICT_TYPE.GIFT_STATUS"
v-model=
"queryParams.status"
@
change=
"handleQuery"
>
</dict-selector>
/>
</el-form-item>
<el-form-item
:label=
"$t('备注')"
prop=
"level"
>
<el-input
v-model.trim=
"queryParams.remark"
:placeholder=
"$t('请输入备注')"
clearable
@
keyup.enter.native=
"handleQuery"
onkeyup=
"this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item
:label=
"$t('剩余数量')"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"8"
>
<dict-selector
v-model=
"queryParams.quantityRemainSymbol"
clearable
:type=
"DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model=
"queryParams.quantityRemainSymbol"
@
change=
"handleQuery"
>
</dict-selector>
/>
</el-col>
<el-col
:span=
"16"
>
<el-input
v-model.trim=
"queryParams.quantityRemain"
:placeholder=
"$t('请输入数字')"
clearable
@
keyup.enter.native=
"handleQuery"
onkeyup=
"this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@
keyup.enter.native=
"handleQuery"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item
:label=
"$t('创建时间')"
>
<el-date-picker
v-model=
"dateRangeCreateTime"
type=
"datetimerange"
clearable
placement=
"bottom-start"
v-model=
"dateRangeCreateTime"
style=
"width: 240px"
value-format=
"yyyy-MM-dd HH:mm:ss"
range-separator=
"-"
...
...
@@ -130,17 +126,13 @@
</el-form>
<el-row
class=
"mb8"
>
<el-button
v-hasPermi=
"['ecw:giftManagement:add']"
type=
"success"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"handleAddReward"
v-hasPermi=
"['ecw:giftManagement:add']"
>
{{
$t
(
"
添加礼品
"
)
}}
</el-button
>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
>
{{
$t
(
"
添加礼品
"
)
}}
</el-button>
<right-toolbar
:show-search.sync=
"showSearch"
@
queryTable=
"getList"
/>
</el-row>
<!-- 礼品列表 -->
<el-table
ref=
"multipleTable"
v-loading=
"loading"
:data=
"list"
>
...
...
@@ -149,7 +141,7 @@
:label=
"$t('礼品ID')"
align=
"center"
prop=
"code"
></el-table-column
>
/
>
<el-table-column
:label=
"$t('礼品名称')"
align=
"center"
>
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleView(scope.row)"
>
{{
...
...
@@ -162,31 +154,27 @@
<el-image
:src=
"firstImg(isChinese ? scope.row.imgZh : scope.row.imgEn)"
style=
"width: 50px; height: 50px"
>
{{
$t
(
"
无
"
)
}}
</el-image
>
>
{{
$t
(
"
无
"
)
}}
</el-image>
</
template
>
</el-table-column>
<el-table-column
width=
"100"
:label=
"$t('开始日期')"
>
<
template
v-slo
t=
"{ row }"
>
<
template
#defaul
t
="{
row
}"
>
{{
parseTime
(
row
.
startTime
,
"
{y
}
-{m
}
-{d
}
"
)
||
"
/
"
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
width
=
"
100
"
:
label
=
"
$t('结束日期')
"
>
<
template
v
-
slo
t
=
"
{ row
}
"
>
<
template
#
defaul
t
=
"
{ row
}
"
>
{{
parseTime
(
row
.
endTime
,
"
{y
}
-{m
}
-{d
}
"
)
||
"
/
"
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
:
label
=
"
$t('兑换积分')
"
prop
=
"
pointsRequire
"
><
/el-table-column
>
<
el
-
table
-
column
:
label
=
"
$t('兑换积分')
"
prop
=
"
pointsRequire
"
/>
<
el
-
table
-
column
:
label
=
"
$t('领取方式')
"
align
=
"
center
"
prop
=
"
pickMethod
"
>
<
template
v
-
slo
t
=
"
{ row
}
"
>
<
template
#
defaul
t
=
"
{ row
}
"
>
{{
handlePickMethod
(
row
.
pickMethod
)
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
:
label
=
"
$t('兑换网点')
"
align
=
"
center
"
>
<
template
v
-
slo
t
=
"
{ row
}
"
>
<
template
#
defaul
t
=
"
{ row
}
"
>
{{
isChinese
?
handleExchangeNodeId
(
row
.
nodeId
).
titleZh
...
...
@@ -198,7 +186,7 @@
:
label
=
"
$t('允许兑换次数')
"
align
=
"
center
"
prop
=
"
allowCount
"
><
/el-table-column
>
/
>
<
el
-
table
-
column
:
label
=
"
$t('状态')
"
>
<
template
slot
-
scope
=
"
{ row
}
"
>
{{
...
...
@@ -232,15 +220,14 @@
<
el
-
button
type
=
"
text
"
@
click
=
"
$router.push('/memberManagement/exchangeRecord')
"
>
{{
scope
.
row
.
exchangeCount
}}
<
/el-butto
n
>
>
{{
scope
.
row
.
exchangeCount
}}
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
:
label
=
"
$t('剩余次数')
"
align
=
"
center
"
prop
=
"
quantityRemain
"
><
/el-table-column
>
/
>
<
el
-
table
-
column
width
=
"
220px
"
align
=
"
center
"
...
...
@@ -249,74 +236,66 @@
>
<
template
slot
-
scope
=
"
scope
"
>
<
el
-
button
v
-
hasPermi
=
"
['ecw:giftManagement:check']
"
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-view
"
@
click
=
"
handleView(scope.row)
"
v
-
hasPermi
=
"
['ecw:giftManagement:check']
"
>
{{
$t
(
"
查看
"
)
}}
<
/el-butto
n
>
>
{{
$t
(
"
查看
"
)
}}
<
/el-button
>
<
el
-
button
v
-
hasPermi
=
"
['ecw:giftManagement:close']
"
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-edit
"
:
disabled
=
"
scope.row.status == '2' || scope.row.status == '3'
"
@
click
=
"
handleCloseStatus(scope.row)
"
:
disabled
=
"
scope.row.status == '2'
"
v
-
hasPermi
=
"
['ecw:giftManagement:close']
"
>
{{
$t
(
"
关闭
"
)
}}
<
/el-butto
n
>
>
{{
$t
(
"
关闭
"
)
}}
<
/el-button
>
<
el
-
button
v
-
hasPermi
=
"
['ecw:giftManagement:copy']
"
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-edit
"
@
click
=
"
copyRewards(scope.row)
"
v
-
hasPermi
=
"
['ecw:giftManagement:copy']
"
>
{{
$t
(
"
复制
"
)
}}
<
/el-butto
n
>
>
{{
$t
(
"
复制
"
)
}}
<
/el-button
>
<
el
-
button
v
-
hasPermi
=
"
['ecw:giftManagement:postpone']
"
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-edit
"
@
click
=
"
handlePostpone(scope.row)
"
:
disabled
=
"
scope.row.status != '1'
"
v
-
hasPermi
=
"
['ecw:giftManagement:postpone']
"
>
{{
$t
(
"
延期
"
)
}}
<
/el-butto
n
>
@
click
=
"
handlePostpone(scope.row)
"
>
{{
$t
(
"
延期
"
)
}}
<
/el-button
>
<
el
-
button
v
-
hasPermi
=
"
['ecw:giftManagement:delete']
"
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-delete
"
@
click
=
"
handleDelete(scope.row)
"
:
disabled
=
"
scope.row.status != '2'
"
v
-
hasPermi
=
"
['ecw:giftManagement:delete']
"
>
{{
$t
(
"
删除
"
)
}}
<
/el-butto
n
>
@
click
=
"
handleDelete(scope.row)
"
>
{{
$t
(
"
删除
"
)
}}
<
/el-button
>
<
el
-
button
size
=
"
mini
"
v
-
has
-
permi
=
"
['ecw:giftManagement:edit']
"
size
=
"
mini
"
type
=
"
text
"
:
disabled
=
"
scope.row.status != '2' && scope.row.status != '1'
"
icon
=
"
el-icon-collection
"
@
click
=
"
editRewards(scope.row)
"
>
{{
$t
(
"
编辑
"
)
}}
<
/el-butto
n
>
>
{{
$t
(
"
编辑
"
)
}}
<
/el-button
>
<
el
-
button
size
=
"
mini
"
v
-
has
-
permi
=
"
['ecw:giftManagement:enable']
"
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-user
"
@
click
=
"
handleLaunchRewards(scope.row)
"
>
{{
$t
(
"
启用
"
)
}}
<
/el-butto
n
>
>
{{
$t
(
"
启用
"
)
}}
<
/el-button
>
<
el
-
button
:
disabled
=
"
scope.row.isInOpenSea
"
v
-
has
-
permi
=
"
['ecw:giftManagement:exchange']
"
:
disabled
=
"
scope.row.isInOpenSea
"
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-user
"
@
click
=
"
handleExchange(scope.row)
"
>
{{
$t
(
"
兑换
"
)
}}
<
/el-butto
n
>
>
{{
$t
(
"
兑换
"
)
}}
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
...
...
@@ -333,11 +312,10 @@
<
operating
-
gift
ref
=
"
operatingGift
"
:
title
=
"
operatingPagetitle
"
:
rewards
D
etails
=
"
rewardsItem
"
:
rewards
-
d
etails
=
"
rewardsItem
"
:
show
.
sync
=
"
dialogVisible
"
:
nodeList
=
"
nodeList
"
>
<
/operating-gift
>
:
node
-
list
=
"
nodeList
"
/>
<
el
-
dialog
:
title
=
"
$t('提示')
"
:
visible
.
sync
=
"
dialogPostponeVisible
"
...
...
@@ -345,14 +323,14 @@
>
<
el
-
row
class
=
"
mb8
"
>
{{
$t
(
"
请选择延期时间
"
)
}}
<
/el-row
>
<
el
-
date
-
picker
v
-
model
=
"
postponeDatetime
"
type
=
"
datetime
"
clearable
v
-
model
=
"
postponeDatetime
"
style
=
"
width: 240px
"
value
-
format
=
"
yyyy-MM-dd HH:mm:ss
"
:
picker
-
options
=
"
pickerOptions
"
:
placeholder
=
"
$t('请选择时间')
"
><
/el-date-picker
>
/
>
<
span
slot
=
"
footer
"
class
=
"
dialog-footer
"
>
<
el
-
button
@
click
=
"
dialogPostponeVisible = false
"
>
{{
$t
(
"
取 消
"
)
...
...
@@ -371,20 +349,21 @@ import {
deleteRewards
,
copyRewardsAPI
,
changeRewardsStatus
,
delayRewards
,
}
from
"
@/api/ecw/giftManagement
"
;
import
{
getDictDatas
,
DICT_TYPE
}
from
"
@/utils/dict
"
;
import
{
parseTime
}
from
"
../../../utils/ruoyi
"
;
import
OperatingGift
from
"
@/views/ecw/giftManagement/components/operatingGift.vue
"
;
import
{
uploadFile
}
from
"
@/api/infra/file
"
;
import
ImageUpload
from
"
@/components/ImageUpload
"
;
delayRewards
}
from
'
@/api/ecw/giftManagement
'
import
{
getDictDatas
,
DICT_TYPE
}
from
'
@/utils/dict
'
import
{
parseTime
}
from
'
../../../utils/ruoyi
'
import
OperatingGift
from
'
@/views/ecw/giftManagement/components/operatingGift.vue
'
import
{
uploadFile
}
from
'
@/api/infra/file
'
import
ImageUpload
from
'
@/components/ImageUpload
'
export
default
{
name
:
"
giftManagementList
"
,
name
:
'
GiftManagementList
'
,
components
:
{
OperatingGift
,
OperatingGift
}
,
data
()
{
return
{
getDictDatas
,
env
:
process
.
env
.
NODE_ENV
,
// 遮罩层
loading
:
true
,
...
...
@@ -397,13 +376,13 @@ export default {
// 礼品列表
list
:
[],
// 弹出层标题
operatingPagetitle
:
""
,
operatingPagetitle
:
''
,
// 是否显示弹出层
dialogVisible
:
false
,
rewardsItem
:
{
}
,
dateRangeCreateTime
:
[],
postponeDatetime
:
""
,
postponeRewardsID
:
""
,
postponeDatetime
:
''
,
postponeRewardsID
:
''
,
dialogPostponeVisible
:
false
,
// 查询参数
queryParams
:
{
...
...
@@ -419,197 +398,195 @@ export default {
quantityRemainSymbol
:
null
,
quantityRemain
:
null
,
beginCreateTime
:
null
,
endCreateTime
:
null
,
endCreateTime
:
null
}
,
// 网点
nodeList
:
[],
pickerOptions
:
{
disabledDate
(
time
)
{
return
time
.
getTime
()
<
Date
.
now
()
-
8.64e7
;
}
,
}
,
}
;
return
time
.
getTime
()
<
Date
.
now
()
-
8.64e7
}
}
}
}
,
computed
:
{
isChinese
()
{
return
this
.
$i18n
.
locale
===
"
zh_CN
"
;
}
,
return
this
.
$i18n
.
locale
===
'
zh_CN
'
}
}
,
created
()
{
this
.
getList
()
;
this
.
getNodeList
()
;
this
.
getList
()
this
.
getNodeList
()
}
,
activated
()
{
this
.
getList
()
;
this
.
getList
()
}
,
methods
:
{
arraysEqual
(
arr1
,
arr2
)
{
return
arr1
.
filter
((
current
)
=>
{
return
arr2
.
find
((
item
)
=>
item
==
current
.
value
.
toString
())
?
true
:
false
;
}
);
return
!!
arr2
.
find
((
item
)
=>
item
==
current
.
value
.
toString
())
}
)
}
,
handleRewardsStatus
(
status
)
{
return
this
.
getDictDatas
(
DICT_TYPE
.
GIFT_STATUS
).
filter
(
(
dicItem
)
=>
dicItem
.
value
.
toString
()
==
status
)[
0
]
;
)[
0
]
}
,
firstImg
(
imgString
)
{
if
(
!
imgString
||
imgString
==
""
)
return
imgString
;
let
imgs
=
imgString
.
split
(
"
,
"
);
return
imgs
.
length
?
imgs
[
0
]
:
null
;
if
(
!
imgString
||
imgString
==
''
)
return
imgString
const
imgs
=
imgString
.
split
(
'
,
'
)
return
imgs
.
length
?
imgs
[
0
]
:
null
}
,
handlePickMethod
(
pickMethod
)
{
let
pickMethodLabel
=
[];
const
pickMethodLabel
=
[]
if
(
this
.
isChinese
)
{
this
.
arraysEqual
(
this
.
getDictDatas
(
DICT_TYPE
.
WAY_OF_RECEIVING
),
pickMethod
.
split
(
"
,
"
)
pickMethod
.
split
(
'
,
'
)
).
forEach
((
element
)
=>
{
pickMethodLabel
.
push
(
element
.
label
)
;
}
)
;
pickMethodLabel
.
push
(
element
.
label
)
}
)
}
else
{
this
.
arraysEqual
(
this
.
getDictDatas
(
DICT_TYPE
.
WAY_OF_RECEIVING
),
pickMethod
.
split
(
"
,
"
)
pickMethod
.
split
(
'
,
'
)
).
forEach
((
element
)
=>
{
pickMethodLabel
.
push
(
element
.
labelEn
)
;
}
)
;
pickMethodLabel
.
push
(
element
.
labelEn
)
}
)
}
return
pickMethodLabel
.
join
()
;
return
pickMethodLabel
.
join
()
}
,
handleExchangeNodeId
(
nodeId
)
{
return
this
.
nodeList
.
filter
((
nodeItem
)
=>
nodeItem
.
id
==
nodeId
)[
0
]
;
return
this
.
nodeList
.
filter
((
nodeItem
)
=>
nodeItem
.
id
==
nodeId
)[
0
]
}
,
handleAddReward
()
{
this
.
rewardsItem
=
{
}
;
this
.
dialogVisible
=
true
;
this
.
operatingPagetitle
=
"
3
"
;
this
.
rewardsItem
=
{
}
this
.
dialogVisible
=
true
this
.
operatingPagetitle
=
'
3
'
}
,
handleExchange
(
row
)
{
this
.
$router
.
push
({
path
:
"
/giftManagement/bulkExchange
"
,
query
:
{
rewardsID
:
row
.
id
}
,
}
)
;
path
:
'
/giftManagement/bulkExchange
'
,
query
:
{
rewardsID
:
row
.
id
}
}
)
}
,
/** 延期按钮操作 */
handlePostpone
(
row
)
{
this
.
postponeRewardsID
=
row
.
id
;
this
.
dialogPostponeVisible
=
true
;
this
.
postponeRewardsID
=
row
.
id
this
.
dialogPostponeVisible
=
true
}
,
confirmPostponeRewards
()
{
this
.
dialogPostponeVisible
=
false
;
this
.
dialogPostponeVisible
=
false
delayRewards
({
id
:
this
.
postponeRewardsID
,
endTime
:
this
.
postponeDatetime
,
endTime
:
this
.
postponeDatetime
}
).
then
((
res
)
=>
{
this
.
getList
()
;
this
.
$message
.
success
(
this
.
$t
(
"
延期成功
"
));
}
)
;
this
.
getList
()
this
.
$message
.
success
(
this
.
$t
(
'
延期成功
'
))
}
)
}
,
/** 关闭按钮操作 */
handleCloseStatus
(
row
)
{
this
.
$confirm
(
this
.
$t
(
"
是否关闭当前礼品?
"
),
this
.
$t
(
"
提示
"
),
{
confirmButtonText
:
this
.
$t
(
"
确定
"
),
cancelButtonText
:
this
.
$t
(
"
取消
"
),
type
:
"
warning
"
,
this
.
$confirm
(
this
.
$t
(
'
是否关闭当前礼品?
'
),
this
.
$t
(
'
提示
'
),
{
confirmButtonText
:
this
.
$t
(
'
确定
'
),
cancelButtonText
:
this
.
$t
(
'
取消
'
),
type
:
'
warning
'
}
)
.
then
((
_
)
=>
{
return
changeRewardsStatus
({
id
:
row
.
id
,
status
:
"
3
"
}
);
return
changeRewardsStatus
({
id
:
row
.
id
,
status
:
'
3
'
}
)
}
)
.
then
((
res
)
=>
{
this
.
getList
()
;
this
.
$message
.
success
(
this
.
$t
(
"
关闭成功
"
));
this
.
getList
()
this
.
$message
.
success
(
this
.
$t
(
'
关闭成功
'
))
}
)
.
catch
((
_
)
=>
{
// this.queryAllData();
}
)
;
}
)
}
,
//启用礼品状态
//
启用礼品状态
handleLaunchRewards
(
row
)
{
this
.
$confirm
(
this
.
$t
(
"
是否启用当前礼品?
"
),
this
.
$t
(
"
提示
"
),
{
confirmButtonText
:
this
.
$t
(
"
确定
"
),
cancelButtonText
:
this
.
$t
(
"
取消
"
),
type
:
"
warning
"
,
this
.
$confirm
(
this
.
$t
(
'
是否启用当前礼品?
'
),
this
.
$t
(
'
提示
'
),
{
confirmButtonText
:
this
.
$t
(
'
确定
'
),
cancelButtonText
:
this
.
$t
(
'
取消
'
),
type
:
'
warning
'
}
)
.
then
(()
=>
{
changeRewardsStatus
({
id
:
row
.
id
,
status
:
"
1
"
}
).
then
((
r
)
=>
{
this
.
$message
.
success
(
this
.
$t
(
"
启用成功
"
));
this
.
getList
()
;
}
)
;
changeRewardsStatus
({
id
:
row
.
id
,
status
:
'
1
'
}
).
then
((
r
)
=>
{
this
.
$message
.
success
(
this
.
$t
(
'
启用成功
'
))
this
.
getList
()
}
)
}
)
.
catch
(()
=>
{
}
)
;
.
catch
(()
=>
{
}
)
}
,
getNodeList
()
{
getNodeList
().
then
((
res
)
=>
{
this
.
nodeList
=
res
.
data
;
}
)
;
this
.
nodeList
=
res
.
data
}
)
}
,
getList
()
{
this
.
loading
=
true
;
this
.
loading
=
true
// 处理查询参数
let
params
=
{
...
this
.
queryParams
}
;
const
params
=
{
...
this
.
queryParams
}
this
.
addBeginAndEndTime
(
params
,
this
.
dateRangeCreateTime
,
"
createTime
"
,
'
createTime
'
,
false
)
;
)
getGiftList
(
params
).
then
((
res
)
=>
{
this
.
loading
=
false
;
this
.
list
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
}
)
;
this
.
loading
=
false
this
.
list
=
res
.
data
.
list
this
.
total
=
res
.
data
.
total
}
)
}
,
// 新增潜在客户
handleAddPotential
()
{
this
.
$refs
.
potentialCustom
.
dialogTableVisible
=
true
;
this
.
$refs
.
potentialCustom
.
dialogTableVisible
=
true
}
,
/** 删除按钮操作 */
handleDelete
(
row
)
{
this
.
$modal
.
confirm
(
this
.
$t
(
"
是否确认删除此礼品
"
))
.
then
(
function
()
{
return
deleteRewards
({
id
:
row
.
id
}
)
;
.
confirm
(
this
.
$t
(
'
是否确认删除此礼品
'
))
.
then
(
function
()
{
return
deleteRewards
({
id
:
row
.
id
}
)
}
)
.
then
(()
=>
{
this
.
getList
()
;
this
.
$modal
.
msgSuccess
(
this
.
$t
(
"
删除成功
"
));
this
.
getList
()
this
.
$modal
.
msgSuccess
(
this
.
$t
(
'
删除成功
'
))
}
)
.
catch
(()
=>
{
}
)
;
.
catch
(()
=>
{
}
)
}
,
/** 搜索按钮操作 */
handleQuery
()
{
this
.
$nextTick
(()
=>
{
this
.
queryParams
.
page
=
1
;
this
.
getList
()
;
}
)
;
this
.
queryParams
.
page
=
1
this
.
getList
()
}
)
}
,
/** 查看按钮操作 */
handleView
(
row
)
{
this
.
dialogVisible
=
true
;
this
.
operatingPagetitle
=
"
1
"
;
this
.
rewardsItem
=
row
;
this
.
dialogVisible
=
true
this
.
operatingPagetitle
=
'
1
'
this
.
rewardsItem
=
row
}
,
/** 编辑按钮操作 */
editRewards
(
row
)
{
this
.
dialogVisible
=
true
;
this
.
operatingPagetitle
=
"
2
"
;
this
.
rewardsItem
=
row
;
this
.
dialogVisible
=
true
this
.
operatingPagetitle
=
'
2
'
this
.
rewardsItem
=
row
}
,
/** 复制按钮操作 */
copyRewards
(
row
)
{
copyRewardsAPI
(
row
.
id
).
then
((
res
)
=>
{
this
.
$modal
.
msgSuccess
(
this
.
$t
(
"
复制成功
"
));
this
.
handleQuery
()
;
}
)
;
this
.
$modal
.
msgSuccess
(
this
.
$t
(
'
复制成功
'
))
this
.
handleQuery
()
}
)
}
,
/** 重置按钮操作 */
resetQuery
()
{
this
.
dateRangeCreateTime
=
[]
;
this
.
dateRangeCreateTime
=
[]
this
.
queryParams
=
{
page
:
1
,
rows
:
10
,
...
...
@@ -625,12 +602,12 @@ export default {
memberCode
:
null
,
memberName
:
null
,
memberMobile
:
null
,
memberAreaCode
:
null
,
}
;
this
.
handleQuery
()
;
}
,
}
,
}
;
memberAreaCode
:
null
}
this
.
handleQuery
()
}
}
}
<
/script
>
<
style
>
.
rewardstToolTip
{
...
...
src/views/ecw/memberManagement/integrationRule/index.vue
View file @
21d16e8f
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams
"
v-show=
"showSearch
"
ref=
"queryForm"
:model=
"queryParams"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
:label=
"$t('指标类型')"
>
<dict-selector
v-model=
"queryParams.type"
clearable
:type=
"DICT_TYPE.SCORE_RULE_TYPE"
v-model=
"queryParams.type"
@
change=
"handleQuery"
>
</dict-selector>
/>
</el-form-item>
<el-form-item
:label=
"$t('标题:')"
>
<el-input
style=
"width: 300px"
v-model.trim=
"queryParams.title"
style=
"width: 300px"
:placeholder=
"$t('请输入查找')"
clearable
@
keyup.enter.native=
"handleQuery"
onkeyup=
"this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item
:label=
"$t('规则说明')"
>
<el-input
style=
"width: 300px"
v-model.trim=
"queryParams.desc"
style=
"width: 300px"
:placeholder=
"$t('请输入关键词查找')"
clearable
@
keyup.enter.native=
"handleQuery"
onkeyup=
"this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item
:label=
"$t('状态')"
>
<dict-selector
v-model=
"queryParams.status"
clearable
:type=
"DICT_TYPE.GIFT_STATUS"
v-model=
"queryParams.status"
>
</dict-selector>
/>
</el-form-item>
<el-form-item
:label=
"$t('单次积分')"
>
<el-row
:gutter=
"10"
style=
"width: 300px"
>
<el-col
:span=
"10"
>
<dict-selector
v-model=
"queryParams.getScoreOnceSymbol"
clearable
:type=
"DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model=
"queryParams.getScoreOnceSymbol"
@
change=
"handleQuery"
>
</dict-selector>
/>
</el-col>
<el-col
:span=
"14"
>
<el-input
v-model.trim=
"queryParams.getScoreOnce"
:placeholder=
"$t('请输入数字')"
clearable
@
keyup.enter.native=
"handleQuery"
onkeyup=
"this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@
keyup.enter.native=
"handleQuery"
/>
</el-col>
</el-row>
...
...
@@ -71,30 +68,29 @@
<el-row
:gutter=
"10"
style=
"width: 300px"
>
<el-col
:span=
"10"
>
<dict-selector
v-model=
"queryParams.maxScoreTotalSymbol"
clearable
:type=
"DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model=
"queryParams.maxScoreTotalSymbol"
@
change=
"handleQuery"
>
</dict-selector>
/>
</el-col>
<el-col
:span=
"14"
>
<el-input
v-model.trim=
"queryParams.maxScoreTotal"
:placeholder=
"$t('请输入数字')"
clearable
@
keyup.enter.native=
"handleQuery"
onkeyup=
"this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@
keyup.enter.native=
"handleQuery"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item
:label=
"$t('创建时间')"
>
<el-date-picker
v-model=
"dateRangeCreateTime"
type=
"datetimerange"
clearable
placement=
"bottom-start"
v-model=
"dateRangeCreateTime"
style=
"width: 240px"
value-format=
"yyyy-MM-dd HH:mm:ss"
range-separator=
"-"
...
...
@@ -112,17 +108,27 @@
</el-form-item>
</el-form>
<el-row
class=
"mb8"
>
<el-button
type=
"success"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"handleNewScoreRule"
>
{{
$t
(
"
添加规则
"
)
}}
</el-button
>
>
{{
$t
(
"
添加规则
"
)
}}
</el-button>
<right-toolbar
:show
S
earch.sync=
"showSearch"
:show
-s
earch.sync=
"showSearch"
@
queryTable=
"handleQueryPagination"
></right-toolbar>
/>
<el-tooltip
v-hasPermi=
"['ecw:memberManagement:enableMemberPointsSystem']"
:content=
"`$
{$t('开启会员积分系统')} : ${switchState} `" placement="top" class="switchBtn">
<el-switch
v-model=
"switchState"
:active-value=
"true"
:inactive-text=
"$t('开启会员积分系统')"
:inactive-value=
"false"
@
change=
"openSwitch($event)"
/>
</el-tooltip>
</el-row>
<el-table
ref=
"multipleTable"
...
...
@@ -142,64 +148,53 @@
:label=
"$t('标题')"
align=
"center"
:prop=
"isChinese ? 'titleZh' : 'titleEn'"
></el-table-column
>
/
>
<el-table-column
:label=
"$t('开始时间')"
align=
"center"
>
<
template
v-slot=
"{ row }"
>
{{
parseTime
(
row
.
startTime
)
||
"
/
"
}}
</
template
>
<
template
#default
="{
row
}"
>
{{
parseTime
(
row
.
startTime
)
||
"
/
"
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('结束时间')"
align=
"center"
>
<
template
v-slot=
"{ row }"
>
{{
parseTime
(
row
.
endTime
)
||
"
/
"
}}
</
template
>
<
template
#default
="{
row
}"
>
{{
parseTime
(
row
.
endTime
)
||
"
/
"
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('单次积分')"
align=
"center"
prop=
"getScoreOnce"
>
</el-table-column>
/>
<el-table-column
:label=
"$t('累计最高积分')"
align=
"center"
prop=
"maxScoreTotal"
>
</el-table-column>
/>
<el-table-column
:label=
"$t('规则说明')"
align=
"center"
:prop=
"isChinese ? 'descZh' : 'descEn'"
>
</el-table-column>
/>
<el-table-column
:label=
"$t('展示平台')"
align=
"center"
>
<
template
v-slot=
"{ row }"
>
{{
handlePlatform
(
row
.
showPlatform
)
||
"
/
"
}}
</
template
>
<
template
#default
="{
row
}"
>
{{
handlePlatform
(
row
.
showPlatform
)
||
"
/
"
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('状态')"
align=
"center"
>
<
template
v-slot=
"{ row }"
>
{{
$l
(
handleStatus
(
row
.
status
),
"
label
"
)
||
"
/
"
}}
</
template
>
<
template
#default
="{
row
}"
>
{{
$l
(
handleStatus
(
row
.
status
),
"
label
"
)
||
"
/
"
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('创建人')"
align=
"center"
prop=
"creator"
>
</el-table-column>
<el-table-column
:label=
"$t('创建人')"
align=
"center"
prop=
"creator"
/>
<el-table-column
:label=
"$t('创建时间')"
align=
"center"
>
<
template
v-slot=
"{ row }"
>
{{
parseTime
(
row
.
createTime
)
||
"
/
"
}}
</
template
>
<
template
#default
="{
row
}"
>
{{
parseTime
(
row
.
createTime
)
||
"
/
"
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('最后更新人')"
align=
"center"
prop=
"updater"
>
</el-table-column>
<el-table-column
:label=
"$t('最后更新人')"
align=
"center"
prop=
"updater"
/>
<el-table-column
:label=
"$t('最后更新时间')"
align=
"center"
>
<
template
v-slot=
"{ row }"
>
{{
parseTime
(
row
.
updateTime
)
||
"
/
"
}}
</
template
>
<
template
#default
="{
row
}"
>
{{
parseTime
(
row
.
updateTime
)
||
"
/
"
}}
</
template
>
</el-table-column>
<el-table-column
width=
"220px"
:label=
"$t('操作')"
align=
"center"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -207,49 +202,42 @@
size=
"mini"
type=
"text"
@
click=
"handleViewDetails(scope.row)"
>
{{
$t
(
"
查看
"
)
}}
</el-button
>
>
{{
$t
(
"
查看
"
)
}}
</el-button>
<el-button
size=
"mini"
type=
"text"
:disabled=
"scope.row.status != '1'"
@
click=
"handleCloseButton(scope.row)"
>
{{
$t
(
"
关闭
"
)
}}
</el-button
>
>
{{
$t
(
"
关闭
"
)
}}
</el-button>
<el-button
size=
"mini"
type=
"text"
@
click=
"handleCopyButton(scope.row)"
>
{{
$t
(
"
复制
"
)
}}
</el-button
>
>
{{
$t
(
"
复制
"
)
}}
</el-button>
<el-button
size=
"mini"
type=
"text"
:disabled=
"scope.row.status != '1'"
@
click=
"handleDelayButton(scope.row)"
>
{{
$t
(
"
延期
"
)
}}
</el-button
>
>
{{
$t
(
"
延期
"
)
}}
</el-button>
<el-button
size=
"mini"
:disabled=
"scope.row.status != '2'"
type=
"text"
@
click=
"handleDelete(scope.row)"
>
{{
$t
(
"
删除
"
)
}}
</el-button
>
>
{{
$t
(
"
删除
"
)
}}
</el-button>
<el-button
size=
"mini"
type=
"text"
:disabled=
"scope.row.status != '2'"
@
click=
"handleUpdate(scope.row)"
>
{{
$t
(
"
编辑
"
)
}}
</el-button
>
>
{{
$t
(
"
编辑
"
)
}}
</el-button>
<el-button
size=
"mini"
type=
"text"
:disabled=
"scope.row.status != '2'"
@
click=
"handleEnabledStatus(scope.row)"
>
{{
$t
(
"
启用
"
)
}}
</el-button
>
>
{{
$t
(
"
启用
"
)
}}
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -268,14 +256,14 @@
>
<el-row
class=
"mb8"
>
{{ $t("请选择延期时间") }}
</el-row>
<el-date-picker
v-model=
"postponeDatetime"
type=
"datetime"
clearable
v-model=
"postponeDatetime"
style=
"width: 240px"
value-format=
"yyyy-MM-dd HH:mm:ss"
:picker-options=
"pickerOptions"
:placeholder=
"$t('请选择时间')"
></el-date-picker
>
/
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogPostponeVisible = false"
>
{{
$t("取 消")
...
...
@@ -288,230 +276,257 @@
</div>
</template>
<
script
>
import
{
getDictDatas
,
DICT_TYPE
}
from
"
@/utils/dict
"
;
import
{
getDictDatas
,
DICT_TYPE
}
from
'
@/utils/dict
'
import
{
getScoreRecordList
,
integralRuleStatus
,
integralRuleCopy
,
integralRuleDelay
,
integralRuleDelete
,
}
from
"
@/api/ecw/memberManagement
"
;
switchRuleSet
,
switchRuleGet
}
from
'
@/api/ecw/memberManagement
'
export
default
{
name
:
"
integralRecord
"
,
name
:
'
IntegralRecord
'
,
data
()
{
return
{
switchState
:
true
,
dateRangeCreateTime
:
[],
total
:
0
,
showSearch
:
true
,
loading
:
true
,
dialogPostponeVisible
:
false
,
integrationRuleList
:
[],
postponeIntegralID
:
""
,
postponeDatetime
:
""
,
postponeIntegralID
:
''
,
postponeDatetime
:
''
,
pickerOptions
:
{
disabledDate
(
time
)
{
return
time
.
getTime
()
<
Date
.
now
()
-
8.64e7
;
}
,
return
time
.
getTime
()
<
Date
.
now
()
-
8.64e7
}
},
queryParams
:
{
type
:
""
,
title
:
""
,
desc
:
""
,
status
:
""
,
getScoreOnceSymbol
:
""
,
getScoreOnce
:
""
,
maxScoreTotalSymbol
:
""
,
maxScoreTotal
:
""
,
type
:
''
,
title
:
''
,
desc
:
''
,
status
:
''
,
getScoreOnceSymbol
:
''
,
getScoreOnce
:
''
,
maxScoreTotalSymbol
:
''
,
maxScoreTotal
:
''
,
page
:
1
,
rows
:
10
,
}
,
}
;
rows
:
10
}
}
},
computed
:
{
isChinese
()
{
return
this
.
$i18n
.
locale
===
"
zh_CN
"
;
}
,
return
this
.
$i18n
.
locale
===
'
zh_CN
'
}
},
created
()
{
this
.
handleQuery
();
this
.
handleQuery
()
this
.
getSwitchRuleStatus
()
},
activated
()
{
this
.
handleQuery
()
;
this
.
handleQuery
()
},
methods
:
{
//编辑操作按钮
openSwitch
(
status
)
{
console
.
log
(
'
9999
'
,
status
)
this
.
$modal
.
confirm
(
this
.
$t
(
'
是否确认{val}会员积分系统
'
,
{
val
:
status
?
this
.
$t
(
'
开启
'
)
:
this
.
$t
(
'
关闭
'
)
}))
.
then
(
async
()
=>
{
// return integralRuleDelete({ id: row.id })
const
{
code
}
=
await
switchRuleSet
({
switchState
:
status
})
if
(
code
===
0
)
{
this
.
$modal
.
msgSuccess
(
this
.
$t
(
'
成功
'
))
}
})
.
catch
(()
=>
{})
},
getSwitchRuleStatus
()
{
switchRuleGet
().
then
(
res
=>
{
this
.
switchState
=
res
.
data
})
},
// 编辑操作按钮
handleUpdate
(
row
)
{
this
.
$router
.
push
({
path
:
"
/memberManagement/addIntegrationRuleOperation
"
,
query
:
{
id
:
row
.
id
,
pageStatus
:
"
edit
"
},
})
;
path
:
'
/memberManagement/addIntegrationRuleOperation
'
,
query
:
{
id
:
row
.
id
,
pageStatus
:
'
edit
'
}
})
},
//查看按钮操作
//
查看按钮操作
handleViewDetails
(
row
)
{
this
.
$router
.
push
({
path
:
"
/memberManagement/addIntegrationRuleOperation
"
,
query
:
{
id
:
row
.
id
,
pageStatus
:
"
view
"
},
})
;
path
:
'
/memberManagement/addIntegrationRuleOperation
'
,
query
:
{
id
:
row
.
id
,
pageStatus
:
'
view
'
}
})
},
//延期按钮操作
//
延期按钮操作
handleDelayButton
(
row
)
{
this
.
postponeIntegralID
=
row
.
id
;
this
.
dialogPostponeVisible
=
true
;
this
.
postponeIntegralID
=
row
.
id
this
.
dialogPostponeVisible
=
true
},
confirmPostponeIntegral
()
{
integralRuleDelay
({
id
:
this
.
postponeIntegralID
,
endTime
:
this
.
postponeDatetime
,
endTime
:
this
.
postponeDatetime
}).
then
((
res
)
=>
{
this
.
postponeDatetime
=
""
;
this
.
$modal
.
msgSuccess
(
this
.
$t
(
"
延期成功
"
));
})
;
this
.
postponeDatetime
=
''
this
.
$modal
.
msgSuccess
(
this
.
$t
(
'
延期成功
'
))
})
},
//删除按钮操作
//
删除按钮操作
handleDelete
(
row
)
{
this
.
$modal
.
confirm
(
this
.
$t
(
"
是否确认删除此礼品规则
"
))
.
then
(
function
()
{
return
integralRuleDelete
({
id
:
row
.
id
})
;
.
confirm
(
this
.
$t
(
'
是否确认删除此礼品规则
'
))
.
then
(
function
()
{
return
integralRuleDelete
({
id
:
row
.
id
})
})
.
then
(()
=>
{
this
.
handleQuery
()
;
this
.
$modal
.
msgSuccess
(
this
.
$t
(
"
删除成功
"
));
this
.
handleQuery
()
this
.
$modal
.
msgSuccess
(
this
.
$t
(
'
删除成功
'
))
})
.
catch
(()
=>
{})
;
.
catch
(()
=>
{})
},
//启用按钮操作
//
启用按钮操作
handleEnabledStatus
(
row
)
{
this
.
$modal
.
confirm
(
this
.
$t
(
"
是否确认启用此礼品规则
"
))
.
then
(
function
()
{
return
integralRuleStatus
({
id
:
row
.
id
,
status
:
"
1
"
});
.
confirm
(
this
.
$t
(
'
是否确认启用此礼品规则
'
))
.
then
(
function
()
{
return
integralRuleStatus
({
id
:
row
.
id
,
status
:
'
1
'
})
})
.
then
(()
=>
{
this
.
handleQuery
()
;
this
.
$modal
.
msgSuccess
(
this
.
$t
(
"
启用成功
"
));
this
.
handleQuery
()
this
.
$modal
.
msgSuccess
(
this
.
$t
(
'
启用成功
'
))
})
.
catch
(()
=>
{})
;
.
catch
(()
=>
{})
},
//复制按钮操作
//
复制按钮操作
handleCopyButton
(
row
)
{
this
.
$modal
.
confirm
(
this
.
$t
(
"
是否确认复制礼品规则
"
))
.
then
(
function
()
{
return
integralRuleCopy
({
id
:
row
.
id
})
;
.
confirm
(
this
.
$t
(
'
是否确认复制礼品规则
'
))
.
then
(
function
()
{
return
integralRuleCopy
({
id
:
row
.
id
})
})
.
then
(()
=>
{
this
.
handleQuery
()
;
this
.
$modal
.
msgSuccess
(
this
.
$t
(
"
复制成功
"
));
this
.
handleQuery
()
this
.
$modal
.
msgSuccess
(
this
.
$t
(
'
复制成功
'
))
})
.
catch
(()
=>
{})
;
.
catch
(()
=>
{})
},
//关闭按钮操作
//
关闭按钮操作
handleCloseButton
(
row
)
{
this
.
$modal
.
confirm
(
this
.
$t
(
"
是否确认关闭此礼品规则
"
))
.
then
(
function
()
{
return
integralRuleStatus
({
id
:
row
.
id
,
status
:
"
3
"
});
.
confirm
(
this
.
$t
(
'
是否确认关闭此礼品规则
'
))
.
then
(
function
()
{
return
integralRuleStatus
({
id
:
row
.
id
,
status
:
'
3
'
})
})
.
then
(()
=>
{
this
.
handleQuery
()
;
this
.
$modal
.
msgSuccess
(
this
.
$t
(
"
关闭成功
"
));
this
.
handleQuery
()
this
.
$modal
.
msgSuccess
(
this
.
$t
(
'
关闭成功
'
))
})
.
catch
(()
=>
{})
;
.
catch
(()
=>
{})
},
// new score rule func
handleNewScoreRule
()
{
this
.
$router
.
push
({
path
:
"
/memberManagement/addIntegrationRuleOperation
"
,
query
:
{
pageStatus
:
"
new
"
},
})
;
path
:
'
/memberManagement/addIntegrationRuleOperation
'
,
query
:
{
pageStatus
:
'
new
'
}
})
},
//积分来源
//
积分来源
handleSourceType
(
id
)
{
return
this
.
getDictDatas
(
DICT_TYPE
.
SCORE_RULE_TYPE
).
filter
(
(
item
)
=>
item
.
value
==
id
)[
0
]
;
)[
0
]
},
// 活动状态
handleStatus
(
id
)
{
return
this
.
getDictDatas
(
DICT_TYPE
.
GIFT_STATUS
).
filter
(
(
item
)
=>
item
.
value
==
id
)[
0
]
;
)[
0
]
},
arraysEqual
(
arr1
,
arr2
)
{
return
arr1
.
filter
((
current
)
=>
{
return
arr2
.
find
((
item
)
=>
item
==
current
.
value
.
toString
())
?
true
:
false
;
});
return
!!
arr2
.
find
((
item
)
=>
item
==
current
.
value
.
toString
())
})
},
//展示平台
//
展示平台
handlePlatform
(
platformId
)
{
let
platformIdLabel
=
[];
const
platformIdLabel
=
[]
if
(
this
.
isChinese
)
{
this
.
arraysEqual
(
this
.
getDictDatas
(
DICT_TYPE
.
PLATFORM_TYPE
),
platformId
.
split
(
"
,
"
)
platformId
.
split
(
'
,
'
)
).
forEach
((
element
)
=>
{
platformIdLabel
.
push
(
element
.
label
)
;
})
;
platformIdLabel
.
push
(
element
.
label
)
})
}
else
{
this
.
arraysEqual
(
this
.
getDictDatas
(
DICT_TYPE
.
PLATFORM_TYPE
),
platformId
.
split
(
"
,
"
)
platformId
.
split
(
'
,
'
)
).
forEach
((
element
)
=>
{
platformIdLabel
.
push
(
element
.
labelEn
)
;
})
;
platformIdLabel
.
push
(
element
.
labelEn
)
})
}
return
platformIdLabel
.
join
()
;
return
platformIdLabel
.
join
()
},
handleQuery
()
{
this
.
queryParams
.
page
=
1
;
let
params
=
{
...
this
.
queryParams
};
this
.
queryParams
.
page
=
1
const
params
=
{
...
this
.
queryParams
}
this
.
addBeginAndEndTime
(
params
,
this
.
dateRangeCreateTime
,
"
createTime
"
,
'
createTime
'
,
false
)
;
)
getScoreRecordList
(
params
).
then
((
res
)
=>
{
this
.
loading
=
false
;
this
.
integrationRuleList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
})
;
this
.
loading
=
false
this
.
integrationRuleList
=
res
.
data
.
list
this
.
total
=
res
.
data
.
total
})
},
handleQueryPagination
()
{
let
params
=
{
...
this
.
queryParams
};
const
params
=
{
...
this
.
queryParams
}
this
.
addBeginAndEndTime
(
params
,
this
.
dateRangeCreateTime
,
"
createTime
"
,
'
createTime
'
,
false
)
;
)
getScoreRecordList
(
params
).
then
((
res
)
=>
{
this
.
loading
=
false
;
this
.
integrationRuleList
=
res
.
data
.
list
;
this
.
total
=
res
.
data
.
total
;
})
;
this
.
loading
=
false
this
.
integrationRuleList
=
res
.
data
.
list
this
.
total
=
res
.
data
.
total
})
},
resetQuery
()
{
this
.
loading
=
true
;
this
.
dateRangeCreateTime
=
[]
;
this
.
loading
=
true
this
.
dateRangeCreateTime
=
[]
this
.
queryParams
=
{
ruleTitle
:
""
,
ruleDesc
:
""
,
key
:
""
,
sourceType
:
""
,
scoreCount
:
""
,
scoreCountOperate
:
""
,
endTime
:
""
,
ruleTitle
:
''
,
ruleDesc
:
''
,
key
:
''
,
sourceType
:
''
,
scoreCount
:
''
,
scoreCountOperate
:
''
,
endTime
:
''
,
pageNo
:
1
,
pageSize
:
10
,
startTime
:
""
,
}
;
this
.
handleQuery
()
;
}
,
}
,
}
;
startTime
:
''
}
this
.
handleQuery
()
}
}
}
</
script
>
<
style
scoped
>
.switchBtn
{
float
:
right
;
padding-right
:
70px
;
padding-top
:
6px
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment