Compare commits

...

10 Commits

Author SHA1 Message Date
tikkhun 69b5ab72ff refactor(Customer/StatisticList): 替换客户列表接口为统计列表接口并调整排序参数格式 2026-01-30 16:44:32 +08:00
tikkhun a4445362d5 fix(SyncForm): 修正日期格式化中的秒数显示问题 2026-01-30 16:44:32 +08:00
zhuotianyuan 500151c957 fix(订单列表): 将默认 shipmentPlatform 从 uniuni 改为 freightwaves 2026-01-30 15:21:59 +08:00
zhuotianyuan 8190dc92eb fix(订单列表): 修正物流公司默认值为空字符串
将"最佳物流"对应的值从"最优物流"改为空字符串,以保持数据一致性
2026-01-30 14:57:29 +08:00
zhuotianyuan 9429df1db7 fix: 移除调试语句debugger 2026-01-30 14:57:29 +08:00
zhuotianyuan 128677e9ac feat(订单列表): 添加最佳物流选项并优化邮件地址处理
添加"最佳物流"到快递公司选项列表
将origin.email_addresses改为直接使用而不分割,保持与destination.email_addresses处理方式一致
2026-01-30 14:57:29 +08:00
tikkhun 4c23fba5de fix: 移除订单列表页中的调试日志 2026-01-30 03:57:26 +00:00
tikkhun 84b8097949 fix(Product): 禁用批量创建套装按钮当未选择行时
fix(Order): 调整同步订单日期范围格式并添加调试日志

fix(Customer): 优化客户信息显示逻辑和空值处理

refactor(SyncForm): 重构同步表单初始值和日期处理逻辑
2026-01-30 03:57:26 +00:00
zhuotianyuan bf41887b6b style: 格式化订单列表页代码缩进和换行 2026-01-27 11:32:02 +00:00
zhuotianyuan 139fdf0474 feat(订单列表): 添加快递公司选择字段
新增快递公司选择下拉框,并默认设置 UNIUNI 为初始值。同时修正发货信息中 email_addresses 字段的取值逻辑
2026-01-27 11:32:02 +00:00
7 changed files with 411 additions and 333 deletions

View File

@ -16,7 +16,7 @@ interface SyncFormProps {
tableRef: React.MutableRefObject<ActionType | undefined>; tableRef: React.MutableRefObject<ActionType | undefined>;
onFinish: (values: any) => Promise<void>; onFinish: (values: any) => Promise<void>;
siteId?: string; siteId?: string;
dateRange?: [dayjs.Dayjs, dayjs.Dayjs]; initialValues?: any;
} }
/** /**
@ -28,7 +28,10 @@ const SyncForm: React.FC<SyncFormProps> = ({
tableRef, tableRef,
onFinish, onFinish,
siteId, siteId,
dateRange, initialValues = {
// 默认一星期
dateRange: [dayjs().subtract(1, 'week'), dayjs()],
},
}) => { }) => {
// 使用 antd 的 App 组件提供的 message API // 使用 antd 的 App 组件提供的 message API
const [loading, setLoading] = React.useState(false); const [loading, setLoading] = React.useState(false);
@ -57,9 +60,7 @@ const SyncForm: React.FC<SyncFormProps> = ({
// 返回一个抽屉表单 // 返回一个抽屉表单
return ( return (
<DrawerForm<API.ordercontrollerSyncorderParams> <DrawerForm<API.ordercontrollerSyncorderParams>
initialValues={{ initialValues={initialValues}
dateRange: [dayjs().subtract(1, 'week'), dayjs()],
}}
title="同步订单" title="同步订单"
// 表单的触发器,一个带图标的按钮 // 表单的触发器,一个带图标的按钮
trigger={ trigger={
@ -75,9 +76,20 @@ const SyncForm: React.FC<SyncFormProps> = ({
destroyOnHidden: true, destroyOnHidden: true,
}} }}
// 表单提交成功后的回调 // 表单提交成功后的回调
onFinish={onFinish} onFinish={async (values) => {
const normalValues = {
...values,
dateRange: values.dateRange
? [
dayjs(values.dateRange[0]).format('YYYY-MM-DDTHH:mm:ss[Z]'),
dayjs(values.dateRange[1]).add(1, 'day').format('YYYY-MM-DDTHH:mm:ss[Z]'),
]
: [],
};
await onFinish(normalValues);
}}
> >
<ProForm.Group>
{/* 站点选择框 */} {/* 站点选择框 */}
<ProFormSelect <ProFormSelect
name="siteId" name="siteId"
@ -99,17 +111,10 @@ const SyncForm: React.FC<SyncFormProps> = ({
name="dateRange" name="dateRange"
label="同步日期范围" label="同步日期范围"
placeholder={['开始日期', '结束日期']} placeholder={['开始日期', '结束日期']}
transform={(value) => {
return {
dateRange: value,
};
}}
fieldProps={{ fieldProps={{
showTime: false, showTime: false,
style: { width: '100%' },
}} }}
/> />
</ProForm.Group>
</DrawerForm> </DrawerForm>
); );
}; };

View File

@ -2,7 +2,7 @@ import { HistoryOrder } from '@/pages/Statistics/Order';
import { import {
customercontrollerAddtag, customercontrollerAddtag,
customercontrollerDeltag, customercontrollerDeltag,
customercontrollerGetcustomerlist, customercontrollerGetcustomerstatisticlist,
customercontrollerGettags, customercontrollerGettags,
customercontrollerSetrate, customercontrollerSetrate,
} from '@/servers/api/customer'; } from '@/servers/api/customer';
@ -27,9 +27,9 @@ const ListPage: React.FC = () => {
dataIndex: 'username', dataIndex: 'username',
hideInSearch: true, hideInSearch: true,
render: (_, record) => { render: (_, record) => {
if (record.billing.first_name || record.billing.last_name) if (record.billing?.first_name || record.billing?.last_name)
return record.billing.first_name + ' ' + record.billing.last_name; return record.billing?.first_name + ' ' + record.billing?.last_name;
return record.shipping.first_name + ' ' + record.shipping.last_name; return record.shipping?.first_name + ' ' + record.shipping?.last_name;
}, },
}, },
{ {
@ -132,7 +132,7 @@ const ListPage: React.FC = () => {
title: '联系电话', title: '联系电话',
dataIndex: 'phone', dataIndex: 'phone',
hideInSearch: true, hideInSearch: true,
render: (_, record) => record?.billing.phone || record?.shipping.phone, render: (_, record) => record.phone ?? record?.billing?.phone ?? record?.shipping?.phone ?? '-',
}, },
{ {
title: '账单地址', title: '账单地址',
@ -200,9 +200,9 @@ const ListPage: React.FC = () => {
rowKey="id" rowKey="id"
request={async (params, sorter) => { request={async (params, sorter) => {
const key = Object.keys(sorter)[0]; const key = Object.keys(sorter)[0];
const { data, success } = await customercontrollerGetcustomerlist({ const { data, success } = await customercontrollerGetcustomerstatisticlist({
...params, ...params,
...(key ? { sorterKey: key, sorterValue: sorter[key] } : {}), ...(key ? { orderBy: `${key}:${sorter[key]}` } : {}),
}); });
return { return {

View File

@ -617,8 +617,8 @@ const ListPage: React.FC = () => {
message: errMsg, message: errMsg,
data, data,
} = await ordercontrollerSyncorders(values, { } = await ordercontrollerSyncorders(values, {
after: values.dateRange?.[0] + 'T00:00:00Z', after: values.dateRange?.[0],
before: values.dateRange?.[1] + 'T23:59:59Z', before: values.dateRange?.[1],
}); });
if (!success) { if (!success) {
throw new Error(errMsg); throw new Error(errMsg);
@ -1385,6 +1385,13 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
{ label: 'uniuni', value: 'uniuni' }, { label: 'uniuni', value: 'uniuni' },
{ label: 'tms.freightwaves', value: 'freightwaves' }, { label: 'tms.freightwaves', value: 'freightwaves' },
]); ]);
const [courierCompany, setCourierCompany] = useState([
{ label: '最佳物流', value: '' },
{ label: 'UNIUNI', value: 'UNIUNI' },
{ label: 'PuroYYZ', value: 'PuroYYZ' },
{ label: 'CPYYZ', value: 'CPYYZ' },
{ label: 'UPSYYZ7000NEW', value: 'UPSYYZ7000NEW' },
]);
return ( return (
<ModalForm <ModalForm
formRef={formRef} formRef={formRef}
@ -1437,7 +1444,8 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
let shipmentInfo = localStorage.getItem('shipmentInfo'); let shipmentInfo = localStorage.getItem('shipmentInfo');
if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo); if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo);
const a = { const a = {
shipmentPlatform: 'uniuni', shipmentPlatform: 'freightwaves',
courierCompany: '',
...data, ...data,
// payment_method_id: shipmentInfo?.payment_method_id, // payment_method_id: shipmentInfo?.payment_method_id,
stockPointId: shipmentInfo?.stockPointId, stockPointId: shipmentInfo?.stockPointId,
@ -1464,7 +1472,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
}, },
origin: { origin: {
name: data?.name, name: data?.name,
email_addresses: data?.email, email_addresses: shipmentInfo?.email_addresses,
contact_name: data?.name, contact_name: data?.name,
phone_number: shipmentInfo?.phone_number, phone_number: shipmentInfo?.phone_number,
address: { address: {
@ -1508,7 +1516,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
...data ...data
}) => { }) => {
details.origin.email_addresses = details.origin.email_addresses =
details.origin.email_addresses.split(','); details.origin.email_addresses;
details.destination.email_addresses = details.destination.email_addresses =
details.destination.email_addresses.split(','); details.destination.email_addresses.split(',');
details.destination.phone_number.number = details.destination.phone_number.number =
@ -1541,6 +1549,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
postal_code: details.origin.address.postal_code, postal_code: details.origin.address.postal_code,
address_line_1: details.origin.address.address_line_1, address_line_1: details.origin.address.address_line_1,
phone_number: details.origin.phone_number, phone_number: details.origin.phone_number,
email_addresses: details.origin.email_addresses,
}), }),
); );
@ -1571,6 +1580,14 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
rules={[{ required: true, message: '请选择一个选项' }]} rules={[{ required: true, message: '请选择一个选项' }]}
/> />
</Col> </Col>
<Col span={8}>
<ProFormSelect
name="courierCompany"
label="快递公司"
options={courierCompany}
placeholder="请选择快递公司"
/>
</Col>
</Row> </Row>
<ProFormText label="订单号" readonly name='externalOrderId' /> <ProFormText label="订单号" readonly name='externalOrderId' />
<ProFormText label="客户备注" readonly name="customer_note" /> <ProFormText label="客户备注" readonly name="customer_note" />
@ -2149,7 +2166,7 @@ const [shipmentPlatforms, setShipmentPlatforms] = useState([
const originEmail = details.origin.email_addresses; const originEmail = details.origin.email_addresses;
const destinationEmail = details.destination.email_addresses; const destinationEmail = details.destination.email_addresses;
details.origin.email_addresses = details.origin.email_addresses =
details.origin.email_addresses.split(','); details.origin.email_addresses;
details.destination.email_addresses = details.destination.email_addresses =
details.destination.email_addresses.split(','); details.destination.email_addresses.split(',');
details.destination.phone_number.number = details.destination.phone_number.number =

View File

@ -467,7 +467,9 @@ const List: React.FC = () => {
</Button>, </Button>,
// 批量创建 bundle 产品按钮 // 批量创建 bundle 产品按钮
<Button onClick={() => setBatchCreateBundleModalVisible(true)}> <Button
disabled={selectedRows.length <= 0}
onClick={() => setBatchCreateBundleModalVisible(true)}>
</Button>, </Button>,
// 批量同步按钮 // 批量同步按钮

View File

@ -12,6 +12,7 @@ import * as order from './order';
import * as product from './product'; import * as product from './product';
import * as site from './site'; import * as site from './site';
import * as siteApi from './siteApi'; import * as siteApi from './siteApi';
import * as siteProduct from './siteProduct';
import * as statistics from './statistics'; import * as statistics from './statistics';
import * as stock from './stock'; import * as stock from './stock';
import * as subscription from './subscription'; import * as subscription from './subscription';
@ -28,6 +29,7 @@ export default {
order, order,
product, product,
siteApi, siteApi,
siteProduct,
site, site,
statistics, statistics,
stock, stock,

View File

@ -0,0 +1,33 @@
// @ts-ignore
/* eslint-disable */
import { request } from 'umi';
/** 此处后端没有提供注释 GET /site-product/list */
export async function siteproductcontrollerGetsiteproductlist(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.siteproductcontrollerGetsiteproductlistParams,
options?: { [key: string]: any },
) {
return request<any>('/site-product/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /site-product/sync */
export async function siteproductcontrollerSyncsiteproducts(
body: number,
options?: { [key: string]: any },
) {
return request<any>('/site-product/sync', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
data: body,
...(options || {}),
});
}

View File

@ -1103,8 +1103,8 @@ declare namespace API {
categoryId?: number; categoryId?: number;
/** 库存组成 */ /** 库存组成 */
components?: ProductStockComponent[]; components?: ProductStockComponent[];
/** 站点 SKU 列表 */ /** 站点 SKU关联 */
siteSkus?: string[]; siteSkus?: SiteSku[];
/** 来源 */ /** 来源 */
source?: number; source?: number;
/** 创建时间 */ /** 创建时间 */
@ -1630,10 +1630,12 @@ declare namespace API {
stockPointId?: number; stockPointId?: number;
orderIds?: number[]; orderIds?: number[];
shipmentPlatform?: string; shipmentPlatform?: string;
courierCompany?: string;
}; };
type ShipmentFeeBookDTO = { type ShipmentFeeBookDTO = {
shipmentPlatform?: string; shipmentPlatform?: string;
courierCompany?: string;
stockPointId?: number; stockPointId?: number;
sender?: string; sender?: string;
startPhone?: Record<string, any>; startPhone?: Record<string, any>;
@ -2221,6 +2223,23 @@ declare namespace API {
id: string; id: string;
}; };
type siteproductcontrollerGetsiteproductlistParams = {
sku?: string;
name?: string;
siteId?: number;
pageSize?: number;
current?: number;
};
type SiteSku = {
/** sku */
sku?: string;
/** 商品ID */
productId?: number;
/** 是否旧版数据 */
isOld?: boolean;
};
type SitesResponse = { type SitesResponse = {
/** 状态码 */ /** 状态码 */
code?: number; code?: number;