review 积分配置
This commit is contained in:
parent
032d5a0a06
commit
4571f893ed
@ -146,9 +146,8 @@ export enum DICT_TYPE {
|
||||
MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型
|
||||
|
||||
// ========== MALL - 会员模块 ==========
|
||||
// 积分模块 TODO 芋艿:改成 member_ 前缀;包括枚举和值;
|
||||
MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type',
|
||||
MEMBER_POINT_STATUS = 'member_point_status',
|
||||
MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', // 积分的业务类型
|
||||
MEMBER_POINT_STATUS = 'member_point_status', // 积分的状态
|
||||
|
||||
// ========== MALL - 商品模块 ==========
|
||||
PRODUCT_UNIT = 'product_unit', // 商品单位
|
||||
|
@ -10,9 +10,11 @@
|
||||
<el-form-item label="hideId" v-show="false">
|
||||
<el-input v-model="formData.id" />
|
||||
</el-form-item>
|
||||
<!-- TODO @xiaqing:展示给用户的字段名,可以和 crmeb 保持一直,然后每一个表单都有类似 crmeb 的 tip;例如说:积分抵用比例(1积分抵多少金额)单位:元 -->
|
||||
<el-form-item label="积分抵扣" prop="tradeDeductEnable">
|
||||
<el-switch v-model="formData.tradeDeductEnable" />
|
||||
</el-form-item>
|
||||
<!-- TODO @xiaqing:用户看到的是元,最多 2 位;分是后端的存储哈 -->
|
||||
<el-form-item label="抵扣单位(分)" prop="tradeDeductUnitPrice">
|
||||
<el-input-number
|
||||
v-model="formData.tradeDeductUnitPrice"
|
||||
@ -27,10 +29,10 @@
|
||||
style="width: 300px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="1元赠送多少分" prop="tradeGivePoint">
|
||||
<el-form-item label="1 元赠送多少分" prop="tradeGivePoint">
|
||||
<el-input-number
|
||||
v-model="formData.tradeGivePoint"
|
||||
placeholder="请输入1元赠送多少积分"
|
||||
placeholder="请输入 1 元赠送多少积分"
|
||||
style="width: 300px"
|
||||
/>
|
||||
</el-form-item>
|
||||
@ -58,6 +60,7 @@ const formData = ref({
|
||||
const formRules = reactive({})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 修改积分配置 */
|
||||
const onSubmit = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
@ -75,6 +78,7 @@ const onSubmit = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得积分配置 */
|
||||
const getConfig = async () => {
|
||||
try {
|
||||
const data = await ConfigApi.getConfig()
|
||||
@ -82,6 +86,7 @@ const getConfig = async () => {
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getConfig()
|
||||
})
|
||||
|
@ -157,6 +157,7 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO @xiaqing:不需要更新操作哇?
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
|
@ -57,7 +57,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发生时间" prop="createDate">
|
||||
<el-form-item label="获得时间" prop="createDate">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createDate"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
@ -78,13 +78,18 @@
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="序号" align="center" prop="id" />
|
||||
<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="id" />
|
||||
<!-- TODO @xiaqing:展示用户的昵称哈; -->
|
||||
<el-table-column label="用户" align="center" prop="userId" />
|
||||
<el-table-column label="积分标题" align="center" prop="title" />
|
||||
<el-table-column label="积分描述" align="center" prop="description" />
|
||||
<el-table-column
|
||||
label="获得时间"
|
||||
align="center"
|
||||
prop="createDate"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<!-- todo @xiaqing:可以参考 crmeb 的展示,把积分和增加减少放一起,用红色和绿色展示 -->
|
||||
<el-table-column
|
||||
label="操作类型"
|
||||
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="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">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.MEMBER_POINT_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户id" align="center" prop="userId" />
|
||||
<el-table-column
|
||||
label="冻结时间"
|
||||
align="center"
|
||||
@ -117,12 +125,6 @@
|
||||
prop="thawingTime"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column
|
||||
label="发生时间"
|
||||
align="center"
|
||||
prop="createDate"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
|
@ -8,6 +8,7 @@
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<!-- TODO @xiaqing:搜索可以去掉,因为一共就没几条配置哈 -->
|
||||
<el-form-item label="签到天数" prop="day">
|
||||
<el-input
|
||||
v-model="queryParams.day"
|
||||
@ -35,6 +36,7 @@
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['point:sign-in-config:export']"
|
||||
>
|
||||
<!-- TODO @xiaqing:四个功能的导出都可以去掉 -->
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@ -44,15 +46,10 @@
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<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="point" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column label="获得积分" align="center" prop="point" />
|
||||
<!-- TODO @xiaqing:展示一个是否开启 -->
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@ -88,7 +85,6 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import * as SignInConfigApi from '@/api/point/signInConfig'
|
||||
import SignInConfigForm from './SignInConfigForm.vue'
|
||||
@ -109,6 +105,7 @@ const queryParams = reactive({
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
// TODO @xiaqing:可以不分页;
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
|
@ -40,14 +40,6 @@
|
||||
<el-form-item>
|
||||
<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-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- @click="openForm('create')"-->
|
||||
<!-- v-hasPermi="['point:sign-in-record:create']"-->
|
||||
<!-- >-->
|
||||
<!-- <Icon icon="ep:plus" class="mr-5px" /> 新增-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@ -64,10 +56,11 @@
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<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="day" />
|
||||
<el-table-column label="签到的分数" align="center" prop="point" />
|
||||
<el-table-column label="获得积分" align="center" prop="point" />
|
||||
<el-table-column
|
||||
label="签到时间"
|
||||
align="center"
|
||||
@ -76,14 +69,6 @@
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<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
|
||||
link
|
||||
type="danger"
|
||||
|
Loading…
Reference in New Issue
Block a user