Compare commits

..

No commits in common. "45fb186ed38d15deddd4ea34196ccfcce582f197" and "644fb1775f841e8f517c44278b783b0b112b3902" have entirely different histories.

1 changed files with 182 additions and 190 deletions

View File

@ -310,14 +310,6 @@ const ListPage: React.FC = () => {
: 'block', : 'block',
}, },
}, },
{
key: 'history',
label:
<HistoryOrder
email={record.customer_email}
tableRef={actionRef}
/>,
},
{ {
key: 'note', key: 'note',
label: <OrderNote id={record.id as number} />, label: <OrderNote id={record.id as number} />,
@ -522,29 +514,29 @@ const Detail: React.FC<{
) )
? [] ? []
: [ : [
<Divider type="vertical" />, <Divider type="vertical" />,
<Button <Button
type="primary" type="primary"
onClick={async () => { onClick={async () => {
try { try {
const { success, message: errMsg } = const { success, message: errMsg } =
await ordercontrollerSyncorderbyid({ await ordercontrollerSyncorderbyid({
siteId: record.siteId as string, siteId: record.siteId as string,
orderId: record.externalOrderId as string, orderId: record.externalOrderId as string,
}); });
if (!success) { if (!success) {
throw new Error(errMsg); throw new Error(errMsg);
}
message.success('同步成功');
tableRef.current?.reload();
} catch (error) {
message.error(error?.message || '同步失败');
} }
message.success('同步成功'); }}
tableRef.current?.reload(); >
} catch (error) {
message.error(error?.message || '同步失败'); </Button>,
} ]),
}}
>
</Button>,
]),
// ...(['processing', 'pending_reshipment'].includes(record.orderStatus) // ...(['processing', 'pending_reshipment'].includes(record.orderStatus)
// ? [ // ? [
// <Divider type="vertical" />, // <Divider type="vertical" />,
@ -563,136 +555,136 @@ const Detail: React.FC<{
'pending_refund', 'pending_refund',
].includes(record.orderStatus) ].includes(record.orderStatus)
? [ ? [
<Divider type="vertical" />, <Divider type="vertical" />,
<Popconfirm <Popconfirm
title="转至售后" title="转至售后"
description="确认转至售后?" description="确认转至售后?"
onConfirm={async () => { onConfirm={async () => {
try { try {
const { success, message: errMsg } = const { success, message: errMsg } =
await ordercontrollerChangestatus( await ordercontrollerChangestatus(
{ {
id: record.id, id: record.id,
}, },
{ {
status: 'after_sale_pending', status: 'after_sale_pending',
}, },
); );
if (!success) { if (!success) {
throw new Error(errMsg); throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
} }
tableRef.current?.reload(); }}
} catch (error: any) { >
message.error(error.message); <Button type="primary" ghost>
}
}} </Button>
> </Popconfirm>,
<Button type="primary" ghost> ]
</Button>
</Popconfirm>,
]
: []), : []),
...(record.orderStatus === 'after_sale_pending' ...(record.orderStatus === 'after_sale_pending'
? [ ? [
<Divider type="vertical" />, <Divider type="vertical" />,
<Popconfirm <Popconfirm
title="转至取消" title="转至取消"
description="确认转至取消?" description="确认转至取消?"
onConfirm={async () => { onConfirm={async () => {
try { try {
const { success, message: errMsg } = const { success, message: errMsg } =
await ordercontrollerCancelorder({ await ordercontrollerCancelorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至退款"
description="确认转至退款?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerRefundorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
退
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至完成"
description="确认转至完成?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerCompletedorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至待补发"
description="确认转至待补发?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerChangestatus(
{
id: record.id, id: record.id,
}, });
{ if (!success) {
status: 'pending_reshipment', throw new Error(errMsg);
}, }
); tableRef.current?.reload();
if (!success) { } catch (error: any) {
throw new Error(errMsg); message.error(error.message);
} }
tableRef.current?.reload(); }}
} catch (error: any) { >
message.error(error.message); <Button type="primary" ghost>
}
}} </Button>
> </Popconfirm>,
<Button type="primary" ghost> <Divider type="vertical" />,
<Popconfirm
</Button> title="转至退款"
</Popconfirm>, description="确认转至退款?"
] onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerRefundorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
退
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至完成"
description="确认转至完成?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerCompletedorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至待补发"
description="确认转至待补发?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerChangestatus(
{
id: record.id,
},
{
status: 'pending_reshipment',
},
);
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
]
: []), : []),
]} ]}
> >
@ -924,31 +916,31 @@ const Detail: React.FC<{
} }
actions={ actions={
v.state === 'waiting-for-scheduling' || v.state === 'waiting-for-scheduling' ||
v.state === 'waiting-for-transit' v.state === 'waiting-for-transit'
? [ ? [
<Popconfirm <Popconfirm
title="取消运单" title="取消运单"
description="确认取消运单?" description="确认取消运单?"
onConfirm={async () => { onConfirm={async () => {
try { try {
const { success, message: errMsg } = const { success, message: errMsg } =
await logisticscontrollerDelshipment({ await logisticscontrollerDelshipment({
id: v.id, id: v.id,
}); });
if (!success) { if (!success) {
throw new Error(errMsg); throw new Error(errMsg);
}
tableRef.current?.reload();
initRequest();
} catch (error: any) {
message.error(error.message);
} }
tableRef.current?.reload(); }}
initRequest(); >
} catch (error: any) { <DeleteFilled />
message.error(error.message);
} </Popconfirm>,
}} ]
>
<DeleteFilled />
</Popconfirm>,
]
: [] : []
} }
> >
@ -1262,16 +1254,16 @@ const Shipping: React.FC<{
<ProFormList <ProFormList
label="发货产品" label="发货产品"
name="sales" name="sales"
// rules={[ // rules={[
// { // {
// required: true, // required: true,
// message: '至少需要一个商品', // message: '至少需要一个商品',
// validator: (_, value) => // validator: (_, value) =>
// value && value.length > 0 // value && value.length > 0
// ? Promise.resolve() // ? Promise.resolve()
// : Promise.reject('至少需要一个商品'), // : Promise.reject('至少需要一个商品'),
// }, // },
// ]} // ]}
> >
<ProForm.Group> <ProForm.Group>
<ProFormSelect <ProFormSelect
@ -1285,7 +1277,7 @@ const Shipping: React.FC<{
return ( return (
data?.map((item) => { data?.map((item) => {
return { return {
label: `${item.name} - ${item.nameCn}`, label: `${item.name} - ${item.nameCn}`,
value: item?.sku, value: item?.sku,
}; };
}) || options }) || options
@ -1693,7 +1685,7 @@ const Shipping: React.FC<{
name="description" name="description"
placeholder="请输入描述" placeholder="请输入描述"
width="lg" width="lg"
// rules={[{ required: true, message: '请输入描述' }]} // rules={[{ required: true, message: '请输入描述' }]}
/> />
</ProForm.Group> </ProForm.Group>
</ProFormList> </ProFormList>
@ -1854,7 +1846,7 @@ const CreateOrder: React.FC<{
return ( return (
data?.map((item) => { data?.map((item) => {
return { return {
label: `${item.name} - ${item.nameCn}`, label: `${item.name} - ${item.nameCn}`,
value: item?.sku, value: item?.sku,
}; };
}) || options }) || options