Commit 20d7095c authored by chenwei's avatar chenwei

Merge branch 'feature/099_customer_filter' into 'dev'

member system status control

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