Commit 5c732dec authored by chenwei's avatar chenwei

Merge branch 'cherry-pick-761bb895' into 'hotfix/preReleaseDefect'

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

See merge request !29

(cherry picked from commit 08db7893)

fb6caff3 Merge branch 'feature/099_customer_filter' into 'dev'
parent c0aeb658
...@@ -4524,7 +4524,6 @@ ...@@ -4524,7 +4524,6 @@
"礼品ID": "Gift ID", "礼品ID": "Gift ID",
"允许兑换次数": "Allow redemption times", "允许兑换次数": "Allow redemption times",
"已兑换次数": "Redemption times", "已兑换次数": "Redemption times",
"剩余次数": "Remaining times",
"添加礼品": "Add Gift", "添加礼品": "Add Gift",
"查看礼品": "View gifts", "查看礼品": "View gifts",
"中文礼品名称": "Chinese gift name", "中文礼品名称": "Chinese gift name",
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
</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"
/> />
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
prop="exchangeCount" prop="exchangeCount"
></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>
......
...@@ -108,19 +108,24 @@ ...@@ -108,19 +108,24 @@
</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
:show-search.sync="showSearch" :show-search.sync="showSearch"
@queryTable="handleQueryPagination" @queryTable="handleQueryPagination"
/> />
<el-tooltip v-hasPermi="['ecw:memberManagement:enableMemberPointsSystem']" :content="`${$t('开启会员积分系统')} : ${switchState} `" placement="top" class="switchBtn"> <el-tooltip
v-hasPermi="['ecw:memberManagement:enableMemberPointsSystem']"
:content="`${$t('开启会员积分系统')} : ${switchState} `"
placement="top"
class="switchBtn"
>
<el-switch <el-switch
v-model="switchState" v-model="switchState"
:active-value="true" :active-value="true"
...@@ -135,6 +140,7 @@ ...@@ -135,6 +140,7 @@
v-loading="loading" v-loading="loading"
:data="integrationRuleList" :data="integrationRuleList"
> >
<el-table-column :label="$t('编号')" align="center" prop="code" />
<el-table-column width="140" :label="$t('指标类型')" align="center"> <el-table-column width="140" :label="$t('指标类型')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
...@@ -152,26 +158,24 @@ ...@@ -152,26 +158,24 @@
<el-table-column :label="$t('开始时间')" align="center"> <el-table-column :label="$t('开始时间')" align="center">
<template #default="{ 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 #default="{ 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('单次积分')" align="center">
:label="$t('单次积分')" <template #default="{ row }"> {{ row.getScoreOnce || "--" }}</template>
align="center" </el-table-column>
prop="getScoreOnce"
/>
<el-table-column <el-table-column
:label="$t('累计最高积分')" :label="$t('累计最高积分')"
align="center" align="center"
prop="maxScoreTotal" prop="maxScoreTotal"
> >
<template #default="{ row }"> <template #default="{ row }"> {{ row.maxScoreTotal || "--" }}</template>
{{ row.maxScoreTotal || "--" }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:label="$t('规则说明')" :label="$t('规则说明')"
...@@ -181,23 +185,31 @@ ...@@ -181,23 +185,31 @@
<el-table-column :label="$t('展示平台')" align="center"> <el-table-column :label="$t('展示平台')" align="center">
<template #default="{ 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 #default="{ 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 :label="$t('创建时间')" align="center"> <el-table-column :label="$t('创建时间')" align="center">
<template #default="{ 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 :label="$t('最后更新时间')" align="center"> <el-table-column :label="$t('最后更新时间')" align="center">
<template #default="{ 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">
...@@ -205,42 +217,49 @@ ...@@ -205,42 +217,49 @@
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>
...@@ -279,7 +298,7 @@ ...@@ -279,7 +298,7 @@
</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,
...@@ -287,10 +306,10 @@ import { ...@@ -287,10 +306,10 @@ import {
integralRuleDelay, integralRuleDelay,
integralRuleDelete, integralRuleDelete,
switchRuleSet, switchRuleSet,
switchRuleGet switchRuleGet,
} from '@/api/ecw/memberManagement' } from "@/api/ecw/memberManagement";
export default { export default {
name: 'IntegralRecord', name: "IntegralRecord",
data() { data() {
return { return {
switchState: true, switchState: true,
...@@ -300,235 +319,240 @@ export default { ...@@ -300,235 +319,240 @@ export default {
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: "1",
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() this.getSwitchRuleStatus();
}, },
activated() { activated() {
this.handleQuery() this.handleQuery();
}, },
methods: { methods: {
openSwitch(status) { openSwitch(status) {
this.$modal this.$modal
.confirm(this.$t('是否确认{val}会员积分系统', { val: status ? this.$t('开启') : this.$t('关闭') })) .confirm(
.then(async() => { this.$t("是否确认{val}会员积分系统", {
val: status ? this.$t("开启") : this.$t("关闭"),
})
)
.then(async () => {
// return integralRuleDelete({ id: row.id }) // return integralRuleDelete({ id: row.id })
const { code } = await switchRuleSet({ switchState: status }) const { code } = await switchRuleSet({ switchState: status });
if (code === 0) { if (code === 0) {
this.$modal.msgSuccess(this.$t('成功')) this.$modal.msgSuccess(this.$t("成功"));
} }
}) })
.catch(() => { .catch(() => {
this.switchState = !status this.switchState = !status;
}) });
}, },
getSwitchRuleStatus() { getSwitchRuleStatus() {
switchRuleGet().then(res => { switchRuleGet().then((res) => {
this.switchState = res.data 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());
}) });
}, },
// 展示平台 // 展示平台
handlePlatform(platformId) { handlePlatform(platformId) {
const 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;
const 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() {
const 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: '', status: "1",
endTime: '', scoreCountOperate: "",
endTime: "",
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
startTime: '' startTime: "",
} };
this.handleQuery() this.handleQuery();
} },
} },
} };
</script> </script>
<style scoped> <style scoped>
.switchBtn{ .switchBtn {
float: right; float: right;
padding-right: 70px; padding-right: 70px;
padding-top: 6px; padding-top: 6px;
......
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