Commit 89a81c87 authored by chenwei's avatar chenwei

兑换记录

parent e6d1db92
......@@ -398,55 +398,6 @@
}}</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-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 v-model="formQuery.comment" type="textarea" />
</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>
......@@ -456,7 +407,6 @@ import {
queryMemberExchangeRecord,
batchVerifyAPI,
batchRecordExport,
batchRecordImport,
batchRecordImportTemplate,
rewardCancelQuery,
verifyRollback
......@@ -737,24 +687,6 @@ export default {
(item) => item.value == id
)[0]
},
handleScoreSubmit() {
this.$confirm(this.$t('确认提交?'))
.then((_) => {
const 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((_) => {
......
<template>
<div class="app-container">
<el-form
:model="queryParams"
v-show="showSearch"
ref="queryForm"
:model="queryParams"
size="small"
:inline="true"
v-show="showSearch"
label-width="120px"
>
<el-form-item :label="$t('关键词')">
<el-input
style="width: 300px"
v-model.trim="queryParams.key"
style="width: 300px"
:placeholder="$t('请输入会员名称/会员编号/手机号')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('国家')">
......@@ -37,20 +37,19 @@
<el-row :gutter="10" style="width: 300px">
<el-col :span="10">
<dict-selector
v-model="queryParams.holdScoreOperate"
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.holdScoreOperate"
@change="handleQuery"
>
</dict-selector>
/>
</el-col>
<el-col :span="14">
<el-input
v-model.trim="queryParams.holdScore"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/>
</el-col>
</el-row>
......@@ -59,30 +58,29 @@
<el-row :gutter="10" style="width: 300px">
<el-col :span="10">
<dict-selector
v-model="queryParams.usedScoreOperate"
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.usedScoreOperate"
@change="handleQuery"
>
</dict-selector>
/>
</el-col>
<el-col :span="14">
<el-input
v-model.trim="queryParams.usedScore"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('会员注册时间')">
<el-date-picker
v-model="dateRangeCreateTime"
type="datetimerange"
clearable
placement="bottom-start"
v-model="dateRangeCreateTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
......@@ -105,75 +103,69 @@
size="mini"
icon="el-icon-plus"
@click="handleScore"
>{{ $t("操作积分") }}</el-button
>
>{{ $t("操作积分") }}</el-button>
<right-toolbar
:showSearch.sync="showSearch"
:show-search.sync="showSearch"
@queryTable="handleQueryPagination"
></right-toolbar>
/>
</el-row>
<el-table
ref="multipleTable"
v-loading="loading"
@selection-change="handleSelectionChange"
:data="memberList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="selection" width="55" />
<el-table-column
width="140"
:label="$t('会员编号')"
align="center"
prop="id"
></el-table-column>
prop="memberCode"
/>
<el-table-column :label="$t('会员名称')" align="center">
<template v-slot="{ row }">
<template #default="{ row }">
<el-button
type="text"
@click="$router.push('/member/member/member-details/' + row.id)"
>{{ isChinese ? row.memberNameZh : row.memberNameEn }}</el-button
>
</template></el-table-column
>
>{{ isChinese ? row.memberNameZh : row.memberNameEn }}</el-button>
</template></el-table-column>
<el-table-column
width="140"
:label="$t('联系方式')"
align="center"
prop="mobile"
></el-table-column>
/>
<el-table-column
width="140"
align="center"
:label="$t('国家')"
:prop="isChinese ? 'countryNameZh' : 'countryNameEn'"
></el-table-column>
/>
<el-table-column :label="$t('当前积分')" align="center">
<template v-slot="{ row }">
<template #default="{ row }">
<el-button
type="text"
@click="$router.push('/memberManagement/integralRecord')"
>{{ row.holdScore }}</el-button
>
>{{ row.holdScore }}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('已兑换积分')" align="center">
<template v-slot="{ row }">
<template #default="{ row }">
<el-button
type="text"
@click="$router.push('/memberManagement/exchangeRecord')"
>{{ row.usedScore }}</el-button
>
>{{ row.usedScore }}</el-button>
</template>
</el-table-column>
<el-table-column
:label="$t('已失效积分')"
align="center"
prop="expiredScore"
></el-table-column>
/>
<el-table-column :label="$t('会员注册时间')" align="center">
<template v-slot="{ row }">
{{ parseTime(row.createTime) || "/" }}</template
>
<template #default="{ row }">
{{ parseTime(row.createTime) || "/" }}</template>
</el-table-column>
</el-table>
<!-- //分页列表 -->
......@@ -202,8 +194,7 @@
:key="item.id"
:label="isChinese ? item.memberNameZh : item.memberNameEn"
:value="item.id"
>
</el-option>
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('操作')">
......@@ -212,8 +203,7 @@
v-for="dict in getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE)"
:key="dict.value"
:label="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
>{{ $l(dict, "label") }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('积分')">
......@@ -224,7 +214,7 @@
/>
</el-form-item>
<el-form-item :label="$t('备注')">
<el-input type="textarea" v-model="formQuery.comment"></el-input>
<el-input v-model="formQuery.comment" type="textarea" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
......@@ -237,12 +227,12 @@
</div>
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { getTradeCountryList, getMemberList } from "@/api/ecw/giftManagement";
import { operateMemberScore } from "@/api/ecw/memberManagement";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import { getTradeCountryList, getMemberList } from '@/api/ecw/giftManagement'
import { operateMemberScore } from '@/api/ecw/memberManagement'
export default {
name: "memberPointsSummary",
name: 'MemberPointsSummary',
data() {
return {
selectedMember: [],
......@@ -256,79 +246,81 @@ export default {
dialogVisible: false,
memberList: [],
formQuery: {
comment: "",
comment: '',
memberIds: [],
operateType: null,
scoreCount: null,
scoreCount: null
},
queryParams: {
country: null,
city: null,
endTime: "",
endTime: '',
holdScore: null,
holdScoreOperate: null,
key: "",
key: '',
pageNo: 1,
pageSize: 10,
startTime: "",
startTime: '',
usedScore: null,
usedScoreOperate: null,
},
};
usedScoreOperate: null
}
}
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
return this.$i18n.locale === 'zh_CN'
}
},
created() {
this.handleQuery();
this.getCountryList();
this.handleQuery()
this.getCountryList()
},
activated() {
this.handleQuery();
this.handleQuery()
},
methods: {
handleScore() {
if (this.selectedMember.length > 0) {
this.dialogVisible = true;
this.formQuery.memberIds = this.selectedMember.map((item) => item.id)
this.dialogVisible = true
} else {
this.$message({
message: this.$t("请先选择会员再进行操作"),
type: "warning",
});
message: this.$t('请先选择会员再进行操作'),
type: 'warning'
})
}
},
handleScoreSubmit() {
this.$confirm(this.$t("确认提交?"))
this.$confirm(this.$t('确认提交?'))
.then((_) => {
let params = { ...this.formQuery };
const params = { ...this.formQuery }
operateMemberScore(params).then((res) => {
this.dialogVisible = false;
this.dialogVisible = false
this.formQuery = {
comment: "",
comment: '',
memberIds: [],
operateType: null,
scoreCount: null,
};
this.selectedMember = [];
this.$message.success(this.$t("操作成功"));
});
scoreCount: null
}
this.$refs.multipleTable.clearSelection()
this.selectedMember = []
this.$message.success(this.$t('操作成功'))
})
})
.catch((_) => {});
.catch((_) => {})
},
handleClose(done) {
this.$confirm(this.$t("确认关闭?"))
this.$confirm(this.$t('确认关闭?'))
.then((_) => {
done();
done()
})
.catch((_) => {});
.catch((_) => {})
},
handleSelectionChange(val) {
this.selectedMember = val;
this.selectedMember = val
},
dialogBeforeClose() {
this.loading = true;
this.loading = true
this.queryParams = {
country: null,
city: null,
......@@ -340,42 +332,42 @@ export default {
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
usedScoreOperate: null
}
},
getCountryList() {
getTradeCountryList().then((res) => {
this.countryList = res.data;
});
this.countryList = res.data
})
},
handleQuery() {
this.queryParams.pageNo = 1;
let params = { ...this.queryParams };
this.queryParams.pageNo = 1
const params = { ...this.queryParams }
if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0];
params.endTime = this.dateRangeCreateTime[1];
params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]
}
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
this.loading = false
this.memberList = res.data.list
this.total = res.data.total
})
},
handleQueryPagination() {
let params = { ...this.queryParams };
const params = { ...this.queryParams }
if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0];
params.endTime = this.dateRangeCreateTime[1];
params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]
}
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
this.loading = false
this.memberList = res.data.list
this.total = res.data.total
})
},
resetQuery() {
this.dateRangeCreateTime = [];
this.loading = true;
this.dateRangeCreateTime = []
this.loading = true
this.queryParams = {
country: null,
city: null,
......@@ -387,10 +379,10 @@ export default {
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
this.handleQuery();
},
},
};
usedScoreOperate: null
}
this.handleQuery()
}
}
}
</script>
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