Commit f79cee34 authored by yujinyao's avatar yujinyao

Merge branch 'dev' of...

Merge branch 'dev' of http://110.41.143.128:8081/lanbaoming/jiedao-app-operator-master into yujinyao
parents 12eeb9de 4cf8f700
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"
v-show="showSearch"
:inline="true" :inline="true"
label-width="120px" label-width="120px"
> >
<el-form-item :label="$t('礼品名称')"> <el-form-item :label="$t('礼品名称')">
<el-input <el-input
style="width: 300px"
v-model.trim="queryParams.rewardTitle" v-model.trim="queryParams.rewardTitle"
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.memberName" v-model.trim="queryParams.memberName"
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.redeemType"
clearable clearable
:type="DICT_TYPE.WAY_OF_RECEIVING" :type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="queryParams.redeemType" />
>
</dict-selector>
</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.REWARD_REDEEM_STATUS" :type="DICT_TYPE.REWARD_REDEEM_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.rewardCountOperate"
clearable clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL" :type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.rewardCountOperate"
@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.rewardCount" v-model.trim="queryParams.rewardCount"
: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="-"
...@@ -81,22 +78,21 @@ ...@@ -81,22 +78,21 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('礼品ID')"> <el-form-item :label="$t('礼品ID')">
<el-input <el-input
style="width: 300px"
v-model.trim="queryParams.rewardCode" v-model.trim="queryParams.rewardCode"
style="width: 300px"
:placeholder="$t('请输入礼品ID')" :placeholder="$t('请输入礼品ID')"
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.entrance"
clearable clearable
:type="DICT_TYPE.PLATFORM_TYPE" :type="DICT_TYPE.PLATFORM_TYPE"
v-model="queryParams.entrance"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换网点')"> <el-form-item :label="$t('兑换网点')">
...@@ -126,89 +122,83 @@ ...@@ -126,89 +122,83 @@
</el-form> </el-form>
<el-row class="mb8"> <el-row class="mb8">
<el-button <el-button
v-hasPermi="['ecw:memberManagement:newExchange']"
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
v-hasPermi="['ecw:memberManagement:newExchange']"
@click="handleNewExchange" @click="handleNewExchange"
>{{ $t("新增兑换") }}</el-button >{{ $t("新增兑换") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:batchWriteOff']"
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
v-hasPermi="['ecw:memberManagement:batchWriteOff']"
@click="handleBatchVerify" @click="handleBatchVerify"
>{{ $t("批量核销") }}</el-button >{{ $t("批量核销") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:export']"
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleBatchExport" @click="handleBatchExport"
v-hasPermi="['ecw:memberManagement:export']" >{{ $t("导出") }}</el-button>
>{{ $t("导出") }}</el-button
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:exchangeoInfoImport']"
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleShowFileUploadDialog" @click="handleShowFileUploadDialog"
v-hasPermi="['ecw:memberManagement:exchangeoInfoImport']" >{{ $t("兑换信息导入") }}</el-button>
>{{ $t("兑换信息导入") }}</el-button
>
<right-toolbar <right-toolbar
:showSearch.sync="showSearch" :show-search.sync="showSearch"
@queryTable="handleQueryPagination" @queryTable="handleQueryPagination"
></right-toolbar> />
</el-row> </el-row>
<el-table <el-table
ref="multipleTable" ref="multipleTable"
v-loading="loading" v-loading="loading"
@selection-change="handleSelectionChange"
:data="memberList" :data="memberList"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55"> </el-table-column> <el-table-column type="selection" width="55" />
<el-table-column <el-table-column
width="140" width="140"
:label="$t('兑换记录ID')" :label="$t('兑换记录ID')"
align="center" align="center"
prop="id" prop="id"
></el-table-column> />
<el-table-column <el-table-column
width="140" width="140"
:label="$t('礼品ID')" :label="$t('礼品ID')"
align="center" align="center"
prop="rewardCode" prop="rewardCode"
></el-table-column> />
<el-table-column <el-table-column
:label="$t('礼品名称')" :label="$t('礼品名称')"
align="center" align="center"
:prop="isChinese ? 'rewardTitleZh' : 'rewardTitleEn'" :prop="isChinese ? 'rewardTitleZh' : 'rewardTitleEn'"
></el-table-column> />
<el-table-column :label="$t('会员名称')" align="center"> <el-table-column :label="$t('会员名称')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
<el-button <el-button
type="text" type="text"
@click=" @click="
$router.push('/member/member/member-details/' + row.memberId) $router.push('/member/member/member-details/' + row.memberId)
" "
>{{ isChinese ? row.memberNameZh : row.memberNameEn }}</el-button >{{ isChinese ? row.memberNameZh : row.memberNameEn }}</el-button>
>
</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 }">
{{ parseTime(row.redemptionTime) || "/" }}</template {{ parseTime(row.redemptionTime) || "/" }}</template>
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:label="$t('兑换积分')" :label="$t('兑换积分')"
align="center" align="center"
prop="totalCount" prop="totalCount"
></el-table-column> />
<el-table-column width="140" :label="$t('兑换入口')" align="center"> <el-table-column width="140" :label="$t('兑换入口')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ {{
isChinese isChinese
? handleExchangeEntrance(row.entrance).label ? handleExchangeEntrance(row.entrance).label
...@@ -221,10 +211,9 @@ ...@@ -221,10 +211,9 @@
:label="$t('兑换网点')" :label="$t('兑换网点')"
align="center" align="center"
:prop="isChinese ? 'nodeTitleZh' : 'nodeTitleEn'" :prop="isChinese ? 'nodeTitleZh' : 'nodeTitleEn'"
> />
</el-table-column>
<el-table-column width="140" :label="$t('领取方式')" align="center"> <el-table-column width="140" :label="$t('领取方式')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ {{
isChinese isChinese
? handleExchangeRedeemType(row.redeemType).label ? handleExchangeRedeemType(row.redeemType).label
...@@ -233,7 +222,7 @@ ...@@ -233,7 +222,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="140" :label="$t('状态')" align="center"> <el-table-column width="140" :label="$t('状态')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ {{
isChinese isChinese
? handleExchangeStatus(row.status).label ? handleExchangeStatus(row.status).label
...@@ -246,26 +235,25 @@ ...@@ -246,26 +235,25 @@
:label="$t('备注')" :label="$t('备注')"
align="center" align="center"
prop="remark" prop="remark"
></el-table-column />
>
<el-table-column <el-table-column
width="140" width="140"
:label="$t('数量')" :label="$t('数量')"
align="center" align="center"
prop="rewardCount" prop="rewardCount"
></el-table-column> />
<el-table-column <el-table-column
width="140" width="140"
:label="$t('创建人')" :label="$t('创建人')"
align="center" align="center"
prop="creatorName" prop="creatorName"
></el-table-column> />
<el-table-column <el-table-column
width="140" width="140"
:label="$t('更新人')" :label="$t('更新人')"
align="center" align="center"
prop="updaterName" prop="updaterName"
></el-table-column> />
<el-table-column <el-table-column
width="220px" width="220px"
align="center" align="center"
...@@ -274,49 +262,44 @@ ...@@ -274,49 +262,44 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-hasPermi="['ecw:memberManagement:cancel']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-view" icon="el-icon-view"
@click="handleRewardCancel(scope.row)"
:disabled="scope.row.status != '1'" :disabled="scope.row.status != '1'"
v-hasPermi="['ecw:memberManagement:cancel']" @click="handleRewardCancel(scope.row)"
>{{ $t("撤销") }}</el-button >{{ $t("撤销") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:edit']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleRewardEdit(scope.row)"
:disabled="scope.row.status != '1'" :disabled="scope.row.status != '1'"
v-hasPermi="['ecw:memberManagement:edit']" @click="handleRewardEdit(scope.row)"
>{{ $t("编辑") }}</el-button >{{ $t("编辑") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:view']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleViewRecord(scope.row)" @click="handleViewRecord(scope.row)"
v-hasPermi="['ecw:memberManagement:view']" >{{ $t("查看") }}</el-button>
>{{ $t("查看") }}</el-button
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:verification']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleVerify(scope.row)"
:disabled="scope.row.status != '1'" :disabled="scope.row.status != '1'"
v-hasPermi="['ecw:memberManagement:verification']" @click="handleVerify(scope.row)"
>{{ $t("核销") }}</el-button >{{ $t("核销") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:verificationRollback']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleVerificationRollback(scope.row)"
:disabled="scope.row.status != '2'" :disabled="scope.row.status != '2'"
v-hasPermi="['ecw:memberManagement:verificationRollback']" @click="handleVerificationRollback(scope.row)"
>{{ $t("核销回退") }}</el-button >{{ $t("核销回退") }}</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -349,18 +332,18 @@ ...@@ -349,18 +332,18 @@
:auto-upload="false" :auto-upload="false"
drag drag
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload" />
<div class="el-upload__text"> <div class="el-upload__text">
{{ $t("将文件拖到此处,或") }}<em>{{ $t("点击上传") }}</em> {{ $t("将文件拖到此处,或") }}<em>{{ $t("点击上传") }}</em>
</div> </div>
<div class="el-upload__tip text-center" slot="tip"> <div slot="tip" class="el-upload__tip text-center">
<span>仅允许导入xls、xlsx格式文件。</span> <span>仅允许导入xls、xlsx格式文件。</span>
<el-link <el-link
type="primary" type="primary"
:underline="false" :underline="false"
style="font-size: 12px; vertical-align: baseline" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate" @click="importTemplate"
>{{ $t("下载模板") }} >{{ $t("下载模板") }}
</el-link> </el-link>
</div> </div>
</el-upload> </el-upload>
...@@ -380,8 +363,8 @@ ...@@ -380,8 +363,8 @@
:before-close="handleClose" :before-close="handleClose"
> >
<el-form <el-form
:model="batchVerifyForm"
ref="numberValidateForm" ref="numberValidateForm"
:model="batchVerifyForm"
label-width="100px" label-width="100px"
class="demo-ruleForm" class="demo-ruleForm"
> >
...@@ -393,19 +376,19 @@ ...@@ -393,19 +376,19 @@
<el-input <el-input
v-model.number="batchVerifyForm.verifyUser" v-model.number="batchVerifyForm.verifyUser"
autocomplete="off" autocomplete="off"
></el-input> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('核销时间')" :label="$t('核销时间')"
:rules="[{ required: true, message: $t('核销时间不能为空') }]" :rules="[{ required: true, message: $t('核销时间不能为空') }]"
> >
<el-date-picker <el-date-picker
v-model="batchVerifyForm.verifyTime"
type="date" type="date"
placement="bottom-start" placement="bottom-start"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="$t('选择核销时间')" :placeholder="$t('选择核销时间')"
v-model="batchVerifyForm.verifyTime" />
></el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -434,8 +417,7 @@ ...@@ -434,8 +417,7 @@
:key="item.id" :key="item.id"
:label="isChinese ? item.memberNameZh : item.memberNameEn" :label="isChinese ? item.memberNameZh : item.memberNameEn"
:value="item.id" :value="item.id"
> />
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('操作')"> <el-form-item :label="$t('操作')">
...@@ -444,8 +426,7 @@ ...@@ -444,8 +426,7 @@
v-for="dict in getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE)" v-for="dict in getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE)"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{ $l(dict, "label") }}</el-radio >{{ $l(dict, "label") }}</el-radio>
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('积分')"> <el-form-item :label="$t('积分')">
...@@ -456,7 +437,7 @@ ...@@ -456,7 +437,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('备注')"> <el-form-item :label="$t('备注')">
<el-input type="textarea" v-model="formQuery.comment"></el-input> <el-input v-model="formQuery.comment" type="textarea" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -469,8 +450,8 @@ ...@@ -469,8 +450,8 @@
</div> </div>
</template> </template>
<script> <script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict"; import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import { getNodeList } from "@/api/ecw/giftManagement"; import { getNodeList } from '@/api/ecw/giftManagement'
import { import {
queryMemberExchangeRecord, queryMemberExchangeRecord,
batchVerifyAPI, batchVerifyAPI,
...@@ -478,19 +459,19 @@ import { ...@@ -478,19 +459,19 @@ import {
batchRecordImport, batchRecordImport,
batchRecordImportTemplate, batchRecordImportTemplate,
rewardCancelQuery, rewardCancelQuery,
verifyRollback, verifyRollback
} from "@/api/ecw/memberManagement"; } from '@/api/ecw/memberManagement'
import { getNowDateTime, parseTime } from "@/utils/ruoyi"; import { getNowDateTime, parseTime } from '@/utils/ruoyi'
import { getBaseHeader } from "@/utils/request"; import { getBaseHeader } from '@/utils/request'
export default { export default {
name: "exchangeRecord", name: 'ExchangeRecord',
data() { data() {
return { return {
upload: { upload: {
// 是否显示弹出层(用户导入) // 是否显示弹出层(用户导入)
open: false, open: false,
// 弹出层标题(用户导入) // 弹出层标题(用户导入)
title: this.$t("兑换信息导入"), title: this.$t('兑换信息导入'),
// 是否禁用上传 // 是否禁用上传
isUploading: false, isUploading: false,
// 设置上传的请求头部 // 设置上传的请求头部
...@@ -498,14 +479,14 @@ export default { ...@@ -498,14 +479,14 @@ export default {
// 上传的地址 // 上传的地址
url: url:
process.env.VUE_APP_BASE_API + process.env.VUE_APP_BASE_API +
"/admin-api/reward/redeem/record/import", '/admin-api/reward/redeem/record/import'
}, },
//批量核销 // 批量核销
dialogBatchVerify: false, dialogBatchVerify: false,
batchVerifyForm: { batchVerifyForm: {
ids: [], ids: [],
verifyTime: "", verifyTime: '',
verifyUser: "", verifyUser: ''
}, },
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
...@@ -517,278 +498,278 @@ export default { ...@@ -517,278 +498,278 @@ export default {
dialogVisible: false, dialogVisible: false,
memberList: [], memberList: [],
formQuery: { formQuery: {
comment: "", comment: '',
memberIds: [], memberIds: [],
operateType: null, operateType: null,
scoreCount: null, scoreCount: null
}, },
queryParams: { queryParams: {
rewardTitle: "", rewardTitle: '',
memberName: "", //会员昵称 memberName: '', // 会员昵称
redeemType: "", //兑换方式 redeemType: '', // 兑换方式
status: "", status: '',
rewardCount: "", rewardCount: '',
rewardCountOperate: "", rewardCountOperate: '',
rewardCode: "", rewardCode: '',
entrance: "", //兑换入口 entrance: '', // 兑换入口
startTime: "", startTime: '',
endTime: "", endTime: '',
nodeId: "", nodeId: '',
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10
}, },
// 网点 // 网点
nodeList: [], nodeList: []
}; }
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === 'zh_CN'
}, }
}, },
created() { created() {
this.getNodeListAPI(); this.getNodeListAPI()
this.handleQuery(); this.handleQuery()
}, },
activated() { activated() {
this.handleQuery(); this.handleQuery()
}, },
methods: { methods: {
//核销回退 // 核销回退
handleVerificationRollback(row) { handleVerificationRollback(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(() => {
let params = { const params = {
redeemIds: [row.id], redeemIds: [row.id]
}; }
verifyRollback(params).then((res) => { verifyRollback(params).then((res) => {
this.$message({ this.$message({
type: "success", type: 'success',
message: this.$t("回退成功!"), message: this.$t('回退成功!')
}); })
this.handleQuery(); this.handleQuery()
}); })
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: 'info',
message: this.$t("已取消回退"), message: this.$t('已取消回退')
}); })
}); })
}, },
//核销 // 核销
handleVerify(row) { handleVerify(row) {
this.$router.push({ this.$router.push({
path: "/memberManagement/exchangeRecordOperation", path: '/memberManagement/exchangeRecordOperation',
query: { exchangeRewardID: row.id, pageStatus: "verify" }, query: { exchangeRewardID: row.id, pageStatus: 'verify' }
}); })
}, },
//查看按钮操作 // 查看按钮操作
handleViewRecord(row) { handleViewRecord(row) {
this.$router.push({ this.$router.push({
path: "/memberManagement/exchangeRecordOperation", path: '/memberManagement/exchangeRecordOperation',
query: { exchangeRewardID: row.id, pageStatus: "view" }, query: { exchangeRewardID: row.id, pageStatus: 'view' }
}); })
}, },
//兑换记录编辑操作 // 兑换记录编辑操作
handleRewardEdit(row) { handleRewardEdit(row) {
this.$router.push({ this.$router.push({
path: "/memberManagement/exchangeRecordOperation", path: '/memberManagement/exchangeRecordOperation',
query: { exchangeRewardID: row.id, pageStatus: "edit" }, query: { exchangeRewardID: row.id, pageStatus: 'edit' }
}); })
}, },
//撤销按钮操作 // 撤销按钮操作
handleRewardCancel(row) { handleRewardCancel(row) {
this.$confirm( this.$confirm(
this.$t("此操作积分可能存在到期积分, 撤销后积分将进行扣除,是否继续?"), this.$t('此操作积分可能存在到期积分, 撤销后积分将进行扣除,是否继续?'),
this.$t("提示"), this.$t('提示'),
{ {
confirmButtonText: this.$t("确定"), confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t("取消"), cancelButtonText: this.$t('取消'),
type: "warning", type: 'warning'
} }
) )
.then(() => { .then(() => {
let params = { const params = {
id: row.id, id: row.id
}; }
rewardCancelQuery(params).then((res) => { rewardCancelQuery(params).then((res) => {
this.$message({ this.$message({
type: "success", type: 'success',
message: this.$t("撤销成功!"), message: this.$t('撤销成功!')
}); })
this.handleQuery(); this.handleQuery()
}); })
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: 'info',
message: this.$t("已取消撤销"), message: this.$t('已取消撤销')
}); })
}); })
}, },
//下载导入模板 // 下载导入模板
importTemplate() { importTemplate() {
batchRecordImportTemplate().then((res) => { batchRecordImportTemplate().then((res) => {
this.$download.excel(res, "用户导入模板.xls"); this.$download.excel(res, '用户导入模板.xls')
this.$message({ this.$message({
message: this.$t("下载模板成功"), message: this.$t('下载模板成功'),
type: "success", type: 'success'
}); })
}); })
}, },
//导入 // 导入
handleShowFileUploadDialog() { handleShowFileUploadDialog() {
this.upload.open = true; this.upload.open = true
}, },
handleFileUploadProgress(event, file, fileList) { handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true; this.upload.isUploading = true
}, },
// 文件上传成功处理 // 文件上传成功处理
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
if (response.code == "1001011027") { if (response.code == '1001011027') {
this.$message.error(response.msg); this.$message.error(response.msg)
} }
if ( if (
!response.data.redeemIdFailedMap || !response.data.redeemIdFailedMap ||
JSON.stringify(response.data.redeemIdFailedMap) == "{}" JSON.stringify(response.data.redeemIdFailedMap) == '{}'
) { ) {
this.upload.open = false; this.upload.open = false
this.$modal.msgSuccess(this.$t("导入成功")); this.$modal.msgSuccess(this.$t('导入成功'))
this.handleQuery(); this.$refs.upload.clearFiles()
return; this.upload.isUploading = false
this.handleQuery()
return
} }
this.upload.open = false; this.upload.open = false
this.upload.isUploading = false; this.upload.isUploading = false
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles()
// 拼接提示语 // 拼接提示语
let data = response.data; const data = response.data
let text = `${this.$t("导入失败:")}`; let text = `${this.$t('导入失败:')}`
for (const username in data.redeemIdFailedMap) { for (const username in data.redeemIdFailedMap) {
text += text +=
"<br />&nbsp;&nbsp;&nbsp;&nbsp;" + '<br />&nbsp;&nbsp;&nbsp;&nbsp;' +
username + username +
this.$t("") + this.$t('') +
data.redeemIdFailedMap[username]; data.redeemIdFailedMap[username]
} }
text += `<br />&nbsp;&nbsp;&nbsp;&nbsp;${this.$t("以上数据格式有问题")}`; text += `<br />&nbsp;&nbsp;&nbsp;&nbsp;${this.$t('以上数据格式有问题')}`
this.$alert(text, this.$t("导入结果"), { this.$alert(text, this.$t('导入结果'), {
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true
}); })
}, },
// 提交上传文件 // 提交上传文件
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit()
}, },
//导出 // 导出
handleBatchExport() { handleBatchExport() {
let params = { ...this.queryParams }; const params = { ...this.queryParams }
if (this.dateRangeCreateTime) { if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0]; params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]; params.endTime = this.dateRangeCreateTime[1]
params.pageNo = null;
params.pageSize = null;
} }
batchRecordExport(params).then((res) => { batchRecordExport(params).then((res) => {
this.$message({ this.$message({
message: this.$t("已加入导出队列,请稍后在下载日志中下载"), message: this.$t('已加入导出队列,请稍后在下载日志中下载'),
type: "success", type: 'success'
}); })
}); })
}, },
//批量核销确认按钮 // 批量核销确认按钮
handleBatchVerifySubmit() { handleBatchVerifySubmit() {
this.$confirm(this.$t("确认提交?")) this.$confirm(this.$t('确认提交?'))
.then((_) => { .then((_) => {
let params = { ...this.batchVerifyForm }; const params = { ...this.batchVerifyForm }
batchVerifyAPI(params).then((res) => { batchVerifyAPI(params).then((res) => {
this.dialogBatchVerify = false; this.dialogBatchVerify = false
this.$message({ this.$message({
message: this.$t("核销成功"), message: this.$t('核销成功'),
type: "success", type: 'success'
}); })
}); })
}) })
.catch((_) => {}); .catch((_) => {})
}, },
// 批量核销 // 批量核销
handleBatchVerify() { handleBatchVerify() {
if (this.batchVerifyForm.ids.length > 0) { if (this.batchVerifyForm.ids.length > 0) {
this.dialogBatchVerify = true; this.dialogBatchVerify = true
this.batchVerifyForm.verifyUser = this.$store.getters.name; this.batchVerifyForm.verifyUser = this.$store.getters.name
this.batchVerifyForm.verifyTime = getNowDateTime(); this.batchVerifyForm.verifyTime = getNowDateTime()
} else { } else {
this.$message({ this.$message({
message: this.$t("请先选择兑换记录"), message: this.$t('请先选择兑换记录'),
type: "warning", type: 'warning'
}); })
} }
}, },
// 新增兑换 // 新增兑换
handleNewExchange() { handleNewExchange() {
this.$router.push({ this.$router.push({
path: "/memberManagement/exchangeRecordOperation", path: '/memberManagement/exchangeRecordOperation'
}); })
}, },
getNodeListAPI() { getNodeListAPI() {
getNodeList().then((res) => { getNodeList().then((res) => {
this.nodeList = res.data; this.nodeList = res.data
}); })
}, },
handleExchangeRedeemType(id) { handleExchangeRedeemType(id) {
return this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING).filter( return this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING).filter(
(item) => item.value == id (item) => item.value == id
)[0]; )[0]
}, },
//兑换入口 // 兑换入口
handleExchangeEntrance(id) { handleExchangeEntrance(id) {
return this.getDictDatas(DICT_TYPE.PLATFORM_TYPE).filter( return this.getDictDatas(DICT_TYPE.PLATFORM_TYPE).filter(
(item) => item.value == id (item) => item.value == id
)[0]; )[0]
}, },
//兑换状态 // 兑换状态
handleExchangeStatus(id) { handleExchangeStatus(id) {
return this.getDictDatas(DICT_TYPE.REWARD_REDEEM_STATUS).filter( return this.getDictDatas(DICT_TYPE.REWARD_REDEEM_STATUS).filter(
(item) => item.value == id (item) => item.value == id
)[0]; )[0]
}, },
handleScoreSubmit() { handleScoreSubmit() {
this.$confirm(this.$t("确认提交?")) this.$confirm(this.$t('确认提交?'))
.then((_) => { .then((_) => {
let params = { ...this.formQuery }; const params = { ...this.formQuery }
operateMemberScore(params).then((res) => { operateMemberScore(params).then((res) => {
this.dialogVisible = true; this.dialogVisible = true
this.formQuery = { this.formQuery = {
comment: "", comment: '',
memberIds: [], memberIds: [],
operateType: null, operateType: null,
scoreCount: null, scoreCount: null
}; }
this.selectedMember = []; this.selectedMember = []
this.$message.success(this.$t("操作成功")); this.$message.success(this.$t('操作成功'))
}); })
}) })
.catch((_) => {}); .catch((_) => {})
}, },
handleClose(done) { handleClose(done) {
this.$confirm(this.$t("确认关闭?")) this.$confirm(this.$t('确认关闭?'))
.then((_) => { .then((_) => {
done(); done()
}) })
.catch((_) => {}); .catch((_) => {})
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectedMember = val; this.selectedMember = val
this.batchVerifyForm.ids = val.map((item) => { this.batchVerifyForm.ids = val.map((item) => {
return item.id; return item.id
}); })
}, },
dialogBeforeClose() { dialogBeforeClose() {
this.loading = true; this.loading = true
this.queryParams = { this.queryParams = {
country: null, country: null,
city: null, city: null,
...@@ -800,37 +781,37 @@ export default { ...@@ -800,37 +781,37 @@ export default {
pageSize: 10, pageSize: 10,
startTime: null, startTime: null,
usedScore: null, usedScore: null,
usedScoreOperate: null, usedScoreOperate: null
}; }
}, },
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
let params = { ...this.queryParams }; const params = { ...this.queryParams }
if (this.dateRangeCreateTime) { if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0]; params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]; params.endTime = this.dateRangeCreateTime[1]
} }
queryMemberExchangeRecord(params).then((res) => { queryMemberExchangeRecord(params).then((res) => {
this.loading = false; this.loading = false
this.memberList = res.data.list; this.memberList = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
}, },
handleQueryPagination() { handleQueryPagination() {
let params = { ...this.queryParams }; const params = { ...this.queryParams }
if (this.dateRangeCreateTime) { if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0]; params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]; params.endTime = this.dateRangeCreateTime[1]
} }
queryMemberExchangeRecord(params).then((res) => { queryMemberExchangeRecord(params).then((res) => {
this.loading = false; this.loading = false
this.memberList = res.data.list; this.memberList = 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 = {
country: null, country: null,
city: null, city: null,
...@@ -842,10 +823,10 @@ export default { ...@@ -842,10 +823,10 @@ export default {
pageSize: 10, pageSize: 10,
startTime: null, startTime: null,
usedScore: null, usedScore: null,
usedScoreOperate: null, usedScoreOperate: null
}; }
this.handleQuery(); this.handleQuery()
}, }
}, }
}; }
</script> </script>
<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,258 @@ ...@@ -288,230 +276,258 @@
</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) {
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(() => {
this.switchState = !status
})
},
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