commit
6ed7b3a69e
@ -0,0 +1,14 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface BargainHelpVO {
|
||||
id: number
|
||||
record: number
|
||||
userId: number
|
||||
reducePrice: number
|
||||
endTime: Date
|
||||
}
|
||||
|
||||
// 查询砍价记录列表
|
||||
export const getBargainHelpPage = async (params) => {
|
||||
return await request.get({ url: `/promotion/bargain-help/page`, params })
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface BargainRecordVO {
|
||||
id: number
|
||||
activityId: number
|
||||
userId: number
|
||||
spuId: number
|
||||
skuId: number
|
||||
bargainFirstPrice: number
|
||||
bargainPrice: number
|
||||
status: number
|
||||
orderId: number
|
||||
endTime: Date
|
||||
}
|
||||
|
||||
// 查询砍价记录列表
|
||||
export const getBargainRecordPage = async (params) => {
|
||||
return await request.get({ url: `/promotion/bargain-record/page`, params })
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface CombinationRecordVO {
|
||||
id: number // 拼团记录编号
|
||||
activityId: number // 拼团活动编号
|
||||
nickname: string // 用户昵称
|
||||
avatar: string // 用户头像
|
||||
headId: number // 团长编号
|
||||
expireTime: string // 过期时间
|
||||
userSize: number // 可参团人数
|
||||
userCount: number // 已参团人数
|
||||
status: number // 拼团状态
|
||||
spuName: string // 商品名字
|
||||
picUrl: string // 商品图片
|
||||
virtualGroup: boolean // 是否虚拟成团
|
||||
startTime: string // 开始时间 (订单付款后开始的时间)
|
||||
endTime: string // 结束时间(成团时间/失败时间)
|
||||
}
|
||||
|
||||
// 查询拼团记录列表
|
||||
export const getCombinationRecordPage = async (params) => {
|
||||
return await request.get({ url: '/promotion/combination-record/page', params })
|
||||
}
|
||||
|
||||
// 查询一个拼团的完整拼团记录
|
||||
export const getCombinationRecordPageByHeadId = async (params) => {
|
||||
return await request.get({ url: '/promotion/combination-record/page-by-headId', params })
|
||||
}
|
||||
|
||||
// 获得拼团记录的概要信息
|
||||
export const getCombinationRecordSummary = async () => {
|
||||
return await request.get({ url: '/promotion/combination-record/get-summary' })
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
import request from '@/config/axios'
|
||||
import dayjs from 'dayjs'
|
||||
import { TradeStatisticsComparisonRespVO } from '@/api/mall/statistics/trade'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
/** 会员分析 Request VO */
|
||||
export interface MemberAnalyseReqVO {
|
||||
times: [dayjs.ConfigType, dayjs.ConfigType]
|
||||
}
|
||||
|
||||
/** 会员分析 Response VO */
|
||||
export interface MemberAnalyseRespVO {
|
||||
visitorCount: number
|
||||
orderUserCount: number
|
||||
payUserCount: number
|
||||
atv: number
|
||||
comparison: TradeStatisticsComparisonRespVO<MemberAnalyseComparisonRespVO>
|
||||
}
|
||||
|
||||
/** 会员分析对照数据 Response VO */
|
||||
export interface MemberAnalyseComparisonRespVO {
|
||||
userCount: number
|
||||
activeUserCount: number
|
||||
rechargeUserCount: number
|
||||
}
|
||||
|
||||
/** 会员地区统计 Response VO */
|
||||
export interface MemberAreaStatisticsRespVO {
|
||||
areaId: number
|
||||
areaName: string
|
||||
userCount: number
|
||||
orderCreateCount: number
|
||||
orderPayCount: number
|
||||
orderPayPrice: number
|
||||
}
|
||||
|
||||
/** 会员性别统计 Response VO */
|
||||
export interface MemberSexStatisticsRespVO {
|
||||
sex: number
|
||||
userCount: number
|
||||
}
|
||||
|
||||
/** 会员统计 Response VO */
|
||||
export interface MemberSummaryRespVO {
|
||||
userCount: number
|
||||
rechargeUserCount: number
|
||||
rechargePrice: number
|
||||
expensePrice: number
|
||||
}
|
||||
|
||||
/** 会员终端统计 Response VO */
|
||||
export interface MemberTerminalStatisticsRespVO {
|
||||
terminal: number
|
||||
userCount: number
|
||||
}
|
||||
|
||||
// 查询会员统计
|
||||
export const getMemberSummary = () => {
|
||||
return request.get<MemberSummaryRespVO>({
|
||||
url: '/statistics/member/summary'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员分析数据
|
||||
export const getMemberAnalyse = (params: MemberAnalyseReqVO) => {
|
||||
return request.get<MemberAnalyseRespVO>({
|
||||
url: '/statistics/member/analyse',
|
||||
params: { times: [formatDate(params.times[0]), formatDate(params.times[1])] }
|
||||
})
|
||||
}
|
||||
|
||||
// 按照省份,查询会员统计列表
|
||||
export const getMemberAreaStatisticsList = () => {
|
||||
return request.get<MemberAreaStatisticsRespVO[]>({
|
||||
url: '/statistics/member/get-area-statistics-list'
|
||||
})
|
||||
}
|
||||
|
||||
// 按照性别,查询会员统计列表
|
||||
export const getMemberSexStatisticsList = () => {
|
||||
return request.get<MemberSexStatisticsRespVO[]>({
|
||||
url: '/statistics/member/get-sex-statistics-list'
|
||||
})
|
||||
}
|
||||
|
||||
// 按照终端,查询会员统计列表
|
||||
export const getMemberTerminalStatisticsList = () => {
|
||||
return request.get<MemberTerminalStatisticsRespVO[]>({
|
||||
url: '/statistics/member/get-terminal-statistics-list'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
import request from '@/config/axios'
|
||||
import dayjs from 'dayjs'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
/** 交易统计对照 Response VO */
|
||||
export interface TradeStatisticsComparisonRespVO<T> {
|
||||
value: T
|
||||
reference: T
|
||||
}
|
||||
|
||||
/** 交易统计 Response VO */
|
||||
export interface TradeSummaryRespVO {
|
||||
yesterdayOrderCount: number
|
||||
monthOrderCount: number
|
||||
yesterdayPayPrice: number
|
||||
monthPayPrice: number
|
||||
}
|
||||
|
||||
/** 交易状况 Request VO */
|
||||
export interface TradeTrendReqVO {
|
||||
times: [dayjs.ConfigType, dayjs.ConfigType]
|
||||
}
|
||||
|
||||
/** 交易状况统计 Response VO */
|
||||
export interface TradeTrendSummaryRespVO {
|
||||
time: string
|
||||
turnover: number
|
||||
orderPayPrice: number
|
||||
rechargePrice: number
|
||||
expensePrice: number
|
||||
balancePrice: number
|
||||
brokerageSettlementPrice: number
|
||||
orderRefundPrice: number
|
||||
}
|
||||
|
||||
// 查询交易统计
|
||||
export const getTradeStatisticsSummary = () => {
|
||||
return request.get<TradeStatisticsComparisonRespVO<TradeSummaryRespVO>>({
|
||||
url: '/statistics/trade/summary'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得交易状况统计
|
||||
export const getTradeTrendSummary = (params: TradeTrendReqVO) => {
|
||||
return request.get<TradeStatisticsComparisonRespVO<TradeTrendSummaryRespVO>>({
|
||||
url: '/statistics/trade/trend/summary',
|
||||
params: formatDateParam(params)
|
||||
})
|
||||
}
|
||||
|
||||
// 获得交易状况明细
|
||||
export const getTradeTrendList = (params: TradeTrendReqVO) => {
|
||||
return request.get<TradeTrendSummaryRespVO[]>({
|
||||
url: '/statistics/trade/trend/list',
|
||||
params: formatDateParam(params)
|
||||
})
|
||||
}
|
||||
|
||||
// 导出交易状况明细
|
||||
export const exportTradeTrend = (params: TradeTrendReqVO) => {
|
||||
return request.download({
|
||||
url: '/statistics/trade/trend/export-excel',
|
||||
params: formatDateParam(params)
|
||||
})
|
||||
}
|
||||
|
||||
/** 时间参数需要格式化, 确保接口能识别 */
|
||||
const formatDateParam = (params: TradeTrendReqVO) => {
|
||||
return { times: [formatDate(params.times[0]), formatDate(params.times[1])] } as TradeTrendReqVO
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ConfigVO {
|
||||
id: number
|
||||
pointTradeDeductEnable: number
|
||||
pointTradeDeductUnitPrice: number
|
||||
pointTradeDeductMaxPrice: number
|
||||
pointTradeGivePoint: number
|
||||
}
|
||||
|
||||
// 查询积分设置详情
|
||||
export const getConfig = async () => {
|
||||
return await request.get({ url: `/member/config/get` })
|
||||
}
|
||||
|
||||
// 新增修改积分设置
|
||||
export const saveConfig = async (data: ConfigVO) => {
|
||||
return await request.put({ url: `/member/config/save`, data })
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ConfigVO {
|
||||
id: number
|
||||
tradeDeductEnable: number
|
||||
tradeDeductUnitPrice: number
|
||||
tradeDeductMaxPrice: number
|
||||
tradeGivePoint: number
|
||||
}
|
||||
|
||||
// 查询积分设置详情
|
||||
export const getConfig = async () => {
|
||||
return await request.get({ url: `/member/point/config/get` })
|
||||
}
|
||||
|
||||
// 新增修改积分设置
|
||||
export const saveConfig = async (data: ConfigVO) => {
|
||||
return await request.put({ url: `/member/point/config/save`, data })
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 用户钱包查询参数 */
|
||||
export interface PayWalletUserReqVO {
|
||||
userId: number
|
||||
userType: number
|
||||
}
|
||||
/** 钱包 VO */
|
||||
export interface WalletVO {
|
||||
id: number
|
||||
userId: number
|
||||
userType: number
|
||||
balance: number
|
||||
totalExpense: number
|
||||
totalRecharge: number
|
||||
freezePrice: number
|
||||
}
|
||||
|
||||
/** 查询用户钱包详情 */
|
||||
export const getWallet = async (params: PayWalletUserReqVO) => {
|
||||
return await request.get<WalletVO>({ url: `/pay/wallet/get`, params })
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -1,12 +1,7 @@
|
||||
import { fenToYuan } from '@/utils'
|
||||
import { TableColumnCtx } from 'element-plus'
|
||||
import { floatToFixed2 } from '@/utils'
|
||||
|
||||
// 格式化金额【分转元】
|
||||
export const fenToYuanFormat = (
|
||||
row: any,
|
||||
column: TableColumnCtx<any>,
|
||||
cellValue: any,
|
||||
index: number
|
||||
) => {
|
||||
return `¥${fenToYuan(cellValue)}`
|
||||
// @ts-ignore
|
||||
export const fenToYuanFormat = (_, __, cellValue: any, ___) => {
|
||||
return `¥${floatToFixed2(cellValue)}`
|
||||
}
|
||||
|
||||
@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="砍价状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择砍价状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.PROMOTION_BARGAIN_RECORD_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<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="['promotion:bargain-record:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['promotion:bargain-record:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="编号" min-width="50" prop="id" />
|
||||
<el-table-column label="发起用户" min-width="120">
|
||||
<template #default="scope">
|
||||
<el-image
|
||||
:src="scope.row.avatar"
|
||||
class="h-20px w-20px"
|
||||
:preview-src-list="[scope.row.avatar]"
|
||||
preview-teleported
|
||||
/>
|
||||
{{ scope.row.nickname }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="发起时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="砍价活动" min-width="150" prop="activity.name" />
|
||||
<el-table-column
|
||||
label="最低价"
|
||||
min-width="100"
|
||||
prop="activity.bargainMinPrice"
|
||||
:formatter="fenToYuanFormat"
|
||||
/>
|
||||
<el-table-column
|
||||
label="当前价"
|
||||
min-width="100"
|
||||
prop="bargainPrice"
|
||||
:formatter="fenToYuanFormat"
|
||||
/>
|
||||
<el-table-column label="总砍价次数" min-width="100" prop="activity.helpMaxCount" />
|
||||
<el-table-column label="剩余砍价次数" min-width="100" prop="helpCount" />
|
||||
<el-table-column label="砍价状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_BARGAIN_RECORD_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="结束时间"
|
||||
align="center"
|
||||
prop="endTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="订单编号" align="center" prop="orderId" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openRecordListDialog(scope.row.id)"
|
||||
v-hasPermi="['promotion:bargain-help:query']"
|
||||
>
|
||||
助力
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗 -->
|
||||
<BargainRecordListDialog ref="recordListDialogRef" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as BargainRecordApi from '@/api/mall/promotion/bargain/bargainRecord'
|
||||
import { fenToYuanFormat } from '@/utils/formatter'
|
||||
import BargainRecordListDialog from './BargainRecordListDialog.vue'
|
||||
|
||||
defineOptions({ name: 'PromotionBargainRecord' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref([]) // 列表的数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
status: null,
|
||||
createTime: []
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await BargainRecordApi.getBargainRecordPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 打开[助力]弹窗 */
|
||||
const recordListDialogRef = ref()
|
||||
const openRecordListDialog = (id?: number) => {
|
||||
recordListDialogRef.value.open(id)
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
@ -1,5 +1,272 @@
|
||||
<template>
|
||||
<div></div>
|
||||
<!-- 统计信息展示 -->
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="6">
|
||||
<ContentWrap class="h-[110px] pb-0!">
|
||||
<div class="flex items-center">
|
||||
<div
|
||||
class="h-[50px] w-[50px] flex items-center justify-center"
|
||||
style="color: rgb(24, 144, 255); background-color: rgba(24, 144, 255, 0.1)"
|
||||
>
|
||||
<Icon :size="23" icon="fa:user-times" />
|
||||
</div>
|
||||
<div class="ml-[20px]">
|
||||
<div class="mb-8px text-14px text-gray-400">参与人数(个)</div>
|
||||
<CountTo
|
||||
:duration="2600"
|
||||
:end-val="recordSummary.userCount"
|
||||
:start-val="0"
|
||||
class="text-20px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<ContentWrap class="h-[110px]">
|
||||
<div class="flex items-center">
|
||||
<div
|
||||
class="h-[50px] w-[50px] flex items-center justify-center"
|
||||
style="color: rgb(162, 119, 255); background-color: rgba(162, 119, 255, 0.1)"
|
||||
>
|
||||
<Icon :size="23" icon="fa:user-plus" />
|
||||
</div>
|
||||
<div class="ml-[20px]">
|
||||
<div class="mb-8px text-14px text-gray-400">成团数量(个)</div>
|
||||
<CountTo
|
||||
:duration="2600"
|
||||
:end-val="recordSummary.successCount"
|
||||
:start-val="0"
|
||||
class="text-20px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<ContentWrap class="h-[110px]">
|
||||
<div class="flex items-center">
|
||||
<div
|
||||
class="h-[50px] w-[50px] flex items-center justify-center"
|
||||
style="color: rgb(162, 119, 255); background-color: rgba(162, 119, 255, 0.1)"
|
||||
>
|
||||
<Icon :size="23" icon="fa:user-plus" />
|
||||
</div>
|
||||
<div class="ml-[20px]">
|
||||
<div class="mb-8px text-14px text-gray-400">虚拟成团(个)</div>
|
||||
<CountTo
|
||||
:duration="2600"
|
||||
:end-val="recordSummary.virtualGroupCount"
|
||||
:start-val="0"
|
||||
class="text-20px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<ContentWrap>
|
||||
<el-form
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
class="-mb-15px"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
:shortcuts="defaultShortcuts"
|
||||
class="!w-240px"
|
||||
end-placeholder="结束日期"
|
||||
start-placeholder="开始日期"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="拼团状态" prop="status">
|
||||
<el-select v-model="queryParams.status" class="!w-240px" clearable placeholder="全部">
|
||||
<el-option
|
||||
v-for="(dict, index) in getIntDictOptions(
|
||||
DICT_TYPE.PROMOTION_COMBINATION_RECORD_STATUS
|
||||
)"
|
||||
:key="index"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<Icon class="mr-5px" icon="ep:refresh" />
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 分页列表数据展示 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="pageList">
|
||||
<el-table-column align="center" label="编号" prop="id" min-width="50" />
|
||||
<el-table-column align="center" label="头像" prop="avatar" min-width="80">
|
||||
<template #default="scope">
|
||||
<el-avatar :src="scope.row.avatar" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="昵称" prop="nickname" min-width="100" />
|
||||
<el-table-column align="center" label="开团团长" prop="headId" min-width="100">
|
||||
<template #default="{ row }: { row: CombinationRecordApi.CombinationRecordVO }">
|
||||
{{
|
||||
row.headId ? pageList.find((item) => item.id === row.headId)?.nickname : row.nickname
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:formatter="dateFormatter"
|
||||
align="center"
|
||||
label="开团时间"
|
||||
prop="startTime"
|
||||
width="180"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="拼团商品"
|
||||
prop="type"
|
||||
show-overflow-tooltip
|
||||
min-width="300"
|
||||
>
|
||||
<template #defaul="{ row }">
|
||||
<el-image
|
||||
:src="row.picUrl"
|
||||
class="mr-5px h-30px w-30px align-middle"
|
||||
@click="imagePreview(row.picUrl)"
|
||||
/>
|
||||
<span class="align-middle">{{ row.spuName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="几人团" prop="userSize" min-width="100" />
|
||||
<el-table-column align="center" label="参与人数" prop="userCount" min-width="100" />
|
||||
<el-table-column
|
||||
:formatter="dateFormatter"
|
||||
align="center"
|
||||
label="参团时间"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
/>
|
||||
<el-table-column
|
||||
:formatter="dateFormatter"
|
||||
align="center"
|
||||
label="结束时间"
|
||||
prop="endTime"
|
||||
width="180"
|
||||
/>
|
||||
<el-table-column align="center" label="拼团状态" prop="status" min-width="150">
|
||||
<template #default="scope">
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.PROMOTION_COMBINATION_RECORD_STATUS"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPermi="['promotion:combination-record:query']"
|
||||
link
|
||||
type="primary"
|
||||
@click="openRecordListDialog(scope.row)"
|
||||
>
|
||||
查看拼团
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗 -->
|
||||
<CombinationRecordListDialog ref="combinationRecordListRef" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import CombinationRecordListDialog from './CombinationRecordListDialog.vue'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { dateFormatter, defaultShortcuts } from '@/utils/formatTime'
|
||||
import { createImageViewer } from '@/components/ImageViewer'
|
||||
import * as CombinationRecordApi from '@/api/mall/promotion/combination/combinationRecord'
|
||||
|
||||
defineOptions({ name: 'PromotionCombinationRecord' })
|
||||
|
||||
const queryParams = ref({
|
||||
status: undefined, // 拼团状态
|
||||
createTime: undefined, // 创建时间
|
||||
pageSize: 10,
|
||||
pageNo: 1
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const combinationRecordListRef = ref() // 查询表单 Ref
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 总记录数
|
||||
const pageList = ref<CombinationRecordApi.CombinationRecordVO[]>([]) // 分页数据
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await CombinationRecordApi.getCombinationRecordPage(queryParams.value)
|
||||
pageList.value = data.list as CombinationRecordApi.CombinationRecordVO[]
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
// 拼团统计数据
|
||||
const recordSummary = ref({
|
||||
successCount: 0,
|
||||
userCount: 0,
|
||||
virtualGroupCount: 0
|
||||
})
|
||||
/** 获得拼团记录统计信息 */
|
||||
const getSummary = async () => {
|
||||
recordSummary.value = await CombinationRecordApi.getCombinationRecordSummary()
|
||||
}
|
||||
|
||||
const openRecordListDialog = (row: CombinationRecordApi.CombinationRecordVO) => {
|
||||
combinationRecordListRef.value?.open(row.headId)
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 商品图预览 */
|
||||
const imagePreview = (imgUrl: string) => {
|
||||
createImageViewer({
|
||||
urlList: [imgUrl]
|
||||
})
|
||||
}
|
||||
|
||||
<script lang="ts" name="CombinationRecord" setup></script>
|
||||
/** 初始化 **/
|
||||
onMounted(async () => {
|
||||
await getSummary()
|
||||
await getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="flex flex-col gap-2 bg-[var(--el-bg-color-overlay)] p-6">
|
||||
<div class="flex items-center justify-between text-gray-500">
|
||||
<span>{{ title }}</span>
|
||||
<el-tooltip :content="tooltip" placement="top-start" v-if="tooltip">
|
||||
<Icon icon="ep:warning" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="mb-4 text-3xl">
|
||||
<CountTo :prefix="prefix" :end-val="value" :decimals="decimals" />
|
||||
</div>
|
||||
<div class="flex flex-row gap-1 text-sm">
|
||||
<span class="text-gray-500">环比</span>
|
||||
<span :class="toNumber(percent) > 0 ? 'text-red-500' : 'text-green-500'">
|
||||
{{ Math.abs(toNumber(percent)) }}%
|
||||
<Icon :icon="toNumber(percent) > 0 ? 'ep:caret-top' : 'ep:caret-bottom'" class="!text-sm" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { toNumber } from 'lodash-es'
|
||||
|
||||
/** 交易统计值组件 */
|
||||
defineOptions({ name: 'TradeStatisticValue' })
|
||||
|
||||
defineProps({
|
||||
tooltip: propTypes.string.def(''),
|
||||
title: propTypes.string.def(''),
|
||||
prefix: propTypes.string.def(''),
|
||||
value: propTypes.number.def(0),
|
||||
decimals: propTypes.number.def(0),
|
||||
percent: propTypes.oneOfType([Number, String]).def(0)
|
||||
})
|
||||
</script>
|
||||
@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<div class="flex flex-row items-center gap-3 rounded bg-[var(--el-bg-color-overlay)] p-4">
|
||||
<div
|
||||
class="h-12 w-12 flex flex-shrink-0 items-center justify-center rounded-1"
|
||||
:class="`${iconColor} ${iconBgColor}`"
|
||||
>
|
||||
<Icon :icon="icon" class="!text-6" />
|
||||
</div>
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="flex items-center gap-1 text-gray-500">
|
||||
<span class="text-3.5">{{ title }}</span>
|
||||
<el-tooltip :content="tooltip" placement="top-start" v-if="tooltip">
|
||||
<Icon icon="ep:warning" class="item-center flex !text-3" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="flex flex-row items-baseline gap-2">
|
||||
<div class="text-7">
|
||||
<CountTo :prefix="prefix" :end-val="value" :decimals="decimals" />
|
||||
</div>
|
||||
<span
|
||||
v-if="percent != undefined"
|
||||
:class="toNumber(percent) > 0 ? 'text-red-500' : 'text-green-500'"
|
||||
>
|
||||
<span class="text-sm">{{ Math.abs(toNumber(percent)) }}%</span>
|
||||
<Icon
|
||||
:icon="toNumber(percent) > 0 ? 'ep:caret-top' : 'ep:caret-bottom'"
|
||||
class="ml-0.5 !text-3"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { toNumber } from 'lodash-es'
|
||||
|
||||
/** 交易状况统计值组件 */
|
||||
defineOptions({ name: 'TradeTrendValue' })
|
||||
|
||||
defineProps({
|
||||
title: propTypes.string.def(''),
|
||||
tooltip: propTypes.string.def(''),
|
||||
icon: propTypes.string.def(''),
|
||||
iconColor: propTypes.string.def(''),
|
||||
iconBgColor: propTypes.string.def(''),
|
||||
prefix: propTypes.string.def(''),
|
||||
value: propTypes.number.def(0),
|
||||
decimals: propTypes.number.def(0),
|
||||
percent: propTypes.oneOfType([Number, String]).def(undefined)
|
||||
})
|
||||
</script>
|
||||
@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="85px"
|
||||
>
|
||||
<el-form-item label="用户类型" prop="level">
|
||||
<el-radio-group v-model="queryParams.level" @change="handleQuery">
|
||||
<el-radio-button checked>全部</el-radio-button>
|
||||
<el-radio-button label="1">一级推广人</el-radio-button>
|
||||
<el-radio-button label="2">二级推广人</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="绑定时间" prop="bindUserTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.bindUserTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<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-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="用户编号" align="center" prop="id" min-width="80px" />
|
||||
<el-table-column label="头像" align="center" prop="avatar" width="70px">
|
||||
<template #default="scope">
|
||||
<el-avatar :src="scope.row.avatar" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="昵称" align="center" prop="nickname" min-width="80px" />
|
||||
<el-table-column label="等级" align="center" prop="level" min-width="80px">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.bindUserId === bindUserId">一级</el-tag>
|
||||
<el-tag v-else>二级</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="绑定时间"
|
||||
align="center"
|
||||
prop="bindUserTime"
|
||||
:formatter="dateFormatter"
|
||||
width="170px"
|
||||
/>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as BrokerageUserApi from '@/api/mall/trade/brokerage/user'
|
||||
|
||||
/** 推广人列表 */
|
||||
defineOptions({ name: 'UserBrokerageList' })
|
||||
|
||||
const { bindUserId }: { bindUserId: number } = defineProps({
|
||||
bindUserId: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
}) //用户编号
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref([]) // 列表的数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
bindUserId: null,
|
||||
level: '',
|
||||
bindUserTime: []
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
queryParams.bindUserId = bindUserId
|
||||
const data = await BrokerageUserApi.getBrokerageUserPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
Loading…
Reference in New Issue