style: 格式化订单列表页代码缩进和换行
This commit is contained in:
parent
139fdf0474
commit
bf41887b6b
|
|
@ -84,8 +84,8 @@ import dayjs from 'dayjs';
|
|||
import * as XLSX from 'xlsx';
|
||||
const ListPage: React.FC = () => {
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [csvData, setCsvData] = useState<any[]>([]);
|
||||
const [processedData, setProcessedData] = useState<any[]>([]);
|
||||
const [csvData, setCsvData] = useState<any[]>([]);
|
||||
const [processedData, setProcessedData] = useState<any[]>([]);
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [activeKey, setActiveKey] = useState<string>('all');
|
||||
const [count, setCount] = useState<any[]>([]);
|
||||
|
|
@ -476,62 +476,62 @@ const ListPage: React.FC = () => {
|
|||
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||
|
||||
|
||||
/**
|
||||
* @description 处理文件上传
|
||||
*/
|
||||
const handleFileUpload = (uploadedFile: File) => {
|
||||
// 检查文件类型
|
||||
if (!uploadedFile.name.match(/\.(xlsx)$/)) {
|
||||
message.error('请上传 xlsx 格式的文件!');
|
||||
return false;
|
||||
/**
|
||||
* @description 处理文件上传
|
||||
*/
|
||||
const handleFileUpload = (uploadedFile: File) => {
|
||||
// 检查文件类型
|
||||
if (!uploadedFile.name.match(/\.(xlsx)$/)) {
|
||||
message.error('请上传 xlsx 格式的文件!');
|
||||
return false;
|
||||
}
|
||||
setFile(uploadedFile);
|
||||
|
||||
const reader = new FileReader();
|
||||
// 对于Excel文件,继续使用readAsArrayBuffer
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
const data = e.target?.result;
|
||||
// 如果是ArrayBuffer,使用type: 'array'来处理
|
||||
const workbook = XLSX.read(data, { type: 'array' });
|
||||
const sheetName = workbook.SheetNames[0];
|
||||
const worksheet = workbook.Sheets[sheetName];
|
||||
const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
|
||||
|
||||
if (jsonData.length < 2) {
|
||||
message.error('文件为空或缺少表头!');
|
||||
setCsvData([]);
|
||||
return;
|
||||
}
|
||||
// 将数组转换为对象数组
|
||||
const headers = jsonData[0] as string[];
|
||||
const rows = jsonData.slice(1).map((rowArray: any) => {
|
||||
const rowData: { [key: string]: any } = {};
|
||||
headers.forEach((header, index) => {
|
||||
rowData[header] = rowArray[index];
|
||||
});
|
||||
return rowData;
|
||||
});
|
||||
|
||||
message.success(`成功解析 ${rows.length} 条数据.`);
|
||||
setCsvData(rows);
|
||||
setProcessedData([]); // 清空旧的处理结果
|
||||
} catch (error) {
|
||||
message.error('Excel文件解析失败,请检查文件格式!');
|
||||
console.error('Excel Parse Error:', error);
|
||||
setCsvData([]);
|
||||
}
|
||||
setFile(uploadedFile);
|
||||
|
||||
const reader = new FileReader();
|
||||
// 对于Excel文件,继续使用readAsArrayBuffer
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
const data = e.target?.result;
|
||||
// 如果是ArrayBuffer,使用type: 'array'来处理
|
||||
const workbook = XLSX.read(data, { type: 'array' });
|
||||
const sheetName = workbook.SheetNames[0];
|
||||
const worksheet = workbook.Sheets[sheetName];
|
||||
const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
|
||||
|
||||
if (jsonData.length < 2) {
|
||||
message.error('文件为空或缺少表头!');
|
||||
setCsvData([]);
|
||||
return;
|
||||
}
|
||||
// 将数组转换为对象数组
|
||||
const headers = jsonData[0] as string[];
|
||||
const rows = jsonData.slice(1).map((rowArray: any) => {
|
||||
const rowData: { [key: string]: any } = {};
|
||||
headers.forEach((header, index) => {
|
||||
rowData[header] = rowArray[index];
|
||||
});
|
||||
return rowData;
|
||||
});
|
||||
|
||||
message.success(`成功解析 ${rows.length} 条数据.`);
|
||||
setCsvData(rows);
|
||||
setProcessedData([]); // 清空旧的处理结果
|
||||
} catch (error) {
|
||||
message.error('Excel文件解析失败,请检查文件格式!');
|
||||
console.error('Excel Parse Error:', error);
|
||||
setCsvData([]);
|
||||
}
|
||||
};
|
||||
reader.readAsArrayBuffer(uploadedFile);
|
||||
|
||||
|
||||
reader.onerror = (error) => {
|
||||
message.error('文件读取失败!');
|
||||
console.error('File Read Error:', error);
|
||||
};
|
||||
|
||||
return false; // 阻止antd Upload组件的默认上传行为
|
||||
};
|
||||
reader.readAsArrayBuffer(uploadedFile);
|
||||
|
||||
|
||||
reader.onerror = (error) => {
|
||||
message.error('文件读取失败!');
|
||||
console.error('File Read Error:', error);
|
||||
};
|
||||
|
||||
return false; // 阻止antd Upload组件的默认上传行为
|
||||
};
|
||||
|
||||
return (
|
||||
<PageContainer ghost>
|
||||
|
|
@ -560,41 +560,41 @@ const ListPage: React.FC = () => {
|
|||
}}
|
||||
toolBarRender={() => [
|
||||
// <CreateOrder tableRef={actionRef} />,
|
||||
<Upload
|
||||
// beforeUpload={handleFileUpload}
|
||||
name="file"
|
||||
<Upload
|
||||
// beforeUpload={handleFileUpload}
|
||||
name="file"
|
||||
accept=".xlsx"
|
||||
showUploadList={false}
|
||||
maxCount={1}
|
||||
customRequest={async (options) => {
|
||||
const { file, onSuccess, onError } = options;
|
||||
console.log(file);
|
||||
const formData = new FormData();
|
||||
const { file, onSuccess, onError } = options;
|
||||
console.log(file);
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
try {
|
||||
try {
|
||||
const res = await request('/order/import', {
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
requestType: 'form',
|
||||
});
|
||||
|
||||
if (res?.success && res.data) {
|
||||
// 使用xlsx将JSON数据转换为Excel
|
||||
if (res?.success && res.data) {
|
||||
// 使用xlsx将JSON数据转换为Excel
|
||||
const XLSX = require('xlsx');
|
||||
const worksheet = XLSX.utils.json_to_sheet(res.data);
|
||||
const workbook = XLSX.utils.book_new();
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, 'Orders');
|
||||
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
||||
// 否则按原逻辑处理二进制数据
|
||||
const blob = new Blob([excelBuffer], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
});
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = 'orders.xlsx';
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
// 否则按原逻辑处理二进制数据
|
||||
const blob = new Blob([excelBuffer], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
});
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = 'orders.xlsx';
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
} else {
|
||||
message.error(res.message || '导出失败');
|
||||
|
|
@ -606,9 +606,9 @@ const ListPage: React.FC = () => {
|
|||
onError?.(error);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button icon={<UploadOutlined />}>选择文件</Button>
|
||||
</Upload>,
|
||||
>
|
||||
<Button icon={<UploadOutlined />}>选择文件</Button>
|
||||
</Upload>,
|
||||
<SyncForm
|
||||
onFinish={async (values: any) => {
|
||||
try {
|
||||
|
|
@ -756,36 +756,36 @@ const Detail: React.FC<{
|
|||
)
|
||||
? []
|
||||
: [
|
||||
<Divider type="vertical" />,
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={async () => {
|
||||
try {
|
||||
if (!record.siteId || !record.externalOrderId) {
|
||||
message.error('站点ID或外部订单ID不存在');
|
||||
return;
|
||||
}
|
||||
const {
|
||||
success,
|
||||
message: errMsg,
|
||||
data,
|
||||
} = await ordercontrollerSyncorderbyid({
|
||||
siteId: record.siteId,
|
||||
orderId: record.externalOrderId,
|
||||
});
|
||||
if (!success) {
|
||||
throw new Error(errMsg);
|
||||
}
|
||||
showSyncResult(data as SyncResultData, '订单');
|
||||
tableRef.current?.reload();
|
||||
} catch (error: any) {
|
||||
message.error(error?.message || '同步失败');
|
||||
<Divider type="vertical" />,
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={async () => {
|
||||
try {
|
||||
if (!record.siteId || !record.externalOrderId) {
|
||||
message.error('站点ID或外部订单ID不存在');
|
||||
return;
|
||||
}
|
||||
}}
|
||||
>
|
||||
同步订单
|
||||
</Button>,
|
||||
]),
|
||||
const {
|
||||
success,
|
||||
message: errMsg,
|
||||
data,
|
||||
} = await ordercontrollerSyncorderbyid({
|
||||
siteId: record.siteId,
|
||||
orderId: record.externalOrderId,
|
||||
});
|
||||
if (!success) {
|
||||
throw new Error(errMsg);
|
||||
}
|
||||
showSyncResult(data as SyncResultData, '订单');
|
||||
tableRef.current?.reload();
|
||||
} catch (error: any) {
|
||||
message.error(error?.message || '同步失败');
|
||||
}
|
||||
}}
|
||||
>
|
||||
同步订单
|
||||
</Button>,
|
||||
]),
|
||||
// ...(['processing', 'pending_reshipment'].includes(record.orderStatus)
|
||||
// ? [
|
||||
// <Divider type="vertical" />,
|
||||
|
|
@ -804,152 +804,152 @@ const Detail: React.FC<{
|
|||
'pending_refund',
|
||||
].includes(record.orderStatus)
|
||||
? [
|
||||
<Divider type="vertical" />,
|
||||
<Popconfirm
|
||||
title="转至售后"
|
||||
description="确认转至售后?"
|
||||
onConfirm={async () => {
|
||||
try {
|
||||
if (!record.id) {
|
||||
message.error('订单ID不存在');
|
||||
return;
|
||||
}
|
||||
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 {
|
||||
if (!record.id) {
|
||||
message.error('订单ID不存在');
|
||||
return;
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button type="primary" ghost>
|
||||
转至售后
|
||||
</Button>
|
||||
</Popconfirm>,
|
||||
]
|
||||
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);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button type="primary" ghost>
|
||||
转至售后
|
||||
</Button>
|
||||
</Popconfirm>,
|
||||
]
|
||||
: []),
|
||||
...(record.orderStatus === 'after_sale_pending'
|
||||
? [
|
||||
<Divider type="vertical" />,
|
||||
<Popconfirm
|
||||
title="转至取消"
|
||||
description="确认转至取消?"
|
||||
onConfirm={async () => {
|
||||
try {
|
||||
if (!record.id) {
|
||||
message.error('订单ID不存在');
|
||||
return;
|
||||
}
|
||||
const { success, message: errMsg } =
|
||||
await ordercontrollerCancelorder({
|
||||
<Divider type="vertical" />,
|
||||
<Popconfirm
|
||||
title="转至取消"
|
||||
description="确认转至取消?"
|
||||
onConfirm={async () => {
|
||||
try {
|
||||
if (!record.id) {
|
||||
message.error('订单ID不存在');
|
||||
return;
|
||||
}
|
||||
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 {
|
||||
if (!record.id) {
|
||||
message.error('订单ID不存在');
|
||||
return;
|
||||
}
|
||||
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 {
|
||||
if (!record.id) {
|
||||
message.error('订单ID不存在');
|
||||
return;
|
||||
}
|
||||
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 {
|
||||
if (!record.id) {
|
||||
message.error('订单ID不存在');
|
||||
return;
|
||||
}
|
||||
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 {
|
||||
if (!record.id) {
|
||||
message.error('订单ID不存在');
|
||||
return;
|
||||
}
|
||||
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>,
|
||||
]
|
||||
: []),
|
||||
]}
|
||||
>
|
||||
|
|
@ -1212,31 +1212,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>,
|
||||
]
|
||||
: []
|
||||
}
|
||||
>
|
||||
|
|
@ -1381,7 +1381,7 @@ const Shipping: React.FC<{
|
|||
const [rates, setRates] = useState<API.RateDTO[]>([]);
|
||||
const [ratesLoading, setRatesLoading] = useState(false);
|
||||
const { message } = App.useApp();
|
||||
const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
||||
const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
||||
{ label: 'uniuni', value: 'uniuni' },
|
||||
{ label: 'tms.freightwaves', value: 'freightwaves' },
|
||||
]);
|
||||
|
|
@ -1419,7 +1419,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
await ordercontrollerGetorderdetail({
|
||||
orderId: id,
|
||||
});
|
||||
console.log('success data',success,data)
|
||||
console.log('success data', success, data)
|
||||
if (!success || !data) return {};
|
||||
data.sales = data.sales?.reduce(
|
||||
(acc: API.OrderSale[], cur: API.OrderSale) => {
|
||||
|
|
@ -1442,7 +1442,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
if (reShipping) data.sales = [{}];
|
||||
let shipmentInfo = localStorage.getItem('shipmentInfo');
|
||||
if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo);
|
||||
const a = {
|
||||
const a = {
|
||||
shipmentPlatform: 'uniuni',
|
||||
courierCompany: 'UNIUNI',
|
||||
...data,
|
||||
|
|
@ -1471,7 +1471,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
},
|
||||
origin: {
|
||||
name: data?.name,
|
||||
email_addresses: shipmentInfo?.email_addresses ,
|
||||
email_addresses: shipmentInfo?.email_addresses,
|
||||
contact_name: data?.name,
|
||||
phone_number: shipmentInfo?.phone_number,
|
||||
address: {
|
||||
|
|
@ -1569,25 +1569,25 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
}
|
||||
}}
|
||||
>
|
||||
<Row gutter={16}>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="shipmentPlatform"
|
||||
label="发货平台"
|
||||
options={shipmentPlatforms}
|
||||
placeholder="请选择发货平台"
|
||||
rules={[{ required: true, message: '请选择一个选项' }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="courierCompany"
|
||||
label="快递公司"
|
||||
options={courierCompany}
|
||||
placeholder="请选择快递公司"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<ProFormSelect
|
||||
name="shipmentPlatform"
|
||||
label="发货平台"
|
||||
options={shipmentPlatforms}
|
||||
placeholder="请选择发货平台"
|
||||
rules={[{ required: true, message: '请选择一个选项' }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="courierCompany"
|
||||
label="快递公司"
|
||||
options={courierCompany}
|
||||
placeholder="请选择快递公司"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<ProFormText label="订单号" readonly name='externalOrderId' />
|
||||
<ProFormText label="客户备注" readonly name="customer_note" />
|
||||
<ProFormList
|
||||
|
|
@ -1657,16 +1657,16 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
<ProFormList
|
||||
label="发货产品"
|
||||
name="sales"
|
||||
// rules={[
|
||||
// {
|
||||
// required: true,
|
||||
// message: '至少需要一个商品',
|
||||
// validator: (_, value) =>
|
||||
// value && value.length > 0
|
||||
//</Col> ? Promise.resolve()
|
||||
// : Promise.reject('至少需要一个商品'),
|
||||
// },
|
||||
// ]}
|
||||
// rules={[
|
||||
// {
|
||||
// required: true,
|
||||
// message: '至少需要一个商品',
|
||||
// validator: (_, value) =>
|
||||
// value && value.length > 0
|
||||
//</Col> ? Promise.resolve()
|
||||
// : Promise.reject('至少需要一个商品'),
|
||||
// },
|
||||
// ]}
|
||||
>
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
|
|
@ -1734,7 +1734,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
// address_id: row.id,
|
||||
details: {
|
||||
origin: {
|
||||
email_addresses:email,
|
||||
email_addresses: email,
|
||||
address,
|
||||
phone_number: {
|
||||
phone: phone_number,
|
||||
|
|
@ -1747,7 +1747,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
/>
|
||||
}
|
||||
>
|
||||
{/* <ProFormText
|
||||
{/* <ProFormText
|
||||
label="address_id"
|
||||
name={'address_id'}
|
||||
rules={[{ required: true, message: '请输入ID' }]}
|
||||
|
|
@ -2100,7 +2100,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
|
|||
name="description"
|
||||
placeholder="请输入描述"
|
||||
width="lg"
|
||||
// rules={[{ required: true, message: '请输入描述' }]}
|
||||
// rules={[{ required: true, message: '请输入描述' }]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ProFormList>
|
||||
|
|
@ -2500,7 +2500,7 @@ const CreateOrder: React.FC<{
|
|||
<ProFormText
|
||||
label="公司名称"
|
||||
name={['billing', 'company']}
|
||||
rules={[{ message: '请输入公司名称' }]}
|
||||
rules={[{ message: '请输入公司名称' }]}
|
||||
/>
|
||||
<ProFormItem
|
||||
name={['billing', 'country']}
|
||||
|
|
@ -2587,7 +2587,7 @@ const AddressPicker: React.FC<{
|
|||
}));
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
title: 'id',
|
||||
dataIndex: ['id'],
|
||||
hideInSearch: true,
|
||||
|
|
@ -2620,7 +2620,7 @@ const AddressPicker: React.FC<{
|
|||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
dataIndex: [ 'email'],
|
||||
dataIndex: ['email'],
|
||||
hideInSearch: true,
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue