parent
21643274cb
commit
5a0579e087
@ -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 })
|
|
||||||
}
|
|
||||||
|
@ -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) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
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>
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user