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

Compare commits

...

6 Commits
main ... main

Author SHA1 Message Date
zhuotianyuan 8d3c3ff71c fix(Address): 调整邮箱输入框的宽度为lg 2026-01-23 16:48:47 +08:00
zhuotianyuan 5f1c6eeb44 fix(Order/List): 移除调试日志和无效的表单验证规则
移除console.log调试语句和无效的公司名称必填验证规则
2026-01-23 16:42:10 +08:00
zhuotianyuan 0abe06d9df feat(地址表单): 添加邮箱字段到地址表单和订单列表
在地址更新表单中新增邮箱字段,并在订单列表页面显示该字段
2026-01-23 16:36:03 +08:00
zhuotianyuan 860b7970c8 fix: 修正组件名称拼写错误,将ProFromSelect改为ProFormSelect 2026-01-22 18:02:23 +08:00
zhuotianyuan 67aa625785 feat(api类型): 添加shipmentPlatform和address_id字段到DTO类型 2026-01-22 17:42:05 +08:00
zhuotianyuan 1d9838f72e feat(订单): 添加发货平台选择功能并优化表单验证
- 在发货表单中新增发货平台选择器
- 将公司名称字段改为非必填
- 添加控制台日志用于调试
- 优化地址选择器的数据处理逻辑
2026-01-22 17:35:53 +08:00
4 changed files with 64 additions and 13 deletions

View File

@ -393,6 +393,14 @@ const UpdateForm: React.FC<{
}));
}}
/>
<ProFormText
name={['email']}
label="邮箱"
width="lg"
placeholder="请输入邮箱"
required
rules={[{ required: true, message: '请输入邮箱' }]}
/>
<ProForm.Group title="地址">
<ProFormText
name={['address', 'country']}
@ -431,6 +439,8 @@ const UpdateForm: React.FC<{
required
rules={[{ required: true, message: '请输入详细地址' }]}
/>
</ProForm.Group>
<ProFormItem
name="contact"

View File

@ -77,6 +77,7 @@ import {
} from 'antd';
import React, { useMemo, useRef, useState } from 'react';
import RelatedOrders from '../../Subscription/Orders/RelatedOrders';
import dayjs from 'dayjs';
const ListPage: React.FC = () => {
const actionRef = useRef<ActionType>();
@ -1267,7 +1268,10 @@ const Shipping: React.FC<{
const [rates, setRates] = useState<API.RateDTO[]>([]);
const [ratesLoading, setRatesLoading] = useState(false);
const { message } = App.useApp();
const [shipmentPlatforms, setShipmentPlatforms] = useState([
{ label: 'uniuni', value: 'uniuni' },
{ label: 'tms.freightwaves', value: 'freightwaves' },
]);
return (
<ModalForm
formRef={formRef}
@ -1296,6 +1300,7 @@ const Shipping: React.FC<{
await ordercontrollerGetorderdetail({
orderId: id,
});
console.log('success data',success,data)
if (!success || !data) return {};
data.sales = data.sales?.reduce(
(acc: API.OrderSale[], cur: API.OrderSale) => {
@ -1318,7 +1323,8 @@ const Shipping: React.FC<{
if (reShipping) data.sales = [{}];
let shipmentInfo = localStorage.getItem('shipmentInfo');
if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo);
return {
const a = {
shipmentPlatform: 'uniuni',
...data,
// payment_method_id: shipmentInfo?.payment_method_id,
stockPointId: shipmentInfo?.stockPointId,
@ -1378,6 +1384,7 @@ const Shipping: React.FC<{
},
},
};
return a
}}
onFinish={async ({
customer_note,
@ -1441,7 +1448,18 @@ const Shipping: React.FC<{
}
}}
>
<ProFormText label="订单号" readonly name={'externalOrderId'} />
<Row gutter={16}>
<Col span={8}>
<ProFormSelect
name="shipmentPlatform"
label="发货平台"
options={shipmentPlatforms}
placeholder="请选择发货平台"
rules={[{ required: true, message: '请选择一个选项' }]}
/>
</Col>
</Row>
<ProFormText label="订单号" readonly name='externalOrderId' />
<ProFormText label="客户备注" readonly name="customer_note" />
<ProFormList
label="后台备注"
@ -1573,16 +1591,21 @@ const Shipping: React.FC<{
title="发货信息"
extra={
<AddressPicker
onChange={({
address,
phone_number,
phone_number_extension,
stockPointId,
}) => {
onChange={(row) => {
console.log(row);
const {
address,
phone_number,
phone_number_extension,
stockPointId,
email,
} = row;
formRef?.current?.setFieldsValue({
stockPointId,
// address_id: row.id,
details: {
origin: {
email_addresses:email,
address,
phone_number: {
phone: phone_number,
@ -1595,6 +1618,11 @@ const Shipping: React.FC<{
/>
}
>
{/* <ProFormText
label="address_id"
name={'address_id'}
rules={[{ required: true, message: '请输入ID' }]}
/> */}
<ProFormSelect
name="stockPointId"
width="md"
@ -1687,7 +1715,6 @@ const Shipping: React.FC<{
<ProFormText
label="公司名称"
name={['details', 'destination', 'name']}
rules={[{ required: true, message: '请输入公司名称' }]}
/>
<ProFormItem
name={['details', 'destination', 'address', 'country']}
@ -2017,6 +2044,7 @@ const Shipping: React.FC<{
details.origin.phone_number.number =
details.origin.phone_number.phone;
const res = await logisticscontrollerGetshipmentfee({
shipmentPlatform: data.shipmentPlatform,
stockPointId: data.stockPointId,
sender: details.origin.contact_name,
@ -2343,7 +2371,7 @@ const CreateOrder: React.FC<{
<ProFormText
label="公司名称"
name={['billing', 'company']}
rules={[{ required: true, message: '请输入公司名称' }]}
rules={[{ message: '请输入公司名称' }]}
/>
<ProFormItem
name={['billing', 'country']}
@ -2429,6 +2457,11 @@ const AddressPicker: React.FC<{
value: item.id,
}));
},
},
{
title: 'id',
dataIndex: ['id'],
hideInSearch: true,
},
{
title: '地区',
@ -2456,6 +2489,11 @@ const AddressPicker: React.FC<{
`+${record.phone_number_extension} ${record.phone_number}`,
hideInSearch: true,
},
{
title: '邮箱',
dataIndex: [ 'email'],
hideInSearch: true,
},
];
return (
<ModalForm

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState, useMemo } from 'react';
import { PageContainer, ProFromSelect } from '@ant-design/pro-components';
import { PageContainer, ProFormSelect } from '@ant-design/pro-components';
import { Card, Collapse, Divider, Image, Select, Space, Typography, message } from 'antd';
import { categorycontrollerGetall } from '@/servers/api/category';
import { productcontrollerGetproductlistgrouped } from '@/servers/api/product';
@ -272,7 +272,7 @@ const ProductGroupBy: React.FC = () => {
{categoryAttributes.map(attr => (
<div key={attr.id} style={{ display: 'flex', alignItems: 'center' }}>
<Text style={{ width: '100px' }}>{attr.title}</Text>
<ProFromSelect
<ProFormSelect
placeholder={`请选择${attr.title}`}
style={{ width: 300 }}
value={attributeFilters[attr.name] || null}

View File

@ -1627,9 +1627,11 @@ declare namespace API {
details?: ShippingDetailsDTO;
stockPointId?: number;
orderIds?: number[];
shipmentPlatform?: string;
};
type ShipmentFeeBookDTO = {
shipmentPlatform?: string;
stockPointId?: number;
sender?: string;
startPhone?: string;
@ -1650,6 +1652,7 @@ declare namespace API {
dimensionUom?: string;
weight?: number;
weightUom?: string;
address_id?: number;
};
type ShippingAddress = {