feat: move order list to payment menu
This commit is contained in:
parent
584a51c791
commit
f0142e75a5
@ -71,12 +71,6 @@ const routes: RouteRecordRaw[] = [
|
||||
component: () => import('#/views/operate/order-abnormal.vue'),
|
||||
meta: { title: '异常订单' },
|
||||
},
|
||||
{
|
||||
name: 'OperateOrderDetails',
|
||||
path: 'order/details',
|
||||
component: () => import('#/views/operate/order-details.vue'),
|
||||
meta: { title: '订单详情' },
|
||||
},
|
||||
{
|
||||
name: 'OperateReimburse',
|
||||
path: 'reimburse',
|
||||
|
||||
@ -9,8 +9,15 @@ const routes: RouteRecordRaw[] = [
|
||||
},
|
||||
name: 'PaymentManager',
|
||||
path: '/payment/manager',
|
||||
redirect: '/payment/manager/country',
|
||||
redirect: '/payment/manager/order/list',
|
||||
children: [
|
||||
{
|
||||
name: 'PaymentOrderList',
|
||||
path: 'order/list',
|
||||
alias: '/operate/manager/order/details',
|
||||
component: () => import('#/views/operate/order-details.vue'),
|
||||
meta: { title: '订单列表' },
|
||||
},
|
||||
{
|
||||
name: 'PayCountry',
|
||||
path: 'country',
|
||||
|
||||
@ -39,7 +39,7 @@ import {
|
||||
import OrderDetailsDrawer from './components/order-details-drawer.vue';
|
||||
import UserProfileLink from './components/user-profile-link.vue';
|
||||
|
||||
defineOptions({ name: 'OperateOrderDetails' });
|
||||
defineOptions({ name: 'PaymentOrderList' });
|
||||
|
||||
const router = useRouter();
|
||||
const accessStore = useAccessStore();
|
||||
@ -89,16 +89,6 @@ const columns = [
|
||||
{ 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(
|
||||
rangeDate,
|
||||
(value) => {
|
||||
@ -112,7 +102,7 @@ function getEffectiveSysOrigin() {
|
||||
if (sysOrigins.value.length > 0) {
|
||||
return sysOrigins.value.join(',');
|
||||
}
|
||||
return sysOriginOptions.value.map((item) => String(item.value)).join(',');
|
||||
return '';
|
||||
}
|
||||
|
||||
async function loadRegions() {
|
||||
@ -125,7 +115,7 @@ async function loadData(reset = false) {
|
||||
query.lastId = '';
|
||||
notMore.value = false;
|
||||
}
|
||||
query.sysOrigins = getEffectiveSysOrigin();
|
||||
const params = buildQueryParams();
|
||||
if (reset) {
|
||||
loading.value = true;
|
||||
} else {
|
||||
@ -133,8 +123,8 @@ async function loadData(reset = false) {
|
||||
}
|
||||
try {
|
||||
const [result, amountResult] = await Promise.all([
|
||||
listInAppPurchase({ ...query }),
|
||||
getOrderAmount({ ...query }),
|
||||
listInAppPurchase(params),
|
||||
getOrderAmount(params),
|
||||
]);
|
||||
const current = result || [];
|
||||
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() {
|
||||
void loadData(true);
|
||||
}
|
||||
@ -170,7 +172,7 @@ void loadData(true);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page title="订单详情">
|
||||
<Page title="订单列表">
|
||||
<Card>
|
||||
<div class="toolbar">
|
||||
<SysOriginSelect
|
||||
@ -184,7 +186,7 @@ void loadData(true);
|
||||
<Select option-label-prop="label"
|
||||
v-model:value="query.factoryPlatform"
|
||||
allow-clear
|
||||
placeholder="支付平台"
|
||||
placeholder="支付平台(全部)"
|
||||
style="width: 140px"
|
||||
|
||||
: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"
|
||||
v-model:value="query.status"
|
||||
allow-clear
|
||||
placeholder="订单状态"
|
||||
placeholder="订单状态(全部)"
|
||||
style="width: 140px"
|
||||
|
||||
: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"
|
||||
v-model:value="query.receiptType"
|
||||
allow-clear
|
||||
placeholder="订单类型"
|
||||
placeholder="订单类型(全部)"
|
||||
style="width: 140px"
|
||||
|
||||
:options="ORDER_RECEIPT_TYPE_OPTIONS.map((item) => ({ label: `${item.name}`, value: item.value as any }))"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user