feat: move order list to payment menu

This commit is contained in:
z 2026-05-04 00:39:31 +08:00
parent 584a51c791
commit f0142e75a5
3 changed files with 29 additions and 26 deletions

View File

@ -71,12 +71,6 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/operate/order-abnormal.vue'), component: () => import('#/views/operate/order-abnormal.vue'),
meta: { title: '异常订单' }, meta: { title: '异常订单' },
}, },
{
name: 'OperateOrderDetails',
path: 'order/details',
component: () => import('#/views/operate/order-details.vue'),
meta: { title: '订单详情' },
},
{ {
name: 'OperateReimburse', name: 'OperateReimburse',
path: 'reimburse', path: 'reimburse',

View File

@ -9,8 +9,15 @@ const routes: RouteRecordRaw[] = [
}, },
name: 'PaymentManager', name: 'PaymentManager',
path: '/payment/manager', path: '/payment/manager',
redirect: '/payment/manager/country', redirect: '/payment/manager/order/list',
children: [ children: [
{
name: 'PaymentOrderList',
path: 'order/list',
alias: '/operate/manager/order/details',
component: () => import('#/views/operate/order-details.vue'),
meta: { title: '订单列表' },
},
{ {
name: 'PayCountry', name: 'PayCountry',
path: 'country', path: 'country',

View File

@ -39,7 +39,7 @@ import {
import OrderDetailsDrawer from './components/order-details-drawer.vue'; import OrderDetailsDrawer from './components/order-details-drawer.vue';
import UserProfileLink from './components/user-profile-link.vue'; import UserProfileLink from './components/user-profile-link.vue';
defineOptions({ name: 'OperateOrderDetails' }); defineOptions({ name: 'PaymentOrderList' });
const router = useRouter(); const router = useRouter();
const accessStore = useAccessStore(); const accessStore = useAccessStore();
@ -89,16 +89,6 @@ const columns = [
{ dataIndex: 'actions', key: 'actions', title: '操作', width: 100, fixed: 'right' as const }, { dataIndex: 'actions', key: 'actions', title: '操作', width: 100, fixed: 'right' as const },
]; ];
watch(
sysOriginOptions,
(options) => {
if (sysOrigins.value.length === 0 && options.length > 0) {
sysOrigins.value = [String(options[0]?.value || '')];
}
},
{ immediate: true },
);
watch( watch(
rangeDate, rangeDate,
(value) => { (value) => {
@ -112,7 +102,7 @@ function getEffectiveSysOrigin() {
if (sysOrigins.value.length > 0) { if (sysOrigins.value.length > 0) {
return sysOrigins.value.join(','); return sysOrigins.value.join(',');
} }
return sysOriginOptions.value.map((item) => String(item.value)).join(','); return '';
} }
async function loadRegions() { async function loadRegions() {
@ -125,7 +115,7 @@ async function loadData(reset = false) {
query.lastId = ''; query.lastId = '';
notMore.value = false; notMore.value = false;
} }
query.sysOrigins = getEffectiveSysOrigin(); const params = buildQueryParams();
if (reset) { if (reset) {
loading.value = true; loading.value = true;
} else { } else {
@ -133,8 +123,8 @@ async function loadData(reset = false) {
} }
try { try {
const [result, amountResult] = await Promise.all([ const [result, amountResult] = await Promise.all([
listInAppPurchase({ ...query }), listInAppPurchase(params),
getOrderAmount({ ...query }), getOrderAmount(params),
]); ]);
const current = result || []; const current = result || [];
list.value = reset ? current : [...list.value, ...current]; list.value = reset ? current : [...list.value, ...current];
@ -147,6 +137,18 @@ async function loadData(reset = false) {
} }
} }
function buildQueryParams() {
query.sysOrigins = getEffectiveSysOrigin();
return Object.fromEntries(
Object.entries({ ...query }).filter(([, value]) => {
if (Array.isArray(value)) {
return value.length > 0;
}
return value !== '' && value !== undefined && value !== null;
}),
);
}
function handleSearch() { function handleSearch() {
void loadData(true); void loadData(true);
} }
@ -170,7 +172,7 @@ void loadData(true);
</script> </script>
<template> <template>
<Page title="订单详情"> <Page title="订单列表">
<Card> <Card>
<div class="toolbar"> <div class="toolbar">
<SysOriginSelect <SysOriginSelect
@ -184,7 +186,7 @@ void loadData(true);
<Select option-label-prop="label" <Select option-label-prop="label"
v-model:value="query.factoryPlatform" v-model:value="query.factoryPlatform"
allow-clear allow-clear
placeholder="支付平台" placeholder="支付平台(全部)"
style="width: 140px" style="width: 140px"
:options="ORIGIN_PLATFORM_OPTIONS.map((item) => ({ label: `${item.name}`, value: item.value as any }))" :options="ORIGIN_PLATFORM_OPTIONS.map((item) => ({ label: `${item.name}`, value: item.value as any }))"
@ -192,7 +194,7 @@ void loadData(true);
<Select option-label-prop="label" <Select option-label-prop="label"
v-model:value="query.status" v-model:value="query.status"
allow-clear allow-clear
placeholder="订单状态" placeholder="订单状态(全部)"
style="width: 140px" style="width: 140px"
:options="ORDER_STATUS_OPTIONS.map((item) => ({ label: `${item.name}`, value: item.value as any }))" :options="ORDER_STATUS_OPTIONS.map((item) => ({ label: `${item.name}`, value: item.value as any }))"
@ -200,7 +202,7 @@ void loadData(true);
<Select option-label-prop="label" <Select option-label-prop="label"
v-model:value="query.receiptType" v-model:value="query.receiptType"
allow-clear allow-clear
placeholder="订单类型" placeholder="订单类型(全部)"
style="width: 140px" style="width: 140px"
:options="ORDER_RECEIPT_TYPE_OPTIONS.map((item) => ({ label: `${item.name}`, value: item.value as any }))" :options="ORDER_RECEIPT_TYPE_OPTIONS.map((item) => ({ label: `${item.name}`, value: item.value as any }))"