release(custom): i
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { request } from '@/utils'
|
||||
|
||||
export default {
|
||||
getList: (data) => request.post('/order', data),
|
||||
getList: (data) => request.post('/record', data),
|
||||
}
|
||||
|
||||
@@ -1,7 +1,58 @@
|
||||
<template>
|
||||
<!-- <div> -->
|
||||
<CommonPage show-footer :title="$route.title">
|
||||
<n-row gutter="12">
|
||||
<n-col :span="24">
|
||||
<div flex>
|
||||
<n-card w-500>
|
||||
<n-statistic label="订单流水(积分)" tabular-nums>
|
||||
<n-number-animation :from="0" :to="cardData.total" />
|
||||
</n-statistic>
|
||||
</n-card>
|
||||
<n-card ml-10 w-500>
|
||||
<n-statistic label="订单服务费(积分)" tabular-nums>
|
||||
<n-number-animation :from="0" :to="cardData.service" />
|
||||
</n-statistic>
|
||||
</n-card>
|
||||
<n-card ml-10 w-500>
|
||||
<n-statistic label="订单数量" tabular-nums>
|
||||
<n-number-animation :from="0" :to="cardData.count" />
|
||||
</n-statistic>
|
||||
</n-card>
|
||||
</div>
|
||||
</n-col>
|
||||
<n-col :span="8">
|
||||
<div mt-10 flex items-center>
|
||||
<span>积分渠道:</span>
|
||||
<n-radio-group v-model:value="queryData.type">
|
||||
<n-radio-button
|
||||
v-for="song in songs"
|
||||
:key="song.value"
|
||||
:value="song.value"
|
||||
:label="song.label"
|
||||
/>
|
||||
</n-radio-group>
|
||||
</div>
|
||||
</n-col>
|
||||
<n-col :span="24">
|
||||
<div mt-10 flex items-center>
|
||||
<span>条件筛选:</span>
|
||||
<n-date-picker
|
||||
v-model:formatted-value="queryData.time"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetimerange"
|
||||
clearable
|
||||
/>
|
||||
</div>
|
||||
</n-col>
|
||||
<n-col :span="24">
|
||||
<div mt-10>
|
||||
<n-button type="primary" @click="getList">搜索</n-button>
|
||||
<n-button ml-10 @click="clear">重置</n-button>
|
||||
</div>
|
||||
</n-col>
|
||||
</n-row>
|
||||
<n-data-table
|
||||
class="mt-10"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
@@ -10,35 +61,48 @@
|
||||
remote
|
||||
/>
|
||||
</CommonPage>
|
||||
<!-- </div> -->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import api from './api'
|
||||
import { NEllipsis } from 'naive-ui'
|
||||
|
||||
const loading = ref(false)
|
||||
const columns = ref([
|
||||
|
||||
const songs = ref([
|
||||
{
|
||||
title: 'ID',
|
||||
key: 'ID',
|
||||
align: 'center',
|
||||
label: '订单',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
title: '商品名称',
|
||||
key: 'goods_name',
|
||||
align: 'center',
|
||||
label: '提现',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
title: '用户名称',
|
||||
key: 'user_name',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '获取积分',
|
||||
key: 'number',
|
||||
align: 'center',
|
||||
label: '增加(含驳回)',
|
||||
value: 3,
|
||||
},
|
||||
])
|
||||
|
||||
const queryData = ref({
|
||||
type: 1,
|
||||
time: null,
|
||||
})
|
||||
|
||||
const cardData = ref({
|
||||
total: 0,
|
||||
service: 0,
|
||||
count: 0,
|
||||
})
|
||||
|
||||
// watch(
|
||||
// () => queryData.value.type,
|
||||
// () => {
|
||||
// getList()
|
||||
// }
|
||||
// )
|
||||
|
||||
const columns = ref([])
|
||||
const data = ref([])
|
||||
|
||||
const pagination = ref({
|
||||
@@ -63,18 +127,137 @@ onMounted(() => {
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
switch (queryData.value.type) {
|
||||
case 1:
|
||||
columns.value = [
|
||||
{
|
||||
title: 'ID',
|
||||
key: 'ID',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '商品名称',
|
||||
align: 'center',
|
||||
slot: 'goods_name',
|
||||
render: (row) => {
|
||||
return h(
|
||||
NEllipsis,
|
||||
{
|
||||
style: 'max-width: 240px',
|
||||
},
|
||||
{
|
||||
default: () => row.goods_name,
|
||||
}
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '商品数量',
|
||||
key: 'count',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户名称',
|
||||
key: 'user_name',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '上次留存积分',
|
||||
key: 'balance',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '获取积分',
|
||||
key: 'number',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '服务费',
|
||||
key: 'commission',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
key: 'record_time',
|
||||
align: 'center',
|
||||
},
|
||||
]
|
||||
break
|
||||
case 2:
|
||||
columns.value = [
|
||||
{
|
||||
title: '单号',
|
||||
key: 'oid',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '上次留存积分',
|
||||
key: 'balance',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '扣除积分',
|
||||
key: 'record_number',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
key: 'record_time',
|
||||
align: 'center',
|
||||
},
|
||||
]
|
||||
break
|
||||
case 3:
|
||||
columns.value = [
|
||||
{
|
||||
title: '单号',
|
||||
key: 'oid',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '上次留存积分',
|
||||
key: 'balance',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '获取积分',
|
||||
key: 'record_number',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
key: 'record_time',
|
||||
align: 'center',
|
||||
},
|
||||
]
|
||||
break
|
||||
}
|
||||
|
||||
const res = await api.getList({
|
||||
pageNum: pagination.value.page,
|
||||
pageSize: pagination.value.pageSize,
|
||||
Type: queryData.value.type,
|
||||
StartTime: queryData.value.time === null ? '' : queryData.value.time[0] || '',
|
||||
EndTime: queryData.value.time === null ? '' : queryData.value.time[1] || '',
|
||||
})
|
||||
console.log(res)
|
||||
data.value = res.data.data || []
|
||||
pagination.value.itemCount = res.data.total
|
||||
cardData.value.total = res.data.number
|
||||
cardData.value.service = res.data.commission
|
||||
cardData.value.count = res.data.total
|
||||
} catch (error) {
|
||||
$message.error(error.msg)
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
const clear = () => {
|
||||
queryData.value = {
|
||||
type: 1,
|
||||
time: null,
|
||||
}
|
||||
getList()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user