add SalesOrderSummary.vue

This commit is contained in:
Timi
2026-09-19 01:21:55 +08:00
parent b9dc39bf55
commit 72e12d62bc
6 changed files with 438 additions and 2 deletions
+12 -2
View File
@@ -59,7 +59,7 @@
@refresh="refresh"
@scrolltolower="loadMore"
>
<div v-if="list.length" class="items">
<div class="items">
<t-cell-group v-if="packageConfigId" class="selected-package" theme="card">
<t-cell title="套餐" :note="selectedPackageName">
<template #left-icon>
@@ -67,6 +67,11 @@
</template>
</t-cell>
</t-cell-group>
<sales-order-summary
v-if="customerId"
ref="customerOrderSummaryRef"
:customer="selectedCustomer"
/>
<sales-order-list-cell
class="item"
v-for="(item, index) in list"
@@ -85,8 +90,8 @@
@refund="toRefund(item)"
@confirm-no-refund="toNoRefund(item)"
/>
<div v-if="!list.length" class="empty" v-text="loading ? '正在加载销售订单' : '暂无销售订单'" />
</div>
<div v-else class="center-tips" v-text="loading ? '正在加载销售订单' : '暂无销售订单'" />
<div class="center-tips" v-text="loading ? '正在加载' : noMore ? '已经到底了' : '上拉加载更多'" />
</t-pull-down-refresh>
</div>
@@ -108,6 +113,7 @@ import SalesOrderAPI from "@/api/SalesOrderAPI";
import CustomerSelector from "@/components/CustomerSelector.vue";
import NavBarActionMenu from "@/components/NavBarActionMenu.vue";
import SalesOrderListCell from "@/pages/salesOrder/components/SalesOrderListCell.vue";
import SalesOrderSummary from "@/pages/salesOrder/components/SalesOrderSummary.vue";
import { useNavBarStore } from "@/store/navBarStore";
import type { Customer } from "@/types/Customer";
import type { GaoPackageConfig } from "@/types/Package";
@@ -157,6 +163,8 @@ type RefundFilter = "ALL" | GaoSalesRefundStatus;
const status = ref("ALL");
const paymentStatus = ref<PaymentFilter>("ALL");
const refundStatus = ref<RefundFilter>("ALL");
type SalesOrderSummaryExpose = { refresh: () => Promise<void> };
const customerOrderSummaryRef = ref<SalesOrderSummaryExpose>();
const list = ref<SalesOrder[]>([]);
const pageIndex = ref(0);
const total = ref(0);
@@ -288,6 +296,7 @@ async function fetchList(reset: boolean): Promise<void> {
async function refresh(): Promise<void> {
try {
await customerOrderSummaryRef.value?.refresh();
await fetchList(true);
} catch (error) {
Message.error(getErrorMessage(error, "销售订单加载失败"));
@@ -494,4 +503,5 @@ onUnmounted(() => { navBarStore.clearRight(); search.cancel(); });
text-align: center;
}
}
</style>