Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
20e02b0c
Commit
20e02b0c
authored
Apr 24, 2022
by
Gavin Peng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 计划送货协同嵌套表格样式
parent
6383da4d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
17 deletions
+79
-17
page-table-column.tsx
src/pages/order/constants/page-table-column.tsx
+37
-6
table-column.ts
src/pages/order/constants/table-column.ts
+5
-0
details.tsx
...liveryNoticeCollaboration/deliveryNoticeAwait/details.tsx
+1
-1
details.tsx
...r/deliveryPlanCollaboration/deliveryPlanAwait/details.tsx
+16
-4
details.tsx
...r/deliveryPlanCollaboration/deliveryPlanQuery/details.tsx
+20
-6
No files found.
src/pages/order/constants/page-table-column.tsx
View file @
20e02b0c
...
...
@@ -2,9 +2,9 @@
* 订单模块 Table Column 组装
* @author: 莫雷
*/
import
{
Button
}
from
"antd"
;
import
{
HarvestMaterial
Delete
,
HarvestMaterial
Input
}
from
"../assets/context"
;
import
{
BrandColumn
,
ClassColumn
,
CommodityIdColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
DeliveryNumColumn
,
FlowNoteColumn
,
FlowOnColumn
,
FlowOptionsColumn
,
FlowOptionsTimeColumn
,
FlowRoleColumn
,
FlowStatusColumn
,
MaterialModelColumn
,
MaterialNameColumn
,
MaterialNoColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderSummaryColumn
,
OrderNumColumn
,
PlannedDeliveryNumColumn
,
TradeNameColumn
,
TransitNumColumn
,
UntilColumn
,
CommodityNoColumn
}
from
"./table-column"
;
import
{
Tooltip
}
from
"antd"
;
import
{
HarvestMaterialInput
}
from
"../assets/context"
;
import
{
BrandColumn
,
ClassColumn
,
CommodityIdColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
DeliveryNumColumn
,
FlowNoteColumn
,
FlowOnColumn
,
FlowOptionsColumn
,
FlowOptionsTimeColumn
,
FlowRoleColumn
,
FlowStatusColumn
,
MaterialModelColumn
,
MaterialNameColumn
,
MaterialNoColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderSummaryColumn
,
OrderNumColumn
,
PlannedDeliveryNumColumn
,
TradeNameColumn
,
TransitNumColumn
,
UntilColumn
,
CommodityNoColumn
,
ReceivingAddressColumn
}
from
"./table-column"
;
export
const
DeliveryNoteAddFromTableColumn
:
any
=
[
MaterialNoColumn
,
...
...
@@ -126,7 +126,7 @@ export const DeliveryGoodsTableColumn: any = [
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
},
]
//
送货计划管理,协同
B2B通用 column
//
送货计划管理
B2B通用 column
export
const
columnB2B
=
[
{
...
CommodityNoColumn
,
dataIndex
:
'skuId'
,
width
:
110
,
ellipsis
:
true
,
fixed
:
'left'
},
{
...
TradeNameColumn
,
dataIndex
:
'productName'
,
width
:
254
,
ellipsis
:
true
,
fixed
:
'left'
},
...
...
@@ -139,7 +139,7 @@ export const columnB2B = [
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCountSum'
,
width
:
96
,
ellipsis
:
true
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
104
,
ellipsis
:
true
,
},
]
//
送货计划管理,协同
SRM通用 column
//
送货计划管理
SRM通用 column
export
const
columnSRM
=
[
{
...
MaterialNoColumn
,
dataIndex
:
'skuId'
,
width
:
110
,
ellipsis
:
true
,
fixed
:
'left'
},
{
...
MaterialNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
ellipsis
:
true
,
fixed
:
'left'
},
...
...
@@ -154,7 +154,7 @@ export const columnSRM = [
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
104
,
ellipsis
:
true
,
},
]
// 送货计划管理
,协同
SRM,B2B 嵌套表格通用 column - 不带地址
// 送货计划管理 SRM,B2B 嵌套表格通用 column - 不带地址
export
const
initExpandIconColumn
=
[
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
110
,
ellipsis
:
true
,
fixed
:
'left'
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
320
,
ellipsis
:
true
,
fixed
:
'left'
},
...
...
@@ -165,3 +165,34 @@ export const initExpandIconColumn = [
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCount'
,
width
:
96
,
ellipsis
:
true
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
,
width
:
104
,
ellipsis
:
true
,
},
]
// 送货计划协同 SRM,B2B 嵌套表格通用 column - 带地址
export
const
jointExpandIconColumn
=
[
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
110
,
ellipsis
:
true
,
fixed
:
'left'
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
218
,
ellipsis
:
true
,
fixed
:
'left'
},
{
...
OrderCreatedAtColumn
,
dataIndex
:
'createTime'
,
width
:
188
,
ellipsis
:
true
,
fixed
:
'left'
},
{
...
ReceivingAddressColumn
,
dataIndex
:
'provinceName'
,
width
:
168
,
ellipsis
:
true
,
fixed
:
'left'
,
render
:
(
txt
:
string
,
record
:
any
)
=>
(
<
Tooltip
placement=
'topLeft'
title=
{
<>
<
span
>
{
`${txt ?? '-'}${record?.cityName ?? '-'}${record?.districtName ?? '-'}${record?.streetName ?? '-'}${record?.address ?? '-'}`
}
</
span
>
<
br
/>
<
span
>
{
record
?.
consignee
??
'-'
}
{
record
?.
phone
??
'-'
}
</
span
>
</>
}
>
<
span
>
{
`${txt ?? '-'}${record?.cityName ?? '-'}${record?.districtName ?? '-'}${record?.streetName ?? '-'}${record?.address ?? '-'}`
}
</
span
>
</
Tooltip
>
)
},
{
...
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
:
104
,
ellipsis
:
true
,
},
]
src/pages/order/constants/table-column.ts
View file @
20e02b0c
...
...
@@ -84,6 +84,11 @@ export const OrderCreatedAtColumn: any = {
render
:
(
txt
,
rcoed
)
=>
dayjs
(
rcoed
.
createTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
export
const
ReceivingAddressColumn
:
any
=
{
title
:
'收货地址'
,
// align: 'center',
}
export
const
OrderNumColumn
:
any
=
{
title
:
'订单数量'
,
dataIndex
:
'purchaseCount'
,
...
...
src/pages/order/deliveryNoticeCollaboration/deliveryNoticeAwait/details.tsx
View file @
20e02b0c
...
...
@@ -147,7 +147,7 @@ const DeliveryNoticeAwaitDetails: React.FC = () => {
{
details
.
noticeNo
}
</
BaseInfo
.
BaseInfoItem
>
<
BaseInfo
.
BaseInfoItem
label=
{
SupplyMember
}
>
{
details
.
buye
rMemberName
}
{
details
.
vendo
rMemberName
}
</
BaseInfo
.
BaseInfoItem
>
<
BaseInfo
.
BaseInfoItem
label=
{
NoticeSummary
}
>
{
details
.
digest
}
...
...
src/pages/order/deliveryPlanCollaboration/deliveryPlanAwait/details.tsx
View file @
20e02b0c
...
...
@@ -48,21 +48,20 @@ const DeliveryPlanCollaborationAwaitDetails: React.FC = () => {
// 动态 expandIconColumn
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
(
initExpandIconColumn
)
const
expandedRowRender
=
(
record
)
=>
{
return
<
div
>
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
return
<
div
className=
'childTable'
>
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
scroll=
{
{
x
:
'100%'
}
}
/>
</
div
>
}
// 计划周期 渲染日期
const
handleDateAssembleColumn
=
(
startDate
:
string
,
endDate
:
string
)
=>
{
const
dates
=
getDayAll
(
moment
(
startDate
).
format
(
'YYYY-MM-DD'
),
moment
(
endDate
).
format
(
'YYYY-MM-DD'
))
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
,
}))
const
datesExpandIconColumn
=
dates
.
map
((
item
,
i
)
=>
({
title
:
item
.
substr
(
1
),
dataIndex
:
item
,
key
:
item
,
width
:
80
,
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(<
CustomizedTableItem
createNotice=
{
text
?.
createNotice
}
createDelivery=
{
text
?.
createDelivery
}
planCount=
{
text
?.
planCount
}
/>)
}))
const
table_column
=
deliveryPlanType
===
'1'
?
columnB2B
:
deliveryPlanType
===
'2'
?
columnSRM
:
[]
...
...
@@ -124,6 +123,18 @@ const DeliveryPlanCollaborationAwaitDetails: React.FC = () => {
getDetails
()
},
[])
useEffect
(()
=>
{
const
parent
=
document
.
querySelector
(
'.parentTable .ant-table-content'
)
parent
?.
addEventListener
(
'scroll'
,
()
=>
{
const
child
:
NodeListOf
<
HTMLElement
>
=
document
.
querySelectorAll
(
'.childTable .ant-table-content'
)
if
(
child
)
{
Array
.
from
(
new
Array
(
child
.
length
)).
map
((
_
:
undefined
,
i
:
number
)
=>
{
child
[
i
].
scrollLeft
=
parent
.
scrollLeft
})
}
})
},[])
return
(<
Spin
spinning=
{
spinning
}
>
<
AnchorPage
title=
{
`${details?.digest} | ${details?.planNo}`
}
...
...
@@ -172,6 +183,7 @@ const DeliveryPlanCollaborationAwaitDetails: React.FC = () => {
<
BaseInfo
className=
'mt-16'
title=
{
deliveryPlanType
===
'1'
?
PlannedDelivery
.
name
:
PlanMaterial
.
name
}
id=
{
deliveryPlanType
===
'1'
?
PlannedDelivery
.
key
:
PlanMaterial
.
key
}
cols=
{
1
}
>
{
/* B2B 显示计划送货物料,SRM显示计划送货商品 */
}
<
Table
className=
'customizationTable parentTable'
// defaultExpandAllRows
rowKey=
{
'planProductId'
}
columns=
{
tableColumn
}
...
...
src/pages/order/deliveryPlanCollaboration/deliveryPlanQuery/details.tsx
View file @
20e02b0c
...
...
@@ -13,7 +13,7 @@ import { CaretDownOutlined, CaretRightOutlined, CheckCircleOutlined } from '@ant
import
BaseInfo
from
'@/components/BaseInfo/BaseInfo'
import
CalendarModal
from
'../../components/CalendarModal'
import
{
BaseInfo
as
base_Info
,
Circulation
,
ConfirmDeliveryPlan
,
ExternalState
,
PlanMaterial
,
PlanningCycle
,
PlanNumber
,
PlanSummary
,
Purchaser
,
SubmitDeliveryPlan
,
Supplier
,
SupplyMembersLabel
,
PlannedDelivery
,
BuyerLabel
,
DeliveryNoteGenerated
,
NoticeGenerated
}
from
'../../constants'
import
{
columnB2B
,
columnSRM
,
ExternalRoamRecordTableColumn
,
initExpandIconColumn
}
from
'../../constants/page-table-column'
import
{
columnB2B
,
columnSRM
,
ExternalRoamRecordTableColumn
,
initExpandIconColumn
,
jointExpandIconColumn
}
from
'../../constants/page-table-column'
import
{
getDayAll
,
godAtob
,
integrationArrToObj
,
integrationOjb
,
newMapValues
,
TagStatus
}
from
'../../utils'
import
{
getOrderDeliveryPlanDeliveryHistory
,
getOrderDeliveryPlanDeliveryOrder
,
getOrderDeliveryPlanDetail
,
getOrderDeliveryPlanDetailProductPage
,
getOrderDeliveryPlanNoticeOrder
}
from
'@/services/OrderNewV2Api'
import
CustomizedTableItem
from
'../../components/CustomizedTableItem'
...
...
@@ -65,14 +65,15 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
}
const
expandedRowRender
=
(
record
:
any
)
=>
{
return
<
div
>
return
<
div
className=
'childTable'
>
<
Table
rowKey=
{
'planOrderId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
rowSelection=
{
expandIconRowSelection
(
record
.
planProductId
)
}
scroll=
{
{
x
:
'100%'
}
}
rowSelection=
{
pageBtn
?
expandIconRowSelection
(
record
.
planProductId
)
:
null
}
/>
</
div
>
}
...
...
@@ -80,18 +81,18 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
// 计划周期 渲染日期
const
handleDateAssembleColumn
=
(
startDate
:
string
,
endDate
:
string
)
=>
{
const
dates
=
getDayAll
(
moment
(
startDate
).
format
(
'YYYY-MM-DD'
),
moment
(
endDate
).
format
(
'YYYY-MM-DD'
))
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
,
}))
const
datesExpandIconColumn
=
dates
.
map
((
item
,
i
)
=>
({
title
:
item
.
substr
(
1
),
dataIndex
:
item
,
key
:
item
,
width
:
80
,
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(<
CustomizedTableItem
createNotice=
{
text
?.
createNotice
}
createDelivery=
{
text
?.
createDelivery
}
planCount=
{
text
?.
planCount
}
/>)
}))
const
table_column
=
deliveryPlanType
===
'1'
?
columnB2B
:
deliveryPlanType
===
'2'
?
columnSRM
:
[]
const
expandIcon_column
=
pageBtn
?
jointExpandIconColumn
:
initExpandIconColumn
setTableColumn
([...
table_column
,
...
datesColumn
])
setExpandIconColumn
([...
expandIcon
C
olumn
,
...
datesExpandIconColumn
])
setExpandIconColumn
([...
expandIcon
_c
olumn
,
...
datesExpandIconColumn
])
}
// 获取计划送货
...
...
@@ -205,6 +206,18 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
getDetails
()
},
[])
useEffect
(()
=>
{
const
parent
=
document
.
querySelector
(
'.parentTable .ant-table-content'
)
parent
?.
addEventListener
(
'scroll'
,
()
=>
{
const
child
:
NodeListOf
<
HTMLElement
>
=
document
.
querySelectorAll
(
'.childTable .ant-table-content'
)
if
(
child
)
{
Array
.
from
(
new
Array
(
child
.
length
)).
map
((
_
:
undefined
,
i
:
number
)
=>
{
child
[
i
].
scrollLeft
=
parent
.
scrollLeft
})
}
})
},[])
return
(
<
Spin
spinning=
{
spinning
}
>
<
AnchorPage
...
...
@@ -260,6 +273,7 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
<
BaseInfo
className=
'mt-16'
title=
{
deliveryPlanType
===
'1'
?
PlannedDelivery
.
name
:
PlanMaterial
.
name
}
id=
{
deliveryPlanType
===
'1'
?
PlannedDelivery
.
key
:
PlanMaterial
.
key
}
cols=
{
1
}
>
{
/* B2B 显示计划送货物料,SRM显示计划送货商品 */
}
<
Table
className=
'customizationTable parentTable'
// defaultExpandAllRows
rowKey=
{
'planProductId'
}
columns=
{
tableColumn
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment