release(custom): i

This commit is contained in:
2023-10-10 15:16:06 +08:00
parent 5d1b96be72
commit a95a8ac0d1
50 changed files with 15273 additions and 4752 deletions

View File

@@ -1,6 +1,72 @@
<template>
<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="24" mt-10>
<div>
<span>订单状态</span>
<n-radio-group v-model:value="queryData.status">
<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>
<div w-100>关键字搜索</div>
<n-input-group>
<n-select
v-model:value="queryData.selectKey"
:style="{ width: '7%' }"
:options="selectOptions"
placeholder="请选择"
/>
<n-input v-model:value="queryData.word" :style="{ width: '20%' }" />
</n-input-group>
</div>
</n-col>
<n-col :span="10">
<div mt-10 flex items-center>
<span w-100>订单时间</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-5"
:loading="loading"
:columns="columns"
:data="data"
@@ -13,9 +79,55 @@
<script setup>
import api from './api'
import { NEllipsis } from 'naive-ui'
const loading = ref(false)
const queryData = ref({
status: '',
time: null,
word: '',
selectKey: null,
})
const songs = ref([
{
value: 1,
label: '待付款',
},
{
value: 2,
label: '待核销',
},
{
value: 3,
label: '已核销',
},
{
value: 4,
label: '已过期',
},
])
const selectOptions = ref([
{
value: 0,
label: '商品名称',
},
{
value: 1,
label: '用户昵称',
},
{
value: 2,
label: '手机号',
},
{
value: 3,
label: '订单号',
},
])
const columns = ref([
{
title: '订单号',
@@ -28,15 +140,41 @@ const columns = ref([
key: 'user_name',
},
{
title: '商品名称',
title: '手机号',
align: 'center',
key: 'goods_name',
key: 'phone',
},
{
title: '商品价格',
title: '商品名称',
align: 'center',
slot: 'goods_name',
render: (row) => {
return h(
NEllipsis,
{
style: 'max-width: 240px',
},
{
default: () => row.goods_name,
}
)
},
},
{
title: '商品数量',
align: 'center',
key: 'count',
},
{
title: '商品总价',
align: 'center',
key: 'number',
},
{
title: '订单佣金',
align: 'center',
key: 'commission',
},
{
title: '订单状态',
align: 'center',
@@ -55,17 +193,33 @@ const columns = ref([
},
},
{
title: '操作',
title: '下单时间',
align: 'center',
slot: 'action',
render(row) {
console.log(row)
},
key: 'add_time',
},
{
title: '核销时间',
align: 'center',
key: 'cancel_time',
},
// {
// title: '操作',
// align: 'center',
// slot: 'action',
// render() {
// // console.log(row)
// },
// },
])
const data = ref([])
const cardData = ref({
total: 0,
service: 0,
count: 0,
})
const pagination = ref({
page: 1,
pageSize: 10,
@@ -88,18 +242,51 @@ onMounted(() => {
const getList = async () => {
loading.value = true
try {
const query_data = {
Status: queryData.value.status || '',
StartTime: queryData.value.time === null ? '' : queryData.value.time[0] || '',
EndTime: queryData.value.time === null ? '' : queryData.value.time[1] || '',
}
switch (queryData.value.selectKey) {
case 0:
query_data['GoodsName'] = queryData.value.word
break
case 1:
query_data['UserName'] = queryData.value.word
break
case 2:
query_data['Phone'] = queryData.value.word
break
case 3:
query_data['Oid'] = queryData.value.word
break
}
const res = await api.getOrder({
pageNum: pagination.value.page,
pageSize: pagination.value.pageSize,
...query_data,
})
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)
throw error
}
loading.value = false
}
const clear = () => {
queryData.value = {
status: '',
time: null,
word: '',
selectKey: null,
}
getList()
}
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,5 @@
import { request } from '@/utils'
export default {
getOrder: (data) => request.post('/order', data),
}

View File

@@ -0,0 +1,282 @@
<template>
<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.count" />
</n-statistic>
</n-card>
</div>
</n-col>
<n-col :span="24" mt-10>
<div>
<span>订单状态</span>
<n-radio-group v-model:value="queryData.status">
<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>
<div w-100>关键字搜索</div>
<n-input-group>
<n-select
v-model:value="queryData.selectKey"
:style="{ width: '7%' }"
:options="selectOptions"
placeholder="请选择"
/>
<n-input v-model:value="queryData.word" :style="{ width: '20%' }" />
</n-input-group>
</div>
</n-col>
<n-col :span="10">
<div mt-10 flex items-center>
<span w-100>订单时间</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-5"
:loading="loading"
:columns="columns"
:data="data"
:pagination="pagination"
:bordered="false"
remote
/>
</CommonPage>
</template>
<script setup>
import api from './api'
import { NEllipsis } from 'naive-ui'
const loading = ref(false)
const queryData = ref({
status: '',
time: null,
word: '',
selectKey: null,
})
const songs = ref([
{
value: 1,
label: '待付款',
},
{
value: 2,
label: '待核销',
},
{
value: 3,
label: '已核销',
},
{
value: 4,
label: '已过期',
},
])
const selectOptions = ref([
{
value: 0,
label: '商品名称',
},
{
value: 1,
label: '用户昵称',
},
{
value: 2,
label: '手机号',
},
{
value: 3,
label: '订单号',
},
])
const columns = ref([
{
title: '订单号',
align: 'center',
key: 'oid',
},
{
title: '用户',
align: 'center',
key: 'user_name',
},
{
title: '手机号',
align: 'center',
key: 'phone',
},
{
title: '商品名称',
align: 'center',
slot: 'goods_name',
render: (row) => {
return h(
NEllipsis,
{
style: 'max-width: 240px',
},
{
default: () => row.goods_name,
}
)
},
},
{
title: '商品数量',
align: 'center',
key: 'count',
},
{
title: '商品总价',
align: 'center',
key: 'number',
},
{
title: '订单状态',
align: 'center',
slot: 'status',
render(row) {
switch (row.status) {
case 0:
return h('span', '待付款')
case 1:
return h('span', '待使用')
case 2:
return h('span', '已完成')
case 3:
return h('span', '已过期')
}
},
},
{
title: '下单时间',
align: 'center',
key: 'add_time',
},
{
title: '核销时间',
align: 'center',
key: 'cancel_time',
},
// {
// title: '操作',
// align: 'center',
// slot: 'action',
// render() {
// // console.log(row)
// },
// },
])
const data = ref([])
const cardData = ref({
total: 0,
service: 0,
count: 0,
})
const pagination = ref({
page: 1,
pageSize: 10,
itemCount: 0,
onChange: (page) => {
pagination.value.page = page
getList()
},
onUpdatePageSize: (pageSize) => {
pagination.value.pageSize = pageSize
pagination.value.page = 1
getList()
},
})
onMounted(() => {
getList()
})
const getList = async () => {
loading.value = true
try {
const query_data = {
Status: queryData.value.status || '',
StartTime: queryData.value.time === null ? '' : queryData.value.time[0] || '',
EndTime: queryData.value.time === null ? '' : queryData.value.time[1] || '',
}
switch (queryData.value.selectKey) {
case 0:
query_data['GoodsName'] = queryData.value.word
break
case 1:
query_data['UserName'] = queryData.value.word
break
case 2:
query_data['Phone'] = queryData.value.word
break
case 3:
query_data['Oid'] = queryData.value.word
break
}
const res = await api.getOrder({
pageNum: pagination.value.page,
pageSize: pagination.value.pageSize,
...query_data,
})
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)
throw error
}
loading.value = false
}
const clear = () => {
queryData.value = {
status: '',
time: null,
word: '',
selectKey: null,
}
getList()
}
</script>
<style lang="scss" scoped></style>

View File

@@ -8,17 +8,28 @@ export default {
meta: {
title: '订单管理',
icon: 'majesticons:compass-line',
order: 1,
// requireAuth: true,
// role: ['1'],
order: 10,
},
children: [
{
name: 'OrderList',
path: 'order_list',
name: 'gyList',
path: 'gy_list',
component: () => import('./index1/index.vue'),
meta: {
requireAuth: true,
role: ['1'],
title: '订单列表',
icon: 'material-symbols:auto-awesome-outline-rounded',
},
},
{
name: 'dhList',
path: 'dh_list',
component: () => import('./index/index.vue'),
meta: {
requireAuth: true,
title: '订单列表',
role: ['2'],
icon: 'material-symbols:auto-awesome-outline-rounded',
},
},