Commit 3d629c1a authored by Gavin Peng's avatar Gavin Peng

fix: 新增送货计划SRM嵌套表格对齐测试

parent a9558346
...@@ -191,6 +191,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => { ...@@ -191,6 +191,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
{...settings} {...settings}
> >
{children} {children}
{defaultFooterDom}
</ProLayout> </ProLayout>
); );
}; };
......
...@@ -128,9 +128,9 @@ export const DeliveryGoodsTableColumn: any = [ ...@@ -128,9 +128,9 @@ export const DeliveryGoodsTableColumn: any = [
// 送货计划管理,协同 B2B通用 column // 送货计划管理,协同 B2B通用 column
export const columnB2B = [ export const columnB2B = [
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, }, { ...CommodityNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, fixed: 'left' },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, }, { ...TradeNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, fixed: 'left' },
{ ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, }, { ...ClassColumn, dataIndex: 'category', width: 128, ellipsis: true, fixed: 'left' },
{ ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, }, { ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, }, { ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, }, { ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, },
...@@ -141,27 +141,27 @@ export const columnB2B = [ ...@@ -141,27 +141,27 @@ export const columnB2B = [
] ]
// 送货计划管理,协同 SRM通用 column // 送货计划管理,协同 SRM通用 column
export const columnSRM = [ export const columnSRM = [
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, }, { ...MaterialNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, fixed: 'left' },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, }, { ...MaterialNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, fixed: 'left' },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, ellipsis: true, }, { ...MaterialModelColumn, dataIndex: 'spec', width: 128, ellipsis: true, fixed: 'left' },
{ ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, }, { ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, fixed: 'left' },
{ ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, }, { ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, fixed: 'left' },
{ ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, }, { ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, fixed: 'left' },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, }, { ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, fixed: 'left' },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, ellipsis: true, }, { ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, ellipsis: true, }, { ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, ellipsis: true, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, ellipsis: true, }, { ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, ellipsis: true, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, ellipsis: true, }, { ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 96, ellipsis: true, },
] ]
// 送货计划管理,协同 SRM,B2B 嵌套表格通用 column - 不带地址 // 送货计划管理,协同 SRM,B2B 嵌套表格通用 column - 不带地址
export const initExpandIconColumn = [ export const initExpandIconColumn = [
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, ellipsis: true, }, { ...OrderNoColumn, dataIndex: 'orderNo', width: 108, ellipsis: true, fixed: 'left' },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 90, ellipsis: true, }, { ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 400, ellipsis: true, fixed: 'left' },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, ellipsis: true, }, { ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 180, ellipsis: true, fixed: 'left' },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 96, ellipsis: true, }, { ...OrderNumColumn, dataIndex: 'purchaseCount', width: 96, ellipsis: true, fixed: 'left' },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 96, ellipsis: true, }, { ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 96, ellipsis: true, }, { ...TransitNumColumn, dataIndex: 'transitCount', width: 96, ellipsis: true, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 96, ellipsis: true, }, { ...DeliveredNumColumn, dataIndex: 'leftCount', width: 96, ellipsis: true, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 128, ellipsis: true, }, { ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 96, ellipsis: true, },
] ]
...@@ -50,7 +50,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -50,7 +50,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
const expandedRowRender = (record) => { const expandedRowRender = (record) => {
return <div> return <div>
<Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" /> <Table id='child' rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" scroll={{ x: '100%' }}/>
</div> </div>
} }
...@@ -125,7 +125,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -125,7 +125,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
const dates = getDayAll(startDate, endDate) const dates = getDayAll(startDate, endDate)
datesRef.current = dates datesRef.current = dates
setSelectedDate([startDate, endDate]) setSelectedDate([startDate, endDate])
const datesColumn = dates.map((item, i) => ({ title: item.substr(1), dataIndex: item, key: item, width: 120, align: 'center', })) const datesColumn = dates.map((item, i) => ({ title: item.substr(1), dataIndex: item, key: item, width: 80, align: 'center', }))
const datesExpandIconColumn = dates.map((item, i) => ({ const datesExpandIconColumn = dates.map((item, i) => ({
title: item.substr(1), title: item.substr(1),
dataIndex: item, dataIndex: item,
...@@ -199,6 +199,16 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -199,6 +199,16 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
} }
}, [selectedDate, selectedMember]) }, [selectedDate, selectedMember])
useEffect(() => {
const parent = document.querySelector('#parent .ant-table-content')
parent?.addEventListener('scroll', () => {
const child = document.querySelector('#child .ant-table-content')
if (child) {
child.scrollLeft = parent.scrollLeft
}
})
},[])
return ( return (
<Spin spinning={spinning}> <Spin spinning={spinning}>
<AnchorPage <AnchorPage
...@@ -255,6 +265,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -255,6 +265,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
</BaseInfo> </BaseInfo>
<BaseInfo className='mt-16' title={PlanMaterial.name} id={PlanMaterial.key} cols={1}> <BaseInfo className='mt-16' title={PlanMaterial.name} id={PlanMaterial.key} cols={1}>
<Table <Table
id='parent'
// defaultExpandAllRows // defaultExpandAllRows
rowKey={'planProductId'} rowKey={'planProductId'}
columns={materialTableColumn} columns={materialTableColumn}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment