feat: product site sku #49

Merged
longbot merged 3 commits from zksu/WEB:main into main 2026-01-24 10:31:02 +00:00
5 changed files with 8 additions and 13 deletions
Showing only changes of commit 686432f893 - Show all commits

View File

@ -180,7 +180,7 @@ export default defineConfig({
component: './Product/Permutation',
},
{
name: '产品品牌空间',
name: '产品聚合空间',
path: '/product/groupBy',
component: './Product/GroupBy',
},

View File

@ -238,7 +238,7 @@ const ProductGroupBy: React.FC = () => {
const { Title, Text } = Typography;
return (
<PageContainer title="品牌空间">
<PageContainer title="聚合空间">
<div style={{ padding: '16px', background: '#fff' }}>
{/* Filter Section */}
<div style={{ marginBottom: '24px' }}>

View File

@ -35,7 +35,6 @@ const EditForm: React.FC<{
const [stockStatus, setStockStatus] = useState<
'in-stock' | 'out-of-stock' | null
>(null);
const [sites, setSites] = useState<any[]>([]);
const [categories, setCategories] = useState<any[]>([]);
const [activeAttributes, setActiveAttributes] = useState<any[]>([]);
@ -44,10 +43,6 @@ const EditForm: React.FC<{
productcontrollerGetcategoriesall().then((res: any) => {
setCategories(res?.data || []);
});
// 获取站点列表用于站点SKU选择
sitecontrollerAll().then((res: any) => {
setSites(res?.data || []);
});
}, []);
useEffect(() => {
@ -118,9 +113,6 @@ const EditForm: React.FC<{
components: components,
type: type,
categoryId: (record as any).categoryId || (record as any).category?.id,
// 初始化站点SKU为字符串数组
// 修改后代码:
siteSkus: (record.siteSkus || []).map((code) => ({ code })),
};
}, [record, components, type]);
return (
@ -187,7 +179,7 @@ const EditForm: React.FC<{
attributes,
type: values.type, // 直接使用 type
categoryId: values.categoryId,
siteSkus: values.siteSkus.map((v: { code: string }) => v.code) || [], // 直接传递字符串数组
siteSkus: values.siteSkus.map((v: { sku: string }) => v.sku) || [], // 直接传递字符串数组
// 连带更新 components
components:
values.type === 'bundle'
@ -251,7 +243,7 @@ const EditForm: React.FC<{
)}
>
<ProFormText
name="code"
name="sku"
width="md"
placeholder="请输入站点SKU"
rules={[{ required: true, message: '请输入站点SKU' }]}

View File

@ -228,7 +228,7 @@ const List: React.FC = () => {
<>
{record.siteSkus?.map((siteSku, index) => (
<Tag key={index} color="cyan">
{siteSku}
{siteSku.sku}
</Tag>
))}
</>

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 = {