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

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

parent a9558346
......@@ -191,6 +191,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
{...settings}
>
{children}
{defaultFooterDom}
</ProLayout>
);
};
......
......@@ -128,9 +128,9 @@ export const DeliveryGoodsTableColumn: any = [
// 送货计划管理,协同 B2B通用 column
export const columnB2B = [
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, },
{ ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, },
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, fixed: 'left' },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, fixed: 'left' },
{ ...ClassColumn, dataIndex: 'category', width: 128, ellipsis: true, fixed: 'left' },
{ ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, },
......@@ -141,27 +141,27 @@ export const columnB2B = [
]
// 送货计划管理,协同 SRM通用 column
export const columnSRM = [
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, ellipsis: true, },
{ ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, },
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, fixed: 'left' },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, fixed: 'left' },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, ellipsis: true, fixed: 'left' },
{ ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, fixed: 'left' },
{ ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, fixed: 'left' },
{ ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, fixed: 'left' },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, fixed: 'left' },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', 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 - 不带地址
export const initExpandIconColumn = [
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, ellipsis: true, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 90, ellipsis: true, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 96, ellipsis: true, },
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 108, ellipsis: true, fixed: 'left' },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 400, ellipsis: true, fixed: 'left' },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 180, ellipsis: true, fixed: 'left' },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 96, ellipsis: true, fixed: 'left' },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCount', 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 = () => {
const expandedRowRender = (record) => {
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>
}
......@@ -125,7 +125,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
const dates = getDayAll(startDate, endDate)
datesRef.current = dates
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) => ({
title: item.substr(1),
dataIndex: item,
......@@ -199,6 +199,16 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
}
}, [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 (
<Spin spinning={spinning}>
<AnchorPage
......@@ -255,6 +265,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
</BaseInfo>
<BaseInfo className='mt-16' title={PlanMaterial.name} id={PlanMaterial.key} cols={1}>
<Table
id='parent'
// defaultExpandAllRows
rowKey={'planProductId'}
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