code review:会员签到配置

This commit is contained in:
YunaiV 2023-08-20 10:14:36 +08:00
parent cbd3d6c9a2
commit 76a63e01c9
3 changed files with 13 additions and 40 deletions

View File

@ -29,8 +29,3 @@ export const updateMemberTag = async (data: TagVO) => {
export const deleteMemberTag = async (id: number) => { export const deleteMemberTag = async (id: number) => {
return await request.delete({ url: `/member/tag/delete?id=` + id }) return await request.delete({ url: `/member/tag/delete?id=` + id })
} }
// 导出会员标签 Excel
export const exportMemberTag = async (params) => {
return await request.download({ url: `/member/tag/export-excel`, params })
}

View File

@ -25,8 +25,8 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-text class="mx-1" size="small" type="info" <el-text class="mx-1" size="small" type="info">
>积分抵用比例(1积分抵多少金额)单位 积分抵用比例(1 积分抵多少金额)单位
</el-text> </el-text>
</el-form-item> </el-form-item>
<el-form-item label="积分抵扣最大值" prop="tradeDeductMaxPrice" class="item-bottom"> <el-form-item label="积分抵扣最大值" prop="tradeDeductMaxPrice" class="item-bottom">
@ -37,7 +37,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-text class="mx-1" size="small" type="info">单次下单积分使用上限,0不限制</el-text> <el-text class="mx-1" size="small" type="info">单次下单积分使用上限0 不限制</el-text>
</el-form-item> </el-form-item>
<el-form-item label="1 元赠送多少分" prop="tradeGivePoint" class="item-bottom"> <el-form-item label="1 元赠送多少分" prop="tradeGivePoint" class="item-bottom">
<el-input-number <el-input-number
@ -47,9 +47,9 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-text class="mx-1" size="small" type="info" <el-text class="mx-1" size="small" type="info">
>下单支付金额按比例赠送积分实际支付1元赠送多少积分</el-text 下单支付金额按比例赠送积分实际支付 1 元赠送多少积分
> </el-text>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit">保存</el-button> <el-button type="primary" @click="onSubmit">保存</el-button>
@ -60,18 +60,20 @@
<script lang="ts" setup> <script lang="ts" setup>
import * as ConfigApi from '@/api/point/config' import * as ConfigApi from '@/api/point/config'
defineOptions({ name: 'MemberPointConfig' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formData = ref({ const formData = ref({
id: undefined,
tradeDeductEnable: true, tradeDeductEnable: true,
tradeDeductUnitPrice: 0, tradeDeductUnitPrice: 0,
tradeDeductMaxPrice: 0, tradeDeductMaxPrice: 0,
tradeGivePoint: 0 tradeGivePoint: 0
}) })
// tradeDeductUnitPrice // tradeDeductUnitPrice
const computedTradeDeductUnitPrice = computed({ const computedTradeDeductUnitPrice = computed({
get: () => (formData.value.tradeDeductUnitPrice / 100).toFixed(2), get: () => (formData.value.tradeDeductUnitPrice / 100).toFixed(2),
@ -105,7 +107,9 @@ const onSubmit = async () => {
const getConfig = async () => { const getConfig = async () => {
try { try {
const data = await ConfigApi.getConfig() const data = await ConfigApi.getConfig()
if (data === null) return if (data === null) {
return
}
formData.value = data formData.value = data
} finally { } finally {
} }
@ -118,6 +122,6 @@ onMounted(() => {
<style scoped> <style scoped>
.item-bottom { .item-bottom {
margin-bottom: 0px; margin-bottom: 0;
} }
</style> </style>

View File

@ -34,15 +34,6 @@
<el-button type="primary" @click="openForm('create')" v-hasPermi="['member:tag:create']"> <el-button type="primary" @click="openForm('create')" v-hasPermi="['member:tag:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增 <Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button> </el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['member:tag:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -50,7 +41,6 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" type="index" width="70px" />
<el-table-column label="编号" align="center" prop="id" width="150px" /> <el-table-column label="编号" align="center" prop="id" width="150px" />
<el-table-column label="标签名称" align="center" prop="name" /> <el-table-column label="标签名称" align="center" prop="name" />
<el-table-column <el-table-column
@ -112,7 +102,6 @@ const queryParams = reactive({
createTime: [] createTime: []
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -157,21 +146,6 @@ const handleDelete = async (id: number) => {
} catch {} } catch {}
} }
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await TagApi.exportMemberTag(queryParams)
download.excel(data, '会员标签.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
getList() getList()