修复一些错误

This commit is contained in:
liu
2026-08-14 21:28:55 +08:00
parent 398bb98356
commit 228212f8e3
20 changed files with 489 additions and 100 deletions
+3 -4
View File
@@ -5,7 +5,6 @@ import type {
IPurchaseCell,
IPurchaseDetail,
IPurchaseStoreSummary,
PurchaseExportType,
} from '@/domain/iPurchaseOrder.ts';
/** 订单商品参数修改 */
@@ -103,11 +102,11 @@ export async function generateBill(purchaseId: number, stores: BillGenerateStore
});
}
/** C2/C3 导出采购单(Excel 表格)type=all 全品类 / category 仅蔬果分类 */
export async function exportPurchase(id: number, type: PurchaseExportType = 'all') {
/** 导出采购单(Excel 表格,全品类 */
export async function exportPurchase(id: number) {
return downloadBlob(
`/purchase/order/${id}/export`,
{ type },
{},
`采购单_${id}.xlsx`,
);
}
-1
View File
@@ -180,5 +180,4 @@ export const PURCHASE_STATUS_MAP: Record<number, { text: string; color: string }
3: { text: '已完成', color: 'success' },
};
export type PurchaseExportType = 'all' | 'category';
export type ExportFormat = 'xlsx' | 'pdf';
+2
View File
@@ -18,6 +18,8 @@ export default interface IStore {
pending_box_num?: number;
/** 待回托盘数量 */
pending_tray_num?: number;
/** 总采购金额(只统计商品金额,账单支付后累加) */
total_purchase_amount?: string;
status?: number;
remark?: string;
created_at?: string;
+10
View File
@@ -110,6 +110,16 @@ const StorePage: React.FC = () => {
</Text>
),
},
{
title: '总采购金额',
dataIndex: 'total_purchase_amount',
hideInForm: true,
hideInSearch: true,
align: 'center',
render: (_, record) => (
<Text strong className={'text-[red]'}>¥{record.total_purchase_amount ?? '0.00'}</Text>
),
},
{
title: '状态',
dataIndex: 'status',
+3 -7
View File
@@ -41,20 +41,16 @@ const { Title, Text } = Typography;
/**
* 状态流转合法路径:待接单→已接单/已取消;采购中→配送中/已完成;配送中→已完成
* (已接单→采购中 通过「生成采购单」完成,不在流转按钮内
* 状态流转合法路径:手动流转仅保留「接单」「取消订单」
* (已接单→采购中 「生成采购单」推进;采购单完成→配送中、生成账单→已完成 由业务链路自动推进
*/
const NEXT_STATUS: Record<number, { status: number; label: string; }> = {
0: { status: 1, label: '接单' },
2: { status: 3, label: '开始配送' },
3: { status: 4, label: '完成订单' },
};
/** 批量流转可选目标状态(弹窗单选,后端全量校验,任一不允许则整批中止) */
const BATCH_TARGET_OPTIONS = [
{ value: 1, label: '接单(待接单 → 已接单)' },
{ value: 3, label: '开始配送(采购中 → 配送中)' },
{ value: 4, label: '完成订单(采购中/配送中 → 已完成)' },
{ value: 9, label: '取消订单(待接单 → 已取消)' },
];
@@ -411,7 +407,7 @@ const StoreOrderPage: React.FC = () => {
<div className="mb-5">
<Title level={3}></Title>
<Text type="secondary">
</Text>
</div>
<XinTable<IStoreOrder> {...tableProps} />
+7 -12
View File
@@ -3,7 +3,6 @@ import {
Button,
Descriptions,
Drawer,
Dropdown,
Empty,
Form,
Image,
@@ -833,18 +832,14 @@ const PurchaseOrderPage: React.FC = () => {
<>
<Space style={{ marginBottom: 20 }}>
<AuthButton key="export" auth="purchase.order.export">
<Dropdown
menu={{
items: [
{ key: 'all', label: '导出全品类', onClick: () => detail && exportPurchase(detail.purchase.id!, 'all') },
{ key: 'category', label: '仅导出蔬果分类', onClick: () => detail && exportPurchase(detail.purchase.id!, 'category') },
],
}}
<Button
type="primary"
ghost
icon={<DownloadOutlined />}
onClick={() => detail && exportPurchase(detail.purchase.id!)}
>
<Button type="primary" ghost icon={<DownloadOutlined />}>
</Button>
</Dropdown>
</Button>
</AuthButton>
</Space>
<Table<IPurchaseDetailRow>