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