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.rewardTitle"
: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.memberName"
: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.WAY_OF_RECEIVING"
v-model="queryParams.redeemType"
>
</dict-selector>
</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.rewardCountOperate"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="14">
<el-input
v-model.trim="queryParams.rewardCount"
: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 :label="$t('礼品ID')">
<el-input
style="width: 300px"
v-model.trim="queryParams.rewardCode"
:placeholder="$t('请输入礼品ID')"
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.PLATFORM_TYPE"
v-model="queryParams.entrance"
@change="handleQuery"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('兑换网点')">
<el-select
v-model="queryParams.nodeId"
:placeholder="$t('请选择兑换网点')"
clearable
size="small"
@change="handleQuery"
>
<el-option
v-for="nodeItem in nodeList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select>
</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"
v-hasPermi="['ecw:memberManagement:newExchange']"
@click="handleNewExchange"
>{{ $t("新增兑换") }}</el-button
>
<el-button
type="success"
size="mini"
icon="el-icon-plus"
v-hasPermi="['ecw:memberManagement:batchWriteOff']"
@click="handleBatchVerify"
>{{ $t("批量核销") }}</el-button
>
<el-button
type="success"
size="mini"
icon="el-icon-plus"
@click="handleBatchExport"
v-hasPermi="['ecw:memberManagement:export']"
>{{ $t("导出") }}</el-button
>
<el-button
type="success"
size="mini"
icon="el-icon-plus"
@click="handleShowFileUploadDialog"
v-hasPermi="['ecw:memberManagement:exchangeoInfoImport']"
>{{ $t("兑换信息导入") }}</el-button
>
</el-row>
<el-table
ref="multipleTable"
v-loading="loading"
@selection-change="handleSelectionChange"
:data="memberList"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column
width="140"
:label="$t('兑换记录ID')"
align="center"
prop="id"
></el-table-column>
<el-table-column
width="140"
:label="$t('礼品ID')"
align="center"
prop="rewardCode"
></el-table-column>
<el-table-column
:label="$t('礼品名称')"
align="center"
:prop="isChinese ? 'rewardTitleZh' : 'rewardTitleEn'"
></el-table-column>
<el-table-column
:label="$t('会员名称')"
align="center"
:prop="isChinese ? 'memberNameZh' : 'memberNameEn'"
></el-table-column>
<el-table-column :label="$t('兑换时间')" align="center">
<template v-slot="{ row }">
{{ parseTime(row.redemptionTime) || "/" }}</template
>
</el-table-column>
<el-table-column
:label="$t('兑换积分')"
align="center"
prop="totalCount"
></el-table-column>
<el-table-column width="140" :label="$t('兑换入口')" align="center">
<template v-slot="{ row }">
{{
isChinese
? handleExchangeEntrance(row.entrance).label
: handleExchangeEntrance(row.entrance).labelEn
}}
</template>
</el-table-column>
<el-table-column
width="140"
:label="$t('兑换网点')"
align="center"
:prop="isChinese ? 'nodeTitleZh' : 'nodeTitleEn'"
>
</el-table-column>
<el-table-column width="140" :label="$t('领取方式')" align="center">
<template v-slot="{ row }">
{{
isChinese
? handleExchangeRedeemType(row.redeemType).label
: handleExchangeRedeemType(row.redeemType).labelEn
}}
</template>
</el-table-column>
<el-table-column width="140" :label="$t('状态')" align="center">
<template v-slot="{ row }">
{{
isChinese
? handleExchangeStatus(row.status).label
: handleExchangeStatus(row.status).labelEn
}}
</template>
</el-table-column>
<el-table-column
width="140"
:label="$t('备注')"
align="center"
prop="remark"
></el-table-column
>
<el-table-column
width="140"
:label="$t('数量')"
align="center"
prop="rewardCount"
></el-table-column>
<el-table-column
width="140"
:label="$t('创建人')"
align="center"
prop="creatorName"
></el-table-column>
<el-table-column
width="140"
:label="$t('更新人')"
align="center"
prop="updaterName"
></el-table-column>
<el-table-column
width="220px"
align="center"
:label="$t('操作')"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleRewardCancel(scope.row)"
:disabled="scope.row.status != '1'"
v-hasPermi="['ecw:memberManagement:cancel']"
>{{ $t("撤销") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleRewardEdit(scope.row)"
:disabled="scope.row.status != '1'"
v-hasPermi="['ecw:memberManagement:edit']"
>{{ $t("编辑") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleViewRecord(scope.row)"
v-hasPermi="['ecw:memberManagement:view']"
>{{ $t("查看") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleVerify(scope.row)"
:disabled="scope.row.status != '1'"
v-hasPermi="['ecw:memberManagement:verification']"
>{{ $t("核销") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleVerificationRollback(scope.row)"
:disabled="scope.row.status != '2'"
v-hasPermi="['ecw:memberManagement:verificationRollback']"
>{{ $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="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
{{ $t("将文件拖到此处,或") }}<em>{{ $t("点击上传") }}</em>
</div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xls、xlsx格式文件。</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>{{ $t("下载模板") }}
</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">{{
$t("确 定")
}}</el-button>
<el-button @click="upload.open = false">{{ $t("取 消") }}</el-button>
</div>
</el-dialog>
<!-- 批量核销 -->
<el-dialog
:title="$t('批量核销')"
:visible.sync="dialogBatchVerify"
width="30%"
:before-close="handleClose"
>
<el-form
:model="batchVerifyForm"
ref="numberValidateForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item
label="核销人"
prop="age"
:rules="[{ required: true, message: $t('核销人不能为空') }]"
>
<el-input
v-model.number="batchVerifyForm.verifyUser"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item
:label="$t('核销时间')"
:rules="[{ required: true, message: $t('核销时间不能为空') }]"
>
<el-date-picker
type="date"
placement="bottom-start"
value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="$t('选择核销时间')"
v-model="batchVerifyForm.verifyTime"
></el-date-picker>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogBatchVerify = false">取 消</el-button>
<el-button type="primary" @click="handleBatchVerifySubmit">{{
$t("确认核销")
}}</el-button>
</span>
</el-dialog>
<el-dialog
:title="$t('操作积分')"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose"
>
<el-form ref="form" :model="formQuery" label-width="80px">
<el-form-item :label="$t('会员')">
<el-select
v-model="formQuery.memberIds"
multiple
placeholder="请选择"
>
<el-option
v-for="item in selectedMember"
:key="item.id"
:label="isChinese ? item.memberNameZh : item.memberNameEn"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('操作')">
<el-radio-group v-model="formQuery.operateType">
<el-radio
v-for="dict in getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE)"
:key="dict.value"
:label="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('积分')">
<el-input
v-model.number="formQuery.scoreCount"
:placeholder="$t('请输入积分')"
clearable
/>
</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>
<el-button type="primary" @click="handleScoreSubmit">{{
$t("操作积分")
}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { getNodeList } from "@/api/ecw/giftManagement";
import {
queryMemberExchangeRecord,
batchVerifyAPI,
batchRecordExport,
batchRecordImport,
batchRecordImportTemplate,
rewardCancelQuery,
verifyRollback,
} from "@/api/ecw/memberManagement";
import { getNowDateTime, parseTime } from "@/utils/ruoyi";
import { getBaseHeader } from "@/utils/request";
export default {
name: "exchangeRecord",
data() {
return {
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: this.$t("兑换信息导入"),
// 是否禁用上传
isUploading: false,
// 设置上传的请求头部
headers: getBaseHeader(),
// 上传的地址
url:
process.env.VUE_APP_BASE_API +
"/admin-api/reward/redeem/record/import",
},
//批量核销
dialogBatchVerify: false,
batchVerifyForm: {
ids: [],
verifyTime: "",
verifyUser: "",
},
selectedMember: [],
cityList: [],
dateRangeCreateTime: [],
total: 0,
loading: true,
dialogVisible: false,
memberList: [],
formQuery: {
comment: "",
memberIds: [],
operateType: null,
scoreCount: null,
},
queryParams: {
rewardTitle: "",
memberName: "", //会员昵称
redeemType: "", //兑换方式
status: "",
rewardCount: "",
rewardCountOperate: "",
rewardCode: "",
entrance: "", //兑换入口
startTime: "",
endTime: "",
nodeId: "",
pageNo: 1,
pageSize: 10,
},
// 网点
nodeList: [],
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.getNodeListAPI();
this.handleQuery();
},
activated() {
this.handleQuery();
},
methods: {
//核销回退
handleVerificationRollback(row) {
this.$confirm(this.$t("是否继续核销回退?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
})
.then(() => {
let params = {
redeemIds: [row.id],
};
verifyRollback(params).then((res) => {
this.$message({
type: "success",
message: this.$t("回退成功!"),
});
this.handleQuery();
});
})
.catch(() => {
this.$message({
type: "info",
message: this.$t("已取消回退"),
});
});
},
//核销
handleVerify(row) {
this.$router.push({
path: "/memberManagement/exchangeRecordOperation",
query: { exchangeRewardID: row.id, pageStatus: "verify" },
});
},
//查看按钮操作
handleViewRecord(row) {
this.$router.push({
path: "/memberManagement/exchangeRecordOperation",
query: { exchangeRewardID: row.id, pageStatus: "view" },
});
},
//兑换记录编辑操作
handleRewardEdit(row) {
this.$router.push({
path: "/memberManagement/exchangeRecordOperation",
query: { exchangeRewardID: row.id, pageStatus: "edit" },
});
},
//撤销按钮操作
handleRewardCancel(row) {
this.$confirm(
this.$t("此操作积分可能存在到期积分, 撤销后积分将进行扣除,是否继续?"),
this.$t("提示"),
{
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
}
)
.then(() => {
let params = {
id: row.id,
};
rewardCancelQuery(params).then((res) => {
this.$message({
type: "success",
message: this.$t("撤销成功!"),
});
this.handleQuery();
});
})
.catch(() => {
this.$message({
type: "info",
message: this.$t("已取消撤销"),
});
});
},
//下载导入模板
importTemplate() {
batchRecordImportTemplate().then((res) => {
this.$download.excel(res, "用户导入模板.xls");
this.$message({
message: this.$t("下载模板成功"),
type: "success",
});
});
},
//导入
handleShowFileUploadDialog() {
this.upload.open = true;
},
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
if (
!response.data.redeemIdFailedMap ||
JSON.stringify(response.data.redeemIdFailedMap) != "{}"
) {
this.$modal.msgSuccess(this.$t("导入成功"));
this.handleQuery();
return;
}
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
// 拼接提示语
let data = response.data;
let text = `${this.$t("导入失败:")}`;
for (const username in data.redeemIdFailedMap) {
text +=
"<br />&nbsp;&nbsp;&nbsp;&nbsp;" +
username +
this.$t("") +
data.redeemIdFailedMap[username];
}
text += `<br />&nbsp;&nbsp;&nbsp;&nbsp;${this.$t("以上数据格式有问题")}`;
this.$alert(text, this.$t("导入结果"), {
dangerouslyUseHTMLString: true,
});
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
//导出
handleBatchExport() {
let params = { ...this.queryParams };
if (this.dateRangeCreateTime.length > 0) {
params.startTime = this.dateRangeCreateTime[0];
params.endTime = this.dateRangeCreateTime[1];
params.pageNo = null;
params.pageSize = null;
}
batchRecordExport(params).then((res) => {
this.$message({
message: this.$t("已加入导出队列,请稍后在下载日志中下载"),
type: "success",
});
});
},
//批量核销确认按钮
handleBatchVerifySubmit() {
this.$confirm(this.$t("确认提交?"))
.then((_) => {
let params = { ...this.batchVerifyForm };
batchVerifyAPI(params).then((res) => {
this.dialogBatchVerify = false;
this.$message({
message: this.$t("核销成功"),
type: "success",
});
});
})
.catch((_) => {});
},
// 批量核销
handleBatchVerify() {
if (this.batchVerifyForm.ids.length > 0) {
this.dialogBatchVerify = true;
this.batchVerifyForm.verifyUser = this.$store.getters.name;
this.batchVerifyForm.verifyTime = getNowDateTime();
} else {
this.$message({
message: this.$t("请先选择兑换记录"),
type: "warning",
});
}
},
// 新增兑换
handleNewExchange() {
this.$router.push({
path: "/memberManagement/exchangeRecordOperation",
});
},
getNodeListAPI() {
getNodeList().then((res) => {
this.nodeList = res.data;
});
},
handleExchangeRedeemType(id) {
return this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING).filter(
(item) => item.value == id
)[0];
},
//兑换入口
handleExchangeEntrance(id) {
return this.getDictDatas(DICT_TYPE.PLATFORM_TYPE).filter(
(item) => item.value == id
)[0];
},
//兑换状态
handleExchangeStatus(id) {
return this.getDictDatas(DICT_TYPE.REWARD_REDEEM_STATUS).filter(
(item) => item.value == id
)[0];
},
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.$t("确认关闭?"))
.then((_) => {
done();
})
.catch((_) => {});
},
handleSelectionChange(val) {
this.selectedMember = val;
this.batchVerifyForm.ids = val.map((item) => {
return item.id;
});
},
dialogBeforeClose() {
this.loading = true;
this.queryParams = {
country: null,
city: null,
endTime: null,
holdScore: null,
holdScoreOperate: null,
key: null,
pageNo: 1,
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
},
handleQuery() {
this.queryParams.pageNo = 1;
let params = { ...this.queryParams };
if (this.dateRangeCreateTime.length > 0) {
params.startTime = this.dateRangeCreateTime[0];
params.endTime = this.dateRangeCreateTime[1];
}
queryMemberExchangeRecord(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];
}
queryMemberExchangeRecord(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
resetQuery() {
this.loading = true;
this.queryParams = {
country: null,
city: null,
endTime: null,
holdScore: null,
holdScoreOperate: null,
key: null,
pageNo: 1,
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
this.handleQuery();
},
},
};
</script>
<template>
<el-dialog
:title="$t('选择礼品')"
:visible.sync="dialogVisible"
width="80%"
:before-close="dialogBeforeClose"
>
<div class="container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item :label="$t('礼品名称')">
<el-input
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-row :gutter="10">
<el-col :span="8">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.pointsRequireSymbol"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="16">
<el-input
v-model.trim="queryParams.pointsRequire"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('领取方式')" prop="level">
<dict-selector
clearable
:type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="queryParams.pickMethod"
@change="handleQuery"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('兑换网点')" prop="level">
<el-select
v-model="queryParams.nodeId"
:placeholder="$t('请选择兑换网点')"
clearable
size="small"
@change="handleQuery"
>
<el-option
v-for="nodeItem in nodeList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('状态')" prop="level">
<dict-selector
clearable
:type="DICT_TYPE.GIFT_STATUS"
v-model="queryParams.status"
@change="handleQuery"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('备注')" prop="level">
<el-input
v-model.trim="queryParams.remark"
:placeholder="$t('请输入备注')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('剩余数量')">
<el-row :gutter="10">
<el-col :span="8">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.quantityRemainSymbol"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="16">
<el-input
v-model.trim="queryParams.quantityRemain"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</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="list">
<el-table-column
width="140"
:label="$t('礼品ID')"
align="center"
prop="code"
></el-table-column>
<el-table-column :label="$t('礼品名称')" align="center">
<template slot-scope="scope">
<el-button type="text" @click="handleView(scope.row)">{{
isChinese ? scope.row.titleZh : scope.row.titleEn
}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('图片')">
<template slot-scope="scope">
<el-image
:src="firstImg(isChinese ? scope.row.imgZh : scope.row.imgEn)"
style="width: 50px; height: 50px"
>{{ $t("") }}</el-image
>
</template>
</el-table-column>
<el-table-column width="160" :label="$t('开始日期')">
<template v-slot="{ row }">
{{ parseTime(row.createTime) || "/" }}
</template>
</el-table-column>
<el-table-column width="160" :label="$t('结束日期')">
<template v-slot="{ row }">
{{ parseTime(row.endTime) || "/" }}
</template>
</el-table-column>
<el-table-column
:label="$t('兑换积分')"
prop="pointsRequire"
></el-table-column>
<el-table-column
:label="$t('领取方式')"
align="center"
prop="pickMethod"
>
<template v-slot="{ row }">
{{ handlePickMethod(row.pickMethod) }}
</template>
</el-table-column>
<el-table-column :label="$t('兑换网点')" align="center">
<template v-slot="{ row }">
{{
isChinese
? handleExchangeNodeId(row.nodeId).titleZh
: handleExchangeNodeId(row.nodeId).titleEn
}}
</template>
</el-table-column>
<el-table-column
:label="$t('允许兑换次数')"
align="center"
prop="allowCount"
></el-table-column>
<el-table-column :label="$t('状态')">
<template slot-scope="{ row }">
{{
isChinese
? handleRewardsStatus(row.status).label
: handleRewardsStatus(row.status).labelEn
}}
</template>
</el-table-column>
<el-table-column :label="$t('备注')" align="center" width="200">
<template slot-scope="{ row }">
<el-tooltip
popper-class="rewardstToolTip"
:content="isChinese ? row.remarkZh : remarkEn"
placement="top"
>
<div
style="
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>
{{ isChinese ? row.remarkZh : remarkEn }}
</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
:label="$t('已兑换次数')"
align="center"
prop="exchangeCount"
></el-table-column>
<el-table-column
:label="$t('剩余次数')"
align="center"
prop="quantityRemain"
></el-table-column>
<el-table-column
width="100px"
align="center"
:label="$t('操作')"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="transferSelectRewards(scope.row)"
:disabled="scope.row.status != '1'"
>{{ $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="getList"
/>
</div>
</el-dialog>
</template>
<script>
import {
getNodeList,
getGiftList,
deleteRewards,
copyRewardsAPI,
changeRewardsStatus,
delayRewards,
} from "@/api/ecw/giftManagement";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { parseTime } from "@/utils/ruoyi";
import { uploadFile } from "@/api/infra/file";
import ImageUpload from "@/components/ImageUpload";
export default {
name: "chooseGift",
props: {
dialogVisible: {
type: Boolean,
default: false,
},
},
watch: {
dialogVisible(val) {
if (val == true) {
this.handleQuery();
}
},
},
data() {
return {
env: process.env.NODE_ENV,
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 礼品列表
list: [],
rewardsItem: {},
dateRangeCreateTime: [],
postponeDatetime: "",
postponeRewardsID: "",
// 查询参数
queryParams: {
page: 1,
rows: 10,
title: null,
pointsRequire: null,
pointsRequireSymbol: null,
pickMethod: null,
nodeId: null,
status: null,
remark: null,
quantityRemainSymbol: null,
quantityRemain: null,
beginCreateTime: null,
endCreateTime: null,
},
// 网点
nodeList: [],
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.getList();
this.getNodeList();
},
activated() {
this.getList();
},
methods: {
transferSelectRewards(row) {
this.$emit("transferSelectRewards", row);
this.dialogBeforeClose();
},
dialogBeforeClose() {
this.loading = true;
this.queryParams = {
page: 1,
rows: 10,
title: null,
pointsRequire: null,
pointsRequireSymbol: null,
pickMethod: null,
nodeId: null,
status: null,
remark: null,
quantityRemainSymbol: null,
quantityRemain: null,
beginCreateTime: null,
endCreateTime: null,
};
// this.dialogVisible = false;
this.$emit("update:dialogVisible", false);
},
arraysEqual(arr1, arr2) {
return arr1.filter((current) => {
return arr2.find((item) => item == current.value.toString())
? true
: false;
});
},
handleRewardsStatus(status) {
return this.getDictDatas(DICT_TYPE.GIFT_STATUS).filter(
(dicItem) => dicItem.value.toString() == status
)[0];
},
firstImg(imgString) {
if (!imgString || imgString == "") return imgString;
let imgs = imgString.split(",");
return imgs.length ? imgs[0] : null;
},
handlePickMethod(pickMethod) {
let pickMethodLabel = [];
if (this.isChinese) {
this.arraysEqual(
this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING),
pickMethod.split(",")
).forEach((element) => {
pickMethodLabel.push(element.label);
});
} else {
this.arraysEqual(
this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING),
pickMethod.split(",")
).forEach((element) => {
pickMethodLabel.push(element.labelEn);
});
}
return pickMethodLabel.join();
},
handleExchangeNodeId(nodeId) {
return this.nodeList.filter((nodeItem) => nodeItem.id == nodeId)[0];
},
handleExchange(row) {
this.$router.push({
path: "/giftManagement/bulkExchange",
query: { rewardsID: row.id },
});
},
/** 关闭按钮操作 */
handleCloseStatus(row) {
this.$confirm(this.$t("是否关闭当前礼品?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
})
.then((_) => {
return changeRewardsStatus({ id: row.id, status: "3" });
})
.then((res) => {
this.getList();
this.$message.success(this.$t("关闭成功"));
})
.catch((_) => {
// this.queryAllData();
});
},
getNodeList() {
getNodeList().then((res) => {
this.nodeList = res.data;
});
},
getList() {
this.loading = true;
// 处理查询参数
let params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
getGiftList(params).then((res) => {
this.loading = false;
this.list = res.data.list;
this.total = res.data.total;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.$nextTick(() => {
this.queryParams.page = 1;
this.getList();
});
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.queryParams = {
page: 1,
rows: 10,
number: null,
name: null,
level: null,
source: null,
customerService: null,
status: null,
department: null,
creditLevel: null,
country: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null,
};
this.handleQuery();
},
},
};
</script>
<style>
.rewardstToolTip {
max-width: 90%;
}
</style>
<template>
<div class="app-container">
<div class="container">
<div class="formBox">
<el-form
v-for="(item, index) in queryParamsList"
:key="item.memberId"
:model="queryParamsList[index]"
:ref="`queryForm${item.memberId}`"
size="small"
:inline="true"
:rules="rules"
:disabled="viewRecordDisable"
label-width="168px"
>
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-row :gutter="10">
<span class="card-title">{{ $t("基础信息") }}</span>
</el-row>
<el-row :gutter="10">
<el-form-item :label="$t('会员名称')">
<el-autocomplete
v-model="item.memberName"
:disabled="rewardEdit || veriftyDisable"
:fetch-suggestions="querySearchAsync"
:placeholder="$t('请输入会员名称')"
@select="handleSelectMemberQuery"
></el-autocomplete>
<!-- <el-input
:placeholder=""
clearable
v-model="item.memberName"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/> -->
</el-form-item>
<el-form-item id="colorRedInput" :label="$t('当前积分')">
<el-input
:placeholder="$t('请输入当前积分')"
clearable
:disabled="true"
v-model="item.holdScore"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('礼品选择')" id="colorRedInput">
<el-input
:placeholder="$t('请选择礼品')"
clearable
:disabled="true"
v-model="item.rewardName"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-button
type="success"
size="small"
@click="handleSelectMember"
>
{{ $t("选择") }}</el-button
>
<el-form-item :label="$t('礼品积分')" id="colorRedInput">
<el-input
:placeholder="$t('请输入礼品积分')"
clearable
:disabled="true"
v-model="item.pointsRequire"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换数量')" prop="rewardCount">
<el-input
:placeholder="$t('请输入兑换数量')"
:disabled="rewardEdit || veriftyDisable"
clearable
v-model.number="item.rewardCount"
@change="
(val) => {
handleRewardCount(item, index, val);
}
"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('本次兑换积分')" id="colorRedInput">
<el-input
:placeholder="$t('请输入本次兑换积分')"
clearable
:disabled="true"
v-model="item.spendCredit"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换后剩余积分')" id="colorRedInput">
<el-input
:placeholder="$t('兑换后剩余积分')"
clearable
:disabled="true"
id="colorRedInput"
v-model="item.remainingPoints"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
</el-row>
<el-row :gutter="10">
<el-row>
<span class="card-title">{{ $t("详细信息") }}</span>
</el-row>
<el-row>
<el-form-item :label="$t('兑换方式')" prop="redeemType">
<dict-selector
clearable
:disabled="veriftyDisable"
:type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="item.redeemType"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('兑换入口')">
<dict-selector
clearable
:disabled="true"
v-model="item.entrance"
:type="DICT_TYPE.PLATFORM_TYPE"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('费用')" required>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item prop="expenses">
<el-input
v-model="item.expenses"
:disabled="veriftyDisable"
:placeholder="$t('请输入数字')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item prop="currency">
<el-select
v-model="item.currency"
:disabled="veriftyDisable"
:placeholder="$t('请选择币种')"
>
<el-option
v-for="nodeItem in currencyList"
:key="nodeItem.id"
:label="
isChinese ? nodeItem.titleZh : nodeItem.titleEn
"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('收件人姓名')" prop="recipientName"
><el-input
:placeholder="$t('请输入收件人姓名')"
clearable
v-model="item.recipientName"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item
:label="$t('收件人电话')"
prop="recipientPhoneNum"
>
<el-input
:placeholder="$t('请输入收件人电话')"
clearable
v-model="item.recipientPhoneNum"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item
:label="$t('收件人地址')"
prop="recipientAddress"
v-if="item.redeemType != '1'"
>
<el-input
:placeholder="$t('请输入收件人地址')"
clearable
v-model="item.recipientAddress"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换人')">
<el-input
:placeholder="$t('请输入兑换人')"
clearable
v-model="item.redeemer"
:disabled="veriftyDisable"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换时间')">
<el-date-picker
type="date"
placement="bottom-start"
:disabled="veriftyDisable"
value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="$t('选择兑换时间')"
v-model="item.redemptionTime"
></el-date-picker>
</el-form-item>
<el-form-item
:label="$t('快递公司')"
v-if="item.redeemType != '1'"
>
<el-select
v-model="item.courierCompany"
:placeholder="$t('请选择快递公司')"
>
<el-option
v-for="nodeItem in expressList"
:key="nodeItem.id"
:label="nodeItem.companyName"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
<el-form-item
:label="$t('快递单号')"
v-if="item.redeemType != '1'"
>
<el-input
:placeholder="$t('请输入快递单号')"
clearable
v-model="item.expressNo"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item
:label="$t('快递日期')"
v-if="item.redeemType != '1'"
>
<el-date-picker
type="date"
:placeholder="$t('选择快递日期')"
v-model="item.expressDate"
value-format="yyyy-MM-dd HH:mm:ss"
placement="bottom-start"
></el-date-picker>
</el-form-item>
<el-form-item :label="$t('快递寄出人')">
<el-input
:placeholder="$t('请输入快递寄出人')"
clearable
v-model="item.expressSender"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('上传附件')">
<file-upload
v-model="item.annex"
:disabled="veriftyDisable || viewRecordDisable"
></file-upload>
</el-form-item>
<el-form-item :label="$t('备注')">
<el-input
style="width: 500px"
:disabled="veriftyDisable"
type="textarea"
v-model="item.remark"
></el-input>
</el-form-item>
<div class="view" v-if="viewRecordDisable || veriftyDisable">
<el-form-item :label="$t('核销人')">
<el-input v-model="item.verifyUser"></el-input>
</el-form-item>
--{{ item.verifyTime }}--
<el-form-item :label="$t('核销时间')">
<el-date-picker
type="date"
:placeholder="$t('选择核销时间')"
v-model="item.verifyTime"
value-format="yyyy-MM-dd HH:mm:ss"
placement="bottom-start"
></el-date-picker>
</el-form-item>
<el-form-item :label="$t('创建人')" v-if="!veriftyDisable">
<el-input v-model="item.creatorName"></el-input>
</el-form-item>
<el-form-item
:label="$t('创建时间')"
v-if="!veriftyDisable"
>
<el-date-picker
type="date"
:placeholder="$t('创建时间')"
v-model="item.createTime"
value-format="yyyy-MM-dd HH:mm:ss"
placement="bottom-start"
></el-date-picker>
</el-form-item>
<el-form-item
:label="$t('最后更新人')"
v-if="!veriftyDisable"
>
<el-input v-model="item.updater"></el-input>
</el-form-item>
<el-form-item
:label="$t('最后更新时间')"
v-if="!veriftyDisable"
>
<el-date-picker
type="date"
:placeholder="$t('最后更新时间')"
v-model="item.updateTime"
value-format="yyyy-MM-dd HH:mm:ss"
placement="bottom-start"
></el-date-picker>
</el-form-item>
</div>
</el-row>
</el-row>
</div>
</el-card>
</el-form>
</div>
<el-row justify="end" :gutter="20" type="flex" class="handleButton">
<el-col :span="3">
<el-button
type="primary"
@click="handleBulkConversion"
v-if="!viewRecordDisable"
>{{ submitButtonText }}</el-button
>
</el-col>
<el-col :span="3">
<el-button @click="handleBack">{{ $t("返回") }}</el-button>
</el-col>
</el-row>
</div>
<choose-Gift
:dialogVisible.sync="dialogVisible"
@transferSelectRewards="onGetSelectRewardsInfo"
>
</choose-Gift>
</div>
</template>
<script>
import { bulkConversion } from "@/api/ecw/giftManagement";
import FileUpload from "@/components/FileUpload";
import chooseGift from "./components/chooseGift.vue";
import { getExpressPage } from "@/api/ecw/express";
import { getCurrencyList } from "@/api/ecw/currency";
import { getNowDateTime, parseTime } from "@/utils/ruoyi";
import { getMemberList } from "@/api/ecw/giftManagement";
import {
getRewardDetailQuery,
updatedRewardsDetails,
verifyRedeem,
} from "@/api/ecw/memberManagement";
import { memberUserGet } from "@/api/member/user";
export default {
name: "exchangeRecordOperation",
components: {
chooseGift,
FileUpload,
},
data() {
var validatePass2 = (rule, value, callback) => {
if (!this.quantityComputation) {
return callback(
new Error(this.$t("兑换积分大于当前总积分,请重新输入兑换数量"))
);
} else {
return callback();
}
};
return {
env: process.env.NODE_ENV,
// 是否显示弹出层
dialogVisible: false,
// 查询参数
queryParamsList: [
{
memberId: null,
holdScore: null,
rewardId: "",
pointsRequire: "",
rewardCount: null,
spendCredit: null, //本次兑换花费积分
remainingPoints: null, //剩余积分
redeemType: null,
entrance: 1,
expenses: null,
currency: null,
recipientName: null,
recipientPhoneNum: null,
recipientAddress: null,
redeemer: this.$store.getters.name,
redemptionTime: getNowDateTime(),
courierCompany: null,
expressNo: null,
expressSender: this.$store.getters.name,
expressDate: null,
remark: null,
annex: null,
memberName: null,
rewardName: null,
},
],
// 网点
nodeList: [],
//快递公司列表
expressList: [],
currencyList: [],
quantityComputation: null,
checkFormResult: [],
rewardEdit: false,
submitButtonText: "确认兑换",
viewRecordDisable: false,
veriftyDisable: false,
rules: {
rewardCount: [
{
required: true,
message: this.$t("请输入兑换数量"),
trigger: "blur",
},
{
validator: validatePass2,
trigger: "blur",
},
],
expenses: [
{
required: true,
message: this.$t("请输入费用"),
trigger: "blur",
},
{
pattern: /^\d+(\.\d{1,2})?$/,
message: this.$t("请输入整数或保留小数点后两位"),
trigger: "blur",
},
],
currency: [
{
required: true,
message: this.$t("请选择币种"),
trigger: "change",
},
],
redeemType: [
{
required: true,
message: this.$t("请选择兑换方式"),
trigger: "change",
},
],
recipientName: [
{
required: true,
message: this.$t("请输入收件人姓名"),
trigger: "blur",
},
],
recipientPhoneNum: [
{
required: true,
message: this.$t("请输入收件人电话"),
trigger: "blur",
},
],
recipientAddress: [
{
required: true,
message: this.$t("请输入收件人地址"),
trigger: "blur",
},
],
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.getExpressList();
this.currencyListAPI();
switch (this.$route.query.pageStatus) {
case "edit":
this.submitButtonText = this.$t("保存");
this.getExchangeDetail();
break;
case "view":
this.viewRecordDisable = true;
this.getExchangeDetail();
break;
case "verify":
this.veriftyDisable = true;
this.submitButtonText = this.$t("确认核销");
this.getExchangeDetail();
break;
case "add":
this.submitButtonText = this.$t("确认兑换");
this.getDetails();
break;
default:
this.submitButtonText = this.$t("确认兑换");
break;
}
},
activated() {},
methods: {
getDetails() {
memberUserGet({ id: this.$route.query.memberId }).then((r) => {
console.log(r, "rrrr");
// this.details = r.data;
this.isChinese
? (this.queryParamsList[0].memberName = r.data.nickname)
: (this.queryParamsList[0].memberName = r.data.englishName);
this.queryParamsList[0].holdScore = r.data.userScoreLevelInfo.holdScore;
this.queryParamsList[0].memberId = r.data.id;
});
},
getExchangeDetail() {
this.queryParamsList = [];
this.$nextTick(() => {
let params = {
id: this.$route.query.exchangeRewardID,
};
getRewardDetailQuery(params).then((res) => {
this.rewardEdit = true;
const data = res.data;
let params = this.queryParamsList[0];
this.queryParamsList = [{ ...data, params }];
if (this.isChinese) {
this.queryParamsList[0].memberName = data.memberNameZh;
this.queryParamsList[0].rewardName = data.rewardTitleZh;
} else {
this.queryParamsList[0].memberName = data.memberNameEn;
this.queryParamsList[0].rewardName = data.rewardTitleEn;
}
this.queryParamsList[0].redemptionTime = parseTime(
data.redemptionTime
); //兑换时间
this.queryParamsList[0].verifyUser = this.$store.getters.name;
this.queryParamsList[0].verifyTime = parseTime(data.verifyTime);
this.queryParamsList[0].updateTime = parseTime(data.updateTime);
this.queryParamsList[0].createTime = parseTime(data.createTime);
this.queryParamsList[0].expressDate = parseTime(data.expressDate); //快递时间
this.handleRewardCount(data, 0, data.rewardCount);
if (this.$route.query.pageStatus == "verify") {
this.queryParamsList[0].verifyTime = getNowDateTime();
}
this.$forceUpdate();
});
});
},
handleSelectMemberQuery(item) {
this.isChinese
? (this.queryParamsList[0].memberName = item.memberNameZh)
: (this.queryParamsList[0].memberName = item.englishName);
this.queryParamsList[0].holdScore = item.holdScore;
this.queryParamsList[0].memberId = item.id;
},
querySearchAsync(queryString, cb) {
let result = [];
if (queryString == "") {
cb(result);
} else {
try {
let params = {
country: null,
city: null,
endTime: "",
holdScore: null,
holdScoreOperate: null,
key: this.queryParamsList[0].memberName,
pageNo: 1,
pageSize: 20,
startTime: "",
usedScore: null,
usedScoreOperate: null,
};
getMemberList(params).then((res) => {
result = res.data.list.map((item) => {
if (this.isChinese) {
return {
...item,
value: `${item.memberNameZh}(${item.mobile})`,
};
} else {
return {
...item,
value: `${item.memberNameEn}(${item.mobile})`,
};
}
});
cb(result);
});
} catch {
this.$message.success(this.$t("获取数据失败"));
}
}
},
handleRewardCount(item, index, value) {
this.queryParamsList[index].spendCredit =
this.queryParamsList[index].pointsRequire * value;
this.queryParamsList[index].remainingPoints =
this.queryParamsList[index].holdScore -
this.queryParamsList[index].spendCredit;
this.quantityComputation =
this.queryParamsList[index].remainingPoints >= 0 ? true : false;
},
currencyListAPI() {
getCurrencyList().then((res) => {
this.currencyList = res.data;
});
},
onGetSelectRewardsInfo(item) {
this.queryParamsList[0].rewardId = item.id;
this.queryParamsList[0];
if (this.isChinese) {
this.queryParamsList[0].rewardName = item.titleZh;
} else {
this.queryParamsList[0].rewardName = item.titleEn;
}
this.queryParamsList[0].pointsRequire = item.pointsRequire;
},
handleSelectMember() {
this.dialogVisible = true;
},
getExpressList() {
let params = {
pageNo: 1,
pageSize: 1000,
};
getExpressPage(params).then((res) => {
this.expressList = res.data.list;
});
},
handleBack() {
this.$store.dispatch("tagsView/delCurrentView");
},
checkForm(formName) {
const result = new Promise((resolve, reject) => {
this.$refs[formName][0].validate((valid) => {
if (valid) {
resolve();
} else {
reject();
}
});
});
this.checkFormResult.push(result);
},
resetForm() {
this.queryParamsList = [
{
memberId: null,
holdScore: null,
rewardId: "",
pointsRequire: "",
rewardCount: null,
spendCredit: null, //本次兑换花费积分
remainingPoints: null, //剩余积分
redeemType: null,
entrance: 1,
expenses: null,
currency: null,
recipientName: null,
recipientPhoneNum: null,
recipientAddress: null,
redeemer: this.$store.getters.name,
redemptionTime: getNowDateTime(),
courierCompany: null,
expressNo: null,
expressSender: this.$store.getters.name,
expressDate: null,
remark: null,
annex: null,
memberName: null,
rewardName: null,
},
];
},
handleBulkConversion() {
this.queryParamsList.forEach((element) => {
this.checkForm(`queryForm${element.memberId}`);
});
Promise.all(this.checkFormResult)
.then((res) => {
this.checkFormResult = [];
let params = this.queryParamsList.map((item) => {
if (item.redeemType == "1") {
let {
recipientAddress,
expressNo,
expressDate,
courierCompany,
...itemNew
} = item;
return itemNew;
} else {
return item;
}
});
if (this.$route.query.pageStatus == "edit") {
updatedRewardsDetails(params[0]).then((res) => {
this.$message.success(this.$t("更新成功"));
this.$router.go(-1);
});
//编辑
} else if (this.$route.query.pageStatus == "verify") {
verifyRedeem(params[0]).then((res) => {
this.$message.success(this.$t("核销成功"));
this.$router.go(-1);
});
} else {
//兑换
bulkConversion(params).then((res) => {
if (res.code == "0") {
this.queryParamsList = this.resetForm();
this.$message.success(this.$t("兑换成功"));
}
});
}
})
.catch(() => {
this.checkFormResult = [];
this.$message.error(this.$t("请填写必要的信息"));
});
},
},
};
</script>
<style>
#colorRedInput .el-input__inner {
color: red;
font-size: 14px;
}
</style>
<style scoped lang="scss">
.card-title {
padding-right: 10px;
border-right: 4px solid rgb(64, 158, 255);
font-size: 16px;
font-weight: 600;
}
.del-btn {
color: red;
}
.app-container .el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 194px;
}
.container {
padding: 20px 0;
}
.emptyText {
font-size: 20px;
padding: 20px;
line-height: 200px;
text-align: center;
color: #97a8be;
}
.handleButton {
padding-right: 160px;
margin-top: 50px;
button {
width: 100%;
}
}
</style>
<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;
......
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item :label="$t('关键字')" prop="nickname">
<el-input v-model="queryParams.searchKey" :placeholder="$t('搜索昵称、姓名、手机、Email')" clearable @keyup.enter.native="handleQuery"/>
<el-input
v-model="queryParams.searchKey"
:placeholder="$t('搜索昵称、姓名、手机、Email')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('成交')" prop="mobile">
<el-select v-model="queryParams.isDeal">
<el-option v-for="item in [{label:$t('全部'),value:''},{label:$t('是'),value:true},{label:$t('否'),value:false}]" :value="item.value" :label="item.label" :key="item.value" ></el-option>
</el-select>
<el-option
v-for="item in [
{ label: $t('全部'), value: '' },
{ label: $t('是'), value: true },
{ label: $t('否'), value: false },
]"
:value="item.value"
:label="item.label"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('认证')" prop="password">
<el-select v-model="queryParams.authType">
<el-option v-for="item in [{label: $t('全部'),value: ''},{label:$t('营业执照认证'),value:1},{label:$t('身份证认证'),value:2},{label:$t('双认证'),value:3}]" :key="item.value" :value="item.value" :label="item.label"></el-option>
<el-option
v-for="item in [
{ label: $t('全部'), value: '' },
{ label: $t('营业执照认证'), value: 1 },
{ label: $t('身份证认证'), value: 2 },
{ label: $t('双认证'), value: 3 },
]"
:key="item.value"
:value="item.value"
:label="item.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('审核状态')" prop="registerIp">
<dict-selector v-model="queryParams.auditStatus" :type="DICT_TYPE.AUDIT_STATUS"></dict-selector>
<dict-selector
v-model="queryParams.auditStatus"
:type="DICT_TYPE.AUDIT_STATUS"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<el-date-picker
v-model="dateRangeCreateTime"
type="datetimerange"
:start-placeholder="$t('开始日期')"
value-format="yyyy-MM-dd HH:mm:ss"
:end-placeholder="$t('结束日期')">
value-format="yyyy-MM-dd HH:mm:ss"
:end-placeholder="$t('结束日期')"
>
</el-date-picker>
</el-form-item>
<el-form-item :label="$t('客户编号')" prop="customerCode">
<el-input
v-model="queryParams.customerCode"
:placeholder="$t('请输入客户编号')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('会员编号')" prop="memberCode">
<el-input
v-model="queryParams.memberCode"
:placeholder="$t('请输入会员编号')"
clearable
@keyup.enter.native="handleQuery"
/>
</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-button v-has-permi="['member:export']" :loading="exportLoading" type="primary" @click="exportFn">{{$t('导 出')}}</el-button>
<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-button
v-has-permi="['member:export']"
:loading="exportLoading"
type="primary"
@click="exportFn"
>{{ $t("导 出") }}</el-button
>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('公司名称')" align="center" prop="enterpriseName" />
<el-table-column :label="$t('用户昵称')" align="center" prop="nickname" width="150"/>
<el-table-column :label="$t('真实姓名')" align="center" prop="identityName" />
<el-table-column
:label="$t('会员编号')"
align="center"
prop="memberCode"
/>
<el-table-column
:label="$t('公司名称')"
align="center"
prop="enterpriseName"
/>
<el-table-column :label="$t('客户编号')" align="center">
<template v-slot="{ row }">
<el-button @click="handleGoDetail(row.customerId)" type="text">{{
row.customerCode
}}</el-button>
</template>
</el-table-column>
<el-table-column
:label="$t('用户昵称')"
align="center"
prop="nickname"
width="150"
/>
<el-table-column
:label="$t('真实姓名')"
align="center"
prop="identityName"
/>
<el-table-column :label="$t('区号')">
<template v-slot:default = 'scope'>
+{{scope.row.areaCode ? `${scope.row.areaCode}`:''}}
<template v-slot:default="scope">
+{{ scope.row.areaCode ? `${scope.row.areaCode}` : "" }}
</template>
</el-table-column>
<el-table-column :label="$t('手机号')" show-overflow-tooltip align="center" prop="mobile" width="150">
</el-table-column>
<el-table-column :label="$t('成交')" align="center" prop="customerStatus" show-overflow-tooltip >
<template v-slot="{row}">
{{row.customerStatus === 3 ? $t('成交') : $t('非成交')}}
<el-table-column
:label="$t('手机号')"
show-overflow-tooltip
align="center"
prop="mobile"
width="150"
>
</el-table-column>
<el-table-column
:label="$t('成交')"
align="center"
prop="customerStatus"
show-overflow-tooltip
>
<template v-slot="{ row }">
{{ row.customerStatus === 3 ? $t("成交") : $t("非成交") }}
</template>
</el-table-column>
<el-table-column :label="$t('认证')" align="center" :formatter="authentication" />
<el-table-column :label="$t('状态')" align="center" prop="status" >
<el-table-column
:label="$t('认证')"
align="center"
:formatter="authentication"
/>
<el-table-column :label="$t('状态')" align="center" prop="status">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="handleStatusChange(scope.row)" />
<el-switch
v-model="scope.row.status"
:active-value="0"
:inactive-value="1"
@change="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column :label="$t('身份证审核状态')" align="center" prop="createTime" >
<el-table-column
:label="$t('身份证审核状态')"
align="center"
prop="createTime"
>
<template slot-scope="scope">
<div v-if="!scope.row.identityAuditStatus">{{$t('未提交')}}</div>
<dict-tag v-else :type="DICT_TYPE.AUDIT_STATUS" :value="scope.row.identityAuditStatus" ></dict-tag>
<el-tooltip v-if="scope.row.identityAuditStatus === 3" class="item" effect="dark" :content="scope.row.identityAuditRemark" placement="bottom">
<div v-if="!scope.row.identityAuditStatus">{{ $t("未提交") }}</div>
<dict-tag
v-else
:type="DICT_TYPE.AUDIT_STATUS"
:value="scope.row.identityAuditStatus"
></dict-tag>
<el-tooltip
v-if="scope.row.identityAuditStatus === 3"
class="item"
effect="dark"
:content="scope.row.identityAuditRemark"
placement="bottom"
>
<i class="el-icon-question"></i>
</el-tooltip>
</template>
</el-table-column>
<el-table-column :label="$t('营业执照审核状态')" align="center" prop="createTime" >
<el-table-column
:label="$t('营业执照审核状态')"
align="center"
prop="createTime"
>
<template slot-scope="scope">
<div v-if="!scope.row.enterpriseAuditStatus">{{$t('未提交')}}</div>
<dict-tag v-else :type="DICT_TYPE.AUDIT_STATUS" :value="scope.row.enterpriseAuditStatus" ></dict-tag>
<el-tooltip v-if="scope.row.enterpriseAuditStatus === 3" class="item" effect="dark" :content="scope.row.rowenterpriseAuditRemark" placement="bottom">
<i class="el-icon-question"></i>
</el-tooltip>
<div v-if="!scope.row.enterpriseAuditStatus">{{ $t("未提交") }}</div>
<dict-tag
v-else
:type="DICT_TYPE.AUDIT_STATUS"
:value="scope.row.enterpriseAuditStatus"
></dict-tag>
<el-tooltip
v-if="scope.row.enterpriseAuditStatus === 3"
class="item"
effect="dark"
:content="scope.row.rowenterpriseAuditRemark"
placement="bottom"
>
<i class="el-icon-question"></i>
</el-tooltip>
</template>
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
<el-table-column
:label="$t('创建时间')"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope" >
<el-button v-has-permi="['member:certificate']" size="mini" type="text" @click="guarantee(scope.row)">{{$t('保函/证书')}}</el-button>
<el-button v-has-permi="['member:log']" size="mini" type="text" @click="operationLogFn(scope.row)">{{$t('操作日志')}}</el-button>
<el-button v-has-permi="['member:id-card']" size="mini" type="text" @click="identityFn(scope.row , '1')">{{$t('身份证')}}</el-button>
<el-button v-has-permi="['member:business-license']" size="mini" type="text" @click="identityFn(scope.row, '2')">{{$t('营业执照')}}</el-button>
<el-button v-has-permi="['member:delete']" size="mini" type="text" @click="deleteFn(scope.row)">{{$t('删 除')}}</el-button>
<el-button type="text" v-has-permi="['member:user:info']" size="mini" @click="$router.push('member/member-details/' + scope.row.id )" >{{ $t('查看') }}</el-button>
<el-table-column
:label="$t('操作')"
align="center"
class-name="small-padding fixed-width"
width="200px"
>
<template slot-scope="scope">
<el-button
v-has-permi="['member:certificate']"
size="mini"
type="text"
@click="guarantee(scope.row)"
>{{ $t("保函/证书") }}</el-button
>
<el-button
v-has-permi="['member:log']"
size="mini"
type="text"
@click="operationLogFn(scope.row)"
>{{ $t("操作日志") }}</el-button
>
<el-button
v-has-permi="['member:id-card']"
size="mini"
type="text"
@click="identityFn(scope.row, '1')"
>{{ $t("身份证") }}</el-button
>
<el-button
v-has-permi="['member:business-license']"
size="mini"
type="text"
@click="identityFn(scope.row, '2')"
>{{ $t("营业执照") }}</el-button
>
<el-button
v-has-permi="['member:delete']"
size="mini"
type="text"
@click="deleteFn(scope.row)"
>{{ $t("删 除") }}</el-button
>
<el-button
type="text"
v-has-permi="['member:user:info']"
size="mini"
@click="$router.push('member/member-details/' + scope.row.id)"
>{{ $t("查看") }}</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows"
@pagination="getList"/>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<el-dialog
title="保函/证书"
:visible.sync="guaranteeShow"
:before-close="()=>{guaranteeUrl = ''; guaranteeShow = false;}"
width="50%">
:before-close="
() => {
guaranteeUrl = '';
guaranteeShow = false;
}
"
width="50%"
>
<el-form>
<el-form-item :label="$t('保函/证书')">
<el-row :gutter="20" type="flex" justify="center" >
<el-col :span="12"><el-input v-model="guaranteeUrl" ></el-input></el-col>
<el-col :span="4"><div style="height: 45px;overflow: hidden;">
<file-upload v-model="guaranteeUrl" :fileType="['png', 'jpg', 'jpeg','pdf']" :limit="1" :isShowTip="false"></file-upload>
</div></el-col>
<el-row :gutter="20" type="flex" justify="center">
<el-col :span="12"
><el-input v-model="guaranteeUrl"></el-input
></el-col>
<el-col :span="4"
><div style="height: 45px; overflow: hidden">
<file-upload
v-model="guaranteeUrl"
:fileType="['png', 'jpg', 'jpeg', 'pdf']"
:limit="1"
:isShowTip="false"
></file-upload></div
></el-col>
<el-col :span="6">
<div>{{$t('可上传图片,pdf文档')}}</div>
<div>{{ $t("可上传图片,pdf文档") }}</div>
</el-col>
</el-row>
</el-form-item>
</el-form>
<div style="text-align: center;"><el-button @click="setGuarantee">{{$t('保 存')}}</el-button></div>
<div style="text-align: center">
<el-button @click="setGuarantee">{{ $t("保 存") }}</el-button>
</div>
</el-dialog>
<el-dialog
:title="$t('操作日志')"
:visible.sync="operationLogShow"
width="50%">
width="50%"
>
<el-table :data="operationLogList">
<el-table-column :label="$t('标题')" prop="title"></el-table-column>
<el-table-column :label="$t('操作内容')" prop="content"></el-table-column>
<el-table-column
:label="$t('操作内容')"
prop="content"
></el-table-column>
<el-table-column :label="$t('操作人')" prop="userId">
<template v-slot="{row}">
{{list.find(i => i.id == row.userId).identityName}}
<template v-slot="{ row }">
{{ list.find((i) => i.id == row.userId).identityName }}
</template>
</el-table-column>
<el-table-column :label="$t('操作时间')">
<template v-slot:default ="scope">
{{parseTime(scope.row.createTime) }}
<template v-slot:default="scope">
{{ parseTime(scope.row.createTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('操作ip')" prop="ip"></el-table-column>
</el-table>
<pagination v-show="totalLog > 0" :total="totalLog" :page.sync="operationLogFrom.page" :limit.sync="operationLogFrom.row"
@pagination="getOperationLogList"/>
<pagination
v-show="totalLog > 0"
:total="totalLog"
:page.sync="operationLogFrom.page"
:limit.sync="operationLogFrom.row"
@pagination="getOperationLogList"
/>
</el-dialog>
<el-dialog
:title="$t('认证')"
:visible.sync="attestationShow"
width="80%">
<div class="details">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane :label="$t('身份证')" name="1">
<div style="padding:0 40px;box-sizing: border-box;">
<el-form :disabled="[2,3].includes(IdDetails.status) && modifyIdCard" ref="formId" label-position="left" label-width="100px" :rules="rulesId" :model="IdDetails" >
<el-form-item :label="$t('姓名')" prop="name">
<el-input v-model="IdDetails.name"></el-input>
</el-form-item>
<el-form-item :label="$t('证件类型')" prop="cardType">
<dict-selector v-model="IdDetails.cardType" :type="DICT_TYPE.CERTIFICATE_TYPE" ></dict-selector>
</el-form-item>
<el-form-item :label="$t('证件号码')" prop="cardNumber">
<el-input v-model="IdDetails.cardNumber"></el-input>
</el-form-item>
<el-form-item :label="$t('证件正面照')" prop="img1">
<div>
<el-input readonly style="margin-bottom: 20px" v-model="IdDetails.img1"></el-input>
<ImageUpload :isShowTip="false" v-model="IdDetails.img1" :limit="1"></ImageUpload>
</div>
</el-form-item>
<el-form-item :label="$t('证件背面照')" prop="img2">
<div>
<el-input readonly style="margin-bottom: 20px" v-model="IdDetails.img2"></el-input>
<ImageUpload :isShowTip="false" :limit="1" v-model="IdDetails.img2"></ImageUpload>
</div>
</el-form-item>
<el-form-item :label="$t('审核状态')" v-if="modifyIdCard && IdDetails.status !== 0 ">
{{getDictDatas(DICT_TYPE.AUDIT_STATUS)[IdDetails.status].label}}
</el-form-item>
<el-form-item :label="$t('审核时间')" v-if="[2,3].includes(IdDetails.status) && modifyIdCard">
{{parseTime(IdDetails.auditTime)}}
</el-form-item>
<el-form-item v-if="modifyIdCard && IdDetails.status !== 0" :label="$t('审核备注')">
<el-input v-model="IdDetails.auditRemark" :disabled="IdDetails.status === 3" type="textarea"></el-input>
</el-form-item>
</el-form>
<div v-if="IdDetails.status === 1" style="text-align: center;margin-top: 20px;">
<el-button type="primary" @click="idCardAuditFn(2)">{{$t('审核通过')}}</el-button>
<el-button type="primary" @click="idCardAuditFn(3)">{{$t('审核不通过')}}</el-button>
<el-button @click="attestationShow = false">{{ $t('取 消') }}</el-button>
</div>
<div v-if="IdDetails.status === 2 || IdDetails.status === 3" style="text-align: center;margin-top: 20px;">
<el-button type="primary" v-if="modifyIdCard" @click="modifyIdCard = false;">{{$t('修 改')}}</el-button>
<el-button type="primary" v-else @click="setMemberUserUpdateIdCard">{{$t('提交审核')}}</el-button>
<el-button @click="attestationShow = false">{{$t('取 消')}}</el-button>
<el-dialog :title="$t('认证')" :visible.sync="attestationShow" width="80%">
<div class="details">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane :label="$t('身份证')" name="1">
<div style="padding: 0 40px; box-sizing: border-box">
<el-form
:disabled="[2, 3].includes(IdDetails.status) && modifyIdCard"
ref="formId"
label-position="left"
label-width="100px"
:rules="rulesId"
:model="IdDetails"
>
<el-form-item :label="$t('姓名')" prop="name">
<el-input v-model="IdDetails.name"></el-input>
</el-form-item>
<el-form-item :label="$t('证件类型')" prop="cardType">
<dict-selector
v-model="IdDetails.cardType"
:type="DICT_TYPE.CERTIFICATE_TYPE"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('证件号码')" prop="cardNumber">
<el-input v-model="IdDetails.cardNumber"></el-input>
</el-form-item>
<el-form-item :label="$t('证件正面照')" prop="img1">
<div>
<el-input
readonly
style="margin-bottom: 20px"
v-model="IdDetails.img1"
></el-input>
<ImageUpload
:isShowTip="false"
v-model="IdDetails.img1"
:limit="1"
></ImageUpload>
</div>
<div v-if="IdDetails.status === 0" style="text-align: center;margin-top: 20px;">
<el-button type="primary" @click="submitId">{{$t('上 传')}}</el-button>
<el-button @click="attestationShow = false">{{$t('取 消')}}</el-button>
</el-form-item>
<el-form-item :label="$t('证件背面照')" prop="img2">
<div>
<el-input
readonly
style="margin-bottom: 20px"
v-model="IdDetails.img2"
></el-input>
<ImageUpload
:isShowTip="false"
:limit="1"
v-model="IdDetails.img2"
></ImageUpload>
</div>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('营业执照')" name="2" >
<div style="width: 500px;padding:0 40px;box-sizing: border-box;">
<el-form :disabled="modifyLicense && [2,3].includes(enterpriseFrom.status)" :rules="rulesEnterprise" :model="enterpriseFrom" label-position="left" ref="formEnter" label-width="100px">
<el-form-item :label="$t('企业名称')" prop="name">
<el-input v-model="enterpriseFrom.name" ></el-input>
</el-form-item>
<el-form-item :label="$t('企业法人')" prop="legalName">
<el-input v-model="enterpriseFrom.legalName" ></el-input>
</el-form-item>
<el-form-item :label="$t('证件号码')" prop="cardNumber">
<el-input v-model="enterpriseFrom.cardNumber"></el-input>
</el-form-item>
<el-form-item :label="$t('证件照')" prop="img1">
<div>
<el-input readonly style="margin-bottom: 20px" v-model="enterpriseFrom.img1"></el-input>
<ImageUpload :isShowTip="false" :limit="1" v-model="enterpriseFrom.img1"></ImageUpload>
</div>
</el-form-item>
<el-form-item :label="$t('附件')">
<el-input readonly v-model="enterpriseFrom.img2"></el-input>
<ImageUpload :isShowTip="false" :limit="1" v-model="enterpriseFrom.img2"></ImageUpload>
</el-form-item>
<el-form-item v-if="modifyLicense && enterpriseFrom.status !== 0 " :label="$t('审核状态')">{{getDictDatas(DICT_TYPE.AUDIT_STATUS)[enterpriseFrom.status].label}}</el-form-item>
<el-form-item v-if="[2,3].includes(enterpriseFrom.status) && modifyLicense " :label="$t('审核时间')">{{parseTime(enterpriseFrom.auditTime)}}</el-form-item>
<el-form-item v-if="modifyLicense && enterpriseFrom.status !== 0" :label="$t('审核备注')">
<el-input v-model="enterpriseFrom.auditRemark" :disabled="enterpriseFrom.status === 3" type="textarea"></el-input>
</el-form-item>
</el-form>
<div v-if="enterpriseFrom.status === 1" style="text-align: center;margin-top: 20px;">
<el-button type="primary" @click="certificateVerificationFn(2)">{{$t('审核通过')}}</el-button>
<el-button type="primary" @click="certificateVerificationFn(3)">{{$t('审核不通过')}}</el-button>
<el-button @click="attestationShow = false">{{$t('取 消')}}</el-button>
</el-form-item>
<el-form-item
:label="$t('审核状态')"
v-if="modifyIdCard && IdDetails.status !== 0"
>
{{
getDictDatas(DICT_TYPE.AUDIT_STATUS)[IdDetails.status].label
}}
</el-form-item>
<el-form-item
:label="$t('审核时间')"
v-if="[2, 3].includes(IdDetails.status) && modifyIdCard"
>
{{ parseTime(IdDetails.auditTime) }}
</el-form-item>
<el-form-item
v-if="modifyIdCard && IdDetails.status !== 0"
:label="$t('审核备注')"
>
<el-input
v-model="IdDetails.auditRemark"
:disabled="IdDetails.status === 3"
type="textarea"
></el-input>
</el-form-item>
</el-form>
<div
v-if="IdDetails.status === 1"
style="text-align: center; margin-top: 20px"
>
<el-button type="primary" @click="idCardAuditFn(2)">{{
$t("审核通过")
}}</el-button>
<el-button type="primary" @click="idCardAuditFn(3)">{{
$t("审核不通过")
}}</el-button>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div>
<div
v-if="IdDetails.status === 2 || IdDetails.status === 3"
style="text-align: center; margin-top: 20px"
>
<el-button
type="primary"
v-if="modifyIdCard"
@click="modifyIdCard = false"
>{{ $t("修 改") }}</el-button
>
<el-button
type="primary"
v-else
@click="setMemberUserUpdateIdCard"
>{{ $t("提交审核") }}</el-button
>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div>
<div
v-if="IdDetails.status === 0"
style="text-align: center; margin-top: 20px"
>
<el-button type="primary" @click="submitId">{{
$t("上 传")
}}</el-button>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('营业执照')" name="2">
<div style="width: 500px; padding: 0 40px; box-sizing: border-box">
<el-form
:disabled="
modifyLicense && [2, 3].includes(enterpriseFrom.status)
"
:rules="rulesEnterprise"
:model="enterpriseFrom"
label-position="left"
ref="formEnter"
label-width="100px"
>
<el-form-item :label="$t('企业名称')" prop="name">
<el-input v-model="enterpriseFrom.name"></el-input>
</el-form-item>
<el-form-item :label="$t('企业法人')" prop="legalName">
<el-input v-model="enterpriseFrom.legalName"></el-input>
</el-form-item>
<el-form-item :label="$t('证件号码')" prop="cardNumber">
<el-input v-model="enterpriseFrom.cardNumber"></el-input>
</el-form-item>
<el-form-item :label="$t('证件照')" prop="img1">
<div>
<el-input
readonly
style="margin-bottom: 20px"
v-model="enterpriseFrom.img1"
></el-input>
<ImageUpload
:isShowTip="false"
:limit="1"
v-model="enterpriseFrom.img1"
></ImageUpload>
</div>
<div v-if="enterpriseFrom.status === 2 || enterpriseFrom.status === 3" style="text-align: center;margin-top: 20px;">
<el-button type="primary" v-if="modifyLicense" @click="modifyLicense = false">{{$t('修 改')}}</el-button>
<el-button type="primary" v-else @click="setMemberUserUpdateEnterprise">{{$t('提交审核')}}</el-button>
<el-button @click="attestationShow = false">{{$t('取 消')}}</el-button>
</div>
<div v-if="enterpriseFrom.status === 0" style="text-align: center;margin-top: 20px;">
<el-button type="primary" @click="submit">{{$t('上 传')}}</el-button>
<el-button @click="attestationShow = false">{{$t('取 消')}}</el-button>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-dialog>
</el-form-item>
<el-form-item :label="$t('附件')">
<el-input readonly v-model="enterpriseFrom.img2"></el-input>
<ImageUpload
:isShowTip="false"
:limit="1"
v-model="enterpriseFrom.img2"
></ImageUpload>
</el-form-item>
<el-form-item
v-if="modifyLicense && enterpriseFrom.status !== 0"
:label="$t('审核状态')"
>{{
getDictDatas(DICT_TYPE.AUDIT_STATUS)[enterpriseFrom.status]
.label
}}</el-form-item
>
<el-form-item
v-if="[2, 3].includes(enterpriseFrom.status) && modifyLicense"
:label="$t('审核时间')"
>{{ parseTime(enterpriseFrom.auditTime) }}</el-form-item
>
<el-form-item
v-if="modifyLicense && enterpriseFrom.status !== 0"
:label="$t('审核备注')"
>
<el-input
v-model="enterpriseFrom.auditRemark"
:disabled="enterpriseFrom.status === 3"
type="textarea"
></el-input>
</el-form-item>
</el-form>
<div
v-if="enterpriseFrom.status === 1"
style="text-align: center; margin-top: 20px"
>
<el-button
type="primary"
@click="certificateVerificationFn(2)"
>{{ $t("审核通过") }}</el-button
>
<el-button
type="primary"
@click="certificateVerificationFn(3)"
>{{ $t("审核不通过") }}</el-button
>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div>
<div
v-if="
enterpriseFrom.status === 2 || enterpriseFrom.status === 3
"
style="text-align: center; margin-top: 20px"
>
<el-button
type="primary"
v-if="modifyLicense"
@click="modifyLicense = false"
>{{ $t("修 改") }}</el-button
>
<el-button
type="primary"
v-else
@click="setMemberUserUpdateEnterprise"
>{{ $t("提交审核") }}</el-button
>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div>
<div
v-if="enterpriseFrom.status === 0"
style="text-align: center; margin-top: 20px"
>
<el-button type="primary" @click="submit">{{
$t("上 传")
}}</el-button>
<el-button @click="attestationShow = false">{{
$t("取 消")
}}</el-button>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-dialog>
</div>
</template>
......@@ -265,30 +622,35 @@ import {
setUserUpdateStatus,
userCreateAuditEnterprise,
memberUserAuditEnterprise,
createAuditIdCard
createAuditIdCard,
} from "@/api/member/user";
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import FileUpload from "@/components/FileUpload"
import { DICT_TYPE, getDictDatas } from "@/utils/dict";
import FileUpload from "@/components/FileUpload";
import ImageUpload from "@/components/ImageUpload";
import uploadImage from "@/components/UploadImage";
import {CommonStatusEnum} from "@/utils/constants";
import {changeUserStatus, listServiceUser, listSimpleUsers} from "@/api/system/user";
import { CommonStatusEnum } from "@/utils/constants";
import {
changeUserStatus,
listServiceUser,
listSimpleUsers,
} from "@/api/system/user";
export default {
name: "User",
components: {
FileUpload,
ImageUpload,uploadImage
ImageUpload,
uploadImage,
},
data() {
return {
totalLog:0,
IdDetails:{},
enterpriseFrom:{},
guaranteeUrl:undefined,
totalLog: 0,
IdDetails: {},
enterpriseFrom: {},
guaranteeUrl: undefined,
DICT_TYPE,
getDictDatas,
// audit_status
activeName:"1",
activeName: "1",
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -309,111 +671,196 @@ export default {
queryParams: {
page: 1,
rows: 10,
isDeal:undefined,// 是否成交
searchKey:undefined,//关键字
auditStatus:undefined,//审核状态
authType:undefined,//关键字
isDeal: undefined, // 是否成交
searchKey: undefined, //关键字
auditStatus: undefined, //审核状态
authType: undefined, //关键字
customerCode: null,
memberCode: null,
},
// 表单参数
form: {},
// 表单校验
rulesId: {
name: [{ required: true, message: this.$t('用户昵称不能为空'), trigger: "blur" }],
cardType: [{ required: true, message: this.$t('证件类型不能为空'), trigger: "blur" }],
cardNumber: [{ required: true, message: this.$t('证件号码不能为空'), trigger: "blur" }],
img1: [{ required: true, message: this.$t('身份正面照不能为空'), trigger: ['blur','change'] }],
img2: [{ required: true, message: this.$t('身份正面照不能为空'), trigger: ['blur','change'] }],
name: [
{
required: true,
message: this.$t("用户昵称不能为空"),
trigger: "blur",
},
],
cardType: [
{
required: true,
message: this.$t("证件类型不能为空"),
trigger: "blur",
},
],
cardNumber: [
{
required: true,
message: this.$t("证件号码不能为空"),
trigger: "blur",
},
],
img1: [
{
required: true,
message: this.$t("身份正面照不能为空"),
trigger: ["blur", "change"],
},
],
img2: [
{
required: true,
message: this.$t("身份正面照不能为空"),
trigger: ["blur", "change"],
},
],
},
rulesEnterprise: {
name: [{required: true, message: this.$t('企业名称不能为空'), trigger: "blur"}],
legalName: [{required: true, message: this.$t('企业法人不能为空'), trigger: "blur"}],
cardNumber: [{required: true, message: this.$t('证件号码不能为空'), trigger: "blur"}],
img1: [{required: true, message: this.$t('证件照不能为空'), trigger: ['blur','change']}],
name: [
{
required: true,
message: this.$t("企业名称不能为空"),
trigger: "blur",
},
],
legalName: [
{
required: true,
message: this.$t("企业法人不能为空"),
trigger: "blur",
},
],
cardNumber: [
{
required: true,
message: this.$t("证件号码不能为空"),
trigger: "blur",
},
],
img1: [
{
required: true,
message: this.$t("证件照不能为空"),
trigger: ["blur", "change"],
},
],
},
publicObj:undefined,
operationLogShow:false,
guaranteeShow:false,
operationLogFrom:{
page:1,
row:10,
userId:undefined
publicObj: undefined,
operationLogShow: false,
guaranteeShow: false,
operationLogFrom: {
page: 1,
row: 10,
userId: undefined,
},
operationLogList:[],
attestationShow:false,
modifyIdCard:true,//修改身份证
modifyLicense:true,//修改营业执照
operationLogList: [],
attestationShow: false,
modifyIdCard: true, //修改身份证
modifyLicense: true, //修改营业执照
};
},
created() {
this.resetId();
this.resetEnterprise()
this.resetEnterprise();
this.getList();
},
methods: {
deleteFn(row){
handleGoDetail(customerId) {
this.$router.push("/customer/query/" + customerId);
},
deleteFn(row) {
const nickname = row.nickname;
this.$modal.confirm(`${this.$t('是否确认删除昵称为{nickname}的会员?', {nickname})}`).then(function (){
return deleteUser(row.id)
}).then( res => {
if(res.code === 0) this.getList(); this.$message.success(this.$t('删除成功'))
}).catch(() =>{
// this.$message.success(this.$t('删除失败'))
}
)
this.$modal
.confirm(
`${this.$t("是否确认删除昵称为{nickname}的会员?", { nickname })}`
)
.then(function () {
return deleteUser(row.id);
})
.then((res) => {
if (res.code === 0) this.getList();
this.$message.success(this.$t("删除成功"));
})
.catch(() => {
// this.$message.success(this.$t('删除失败'))
});
},
//导出
exportFn(){
this.$modal.confirm(this.$t('是否确认导出所有用户数据项?')).then(() => {
this.exportLoading = true;
return exportUserExcel(this.queryParams);
}).then(response => {
this.$download.excel(response, `${this.$t('注册会员')}.xls`);
this.exportLoading = false;
}).catch(() => {});
exportFn() {
this.$modal
.confirm(this.$t("是否确认导出所有用户数据项?"))
.then(() => {
this.exportLoading = true;
return exportUserExcel(this.queryParams);
})
.then((response) => {
this.$download.excel(response, `${this.$t("注册会员")}.xls`);
this.exportLoading = false;
})
.catch(() => {});
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === CommonStatusEnum.ENABLE ? this.$t('启用') : this.$t('停用');
this.$modal.confirm(this.$t('确认要"') + text + '""' + row.nickname + this.$t('"用户吗?')).then(function() {
return setUserUpdateStatus({id:row.id,status:row.status})
}).then(() => {
this.$modal.msgSuccess(text + this.$t('成功'));
}).catch(function() {
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
: CommonStatusEnum.ENABLE;
});
let text =
row.status === CommonStatusEnum.ENABLE
? this.$t("启用")
: this.$t("停用");
this.$modal
.confirm(
this.$t('确认要"') + text + '""' + row.nickname + this.$t('"用户吗?')
)
.then(function () {
return setUserUpdateStatus({ id: row.id, status: row.status });
})
.then(() => {
this.$modal.msgSuccess(text + this.$t("成功"));
})
.catch(function () {
row.status =
row.status === CommonStatusEnum.ENABLE
? CommonStatusEnum.DISABLE
: CommonStatusEnum.ENABLE;
});
},
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
let params = { ...this.queryParams };
// this.addBeginAndEndTime(params, this.dateRangeLoginDate, 'loginDate');
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime', false);
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
// 执行查询
getUserPage(params).then(response => {
getUserPage(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 表单重置 */
resetId(){
this.IdDetails = {
auditRemark: undefined,
auditTime: undefined,
cardNumber: undefined,
cardType: undefined,
createTime: undefined,
id: 0,
img1: undefined,
img2: undefined,
name: '',
status: 0,
userId: 0
}
},//清空身份证
resetEnterprise(){
resetId() {
this.IdDetails = {
auditRemark: undefined,
auditTime: undefined,
cardNumber: undefined,
cardType: undefined,
createTime: undefined,
id: 0,
img1: undefined,
img2: undefined,
name: "",
status: 0,
userId: 0,
};
}, //清空身份证
resetEnterprise() {
this.enterpriseFrom = {
auditRemark: undefined,
auditTime: undefined,
......@@ -425,9 +872,9 @@ export default {
legalName: undefined,
name: undefined,
status: 0,
userId: undefined
}
},//清空企业
userId: undefined,
};
}, //清空企业
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
......@@ -440,235 +887,237 @@ export default {
this.queryParams = {
page: 1,
rows: 10,
isDeal:undefined,// 是否成交
searchKey:undefined,//关键字
auditStatus:undefined,//审核状态
authType:undefined,//关键字
}
isDeal: undefined, // 是否成交
searchKey: undefined, //关键字
auditStatus: undefined, //审核状态
authType: undefined, //关键字
};
this.resetForm("queryForm");
this.handleQuery();
},
// 保函证书
guarantee(row) {
this.publicObj = row;
this.guaranteeShow = true;
this.guaranteeUrl = row.backLetterImg;
this.publicObj = row;
this.guaranteeShow = true;
this.guaranteeUrl = row.backLetterImg;
},
// 操作日志
operationLogFn(row){
operationLogFn(row) {
this.publicObj = row;
this.operationLogFrom.page = 1;
this.operationLogFrom.userId = row.id
this.operationLogFrom.userId = row.id;
this.operationLogShow = true;
this.operationLogList = [];
this.getOperationLogList();
},
getOperationLogList(){
operationLogApi(this.operationLogFrom).then(r=>{
if(r.code === 0){
this.operationLogList = r.data.list
this.totalLog = r.data.total
getOperationLogList() {
operationLogApi(this.operationLogFrom).then((r) => {
if (r.code === 0) {
this.operationLogList = r.data.list;
this.totalLog = r.data.total;
}
})
});
},
setGuarantee(){
seTupdateBackletter({userId:this.publicObj.id,backLetter:this.guaranteeUrl}).then(r=>{
if(r.code === 0){
setGuarantee() {
seTupdateBackletter({
userId: this.publicObj.id,
backLetter: this.guaranteeUrl,
}).then((r) => {
if (r.code === 0) {
this.publicObj.backLetterImg = this.guaranteeUrl;
this.guaranteeShow = false;
this.$message.success(this.$t('保存成功'));
this.$message.success(this.$t("保存成功"));
}
})
});
},
identityFn(row,val){
identityFn(row, val) {
this.attestationShow = true;
this.activeName = val;
this.publicObj = row;
if(val == 1){
if (val == 1) {
this.getIdentityDetails();
}else {
} else {
this.getEnterpriseFn();
}
},
handleClick(val){
if(val.name == 1){
handleClick(val) {
if (val.name == 1) {
this.getIdentityDetails();
}else {
} else {
this.getEnterpriseFn();
}
},
getIdentityDetails(){
getIdentityDetails() {
this.resetId();
memberGetAuthIdcardInfo({userId:this.publicObj.id}).then(r=>{
if(r.code === 0 && !!r.data){
this.IdDetails = r.data
memberGetAuthIdcardInfo({ userId: this.publicObj.id }).then((r) => {
if (r.code === 0 && !!r.data) {
this.IdDetails = r.data;
}
})
});
},
getEnterpriseFn(){
getEnterpriseFn() {
this.resetEnterprise();
memberGetAuthEnterpriseInfo({userId:this.publicObj.id}).then(r => {
if(r.code === 0 && !!r.data){
this.enterpriseFrom = r.data
}
})
memberGetAuthEnterpriseInfo({ userId: this.publicObj.id }).then((r) => {
if (r.code === 0 && !!r.data) {
this.enterpriseFrom = r.data;
}
});
},
//身份证审核
idCardAuditFn(val){
idCardAuditFn(val) {
let p = {
auditStatus:val,
userCardAuthId:this.IdDetails.id,
auditRemark:this.IdDetails.auditRemark
}
memberUserAuditIdCard(p).then(r => {
if(r.code === 0){
this.$message.success(this.$t('修改成功'));
this.getList()
this.getIdentityDetails()
auditStatus: val,
userCardAuthId: this.IdDetails.id,
auditRemark: this.IdDetails.auditRemark,
};
memberUserAuditIdCard(p).then((r) => {
if (r.code === 0) {
this.$message.success(this.$t("修改成功"));
this.getList();
this.getIdentityDetails();
}
})
});
},
// 企业证书审核
certificateVerificationFn(val){
// 企业证书审核
certificateVerificationFn(val) {
let p = {
auditStatus:val,
userEnterpriseAuthId:this.enterpriseFrom.id,
auditRemark:this.enterpriseFrom.auditRemark
}
memberUserAuditEnterprise(p).then(r => {
if(r.code === 0){
this.getList()
auditStatus: val,
userEnterpriseAuthId: this.enterpriseFrom.id,
auditRemark: this.enterpriseFrom.auditRemark,
};
memberUserAuditEnterprise(p).then((r) => {
if (r.code === 0) {
this.getList();
this.getEnterpriseFn();
}
})
});
},
setMemberUserUpdateIdCard(){
this.$refs.formId.validate(async valid =>{
if(valid){
let p ={
cardNumber:this.IdDetails.cardNumber,
cardType:this.IdDetails.cardType,
img1:this.IdDetails.img1,
img2:this.IdDetails.img2,
name:this.IdDetails.name,
userCardAuthId:this.IdDetails.id,
auditPass:true,
};
memberUserUpdateIdCard(p).then(r => {
if(r.code === 0){
this.$message.success(this.$t('修改成功'))
if(p.auditPass === true ){
this.getIdentityDetails()
}
this.getList()
this.modifyIdCard = true;
}
})
}
})
setMemberUserUpdateIdCard() {
this.$refs.formId.validate(async (valid) => {
if (valid) {
let p = {
cardNumber: this.IdDetails.cardNumber,
cardType: this.IdDetails.cardType,
img1: this.IdDetails.img1,
img2: this.IdDetails.img2,
name: this.IdDetails.name,
userCardAuthId: this.IdDetails.id,
auditPass: true,
};
memberUserUpdateIdCard(p).then((r) => {
if (r.code === 0) {
this.$message.success(this.$t("修改成功"));
if (p.auditPass === true) {
this.getIdentityDetails();
}
this.getList();
this.modifyIdCard = true;
}
});
}
});
},
setMemberUserUpdateEnterprise(){
this.$refs.formEnter.validate(async valid =>{
if(valid){
setMemberUserUpdateEnterprise() {
this.$refs.formEnter.validate(async (valid) => {
if (valid) {
let p = {
cardNumber:this.enterpriseFrom.cardNumber,
img1:this.enterpriseFrom.img1,
img2:this.enterpriseFrom.img2,
legalName:this.enterpriseFrom.legalName,
name:this.enterpriseFrom.name,
userEnterpriseAuthId:this.enterpriseFrom.id,
auditPass:true,
}
memberUserUpdateEnterprise(p).then(r =>{
if(r.code === 0){
if(p.auditPass === true){
cardNumber: this.enterpriseFrom.cardNumber,
img1: this.enterpriseFrom.img1,
img2: this.enterpriseFrom.img2,
legalName: this.enterpriseFrom.legalName,
name: this.enterpriseFrom.name,
userEnterpriseAuthId: this.enterpriseFrom.id,
auditPass: true,
};
memberUserUpdateEnterprise(p).then((r) => {
if (r.code === 0) {
if (p.auditPass === true) {
this.getEnterpriseFn();
}
this.getList()
this.getList();
this.modifyLicense = true;
this.$message.success(this.$t('修改成功'));
this.$message.success(this.$t("修改成功"));
}
})
});
}
})
});
},
authentication(row){
if(!row.identityAuditStatus && !row.enterpriseAuditStatus){
return this.$t('')
}else if(!!row.identityAuditStatus && !!row.enterpriseAuditStatus){
return this.$t('双认证')
} else if(row.identityAuditStatus >= 0){
return this.$t('身份')
}else if(row.enterpriseAuditStatus >= 0){
return this.$t('营业')
}
authentication(row) {
if (!row.identityAuditStatus && !row.enterpriseAuditStatus) {
return this.$t("");
} else if (!!row.identityAuditStatus && !!row.enterpriseAuditStatus) {
return this.$t("双认证");
} else if (row.identityAuditStatus >= 0) {
return this.$t("身份");
} else if (row.enterpriseAuditStatus >= 0) {
return this.$t("营业");
}
},
submit(){
submit() {
let p = {
cardNumber:this.enterpriseFrom.cardNumber,
img1:this.enterpriseFrom.img1,
img2:this.enterpriseFrom.img2,
legalName:this.enterpriseFrom.legalName,
name:this.enterpriseFrom.name,
userEnterpriseAuthId:this.enterpriseFrom.id,
userId:this.publicObj.id
}
userCreateAuditEnterprise(p).then(r => {
if(r.code === 0){
this.$message.success(this.$t('添加成功!'));
this.enterpriseFrom.status = 2
this.enterpriseFrom.auditTime = new Date().getTime()
cardNumber: this.enterpriseFrom.cardNumber,
img1: this.enterpriseFrom.img1,
img2: this.enterpriseFrom.img2,
legalName: this.enterpriseFrom.legalName,
name: this.enterpriseFrom.name,
userEnterpriseAuthId: this.enterpriseFrom.id,
userId: this.publicObj.id,
};
userCreateAuditEnterprise(p).then((r) => {
if (r.code === 0) {
this.$message.success(this.$t("添加成功!"));
this.enterpriseFrom.status = 2;
this.enterpriseFrom.auditTime = new Date().getTime();
this.getEnterpriseFn();
this.getList()
this.getList();
}
})
});
},
submitId(){
this.$refs.formId.validate(async valid =>{
if(valid){
let p ={
cardNumber:this.IdDetails.cardNumber,
cardType:this.IdDetails.cardType,
img1:this.IdDetails.img1,
img2:this.IdDetails.img2,
name:this.IdDetails.name,
status:2,
userId:this.publicObj.id
submitId() {
this.$refs.formId.validate(async (valid) => {
if (valid) {
let p = {
cardNumber: this.IdDetails.cardNumber,
cardType: this.IdDetails.cardType,
img1: this.IdDetails.img1,
img2: this.IdDetails.img2,
name: this.IdDetails.name,
status: 2,
userId: this.publicObj.id,
};
createAuditIdCard(p).then(r => {
if(r.code === 0){
this.$message.success(this.$t('添加成功!'));
this.IdDetails.status = 2
this.IdDetails.auditTime = new Date().getTime()
createAuditIdCard(p).then((r) => {
if (r.code === 0) {
this.$message.success(this.$t("添加成功!"));
this.IdDetails.status = 2;
this.IdDetails.auditTime = new Date().getTime();
this.getIdentityDetails();
this.getList()
this.getList();
}
})
});
}
})
}
});
},
},
watch: {
attestationShow(newVal) {
if (!newVal) {
this.resetId();
this.resetEnterprise();
this.publicObj = undefined;
} else {
this.modifyIdCard = true;
this.modifyLicense = true;
}
},
},
watch:{
attestationShow(newVal){
if(!newVal){
this.resetId();
this.resetEnterprise()
this.publicObj = undefined;
}else {
this.modifyIdCard = true;
this.modifyLicense = true;
}
}
}
};
</script>
<style lang="scss" scoped>
.details{
.details {
.el-input {
width: 300px;
}
.el-textarea{
.el-textarea {
width: 300px;
}
}
......
......@@ -81,6 +81,15 @@
<el-descriptions-item :label="$t('上次登录')">{{
details.loginDate
}}</el-descriptions-item>
<el-descriptions-item :label="$t('绑定客户')">{{
details.customerCode
}}</el-descriptions-item>
<el-descriptions-item :label="$t('国家')">{{
isChinese ? details.countryTitleZh : details.countryTitleEn
}}</el-descriptions-item>
<el-descriptions-item :label="$t('城市')">{{
isChinese ? details.cityTitleZh : cityTitleEn
}}</el-descriptions-item>
</el-descriptions>
<!--lanbm 2024-05-15 修改信息显示BUG-->
<el-descriptions
......@@ -168,6 +177,320 @@
: ""
}}</el-descriptions-item>
</el-descriptions>
<!-- 积分信息 -->
<el-descriptions
style="margin-top: 20px"
:title="$t('积分信息')"
:column="6"
direction="vertical"
border
>
<el-descriptions-item :label="$t('会员图标')">
<el-image
:src="details.userScoreLevelInfo.levelIcon"
style="width: 20px; height: 20px"
>{{ $t("") }}</el-image
></el-descriptions-item
>
<el-descriptions-item :label="$t('会员等级')">
{{ details.userScoreLevelInfo.levelName }}
</el-descriptions-item>
<el-descriptions-item :label="$t('当前积分')">{{
details.userScoreLevelInfo.holdScore
}}</el-descriptions-item>
<el-descriptions-item :label="$t('已兑换积分')">{{
details.userScoreLevelInfo.usedScore
}}</el-descriptions-item>
<el-descriptions-item :label="$t('推荐码')">{{
details.userScoreLevelInfo.memberCode
}}</el-descriptions-item>
<el-descriptions-item :label="$t('操作')">
<!-- <el-button
type="text"
class="copy-btn"
:data-clipboard-text="details.memberCode"
>
{{ $t("复制推荐码") }}
</el-button> -->
<el-button type="text" @click="handleExchangeRewards(details)">
{{ $t("兑换礼品") }}
</el-button>
</el-descriptions-item>
</el-descriptions>
<!-- table Tab -->
<el-menu
:default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
>
<el-menu-item index="reward">{{ $t("积分记录") }}</el-menu-item>
<el-menu-item index="exchange">{{ $t("兑换记录") }}</el-menu-item>
</el-menu>
<div class="table-container">
<div class="reward" v-if="activeIndex == 'reward'">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="120px"
>
<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.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-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">
<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
align="center"
:label="$t('分值')"
prop="scoreCount"
></el-table-column>
<el-table-column :label="$t('操作积分时间')" align="center">
<template v-slot="{ row }">
{{ parseTime(row.createTime) || "/" }}</template
>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="handleQueryPagination"
/>
</div>
<div class="exchange" v-else>
<el-form
:model="queryParamsRecord"
ref="queryForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item :label="$t('礼品名称')">
<el-input
style="width: 300px"
v-model.trim="queryParamsRecord.rewardTitle"
: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.WAY_OF_RECEIVING"
v-model="queryParamsRecord.redeemType"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('兑换时间')">
<el-date-picker
type="datetimerange"
clearable
placement="bottom-start"
v-model="dateRangeCreateTimeRecord"
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="handleQueryRecord"
>{{ $t("搜索") }}</el-button
>
<el-button icon="el-icon-refresh" @click="resetQueryRecord">{{
$t("重置")
}}</el-button>
</el-form-item>
</el-form>
<el-table
ref="multipleTable"
v-loading="loading"
:data="memberRecordList"
>
<el-table-column
width="140"
:label="$t('兑换记录ID')"
align="center"
prop="id"
></el-table-column>
<el-table-column
width="140"
:label="$t('礼品ID')"
align="center"
prop="rewardCode"
></el-table-column>
<el-table-column
:label="$t('礼品名称')"
align="center"
:prop="isChinese ? 'rewardTitleZh' : 'rewardTitleEn'"
></el-table-column>
<el-table-column
:label="$t('会员名称')"
align="center"
:prop="isChinese ? 'memberNameZh' : 'memberNameEn'"
></el-table-column>
<el-table-column :label="$t('兑换时间')" align="center">
<template v-slot="{ row }">
{{ parseTime(row.redemptionTime) || "/" }}</template
>
</el-table-column>
<el-table-column
:label="$t('兑换积分')"
align="center"
prop="totalCount"
></el-table-column>
<el-table-column width="140" :label="$t('兑换入口')" align="center">
<template v-slot="{ row }">
{{
isChinese
? handleExchangeEntrance(row.entrance).label
: handleExchangeEntrance(row.entrance).labelEn
}}
</template>
</el-table-column>
<el-table-column
width="140"
:label="$t('兑换网点')"
align="center"
:prop="isChinese ? 'nodeTitleZh' : 'nodeTitleEn'"
>
</el-table-column>
<el-table-column width="140" :label="$t('领取方式')" align="center">
<template v-slot="{ row }">
{{
isChinese
? handleExchangeRedeemType(row.redeemType).label
: handleExchangeRedeemType(row.redeemType).labelEn
}}
</template>
</el-table-column>
<el-table-column width="140" :label="$t('状态')" align="center">
<template v-slot="{ row }">
{{
isChinese
? handleExchangeStatus(row.status).label
: handleExchangeStatus(row.status).labelEn
}}
</template>
</el-table-column>
<el-table-column
width="140"
:label="$t('备注')"
align="center"
prop="remark"
></el-table-column
>
<el-table-column
width="140"
:label="$t('数量')"
align="center"
prop="rewardCount"
></el-table-column>
<el-table-column
width="140"
:label="$t('创建人')"
align="center"
prop="creatorName"
></el-table-column>
<el-table-column
width="140"
:label="$t('更新人')"
align="center"
prop="updaterName"
></el-table-column>
</el-table>
<!-- //分页列表 -->
<pagination
v-show="totalRecord > 0"
:total="totalRecord"
:page.sync="queryParamsRecord.pageNo"
:limit.sync="queryParamsRecord.pageSize"
@pagination="handleQueryPaginationRecord"
/>
</div>
</div>
<el-dialog
title="保函/证书"
:visible.sync="guaranteeShow"
......@@ -509,12 +832,54 @@ import {
import FileUpload from "@/components/FileUpload/index.vue";
import ImageUpload from "@/components/ImageUpload/index.vue";
import { DICT_TYPE, getDictDatas } from "@/utils/dict";
import ClipboardJS from "clipboard";
import {
queryMemberScoreRecord,
queryMemberExchangeRecord,
} from "@/api/ecw/memberManagement";
export default {
name: "memberDetails",
components: { ImageUpload, FileUpload },
data() {
return {
//兑换记录:
dateRangeCreateTimeRecord: [],
memberRecordList: [],
queryParamsRecord: {
rewardTitle: "",
memberId: this.$route.params.id,
memberName: "", //会员昵称
redeemType: "", //兑换方式
status: "",
rewardCount: "",
rewardCountOperate: "",
rewardCode: "",
entrance: "", //兑换入口
startTime: "",
endTime: "",
nodeId: "",
pageNo: 1,
pageSize: 100,
},
queryParams: {
ruleTitle: "",
ruleDesc: "",
key: "",
sourceType: "",
scoreCount: "",
memberId: this.$route.params.id,
scoreCountOperate: "",
endTime: "",
pageNo: 1,
pageSize: 100,
startTime: "",
},
dateRangeCreateTime: [],
total: 0,
totalRecord: 0,
loading: true,
activeIndex: "reward",
// 表单校验
rulesId: {
name: [
......@@ -648,8 +1013,154 @@ export default {
},
created() {
this.getDetails();
this.handleQuery();
this.handleQueryRecord();
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
mounted() {
let clipboard = new ClipboardJS(".copy-btn");
clipboard.on("success", () => {
this.$message.success(this.$t("复制成功"));
});
clipboard.on("error", () => {
this.$message.error(this.$t("复制失败"));
});
},
methods: {
handleExchangeRedeemType(id) {
return this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING).filter(
(item) => item.value == id
)[0];
},
//兑换入口
handleExchangeEntrance(id) {
return this.getDictDatas(DICT_TYPE.PLATFORM_TYPE).filter(
(item) => item.value == id
)[0];
},
//兑换状态
handleExchangeStatus(id) {
return this.getDictDatas(DICT_TYPE.REWARD_REDEEM_STATUS).filter(
(item) => item.value == id
)[0];
},
handleQueryRecord() {
this.queryParamsRecord.pageNo = 1;
let params = { ...this.queryParamsRecord };
if (this.dateRangeCreateTimeRecord.length > 0) {
params.startTime = this.dateRangeCreateTimeRecord[0];
params.endTime = this.dateRangeCreateTimeRecord[1];
}
queryMemberExchangeRecord(params).then((res) => {
this.loading = false;
this.memberRecordList = res.data.list;
this.totalRecord = res.data.total;
});
},
resetQueryRecord() {
this.loading = true;
this.queryParamsRecord = {
country: null,
city: null,
endTime: null,
holdScore: null,
memberId: this.$route.params.id,
holdScoreOperate: null,
key: null,
pageNo: 1,
pageSize: 100,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
this.handleQueryRecord();
},
handleQueryPaginationRecord() {
let params = { ...this.queryParamsRecord };
if (this.dateRangeCreateTimeRecord.length > 0) {
params.startTime = this.dateRangeCreateTimeRecord[0];
params.endTime = this.dateRangeCreateTimeRecord[1];
}
queryMemberExchangeRecord(params).then((res) => {
this.loading = false;
this.memberRecordList = res.data.list;
this.totalRecord = res.data.total;
});
},
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: "",
memberId: this.$route.params.id,
scoreCountOperate: "",
endTime: "",
pageNo: 1,
pageSize: 1000,
startTime: "",
};
this.handleQuery();
},
handleCopyReferralCode(details) {},
handleSelect(key, keyPath) {
console.log(key, keyPath);
this.activeIndex = key;
},
handleExchangeRewards(details) {
this.$router.push({
path: "/memberManagement/exchangeRecordOperation",
query: {
memberId: details.userScoreLevelInfo.memberId,
pageStatus: "add",
},
});
},
deleteFn(row) {
const nickname = row.nickname;
this.$modal
......@@ -899,4 +1410,7 @@ export default {
};
</script>
<style scoped lang="scss">
.table-container {
padding-top: 20px;
}
</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