review 积分配置

(cherry picked from commit 4571f893ed)
This commit is contained in:
YunaiV 2023-07-02 23:18:45 +08:00 committed by shizhong
parent 401112f668
commit 23fa3fe14c
6 changed files with 42 additions and 50 deletions

View File

@ -147,9 +147,8 @@ export enum DICT_TYPE {
MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型 MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型
// ========== MALL - 会员模块 ========== // ========== MALL - 会员模块 ==========
// 积分模块 TODO 芋艿:改成 member_ 前缀;包括枚举和值; MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', // 积分的业务类型
MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', MEMBER_POINT_STATUS = 'member_point_status', // 积分的状态
MEMBER_POINT_STATUS = 'member_point_status',
// ========== MALL - 商品模块 ========== // ========== MALL - 商品模块 ==========
PRODUCT_UNIT = 'product_unit', // 商品单位 PRODUCT_UNIT = 'product_unit', // 商品单位

View File

@ -10,9 +10,11 @@
<el-form-item label="hideId" v-show="false"> <el-form-item label="hideId" v-show="false">
<el-input v-model="formData.id" /> <el-input v-model="formData.id" />
</el-form-item> </el-form-item>
<!-- TODO @xiaqing展示给用户的字段名可以和 crmeb 保持一直然后每一个表单都有类似 crmeb tip例如说积分抵用比例(1积分抵多少金额)单位 -->
<el-form-item label="积分抵扣" prop="tradeDeductEnable"> <el-form-item label="积分抵扣" prop="tradeDeductEnable">
<el-switch v-model="formData.tradeDeductEnable" /> <el-switch v-model="formData.tradeDeductEnable" />
</el-form-item> </el-form-item>
<!-- TODO @xiaqing用户看到的是元最多 2 分是后端的存储哈 -->
<el-form-item label="抵扣单位(分)" prop="tradeDeductUnitPrice"> <el-form-item label="抵扣单位(分)" prop="tradeDeductUnitPrice">
<el-input-number <el-input-number
v-model="formData.tradeDeductUnitPrice" v-model="formData.tradeDeductUnitPrice"
@ -27,10 +29,10 @@
style="width: 300px" style="width: 300px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="1元赠送多少分" prop="tradeGivePoint"> <el-form-item label="1 元赠送多少分" prop="tradeGivePoint">
<el-input-number <el-input-number
v-model="formData.tradeGivePoint" v-model="formData.tradeGivePoint"
placeholder="请输入1元赠送多少积分" placeholder="请输入 1 元赠送多少积分"
style="width: 300px" style="width: 300px"
/> />
</el-form-item> </el-form-item>
@ -58,6 +60,7 @@ const formData = ref({
const formRules = reactive({}) const formRules = reactive({})
const formRef = ref() // Ref const formRef = ref() // Ref
/** 修改积分配置 */
const onSubmit = async () => { const onSubmit = async () => {
// //
if (!formRef) return if (!formRef) return
@ -75,6 +78,7 @@ const onSubmit = async () => {
} }
} }
/** 获得积分配置 */
const getConfig = async () => { const getConfig = async () => {
try { try {
const data = await ConfigApi.getConfig() const data = await ConfigApi.getConfig()
@ -82,6 +86,7 @@ const getConfig = async () => {
} finally { } finally {
} }
} }
onMounted(() => { onMounted(() => {
getConfig() getConfig()
}) })

View File

@ -157,6 +157,7 @@ const submitForm = async () => {
} }
} }
// TODO @xiaqing
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {

View File

@ -57,7 +57,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发生时间" prop="createDate"> <el-form-item label="获得时间" prop="createDate">
<el-date-picker <el-date-picker
v-model="queryParams.createDate" v-model="queryParams.createDate"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
@ -78,13 +78,18 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="序号" align="center" prop="id" /> <el-table-column label="编号" align="center" prop="id" />
<el-table-column label="业务编码" align="center" prop="bizId" /> <!-- TODO @xiaqing展示用户的昵称哈 -->
<el-table-column label="业务类型" align="center" prop="bizType"> <el-table-column label="用户" align="center" prop="userId" />
<template #default="scope"> <el-table-column label="积分标题" align="center" prop="title" />
<dict-tag :type="DICT_TYPE.MEMBER_POINT_BIZ_TYPE" :value="scope.row.bizType" /> <el-table-column label="积分描述" align="center" prop="description" />
</template> <el-table-column
</el-table-column> label="获得时间"
align="center"
prop="createDate"
:formatter="dateFormatter"
/>
<!-- todo @xiaqing可以参考 crmeb 的展示把积分和增加减少放一起用红色和绿色展示 -->
<el-table-column <el-table-column
label="操作类型" label="操作类型"
align="center" align="center"
@ -95,16 +100,19 @@
} }
" "
/> />
<el-table-column label="积分标题" align="center" prop="title" />
<el-table-column label="积分描述" align="center" prop="description" />
<el-table-column label="积分" align="center" prop="point" /> <el-table-column label="积分" align="center" prop="point" />
<el-table-column label="变动后的积分" align="center" prop="totalPoint" /> <el-table-column label="变动后的积分" align="center" prop="totalPoint" />
<el-table-column label="业务编码" align="center" prop="bizId" />
<el-table-column label="业务类型" align="center" prop="bizType">
<template #default="scope">
<dict-tag :type="DICT_TYPE.MEMBER_POINT_BIZ_TYPE" :value="scope.row.bizType" />
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.MEMBER_POINT_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.MEMBER_POINT_STATUS" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用户id" align="center" prop="userId" />
<el-table-column <el-table-column
label="冻结时间" label="冻结时间"
align="center" align="center"
@ -117,12 +125,6 @@
prop="thawingTime" prop="thawingTime"
:formatter="dateFormatter" :formatter="dateFormatter"
/> />
<el-table-column
label="发生时间"
align="center"
prop="createDate"
:formatter="dateFormatter"
/>
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<Pagination <Pagination

View File

@ -8,6 +8,7 @@
:inline="true" :inline="true"
label-width="68px" label-width="68px"
> >
<!-- TODO @xiaqing搜索可以去掉因为一共就没几条配置哈 -->
<el-form-item label="签到天数" prop="day"> <el-form-item label="签到天数" prop="day">
<el-input <el-input
v-model="queryParams.day" v-model="queryParams.day"
@ -35,6 +36,7 @@
:loading="exportLoading" :loading="exportLoading"
v-hasPermi="['point:sign-in-config:export']" v-hasPermi="['point:sign-in-config:export']"
> >
<!-- TODO @xiaqing四个功能的导出都可以去掉 -->
<Icon icon="ep:download" class="mr-5px" /> 导出 <Icon icon="ep:download" class="mr-5px" /> 导出
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -44,15 +46,10 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="序号" align="center" prop="id" v-if="false" /> <!-- TODO @xiaqing展示优化下改成第 1 2 天这种 -->
<el-table-column label="签到天数" align="center" prop="day" /> <el-table-column label="签到天数" align="center" prop="day" />
<el-table-column label="签到分数" align="center" prop="point" /> <el-table-column label="获得积分" align="center" prop="point" />
<el-table-column <!-- TODO @xiaqing展示一个是否开启 -->
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
/>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -87,11 +84,13 @@
<SignInConfigForm ref="formRef" @success="getList" /> <SignInConfigForm ref="formRef" @success="getList" />
</template> </template>
<script setup lang="ts" name="SignInConfig"> <script lang="ts" setup>
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import * as SignInConfigApi from '@/api/point/signInConfig' import * as SignInConfigApi from '@/api/point/signInConfig'
import SignInConfigForm from './SignInConfigForm.vue' import SignInConfigForm from './SignInConfigForm.vue'
defineOptions({ name: 'SignInConfig' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -106,6 +105,7 @@ const queryParams = reactive({
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
// TODO @xiaqing
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true

View File

@ -40,14 +40,6 @@
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- @click="openForm('create')"-->
<!-- v-hasPermi="['point:sign-in-record:create']"-->
<!-- >-->
<!-- <Icon icon="ep:plus" class="mr-5px" /> 新增-->
<!-- </el-button>-->
<el-button <el-button
type="success" type="success"
plain plain
@ -64,10 +56,11 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="序号" align="center" prop="id" /> <el-table-column label="编号" align="center" prop="id" />
<!-- TODO @xiaqing展示用户昵称 -->
<el-table-column label="签到用户" align="center" prop="userId" /> <el-table-column label="签到用户" align="center" prop="userId" />
<el-table-column label="签到天数" align="center" prop="day" /> <el-table-column label="签到天数" align="center" prop="day" />
<el-table-column label="签到的分数" align="center" prop="point" /> <el-table-column label="获得积分" align="center" prop="point" />
<el-table-column <el-table-column
label="签到时间" label="签到时间"
align="center" align="center"
@ -76,14 +69,6 @@
/> />
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template #default="scope"> <template #default="scope">
<!-- <el-button-->
<!-- link-->
<!-- type="primary"-->
<!-- @click="openForm('update', scope.row.id)"-->
<!-- v-hasPermi="['point:sign-in-record:update']"-->
<!-- >-->
<!-- 编辑-->
<!-- </el-button>-->
<el-button <el-button
link link
type="danger" type="danger"