forked from yoone/WEB
feat(订单): 添加订单导出功能并更新相关类型定义
添加订单导出API接口及前端实现 调整订单列表页面的IP字段显示 更新订单相关类型定义,包括物流信息和状态字段
This commit is contained in:
parent
ce12e55adc
commit
bb907fa47c
|
|
@ -288,7 +288,6 @@ const ListPage: React.FC = () => {
|
||||||
{
|
{
|
||||||
title: 'IP',
|
title: 'IP',
|
||||||
dataIndex: 'customer_ip_address',
|
dataIndex: 'customer_ip_address',
|
||||||
hideInSearch: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '设备',
|
title: '设备',
|
||||||
|
|
@ -504,31 +503,24 @@ const ListPage: React.FC = () => {
|
||||||
}}
|
}}
|
||||||
tableRef={actionRef}
|
tableRef={actionRef}
|
||||||
/>,
|
/>,
|
||||||
// <Button
|
|
||||||
// type="primary"
|
|
||||||
// disabled={selectedRowKeys.length === 0}
|
|
||||||
// onClick={handleBatchExport}
|
|
||||||
// >
|
|
||||||
// 批量导出
|
|
||||||
// </Button>,
|
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="批量导出"
|
title="批量导出"
|
||||||
description="确认导出选中的订单吗?"
|
description="确认导出选中的订单吗?"
|
||||||
onConfirm={async () => {
|
onConfirm={async () => {
|
||||||
console.log(selectedRowKeys);
|
console.log(selectedRowKeys);
|
||||||
try {
|
try {
|
||||||
const res = await request('/order/order/export', {
|
const res = await request('/order/export', {
|
||||||
method: 'GET',
|
method: 'POST',
|
||||||
params: {
|
data: {
|
||||||
ids: selectedRowKeys,
|
ids: selectedRowKeys,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (res?.success && res?.data?.csv) {
|
if (res?.success && res.data) {
|
||||||
const blob = new Blob([res.data.csv], { type: 'text/csv;charset=utf-8;' });
|
const blob = new Blob([res.data], { type: 'text/csv;charset=utf-8;' });
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = 'customers.csv';
|
a.download = 'orders.csv';
|
||||||
a.click();
|
a.click();
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,21 @@ export async function ordercontrollerCreatenote(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 此处后端没有提供注释 POST /order/export */
|
||||||
|
export async function ordercontrollerExportorder(
|
||||||
|
body: Record<string, any>,
|
||||||
|
options?: { [key: string]: any },
|
||||||
|
) {
|
||||||
|
return request<any>('/order/export', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'text/plain',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** 此处后端没有提供注释 POST /order/getOrderByNumber */
|
/** 此处后端没有提供注释 POST /order/getOrderByNumber */
|
||||||
export async function ordercontrollerGetorderbynumber(
|
export async function ordercontrollerGetorderbynumber(
|
||||||
body: string,
|
body: string,
|
||||||
|
|
@ -251,11 +266,14 @@ export async function ordercontrollerSyncorderbyid(
|
||||||
options?: { [key: string]: any },
|
options?: { [key: string]: any },
|
||||||
) {
|
) {
|
||||||
const { orderId: param0, siteId: param1, ...queryParams } = params;
|
const { orderId: param0, siteId: param1, ...queryParams } = params;
|
||||||
return request<API.BooleanRes>(`/order/syncOrder/${param1}/order/${param0}`, {
|
return request<API.SyncOperationResult>(
|
||||||
|
`/order/syncOrder/${param1}/order/${param0}`,
|
||||||
|
{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
params: { ...queryParams },
|
params: { ...queryParams },
|
||||||
...(options || {}),
|
...(options || {}),
|
||||||
});
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 此处后端没有提供注释 POST /order/updateOrderItems/${param0} */
|
/** 此处后端没有提供注释 POST /order/updateOrderItems/${param0} */
|
||||||
|
|
|
||||||
|
|
@ -456,6 +456,10 @@ declare namespace API {
|
||||||
shipping_provider?: string;
|
shipping_provider?: string;
|
||||||
/** 发货方式 */
|
/** 发货方式 */
|
||||||
shipping_method?: string;
|
shipping_method?: string;
|
||||||
|
/** 状态 */
|
||||||
|
status?: string;
|
||||||
|
/** 创建时间 */
|
||||||
|
date_created?: string;
|
||||||
/** 发货商品项 */
|
/** 发货商品项 */
|
||||||
items?: FulfillmentItemDTO[];
|
items?: FulfillmentItemDTO[];
|
||||||
};
|
};
|
||||||
|
|
@ -2406,6 +2410,8 @@ declare namespace API {
|
||||||
params?: UnifiedSearchParamsDTO;
|
params?: UnifiedSearchParamsDTO;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type SyncOperationResult = {};
|
||||||
|
|
||||||
type SyncOperationResultDTO = {
|
type SyncOperationResultDTO = {
|
||||||
/** 总处理数量 */
|
/** 总处理数量 */
|
||||||
total?: number;
|
total?: number;
|
||||||
|
|
@ -2641,6 +2647,8 @@ declare namespace API {
|
||||||
number?: string;
|
number?: string;
|
||||||
/** 订单状态 */
|
/** 订单状态 */
|
||||||
status?: string;
|
status?: string;
|
||||||
|
/** 财务状态 */
|
||||||
|
financial_status?: string;
|
||||||
/** 货币 */
|
/** 货币 */
|
||||||
currency?: string;
|
currency?: string;
|
||||||
/** 货币符号 */
|
/** 货币符号 */
|
||||||
|
|
@ -2683,8 +2691,6 @@ declare namespace API {
|
||||||
fee_lines?: UnifiedFeeLineDTO[];
|
fee_lines?: UnifiedFeeLineDTO[];
|
||||||
/** 优惠券项 */
|
/** 优惠券项 */
|
||||||
coupon_lines?: UnifiedCouponLineDTO[];
|
coupon_lines?: UnifiedCouponLineDTO[];
|
||||||
/** 物流追踪信息 */
|
|
||||||
tracking?: UnifiedOrderTrackingDTO[];
|
|
||||||
/** 支付时间 */
|
/** 支付时间 */
|
||||||
date_paid?: string;
|
date_paid?: string;
|
||||||
/** 客户IP地址 */
|
/** 客户IP地址 */
|
||||||
|
|
@ -2695,6 +2701,10 @@ declare namespace API {
|
||||||
device_type?: string;
|
device_type?: string;
|
||||||
/** 来源类型 */
|
/** 来源类型 */
|
||||||
source_type?: string;
|
source_type?: string;
|
||||||
|
/** 订单状态 */
|
||||||
|
fulfillment_status?: number;
|
||||||
|
/** 物流信息 */
|
||||||
|
fulfillments?: FulfillmentDTO[];
|
||||||
};
|
};
|
||||||
|
|
||||||
type UnifiedOrderLineItemDTO = {
|
type UnifiedOrderLineItemDTO = {
|
||||||
|
|
@ -2739,14 +2749,16 @@ declare namespace API {
|
||||||
type UnifiedOrderTrackingDTO = {
|
type UnifiedOrderTrackingDTO = {
|
||||||
/** 订单ID */
|
/** 订单ID */
|
||||||
order_id?: string;
|
order_id?: string;
|
||||||
/** 快递公司 */
|
/** 物流单号 */
|
||||||
tracking_provider?: string;
|
|
||||||
/** 运单跟踪号 */
|
|
||||||
tracking_number?: string;
|
tracking_number?: string;
|
||||||
/** 发货日期 */
|
/** 物流公司 */
|
||||||
date_shipped?: string;
|
shipping_provider?: string;
|
||||||
/** 发货状态 */
|
/** 发货方式 */
|
||||||
status_shipped?: string;
|
shipping_method?: string;
|
||||||
|
/** 状态 */
|
||||||
|
status?: string;
|
||||||
|
/** 创建时间 */
|
||||||
|
date_created?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type UnifiedPaginationDTO = {
|
type UnifiedPaginationDTO = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue