zksu
/
WEB
forked from yoone/WEB
1
0
Fork 0

Compare commits

..

3 Commits

Author SHA1 Message Date
tikkhun 04b9fed6f7 feat(Product/List): 添加图片列到产品列表
feat(Product/BrandSpace): 重构品牌空间页面布局和逻辑

refactor(.umirc): 调整产品路由顺序

fix(Product/CsvTool): 修复复选框事件处理并移除调试日志
2026-01-16 15:58:56 +08:00
tikkhun 49e3049681 refactor(DictItemImportButton): 移除冗余的成功检查逻辑
该逻辑已在API层处理,无需在前端重复检查
2026-01-16 15:58:55 +08:00
zhuotianyuan af1cebe29d fix(订单同步): 修复订单同步功能并添加日期范围选择
修复订单同步接口调用参数错误
在同步表单中添加日期范围选择器
调整订单来源统计接口名称拼写错误
2026-01-14 20:04:07 +08:00
3 changed files with 40 additions and 15 deletions

View File

@ -5,8 +5,10 @@ import {
DrawerForm,
ProForm,
ProFormSelect,
ProFormDateRangePicker,
} from '@ant-design/pro-components';
import { Button } from 'antd';
import dayjs from 'dayjs';
import React from 'react';
// 定义SyncForm组件的props类型
@ -14,6 +16,7 @@ interface SyncFormProps {
tableRef: React.MutableRefObject<ActionType | undefined>;
onFinish: (values: any) => Promise<void>;
siteId?: string;
dateRange?: [dayjs.Dayjs, dayjs.Dayjs];
}
/**
@ -21,7 +24,7 @@ interface SyncFormProps {
* @param {SyncFormProps} props
* @returns {React.ReactElement}
*/
const SyncForm: React.FC<SyncFormProps> = ({ tableRef, onFinish, siteId }) => {
const SyncForm: React.FC<SyncFormProps> = ({ tableRef, onFinish, siteId, dateRange }) => {
// 使用 antd 的 App 组件提供的 message API
const [loading, setLoading] = React.useState(false);
@ -49,7 +52,11 @@ const SyncForm: React.FC<SyncFormProps> = ({ tableRef, onFinish, siteId }) => {
// 返回一个抽屉表单
return (
<DrawerForm<API.ordercontrollerSyncorderParams>
title="同步订单"
initialValues={{
dateRange: [dayjs().subtract(1, 'week'), dayjs()],
}}
title="同步订单"
// 表单的触发器,一个带图标的按钮
trigger={
<Button key="syncSite" type="primary">
@ -67,6 +74,7 @@ const SyncForm: React.FC<SyncFormProps> = ({ tableRef, onFinish, siteId }) => {
onFinish={onFinish}
>
<ProForm.Group>
{/* 站点选择框 */}
<ProFormSelect
name="siteId"
@ -83,6 +91,22 @@ const SyncForm: React.FC<SyncFormProps> = ({ tableRef, onFinish, siteId }) => {
}));
}}
/>
<ProFormDateRangePicker
name="dateRange"
label="同步日期范围"
placeholder={['开始日期', '结束日期']}
transform={(value) => {
return {
dateRange: value,
};
}}
fieldProps={{
showTime: false,
style: { width: '100%' },
}}
/>
</ProForm.Group>
</DrawerForm>
);

View File

@ -502,7 +502,7 @@ const ListPage: React.FC = () => {
success,
message: errMsg,
data,
} = await ordercontrollerSyncorders(values);
} = await ordercontrollerSyncorders(values,{after:values.dateRange?.[0]+'T00:00:00Z',before:values.dateRange?.[1]+'T23:59:59Z'});
if (!success) {
throw new Error(errMsg);
}
@ -997,6 +997,7 @@ const Detail: React.FC<{
);
}}
/>
{/* 显示 related order */}
<ProDescriptions.Item
label="关联"
@ -1506,16 +1507,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
//</Col> ? Promise.resolve()
// : Promise.reject('至少需要一个商品'),
// },
// ]}
>
<ProForm.Group>
<ProFormSelect

View File

@ -2,7 +2,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
import {
statisticscontrollerGetinativeusersbymonth,
statisticscontrollerGetordersorce,
statisticscontrollerGetordersource,
} from '@/servers/api/statistics';
import {
ActionType,
@ -25,7 +25,7 @@ const ListPage: React.FC = () => {
country: ['CA'],
};
function handleSubmit(values: typeof initialValues) {
statisticscontrollerGetordersorce({params: values}).then(({ data, success }) => {
statisticscontrollerGetordersource({params: values}).then(({ data, success }) => {
if (success) setData(data);
});
}