Commit 17c94196 authored by chenwei's avatar chenwei

2024/08/06/---管理系统暂存更改

parent c526dc21
import request from "@/utils/request";
//操作积分
export function operateMemberScore(data) {
return request({
url: "/member/user-score/operate",
method: "post",
data: data,
});
}
//积分记录分页
export function queryMemberScoreRecord(data) {
return request({
url: "/member/user-score-log/page",
method: "post",
data: data,
});
}
//兑换记录分页
export function queryMemberExchangeRecord(data) {
return request({
url: "/reward/redeem/record/page",
method: "post",
data: data,
});
}
//批量核销按钮
export function batchVerifyAPI(data) {
return request({
url: "/reward/redeem/record/batch/verify",
method: "post",
data: data,
});
}
//兑换记录导出
export function batchRecordExport(data) {
return request({
url: "/reward/redeem/record/export",
method: "post",
data: data,
});
}
//兑换记录导入
export function batchRecordImport(data) {
return request({
url: "/reward/redeem/record/import",
method: "post",
data: data,
});
}
//兑换记录导入模板下载
export function batchRecordImportTemplate() {
return request({
url: "/reward/redeem/record/import/template",
method: "post",
responseType: "blob",
});
}
//撤销 操作
export function rewardCancelQuery(data) {
return request({
url: "/reward/redeem/record/cancel",
method: "post",
data: data,
});
}
//获取记录详情
export function getRewardDetailQuery(data) {
return request({
url: "/reward/redeem/record/detail",
method: "post",
data: data,
});
}
//更新兑换记录
export function updatedRewardsDetails(data) {
return request({
url: "/reward/redeem/record/update",
method: "post",
data: data,
});
}
//核销回退
export function verifyRollback(data) {
return request({
url: "/reward/redeem/record/verify-back",
method: "post",
data: data,
});
}
//核销 操作
export function verifyRedeem(data) {
return request({
url: "/reward/redeem/record/verify",
method: "post",
data: data,
});
}
//获取积分规则记录
export function getScoreRecordList(data) {
return request({
url: "/member/score-rule/page",
method: "post",
params: {
page: data.page,
rows: data.rows,
},
data,
});
}
//会员积分等级列表
export function getMemberLevelList(data) {
return request({
url: "/member/user-level/page",
method: "post",
data,
});
}
//新增会员等级设置
export function addNewMemberLevel(data) {
return request({
url: "/member/user-level/add",
method: "post",
data,
});
}
//删除会员等级
export function delMemberLevel(data) {
return request({
url: "/member/user-level/delete",
method: "post",
data,
});
}
//edit member level
export function editMemberLevel(data) {
return request({
url: "/member/user-level/update",
method: "post",
data,
});
}
......@@ -6,6 +6,7 @@
:before-upload="handleBeforeUpload"
:file-list="fileList"
:limit="limit"
:disabled="disabled"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
......@@ -15,24 +16,40 @@
ref="upload"
>
<!-- 上传按钮 -->
<el-button size="mini" type="primary">{{$t('选取文件')}}</el-button>
<el-button size="mini" type="primary" :disabled="disabled">{{
$t("选取文件")
}}</el-button>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
</template>
的文件
</div>
</el-upload>
<!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
<transition-group
class="upload-file-list el-upload-list el-upload-list--text"
name="el-fade-in-linear"
tag="ul"
>
<li
:key="file.url"
class="el-upload-list__item ele-upload-list__item-content"
v-for="(file, index) in fileList"
>
<el-link :href="`${file.url}`" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
<el-link :underline="false" @click="handleDelete(index)" type="danger"
>删除</el-link
>
</div>
</li>
</transition-group>
......@@ -62,18 +79,23 @@ export default {
type: Array,
default: () => ["doc", "xls", "ppt", "txt", "pdf"],
},
disabled: {
type: Boolean,
default: false,
},
// 是否显示提示
isShowTip: {
type: Boolean,
default: true
}
default: true,
},
},
data() {
return {
number: 0,
uploadList: [],
baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/org-name/up", // 上传的文件服务器地址
uploadFileUrl:
process.env.VUE_APP_BASE_API + "/admin-api/infra/file/org-name/up", // 上传的文件服务器地址
headers: {
Authorization: "Bearer " + getToken(),
},
......@@ -86,9 +108,9 @@ export default {
if (val) {
let temp = 1;
// 首先将值转为数组
const list = Array.isArray(val) ? val : this.value.split(',');
const list = Array.isArray(val) ? val : this.value.split(",");
// 然后将数组转为对象数组
this.fileList = list.map(item => {
this.fileList = list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
}
......@@ -101,8 +123,8 @@ export default {
}
},
deep: true,
immediate: true
}
immediate: true,
},
},
computed: {
// 是否显示提示
......@@ -117,7 +139,9 @@ export default {
if (this.fileType) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1).toLowerCase();
fileExtension = file.name
.slice(file.name.lastIndexOf(".") + 1)
.toLowerCase();
}
const isTypeOk = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
......@@ -125,7 +149,9 @@ export default {
return false;
});
if (!isTypeOk) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
this.$modal.msgError(
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
);
return false;
}
}
......@@ -148,7 +174,7 @@ export default {
// 上传失败
handleUploadError(err) {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading()
this.$modal.closeLoading();
},
// 上传成功回调
handleUploadSuccess(res) {
......@@ -182,9 +208,9 @@ export default {
for (let i in list) {
strs += list[i].url + separator;
}
return strs != '' ? strs.substr(0, strs.length - 1) : '';
}
}
return strs != "" ? strs.substr(0, strs.length - 1) : "";
},
},
};
</script>
......
......@@ -250,6 +250,7 @@ export const DICT_TYPE = {
PLATFORM_TYPE: "platform_type", //平台入口
REWARD_REDEEM_STATUS: "reward_redeem_status", //礼品兑换状态
MEMBER_SCORE_OPERATE_TYPE: "member_user_score_log_operate_type", //会员积分日志操作类型
SCORE_RULE_TYPE: "score_rule_type", //积分规则指标类型
};
/**
......
......@@ -160,7 +160,7 @@ import {
import { color } from "echarts/lib/export";
export default {
name: "chooseGift",
name: "chooseMember",
props: {
dialogVisible: {
type: Boolean,
......
......@@ -296,27 +296,26 @@
</el-row>
</div>
<choose-Gift
<choose-Member
:dialogVisible.sync="dialogVisible"
@transferSelectMemberInfo="onGetSelectMemberInfo"
:memberSelectList="memberList"
>
</choose-Gift>
</choose-Member>
</div>
</template>
<script>
import { getRewardsDetails, bulkConversion } from "@/api/ecw/giftManagement";
import FileUpload from "@/components/FileUpload";
import chooseGift from "./components/chooseGift.vue";
import chooseMember from "./components/chooseMember.vue";
import { getExpressPage } from "@/api/ecw/express";
import { getCurrencyList } from "@/api/ecw/currency";
import { getNowDateTime } from "@/utils/ruoyi";
import { number } from "echarts/lib/export";
export default {
name: "giftManagementList",
components: {
chooseGift,
chooseMember,
FileUpload,
},
data() {
......
......@@ -497,6 +497,7 @@ export default {
id: this.postponeRewardsID,
endTime: this.postponeDatetime,
}).then((res) => {
this.getList();
this.$message.success(this.$t("延期成功"));
});
},
......
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
label-width="120px"
>
<el-form-item :label="$t('指标类型')">
<dict-selector
clearable
:type="DICT_TYPE.SCORE_RULE_TYPE"
v-model="queryParams.type"
@change="handleQuery"
>
</dict-selector>
</el-form-item>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('中文标题:')">
<el-input
style="width: 300px"
v-model.trim="queryParams.titleZh"
:placeholder="$t('请输入查找')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item :label="$t('英文标题:')">
<el-input
style="width: 300px"
v-model.trim="queryParams.titleEn"
:placeholder="$t('请输入查找')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/> </el-form-item
></el-col>
</el-row>
</el-form>
</div>
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { queryMemberScoreRecord } from "@/api/ecw/memberManagement";
export default {
name: "addIntegrationRuleOperation",
data() {
return {
queryParams: {
type: "",
titleZh: "",
titleEn: "",
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {},
activated() {},
methods: {
//积分来源
handleSourceType(id) {
return this.getDictDatas(DICT_TYPE.SCORE_RULE_TYPE).filter(
(item) => item.value == id
)[0];
},
},
};
</script>
<template>
<div class="app-container">积分记录</div>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item :label="$t('关键词')">
<el-input
style="width: 300px"
v-model.trim="queryParams.key"
:placeholder="$t('请输入会员名称/会员编号/手机号')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('积分规则')">
<dict-selector
clearable
:type="DICT_TYPE.SCORE_RULE_TYPE"
v-model="queryParams.sourceType"
@change="handleQuery"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('标题')">
<el-input
style="width: 300px"
v-model.trim="queryParams.ruleTitle"
:placeholder="$t('请输入关键词查找')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('规则说明')">
<el-input
style="width: 300px"
v-model.trim="queryParams.ruleDesc"
:placeholder="$t('请输入关键词查找')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('当前积分')">
<el-row :gutter="10" style="width: 300px">
<el-col :span="10">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.scoreCount"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="14">
<el-input
v-model.trim="queryParams.scoreCountOperate"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('时间')">
<el-date-picker
type="datetimerange"
clearable
placement="bottom-start"
v-model="dateRangeCreateTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
</el-form-item>
</el-form>
<el-table ref="multipleTable" v-loading="loading" :data="memberList">
<el-table-column
width="140"
:label="$t('积分记录ID')"
align="center"
prop="id"
></el-table-column>
<el-table-column
:label="$t('会员名称')"
align="center"
:prop="isChinese ? 'memberNameZh' : 'memberNameEn'"
></el-table-column>
<el-table-column
width="140"
:label="$t('封面图片')"
align="center"
prop="mobile"
>
<template slot-scope="scope">
<el-image
:src="isChinese ? scope.row.coverImageZh : scope.row.coverImageEn"
style="width: 50px; height: 50px"
>{{ $t("") }}</el-image
>
</template>
</el-table-column>
<el-table-column
width="140"
align="center"
:label="$t('分值')"
prop="scoreCount"
></el-table-column>
<el-table-column :label="$t('类别')" align="center">
<template slot-scope="scope">
{{
isChinese
? handleholdScoreStatus(scope.row.operateType).label
: handleholdScoreStatus(scope.row.operateType).labelEn
}}
</template>
</el-table-column>
<el-table-column :label="$t('积分来源')" align="center">
<template slot-scope="scope">
{{
isChinese
? handleSourceType(scope.row.sourceType).label
: handleholdScore(scope.row.sourceType).labelEn
}}
</template>
</el-table-column>
<el-table-column
:label="$t('规则标题')"
align="center"
:prop="isChinese ? 'ruleTitleZh' : 'ruleTitleEn'"
>
</el-table-column>
<el-table-column
:label="$t('规则说明')"
align="center"
:prop="isChinese ? 'ruleDescZh' : 'ruleDescEn'"
>
</el-table-column>
<el-table-column :label="$t('操作积分时间')" align="center">
<template v-slot="{ row }">
{{ parseTime(row.createTime) || "/" }}</template
>
</el-table-column>
<el-table-column :label="$t('详细信息')" align="center">
<template v-slot="{ row }"> {{}} </template>
</el-table-column>
</el-table>
<!-- //分页列表 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="handleQueryPagination"
/>
</div>
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { queryMemberScoreRecord } from "@/api/ecw/memberManagement";
export default {
name: "integralRecord",
data() {
return {
dateRangeCreateTime: [],
total: 0,
loading: true,
memberList: [],
queryParams: {
ruleTitle: "",
ruleDesc: "",
key: "",
sourceType: "",
scoreCount: "",
scoreCountOperate: "",
endTime: "",
pageNo: 1,
pageSize: 10,
startTime: "",
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.handleQuery();
},
activated() {
this.handleQuery();
},
methods: {
//积分来源
handleSourceType(id) {
return this.getDictDatas(DICT_TYPE.SCORE_RULE_TYPE).filter(
(item) => item.value == id
)[0];
},
handleholdScoreStatus(id) {
return this.getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE).filter(
(item) => item.value == id
)[0];
},
handleQuery() {
this.queryParams.pageNo = 1;
let params = { ...this.queryParams };
if (this.dateRangeCreateTime.length > 0) {
params.startTime = this.dateRangeCreateTime[0];
params.endTime = this.dateRangeCreateTime[1];
}
queryMemberScoreRecord(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
handleQueryPagination() {
let params = { ...this.queryParams };
if (this.dateRangeCreateTime.length > 0) {
params.startTime = this.dateRangeCreateTime[0];
params.endTime = this.dateRangeCreateTime[1];
}
queryMemberScoreRecord(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
resetQuery() {
this.loading = true;
this.queryParams = {
ruleTitle: "",
ruleDesc: "",
key: "",
sourceType: "",
scoreCount: "",
scoreCountOperate: "",
endTime: "",
pageNo: 1,
pageSize: 10,
startTime: "",
};
this.handleQuery();
},
},
};
</script>
<template>
<div class="app-container">积分规则</div>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
>
<el-form-item :label="$t('指标类型')">
<dict-selector
clearable
:type="DICT_TYPE.SCORE_RULE_TYPE"
v-model="queryParams.type"
@change="handleQuery"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('标题:')">
<el-input
style="width: 300px"
v-model.trim="queryParams.title"
:placeholder="$t('请输入查找')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('规则说明')">
<el-input
style="width: 300px"
v-model.trim="queryParams.desc"
:placeholder="$t('请输入关键词查找')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('状态')">
<dict-selector
clearable
:type="DICT_TYPE.REWARD_REDEEM_STATUS"
v-model="queryParams.status"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('单次积分')">
<el-row :gutter="10" style="width: 300px">
<el-col :span="10">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.getScoreOnceSymbol"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="14">
<el-input
v-model.trim="queryParams.getScoreOnce"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('最高积分')">
<el-row :gutter="10" style="width: 300px">
<el-col :span="10">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.maxScoreTotalSymbol"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="14">
<el-input
v-model.trim="queryParams.maxScoreTotal"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<el-date-picker
type="datetimerange"
clearable
placement="bottom-start"
v-model="dateRangeCreateTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
</el-form-item>
</el-form>
<el-row class="mb8">
<el-button
type="success"
size="mini"
icon="el-icon-plus"
@click="handleNewScoreRule"
>{{ $t("添加规则") }}</el-button
>
</el-row>
</div>
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { getScoreRecordList } from "@/api/ecw/memberManagement";
export default {
name: "integralRecord",
data() {
return {
dateRangeCreateTime: [],
total: 0,
loading: true,
memberList: [],
queryParams: {
type: "",
title: "",
desc: "",
status: "",
getScoreOnceSymbol: "",
getScoreOnce: "",
maxScoreTotalSymbol: "",
maxScoreTotal: "",
page: 1,
rows: 10,
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.handleQuery();
},
activated() {
this.handleQuery();
},
methods: {
// new score rule func
handleNewScoreRule() {
this.$router.push({
path: "/memberManagement/addIntegrationRuleOperation",
});
},
//积分来源
handleSourceType(id) {
return this.getDictDatas(DICT_TYPE.SCORE_RULE_TYPE).filter(
(item) => item.value == id
)[0];
},
handleholdScoreStatus(id) {
return this.getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE).filter(
(item) => item.value == id
)[0];
},
handleQuery() {
this.queryParams.page = 1;
let params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
getScoreRecordList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
handleQueryPagination() {
let params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
getScoreRecordList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
resetQuery() {
this.loading = true;
this.queryParams = {
ruleTitle: "",
ruleDesc: "",
key: "",
sourceType: "",
scoreCount: "",
scoreCountOperate: "",
endTime: "",
pageNo: 1,
pageSize: 10,
startTime: "",
};
this.handleQuery();
},
},
};
</script>
<template>
<div class="app-container">
<el-row class="mb8">
<el-button
type="success"
size="mini"
icon="el-icon-plus"
@click="handleNewScoreRule"
>{{ $t("添加规则") }}</el-button
>
<el-button
type="success"
size="mini"
icon="el-icon-delete"
@click="handleDelScoreRule"
>{{ $t("删除规则") }}</el-button
>
</el-row>
<el-table
ref="multipleTable"
v-loading="loading"
@selection-change="handleSelectionChange"
:data="memberLevelList"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
width="140"
:label="$t('序号')"
align="center"
prop="id"
></el-table-column>
<el-table-column
:label="$t('等级名称')"
align="center"
prop="name"
></el-table-column>
<el-table-column
width="140"
:label="$t('图标')"
align="center"
prop="mobile"
>
<template slot-scope="scope">
<el-image :src="scope.row.icon" style="width: 50px; height: 50px">{{
$t("")
}}</el-image>
</template>
</el-table-column>
<el-table-column :label="$t('积分范围')" align="center">
<template slot-scope="scope">
{{ scope.row.lowerCount }}-{{ scope.row.upperCount }}
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>{{ $t("修改") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>{{ $t("删除") }}</el-button
>
</template>
</el-table-column>
</el-table>
<!-- //分页列表 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="handleQueryPagination"
/>
<el-dialog
:title="$t('添加规则')"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose"
>
<el-form
:model="ruleForm"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item :label="$t('等级名称')">
<el-input v-model="ruleForm.name"></el-input>
</el-form-item>
<el-form-item :label="$t('积分范围')">
<el-col :span="11">
<el-form-item>
<el-input v-model="ruleForm.lowerCount"></el-input>
</el-form-item>
</el-col>
<el-col class="line" :span="2">{{ $t("至") }}</el-col>
<el-col :span="11">
<el-form-item>
<el-input v-model="ruleForm.upperCount"></el-input>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item :label="$t('上传图标')">
<image-upload v-model="ruleForm.icon" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">{{ $t("取 消") }}</el-button>
<el-button type="primary" @click="handelAddNewMemberLevel">{{
$t("确定")
}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import {
getMemberLevelList,
addNewMemberLevel,
delMemberLevel,
editMemberLevel,
} from "@/api/ecw/memberManagement";
import ImageUpload from "@/components/ImageUpload";
export default {
name: "integralRecord",
components: {
ImageUpload,
},
data() {
return {
dialogVisible: false,
selectList: [],
ruleForm: {
icon: "",
lowerCount: "",
name: "",
upperCount: "",
},
total: 0,
loading: true,
memberLevelList: [],
queryParams: {
pageNo: 1,
pageSize: 10,
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.handleQuery();
},
activated() {
this.handleQuery();
},
methods: {
handleUpdate(row) {
this.ruleForm = { ...row };
this.dialogVisible = true;
},
handleDelete(row) {
let ids = [row.id];
delMemberLevel(ids).then((res) => {
this.$message.success(this.$t("删除成功"));
this.handleClose();
this.handleQuery();
});
},
handelAddNewMemberLevel() {
if (this.ruleForm.id) {
editMemberLevel(this.ruleForm).then((res) => {
this.$message.success(this.$t("更新成功"));
this.handleClose();
this.handleQuery();
});
} else {
let params = { ...this.ruleForm };
addNewMemberLevel(params).then((res) => {
this.$message.success(this.$t("保存成功"));
this.handleClose();
this.handleQuery();
});
}
},
handleSelectionChange(ids) {
this.selectList = ids;
},
handleClose() {
this.dialogVisible = false;
this.selectList = [];
this.ruleForm = {
icon: "",
lowerCount: "",
name: "",
upperCount: "",
};
},
handleDelScoreRule() {
if (this.selectList.length > 0) {
let ids = this.selectList.map((item) => {
return item.id;
});
delMemberLevel(ids).then((res) => {
this.$message.success(this.$t("删除成功"));
this.handleClose();
this.handleQuery();
});
} else {
this.$message.warning(this.$t("请先选择要删除的会员等级"));
}
},
handleNewScoreRule() {
this.dialogVisible = true;
},
handleQuery() {
this.queryParams.pageNo = 1;
let params = { ...this.queryParams };
getMemberLevelList(params).then((res) => {
this.loading = false;
this.memberLevelList = res.data.list;
this.total = res.data.total;
});
},
handleQueryPagination() {
let params = { ...this.queryParams };
getMemberLevelList(params).then((res) => {
this.loading = false;
this.memberLevelList = res.data.list;
this.total = res.data.total;
});
},
},
};
</script>
......@@ -201,12 +201,14 @@
</el-form-item>
<el-form-item :label="$t('积分')">
<el-input
v-model.number="queryParams.title"
v-model.number="formQuery.scoreCount"
:placeholder="$t('请输入积分')"
clearable
/>
</el-form-item>
<el-form-item :label="$t('备注')"></el-form-item>
<el-form-item :label="$t('备注')">
<el-input type="textarea" v-model="formQuery.comment"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
......@@ -220,6 +222,7 @@
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { getTradeCountryList, getMemberList } from "@/api/ecw/giftManagement";
import { operateMemberScore } from "@/api/ecw/memberManagement";
export default {
name: "memberPointsSummary",
......@@ -277,9 +280,26 @@ export default {
});
}
},
handleScoreSubmit() {},
handleScoreSubmit() {
this.$confirm(this.$t("确认提交?"))
.then((_) => {
let params = { ...this.formQuery };
operateMemberScore(params).then((res) => {
this.dialogVisible = true;
this.formQuery = {
comment: "",
memberIds: [],
operateType: null,
scoreCount: null,
};
this.selectedMember = [];
this.$message.success(this.$t("操作成功"));
});
})
.catch((_) => {});
},
handleClose(done) {
this.$confirm("确认关闭?")
this.$confirm(this.$t("确认关闭?"))
.then((_) => {
done();
})
......@@ -312,12 +332,11 @@ export default {
handleQuery() {
this.queryParams.pageNo = 1;
let params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
if (this.dateRangeCreateTime.length > 0) {
params.startTime = this.dateRangeCreateTime[0];
params.endTime = this.dateRangeCreateTime[1];
}
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
......@@ -326,12 +345,10 @@ export default {
},
handleQueryPagination() {
let params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
if (this.dateRangeCreateTime.length > 0) {
params.startTime = this.dateRangeCreateTime[0];
params.endTime = this.dateRangeCreateTime[1];
}
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
......
This diff is collapsed.
This diff is collapsed.
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