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
6fb1665c
Commit
6fb1665c
authored
Apr 21, 2022
by
Gavin Peng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复禅道bug
parent
7490be07
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
206 additions
and
293 deletions
+206
-293
page-table-column.tsx
src/pages/order/constants/page-table-column.tsx
+41
-1
index.tsx
...iveryPlanCollaboration/deliveryPlanQuery/schema/index.tsx
+1
-1
create.tsx
...er/deliveryPlanManagement/deliveryPlanAwaitB2B/create.tsx
+26
-38
details.tsx
...r/deliveryPlanManagement/deliveryPlanAwaitB2B/details.tsx
+20
-30
index.tsx
...der/deliveryPlanManagement/deliveryPlanAwaitB2B/index.tsx
+1
-1
index.tsx
...iveryPlanManagement/deliveryPlanAwaitB2B/schema/index.tsx
+6
-0
update.tsx
...er/deliveryPlanManagement/deliveryPlanAwaitB2B/update.tsx
+16
-30
create.tsx
...er/deliveryPlanManagement/deliveryPlanAwaitSRM/create.tsx
+29
-42
details.tsx
...r/deliveryPlanManagement/deliveryPlanAwaitSRM/details.tsx
+20
-31
index.tsx
...der/deliveryPlanManagement/deliveryPlanAwaitSRM/index.tsx
+1
-1
update.tsx
...er/deliveryPlanManagement/deliveryPlanAwaitSRM/update.tsx
+22
-34
details.tsx
...rder/deliveryPlanManagement/deliveryPlanQuery/details.tsx
+6
-40
update.tsx
...order/deliveryPlanManagement/deliveryPlanQuery/update.tsx
+17
-44
No files found.
src/pages/order/constants/page-table-column.tsx
View file @
6fb1665c
...
...
@@ -4,7 +4,7 @@
*/
import
{
Button
}
from
"antd"
;
import
{
HarvestMaterialDelete
,
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
}
from
"./table-column"
;
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"
;
export
const
DeliveryNoteAddFromTableColumn
:
any
=
[
MaterialNoColumn
,
...
...
@@ -125,3 +125,43 @@ export const DeliveryGoodsTableColumn: any = [
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCount'
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
},
]
// 送货计划管理,协同 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
,
},
{
...
BrandColumn
,
dataIndex
:
'brand'
,
width
:
96
,
ellipsis
:
true
,
},
{
...
UntilColumn
,
dataIndex
:
'unit'
,
width
:
64
,
ellipsis
:
true
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCountSum'
,
width
:
96
,
ellipsis
:
true
,
},
{
...
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
,
},
]
// 送货计划管理,协同 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
,
},
{
...
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
,
},
]
// 送货计划管理,协同 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
,
},
{
...
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
,
},
]
src/pages/order/deliveryPlanCollaboration/deliveryPlanQuery/schema/index.tsx
View file @
6fb1665c
...
...
@@ -52,7 +52,7 @@ export const deliveryPlanCollaborationQuerySchema: ISchema = {
type
:
'string'
,
'x-component-props'
:
{
allowClear
:
true
,
placeholder
:
'
供应
会员'
placeholder
:
'
采购
会员'
}
},
submit
:
{
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanAwaitB2B/create.tsx
View file @
6fb1665c
...
...
@@ -8,14 +8,14 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import
{
history
}
from
'umi'
import
{
Circulation
,
ConfirmDeliveryPlan
,
Purchaser
,
SubmitDeliveryPlan
,
BaseInfo
as
base_Info
,
Supplier
,
PlanningCycle
,
SupplyMembersLabel
,
PlanSummary
,
Remarks
,
PlannedDelivery
,
DeliveryPlanText
,
DeliveryPlanRemark
,
CreateDeliveryPlanTitleB2B
}
from
'../../constants'
import
{
Button
,
DatePicker
,
Form
,
Input
,
InputNumber
,
message
,
Space
,
Spin
,
Steps
,
Table
}
from
'antd'
import
{
SaveOutlined
}
from
'@ant-design/icons'
import
{
CaretDownOutlined
,
CaretRightOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
import
BaseInfo
from
'@/components/BaseInfo/BaseInfo'
import
_
from
'lodash'
import
{
afterToday
,
convertArrToObj
,
disabledDate
,
getDayAll
,
limitDecimalsF
,
limitDecimalsP
}
from
'../../utils'
import
{
BrandColumn
,
ClassColumn
,
CommodityNoColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderSummaryColumn
,
OrderNumColumn
,
PlannedDeliveryNumColumn
,
TradeNameColumn
,
TransitNumColumn
,
UntilColumn
}
from
'../../constants/table-column'
import
{
RoleSelect
}
from
'@/components/RoleSelect'
import
{
getMemberManageSupplyMember
}
from
'@/services/MemberV2Api'
import
{
getOrderDeliveryPlanOrderProductPage
,
postOrderDeliveryPlanB2bCreate
}
from
'@/services/OrderNewV2Api'
import
{
columnB2B
,
initExpandIconColumn
}
from
'../../constants/page-table-column'
const
formItemLayout
=
{
labelCol
:
{
span
:
3
},
...
...
@@ -27,28 +27,6 @@ const ROLE_TYPE = '1'
// 1:b2b,2:srm
const
ORDER_TYPE
=
'1'
const
initGoodsTableColumn
=
[
{
...
CommodityNoColumn
,
dataIndex
:
'skuId'
,
width
:
80
,
},
{
...
TradeNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
},
{
...
ClassColumn
,
dataIndex
:
'category'
,
width
:
96
,
},
{
...
BrandColumn
,
dataIndex
:
'brand'
,
width
:
96
,
},
{
...
UntilColumn
,
dataIndex
:
'unit'
,
width
:
64
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCountSum'
,
width
:
96
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCountSum'
,
width
:
96
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCountSum'
,
width
:
96
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCountSum'
,
width
:
96
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
128
,
},
]
const
initExpandIconColumn
=
[
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
80
,
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
150
,
},
{
...
OrderCreatedAtColumn
,
dataIndex
:
'createTime'
,
width
:
120
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCount'
,
width
:
86
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCount'
,
width
:
86
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCount'
,
width
:
86
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCount'
,
width
:
86
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
,
width
:
96
,
},
]
const
DeliveryPlanAwaitB2BCreate
:
React
.
FC
=
()
=>
{
const
[
form
]
=
Form
.
useForm
()
const
datesRef
=
useRef
<
any
>
(
null
)
...
...
@@ -58,19 +36,21 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
// 锚点标题
const
[
iAnchors
,
setIAnchors
]
=
useState
<
AnchorsItem
[]
>
([
Circulation
,
//
Circulation,
base_Info
,
PlannedDelivery
,
Remarks
,
])
// 动态 TableColumn
const
[
goodsTableColumn
,
setGoodsTableColumn
]
=
useState
<
any
>
(
initGoodsTableColumn
)
const
[
goodsTableColumn
,
setGoodsTableColumn
]
=
useState
<
any
>
(
columnB2B
)
// 动态 expandIconColumn
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
(
initExpandIconColumn
)
const
expandedRowRender
=
(
record
,
index
)
=>
{
return
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
return
<
div
>
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
</
div
>
}
// 选中 开始时间,结束时间
...
...
@@ -127,7 +107,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
const
inputChange
=
(
val
:
any
,
text
:
any
,
record
:
any
)
=>
{
let
{
day
}
=
text
let
dataArr
=
JSON
.
parse
(
JSON
.
stringify
(
goodsTableDataRef
.
current
))
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
skuId
===
record
.
sku
Id
)
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
planProductId
===
record
.
planProduct
Id
)
let
childIndex
=
dataArr
[
index
].
orders
.
findIndex
(
f
=>
f
.
orderProductId
===
record
.
orderProductId
)
dataArr
[
index
].
orders
[
childIndex
][
`$
${
day
}
`
].
planCount
=
val
goodsTableDataRef
.
current
=
dataArr
...
...
@@ -161,7 +141,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
/>
)
}))
setGoodsTableColumn
([...
initGoodsTableColumn
,
...
datesColumn
])
setGoodsTableColumn
([...
columnB2B
,
...
datesColumn
])
setExpandIconColumn
([...
initExpandIconColumn
,
...
datesExpandIconColumn
])
}
else
{
// 清空
...
...
@@ -169,7 +149,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
goodsTableDataRef
.
current
=
null
setSelectedDate
([])
setGoodsTableData
([])
setGoodsTableColumn
(
initGoodsTableColumn
)
setGoodsTableColumn
(
columnB2B
)
setExpandIconColumn
(
initExpandIconColumn
)
}
}
...
...
@@ -189,7 +169,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
roleType
:
ROLE_TYPE
,
orderType
:
ORDER_TYPE
,
current
:
'1'
,
pageSize
:
'
100
'
pageSize
:
'
999
'
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
const
assemble
=
res
.
data
.
data
.
map
((
item
=>
{
...
...
@@ -234,13 +214,13 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
labelAlign=
'left'
form=
{
form
}
>
<
BaseInfo
className=
'mt-0'
title=
{
Circulation
.
name
}
id=
{
Circulation
.
key
}
cols=
{
1
}
>
{
/*
<BaseInfo className='mt-0' title={Circulation.name} id={Circulation.key} cols={1}>
<Steps progressDot current={0}>
<Steps.Step title={Purchaser} description={SubmitDeliveryPlan} />
<Steps.Step title={Supplier} description={ConfirmDeliveryPlan} />
</Steps>
</
BaseInfo
>
<
BaseInfo
className=
'mt-
16
'
title=
{
base_Info
.
name
}
id=
{
base_Info
.
key
}
>
</BaseInfo>
*/
}
<
BaseInfo
className=
'mt-
0
'
title=
{
base_Info
.
name
}
id=
{
base_Info
.
key
}
>
<
Form
.
Item
{
...
formItemLayout
}
label=
{
PlanningCycle
}
...
...
@@ -280,19 +260,27 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
<
BaseInfo
className=
'mt-16'
title=
{
PlannedDelivery
.
name
}
id=
{
PlannedDelivery
.
key
}
cols=
{
1
}
>
<
Table
// defaultExpandAllRows
rowKey=
{
'
sku
Id'
}
rowKey=
{
'
planProduct
Id'
}
columns=
{
goodsTableColumn
}
expandedRowRender=
{
expandedRowRender
}
expandable=
{
{
expandIcon
:
({
expanded
,
onExpand
,
record
})
=>
expanded
?
(
<
CaretDownOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
)
:
(
<
CaretRightOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
),
expandedRowRender
}
}
dataSource=
{
goodsTableData
}
tableLayout=
"fixed"
scroll=
{
{
x
:
'100%'
}
}
/>
</
BaseInfo
>
<
BaseInfo
className=
'mt-16'
title=
{
<>
{
Remarks
.
name
}
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
></>
}
id=
{
Remarks
.
key
}
cols=
{
1
}
>
<
BaseInfo
className=
'mt-16'
title=
{
Remarks
.
name
}
id=
{
Remarks
.
key
}
cols=
{
1
}
>
<
Form
.
Item
name=
'remark'
rules=
{
[
{
required
:
tru
e
,
message
:
'请输入'
}
{
required
:
fals
e
,
message
:
'请输入'
}
]
}
>
<
Input
.
TextArea
rows=
{
4
}
maxLength=
{
300
}
placeholder=
{
DeliveryPlanRemark
}
/>
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanAwaitB2B/details.tsx
View file @
6fb1665c
...
...
@@ -9,13 +9,13 @@ import { history } from 'umi'
import
{
Circulation
,
ConfirmDeliveryPlan
,
Purchaser
,
SubmitDeliveryPlan
,
BaseInfo
as
base_Info
,
Supplier
,
PlanningCycle
,
SupplyMembersLabel
,
PlanSummary
,
ExternalState
,
Remarks
,
ExternalRoamRecord
,
PlannedDelivery
,
PlanNumber
}
from
'../../constants'
import
{
Steps
,
Table
,
Tag
}
from
'antd'
import
BaseInfo
from
'@/components/BaseInfo/BaseInfo'
import
{
ExternalRoamRecordTable
Column
}
from
'../../constants/page-table-column'
import
{
columnB2B
,
ExternalRoamRecordTableColumn
,
initExpandIcon
Column
}
from
'../../constants/page-table-column'
import
_
from
'lodash'
import
{
getDayAll
,
godAtob
,
integrationArrToObj
,
integrationOjb
,
TagStatus
}
from
'../../utils'
import
{
BrandColumn
,
ClassColumn
,
CommodityNoColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderSummaryColumn
,
OrderNumColumn
,
PlannedDeliveryNumColumn
,
TradeNameColumn
,
TransitNumColumn
,
UntilColumn
}
from
'../../constants/table-column'
import
{
getOrderDeliveryPlanDeliveryHistory
,
getOrderDeliveryPlanDetail
,
getOrderDeliveryPlanDetailProductPage
}
from
'@/services/OrderNewV2Api'
import
moment
from
'moment'
import
CustomizedTableItem
from
'../../components/CustomizedTableItem'
import
{
CaretDownOutlined
,
CaretRightOutlined
}
from
'@ant-design/icons'
const
tagStatus
=
new
TagStatus
()
const
statusTxt
=
new
Map
([[
1
,
'待提交'
],
[
2
,
'待确认'
],
[
3
,
'待修订'
],
[
4
,
'已确认'
],
[
5
,
'已删除'
]])
...
...
@@ -35,32 +35,14 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
])
// 动态 TableColumn
const
[
goodsTableColumn
,
setGoodsTableColumn
]
=
useState
<
any
>
([
{
...
CommodityNoColumn
,
dataIndex
:
'skuId'
,
width
:
80
,
},
{
...
TradeNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
},
{
...
ClassColumn
,
dataIndex
:
'category'
,
width
:
96
,
},
{
...
BrandColumn
,
dataIndex
:
'brand'
,
width
:
96
,
},
{
...
UntilColumn
,
dataIndex
:
'unit'
,
width
:
64
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCountSum'
,
width
:
96
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCountSum'
,
width
:
96
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCountSum'
,
width
:
96
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCountSum'
,
width
:
96
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
128
,
},
])
const
[
goodsTableColumn
,
setGoodsTableColumn
]
=
useState
<
any
>
(
columnB2B
)
// 动态 expandIconColumn
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
([
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
80
,
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
200
,
},
{
...
OrderCreatedAtColumn
,
dataIndex
:
'createTime'
,
width
:
160
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCount'
,
width
:
96
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCount'
,
width
:
96
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCount'
,
width
:
96
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCount'
,
width
:
96
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
,
width
:
128
,
},
])
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
(
initExpandIconColumn
)
const
expandedRowRender
=
(
record
,
index
)
=>
{
return
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
return
<
div
>
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
</
div
>
}
// 详情
...
...
@@ -91,7 +73,7 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
getOrderDeliveryPlanDetailProductPage
({
id
,
current
:
'1'
,
pageSize
:
'
10
'
pageSize
:
'
999
'
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
const
assemble
=
res
.
data
.
data
.
map
(
item
=>
{
...
...
@@ -136,7 +118,7 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
return
(<>
<
AnchorPage
title=
{
details
?.
planNo
}
title=
{
`${details?.digest}|${details?.planNo}`
}
onBack=
{
()
=>
history
.
goBack
()
}
anchors=
{
iAnchors
}
>
...
...
@@ -164,12 +146,20 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
<
BaseInfo
className=
'mt-16'
title=
{
PlannedDelivery
.
name
}
id=
{
PlannedDelivery
.
key
}
cols=
{
1
}
>
<
Table
// defaultExpandAllRows
rowKey=
{
'
sku
Id'
}
rowKey=
{
'
planProduct
Id'
}
columns=
{
goodsTableColumn
}
expandedRowRender=
{
expandedRowRender
}
expandable=
{
{
expandIcon
:
({
expanded
,
onExpand
,
record
})
=>
expanded
?
(
<
CaretDownOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
)
:
(
<
CaretRightOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
),
expandedRowRender
}
}
dataSource=
{
goodsTableData
}
tableLayout=
"fixed"
scroll=
{
{
x
:
2022
}
}
scroll=
{
{
x
:
'100%'
}
}
/>
</
BaseInfo
>
<
BaseInfo
className=
'mt-16'
title=
{
ExternalRoamRecord
.
name
}
id=
{
ExternalRoamRecord
.
key
}
cols=
{
1
}
>
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanAwaitB2B/index.tsx
View file @
6fb1665c
...
...
@@ -80,7 +80,7 @@ const DeliveryPlanManagementAwaitB2B: React.FC = () => {
}
const
buttonGroup
=
{
'提交'
:
record
.
status
<=
1
,
'修改'
:
record
.
status
>=
1
,
'修改'
:
record
.
status
===
1
||
record
.
status
===
3
,
'删除'
:
record
.
status
<=
1
,
'查看'
:
true
,
}
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanAwaitB2B/schema/index.tsx
View file @
6fb1665c
...
...
@@ -48,6 +48,12 @@ export const deliveryPlanManagementAwaitB2BSchema: ISchema = {
},
},
properties
:
{
digest
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'计划摘要'
,
}
},
'[startTime, endTime]'
:
{
type
:
'daterange'
,
'x-component-props'
:
{
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanAwaitB2B/update.tsx
View file @
6fb1665c
...
...
@@ -8,14 +8,13 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import
{
history
}
from
'umi'
import
{
Circulation
,
ConfirmDeliveryPlan
,
Purchaser
,
SubmitDeliveryPlan
,
BaseInfo
as
base_Info
,
Supplier
,
PlanningCycle
,
SupplyMembersLabel
,
PlanSummary
,
Remarks
,
PlannedDelivery
,
DeliveryPlanRemark
,
ExternalRoamRecord
,
ExternalState
}
from
'../../constants'
import
{
Button
,
Form
,
Input
,
InputNumber
,
message
,
Space
,
Spin
,
Steps
,
Table
,
Tag
}
from
'antd'
import
{
SaveOutlined
}
from
'@ant-design/icons'
import
{
CaretDownOutlined
,
CaretRightOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
import
BaseInfo
from
'@/components/BaseInfo/BaseInfo'
import
_
from
'lodash'
import
{
afterToday
,
getDayAll
,
godAtob
,
integrationArrToObj
,
integrationOjb
,
limitDecimalsF
,
limitDecimalsP
,
TagStatus
}
from
'../../utils'
import
{
BrandColumn
,
ClassColumn
,
CommodityNoColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderSummaryColumn
,
OrderNumColumn
,
PlannedDeliveryNumColumn
,
TradeNameColumn
,
TransitNumColumn
,
UntilColumn
}
from
'../../constants/table-column'
import
{
getOrderDeliveryPlanDeliveryHistory
,
getOrderDeliveryPlanDetail
,
getOrderDeliveryPlanDetailProductPage
,
postOrderDeliveryPlanUpdate
}
from
'@/services/OrderNewV2Api'
import
moment
from
'moment'
import
{
ExternalRoamRecordTable
Column
}
from
'../../constants/page-table-column'
import
{
columnB2B
,
ExternalRoamRecordTableColumn
,
initExpandIcon
Column
}
from
'../../constants/page-table-column'
const
formItemLayout
=
{
labelCol
:
{
span
:
6
},
...
...
@@ -44,29 +43,9 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
])
// 动态 TableColumn
const
[
goodsTableColumn
,
setGoodsTableColumn
]
=
useState
<
any
>
([
{
...
CommodityNoColumn
,
dataIndex
:
'skuId'
,
width
:
80
,
},
{
...
TradeNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
},
{
...
ClassColumn
,
dataIndex
:
'category'
,
width
:
96
,
},
{
...
BrandColumn
,
dataIndex
:
'brand'
,
width
:
96
,
},
{
...
UntilColumn
,
dataIndex
:
'unit'
,
width
:
64
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCountSum'
,
width
:
96
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCountSum'
,
width
:
96
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCountSum'
,
width
:
96
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCountSum'
,
width
:
96
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
128
,
},
])
const
[
goodsTableColumn
,
setGoodsTableColumn
]
=
useState
<
any
>
(
columnB2B
)
// 动态 expandIconColumn
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
([
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
80
,
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
150
,
},
{
...
OrderCreatedAtColumn
,
dataIndex
:
'createTime'
,
width
:
120
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCount'
,
width
:
86
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCount'
,
width
:
86
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCount'
,
width
:
86
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCount'
,
width
:
86
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
,
width
:
96
,
},
])
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
(
initExpandIconColumn
)
const
expandedRowRender
=
(
record
,
index
)
=>
{
return
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
...
...
@@ -82,7 +61,6 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
// 保存
const
save
=
()
=>
{
form
.
validateFields
().
then
(
values
=>
{
console
.
log
(
'values :>> '
,
values
)
if
(
_
.
isEmpty
(
goodsTableDataRef
.
current
))
{
message
.
warning
(
'没有找到可执行计划送货'
)
return
...
...
@@ -112,7 +90,7 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
const
inputChange
=
(
val
:
any
,
text
:
any
,
record
:
any
)
=>
{
let
{
day
}
=
text
let
dataArr
=
JSON
.
parse
(
JSON
.
stringify
(
goodsTableDataRef
.
current
))
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
skuId
===
record
.
sku
Id
)
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
planProductId
===
record
.
planProduct
Id
)
let
childIndex
=
dataArr
[
index
].
orders
.
findIndex
(
f
=>
f
.
orderProductId
===
record
.
orderProductId
)
dataArr
[
index
].
orders
[
childIndex
][
`$
${
day
}
`
].
planCount
=
val
goodsTableDataRef
.
current
=
dataArr
...
...
@@ -151,7 +129,7 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
getOrderDeliveryPlanDetailProductPage
({
id
,
current
:
'1'
,
pageSize
:
'
10
'
pageSize
:
'
999
'
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
const
assemble
=
res
.
data
.
data
.
map
(
item
=>
{
...
...
@@ -246,9 +224,17 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
<
BaseInfo
className=
'mt-16'
title=
{
PlannedDelivery
.
name
}
id=
{
PlannedDelivery
.
key
}
cols=
{
1
}
>
<
Table
// defaultExpandAllRows
rowKey=
{
'
sku
Id'
}
rowKey=
{
'
planProduct
Id'
}
columns=
{
goodsTableColumn
}
expandedRowRender=
{
expandedRowRender
}
expandable=
{
{
expandIcon
:
({
expanded
,
onExpand
,
record
})
=>
expanded
?
(
<
CaretDownOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
)
:
(
<
CaretRightOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
),
expandedRowRender
}
}
dataSource=
{
goodsTableData
}
tableLayout=
"fixed"
scroll=
{
{
x
:
2022
}
}
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanAwaitSRM/create.tsx
View file @
6fb1665c
...
...
@@ -6,16 +6,16 @@
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'react'
import
{
history
}
from
'umi'
import
AnchorPage
,
{
AnchorsItem
}
from
'@/components/AnchorPage'
import
{
BaseInfo
as
base_Info
,
Remarks
,
PlanningCycle
,
SupplyMembersLabel
,
PlanSummary
,
ExternalState
,
ExternalDeliveryPlanCirculation
,
Purchaser
,
SubmitDeliveryPlan
,
Supplier
,
ConfirmDeliveryPlan
,
PlanMaterial
,
DeliveryPlanText
,
DeliveryPlanRemark
,
CreateDeliveryPlanTitleSRM
}
from
'../../constants'
import
{
BaseInfo
as
base_Info
,
Remarks
,
PlanningCycle
,
SupplyMembersLabel
,
PlanSummary
,
Purchaser
,
SubmitDeliveryPlan
,
Supplier
,
ConfirmDeliveryPlan
,
PlanMaterial
,
DeliveryPlanText
,
DeliveryPlanRemark
,
CreateDeliveryPlanTitleSRM
,
Circulation
}
from
'../../constants'
import
{
Button
,
DatePicker
,
Form
,
Input
,
InputNumber
,
message
,
Space
,
Spin
,
Steps
,
Table
}
from
'antd'
import
{
SaveOutlined
}
from
'@ant-design/icons'
import
{
CaretDownOutlined
,
CaretRightOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
import
BaseInfo
from
'@/components/BaseInfo/BaseInfo'
import
_
from
'lodash'
import
{
afterToday
,
convertArrToObj
,
disabledDate
,
getDayAll
,
limitDecimalsF
,
limitDecimalsP
}
from
'../../utils'
import
{
BrandColumn
,
ClassColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
MaterialModelColumn
,
MaterialNameColumn
,
MaterialNoColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderSummaryColumn
,
OrderNumColumn
,
PlannedDeliveryNumColumn
,
TransitNumColumn
,
UntilColumn
}
from
'../../constants/table-column'
import
{
RoleSelect
}
from
'@/components/RoleSelect'
import
{
getOrderDeliveryPlanOrderProductPage
,
postOrderDeliveryPlanSrmCreate
}
from
'@/services/OrderNewV2Api'
import
{
getMemberManageLowerMerchantProviderPage
}
from
'@/services/MemberV2Api'
import
{
columnSRM
,
initExpandIconColumn
}
from
'../../constants/page-table-column'
const
formItemLayout
=
{
labelCol
:
{
span
:
3
},
...
...
@@ -27,29 +27,6 @@ const ROLE_TYPE = '1'
// 1:b2b,2:srm
const
ORDER_TYPE
=
'2'
const
initMaterialTableColumn
=
[
{
...
MaterialNoColumn
,
dataIndex
:
'skuId'
,
width
:
80
,
},
{
...
MaterialNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
},
{
...
MaterialModelColumn
,
dataIndex
:
'spec'
,
width
:
128
,
},
{
...
ClassColumn
,
dataIndex
:
'category'
,
width
:
96
,
},
{
...
BrandColumn
,
dataIndex
:
'brand'
,
width
:
96
,
},
{
...
UntilColumn
,
dataIndex
:
'unit'
,
width
:
64
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCountSum'
,
width
:
96
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCountSum'
,
width
:
96
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCountSum'
,
width
:
96
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCountSum'
,
width
:
96
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
128
,
},
]
const
initExpandIconColumn
=
[
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
80
,
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
150
,
},
{
...
OrderCreatedAtColumn
,
dataIndex
:
'createTime'
,
width
:
120
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCount'
,
width
:
86
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCount'
,
width
:
86
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCount'
,
width
:
86
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCount'
,
width
:
86
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
,
width
:
96
,
},
]
const
DeliveryPlanAwaitSRMCreate
:
React
.
FC
=
()
=>
{
const
[
form
]
=
Form
.
useForm
()
const
datesRef
=
useRef
<
any
>
(
null
)
...
...
@@ -58,19 +35,21 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
const
[
spinning
,
setSpinning
]
=
useState
<
boolean
>
(
false
)
const
[
iAnchors
,
setIAnchors
]
=
useState
<
AnchorsItem
[]
>
([
ExternalDeliveryPlan
Circulation
,
//
Circulation,
base_Info
,
PlanMaterial
,
Remarks
,
])
// 动态 TableColumn
const
[
materialTableColumn
,
setMaterialTableColumn
]
=
useState
<
any
>
(
initMaterialTableColumn
)
const
[
materialTableColumn
,
setMaterialTableColumn
]
=
useState
<
any
>
(
columnSRM
)
// 动态 expandIconColumn
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
(
initExpandIconColumn
)
const
expandedRowRender
=
(
record
)
=>
{
return
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
return
<
div
>
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
</
div
>
}
...
...
@@ -129,7 +108,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
const
inputChange
=
(
val
:
any
,
text
:
any
,
record
:
any
)
=>
{
let
{
day
}
=
text
let
dataArr
=
JSON
.
parse
(
JSON
.
stringify
(
materialTableDataRef
.
current
))
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
skuId
===
record
.
sku
Id
)
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
planProductId
===
record
.
planProduct
Id
)
let
childIndex
=
dataArr
[
index
].
orders
.
findIndex
(
f
=>
f
.
orderProductId
===
record
.
orderProductId
)
dataArr
[
index
].
orders
[
childIndex
][
`$
${
day
}
`
].
planCount
=
val
materialTableDataRef
.
current
=
dataArr
...
...
@@ -163,7 +142,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
/>
)
}))
setMaterialTableColumn
([...
initMaterialTableColumn
,
...
datesColumn
])
setMaterialTableColumn
([...
columnSRM
,
...
datesColumn
])
setExpandIconColumn
([...
initExpandIconColumn
,
...
datesExpandIconColumn
])
}
else
{
// 清空
...
...
@@ -171,7 +150,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
materialTableDataRef
.
current
=
null
setSelectedDate
([])
setMaterialTableData
([])
setMaterialTableColumn
(
initMaterialTableColumn
)
setMaterialTableColumn
(
columnSRM
)
setExpandIconColumn
(
initExpandIconColumn
)
}
}
...
...
@@ -191,7 +170,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
roleType
:
ROLE_TYPE
,
orderType
:
ORDER_TYPE
,
current
:
'1'
,
pageSize
:
'
110
'
pageSize
:
'
999
'
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
const
assemble
=
res
.
data
.
data
.
map
((
item
=>
{
...
...
@@ -236,13 +215,13 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
labelAlign=
'left'
form=
{
form
}
>
<
BaseInfo
className=
'mt-0'
title=
{
ExternalDeliveryPlanCirculation
.
name
}
id=
{
ExternalDeliveryPlan
Circulation
.
key
}
cols=
{
1
}
>
{
/* <BaseInfo className='mt-0' title={Circulation.name} id={
Circulation.key} cols={1}>
<Steps progressDot current={0}>
<Steps.Step title={Purchaser} description={SubmitDeliveryPlan} />
<Steps.Step title={Supplier} description={ConfirmDeliveryPlan} />
</Steps>
</
BaseInfo
>
<
BaseInfo
className=
'mt-
16
'
title=
{
base_Info
.
name
}
id=
{
base_Info
.
key
}
>
</BaseInfo>
*/
}
<
BaseInfo
className=
'mt-
0
'
title=
{
base_Info
.
name
}
id=
{
base_Info
.
key
}
>
<
Form
.
Item
{
...
formItemLayout
}
label=
{
PlanningCycle
}
...
...
@@ -273,7 +252,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
label=
{
PlanSummary
}
name=
'planSummaryText'
rules=
{
[
{
required
:
tru
e
,
message
:
'请选择'
}
{
required
:
fals
e
,
message
:
'请选择'
}
]
}
>
<
Input
/>
...
...
@@ -282,19 +261,27 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
<
BaseInfo
className=
'mt-16'
title=
{
PlanMaterial
.
name
}
id=
{
PlanMaterial
.
key
}
cols=
{
1
}
>
<
Table
// defaultExpandAllRows
rowKey=
{
'
sku
Id'
}
rowKey=
{
'
planProduct
Id'
}
columns=
{
materialTableColumn
}
expandedRowRender=
{
expandedRowRender
}
expandable=
{
{
expandIcon
:
({
expanded
,
onExpand
,
record
})
=>
expanded
?
(
<
CaretDownOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
)
:
(
<
CaretRightOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
),
expandedRowRender
}
}
dataSource=
{
materialTableData
}
tableLayout=
"fixed"
scroll=
{
{
x
:
2022
}
}
scroll=
{
{
x
:
'100%'
}
}
/>
</
BaseInfo
>
<
BaseInfo
className=
'mt-16'
title=
{
<>
{
Remarks
.
name
}
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
></>
}
id=
{
Remarks
.
key
}
cols=
{
1
}
>
<
BaseInfo
className=
'mt-16'
title=
{
Remarks
.
name
}
id=
{
Remarks
.
key
}
cols=
{
1
}
>
<
Form
.
Item
name=
'remark'
rules=
{
[
{
required
:
tru
e
,
message
:
'请输入'
}
{
required
:
fals
e
,
message
:
'请输入'
}
]
}
>
<
Input
.
TextArea
rows=
{
4
}
maxLength=
{
300
}
placeholder=
{
DeliveryPlanRemark
}
/>
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanAwaitSRM/details.tsx
View file @
6fb1665c
...
...
@@ -9,13 +9,13 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import
{
BaseInfo
as
base_Info
,
PlanningCycle
,
SupplyMembersLabel
,
PlanSummary
,
ExternalRoamRecord
,
Circulation
,
Purchaser
,
SubmitDeliveryPlan
,
Supplier
,
ConfirmDeliveryPlan
,
PlannedDelivery
,
ExternalState
,
PlanNumber
}
from
'../../constants'
import
{
Steps
,
Table
,
Tag
}
from
'antd'
import
BaseInfo
from
'@/components/BaseInfo/BaseInfo'
import
{
ExternalRoamRecordTable
Column
}
from
'../../constants/page-table-column'
import
{
columnSRM
,
ExternalRoamRecordTableColumn
,
initExpandIcon
Column
}
from
'../../constants/page-table-column'
import
_
from
'lodash'
import
{
getDayAll
,
godAtob
,
integrationArrToObj
,
integrationOjb
,
TagStatus
}
from
'../../utils'
import
{
BrandColumn
,
ClassColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
MaterialModelColumn
,
MaterialNameColumn
,
MaterialNoColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderSummaryColumn
,
OrderNumColumn
,
PlannedDeliveryNumColumn
,
TransitNumColumn
,
UntilColumn
}
from
'../../constants/table-column'
import
{
getOrderDeliveryPlanDeliveryHistory
,
getOrderDeliveryPlanDetail
,
getOrderDeliveryPlanDetailProductPage
}
from
'@/services/OrderNewV2Api'
import
moment
from
'moment'
import
CustomizedTableItem
from
'../../components/CustomizedTableItem'
import
{
CaretDownOutlined
,
CaretRightOutlined
}
from
'@ant-design/icons'
const
tagStatus
=
new
TagStatus
()
const
statusTxt
=
new
Map
([[
1
,
'待提交'
],
[
2
,
'待确认'
],
[
3
,
'待修订'
],
[
4
,
'已确认'
],
[
5
,
'已删除'
]])
...
...
@@ -31,33 +31,14 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
])
// 动态 TableColumn
const
[
materialTableColumn
,
setMaterialTableColumn
]
=
useState
<
any
>
([
{
...
MaterialNoColumn
,
dataIndex
:
'skuId'
,
width
:
80
,
},
{
...
MaterialNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
},
{
...
MaterialModelColumn
,
dataIndex
:
'spec'
,
width
:
128
,
},
{
...
ClassColumn
,
dataIndex
:
'category'
,
width
:
96
,
},
{
...
BrandColumn
,
dataIndex
:
'brand'
,
width
:
96
,
},
{
...
UntilColumn
,
dataIndex
:
'unit'
,
width
:
64
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCountSum'
,
width
:
96
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCountSum'
,
width
:
96
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCountSum'
,
width
:
96
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCountSum'
,
width
:
96
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
128
,
},
])
const
[
materialTableColumn
,
setMaterialTableColumn
]
=
useState
<
any
>
(
columnSRM
)
// 动态 expandIconColumn
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
([
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
80
,
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
150
,
},
{
...
OrderCreatedAtColumn
,
dataIndex
:
'createTime'
,
width
:
120
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCount'
,
width
:
86
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCount'
,
width
:
86
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCount'
,
width
:
86
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCount'
,
width
:
86
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
,
width
:
96
,
},
])
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
(
initExpandIconColumn
)
const
expandedRowRender
=
(
record
,
index
)
=>
{
return
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
return
<
div
>
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
</
div
>
}
...
...
@@ -89,7 +70,7 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
getOrderDeliveryPlanDetailProductPage
({
id
,
current
:
'1'
,
pageSize
:
'
10
'
pageSize
:
'
999
'
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
const
assemble
=
res
.
data
.
data
.
map
(
item
=>
{
...
...
@@ -133,7 +114,7 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
return
(
<
AnchorPage
title=
{
details
?.
planNo
}
title=
{
`${details?.digest}|${details?.planNo}`
}
onBack=
{
()
=>
history
.
goBack
()
}
anchors=
{
iAnchors
}
>
...
...
@@ -161,12 +142,20 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
<
BaseInfo
className=
'mt-16'
title=
{
PlannedDelivery
.
name
}
id=
{
PlannedDelivery
.
key
}
cols=
{
1
}
>
<
Table
// defaultExpandAllRows
rowKey=
{
'
sku
Id'
}
rowKey=
{
'
planProduct
Id'
}
columns=
{
materialTableColumn
}
expandedRowRender=
{
expandedRowRender
}
expandable=
{
{
expandIcon
:
({
expanded
,
onExpand
,
record
})
=>
expanded
?
(
<
CaretDownOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
)
:
(
<
CaretRightOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
),
expandedRowRender
}
}
dataSource=
{
materialTableData
}
tableLayout=
"fixed"
scroll=
{
{
x
:
2022
}
}
scroll=
{
{
x
:
'100%'
}
}
/>
</
BaseInfo
>
<
BaseInfo
className=
'mt-16'
title=
{
ExternalRoamRecord
.
name
}
id=
{
ExternalRoamRecord
.
key
}
cols=
{
1
}
>
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanAwaitSRM/index.tsx
View file @
6fb1665c
...
...
@@ -80,7 +80,7 @@ const DeliveryPlanManagementAwaitSRM: React.FC = () => {
}
const
buttonGroup
=
{
'提交'
:
record
.
status
<=
1
,
'修改'
:
record
.
status
>=
1
,
'修改'
:
record
.
status
===
1
||
record
.
status
===
3
,
'删除'
:
record
.
status
<=
1
,
'查看'
:
true
,
}
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanAwaitSRM/update.tsx
View file @
6fb1665c
...
...
@@ -8,12 +8,11 @@ import { history } from 'umi'
import
AnchorPage
,
{
AnchorsItem
}
from
'@/components/AnchorPage'
import
{
BaseInfo
as
base_Info
,
Remarks
,
PlanningCycle
,
SupplyMembersLabel
,
PlanSummary
,
ExternalRoamRecord
,
ExternalState
,
Circulation
,
Purchaser
,
SubmitDeliveryPlan
,
Supplier
,
ConfirmDeliveryPlan
,
PlannedDelivery
,
DeliveryPlanRemark
}
from
'../../constants'
import
{
Button
,
Form
,
Input
,
InputNumber
,
message
,
Space
,
Spin
,
Steps
,
Table
,
Tag
}
from
'antd'
import
{
SaveOutlined
}
from
'@ant-design/icons'
import
{
CaretDownOutlined
,
CaretRightOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
import
BaseInfo
from
'@/components/BaseInfo/BaseInfo'
import
{
ExternalRoamRecordTable
Column
}
from
'../../constants/page-table-column'
import
{
columnSRM
,
ExternalRoamRecordTableColumn
,
initExpandIcon
Column
}
from
'../../constants/page-table-column'
import
_
from
'lodash'
import
{
afterToday
,
getDayAll
,
godAtob
,
integrationArrToObj
,
integrationOjb
,
limitDecimalsF
,
limitDecimalsP
,
TagStatus
}
from
'../../utils'
import
{
BrandColumn
,
ClassColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
MaterialModelColumn
,
MaterialNameColumn
,
MaterialNoColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderSummaryColumn
,
OrderNumColumn
,
PlannedDeliveryNumColumn
,
TransitNumColumn
,
UntilColumn
}
from
'../../constants/table-column'
import
{
getOrderDeliveryPlanDeliveryHistory
,
getOrderDeliveryPlanDetail
,
getOrderDeliveryPlanDetailProductPage
,
postOrderDeliveryPlanUpdate
}
from
'@/services/OrderNewV2Api'
import
moment
from
'moment'
...
...
@@ -43,33 +42,14 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
])
// 动态 TableColumn
const
[
materialTableColumn
,
setMaterialTableColumn
]
=
useState
<
any
>
([
{
...
MaterialNoColumn
,
dataIndex
:
'skuId'
,
width
:
80
,
},
{
...
MaterialNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
},
{
...
MaterialModelColumn
,
dataIndex
:
'spec'
,
width
:
128
,
},
{
...
ClassColumn
,
dataIndex
:
'category'
,
width
:
96
,
},
{
...
BrandColumn
,
dataIndex
:
'brand'
,
width
:
96
,
},
{
...
UntilColumn
,
dataIndex
:
'unit'
,
width
:
64
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCountSum'
,
width
:
96
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCountSum'
,
width
:
96
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCountSum'
,
width
:
96
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCountSum'
,
width
:
96
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
128
,
},
])
const
[
materialTableColumn
,
setMaterialTableColumn
]
=
useState
<
any
>
(
columnSRM
)
// 动态 expandIconColumn
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
([
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
80
,
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
150
,
},
{
...
OrderCreatedAtColumn
,
dataIndex
:
'createTime'
,
width
:
120
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCount'
,
width
:
86
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCount'
,
width
:
86
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCount'
,
width
:
86
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCount'
,
width
:
86
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
,
width
:
96
,
},
])
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
(
initExpandIconColumn
)
const
expandedRowRender
=
(
record
)
=>
{
return
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
return
<
div
>
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
</
div
>
}
// 详情
...
...
@@ -112,7 +92,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
const
inputChange
=
(
val
:
any
,
text
:
any
,
record
:
any
)
=>
{
let
{
day
}
=
text
let
dataArr
=
JSON
.
parse
(
JSON
.
stringify
(
materialTableDataRef
.
current
))
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
skuId
===
record
.
sku
Id
)
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
planProductId
===
record
.
planProduct
Id
)
let
childIndex
=
dataArr
[
index
].
orders
.
findIndex
(
f
=>
f
.
orderProductId
===
record
.
orderProductId
)
dataArr
[
index
].
orders
[
childIndex
][
`$
${
day
}
`
].
planCount
=
val
materialTableDataRef
.
current
=
dataArr
...
...
@@ -151,7 +131,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
getOrderDeliveryPlanDetailProductPage
({
id
,
current
:
'1'
,
pageSize
:
'
10
'
pageSize
:
'
999
'
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
const
assemble
=
res
.
data
.
data
.
map
(
item
=>
{
...
...
@@ -201,7 +181,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
return
(
<
Spin
spinning=
{
spinning
}
>
<
AnchorPage
title=
{
details
?.
planNo
}
title=
{
`${details?.digest}|${details?.planNo}`
}
onBack=
{
()
=>
history
.
goBack
()
}
anchors=
{
iAnchors
}
extra=
{
...
...
@@ -245,19 +225,27 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
<
BaseInfo
className=
'mt-16'
title=
{
PlannedDelivery
.
name
}
id=
{
PlannedDelivery
.
key
}
cols=
{
1
}
>
<
Table
// defaultExpandAllRows
rowKey=
{
'
sku
Id'
}
rowKey=
{
'
planProduct
Id'
}
columns=
{
materialTableColumn
}
expandedRowRender=
{
expandedRowRender
}
expandable=
{
{
expandIcon
:
({
expanded
,
onExpand
,
record
})
=>
expanded
?
(
<
CaretDownOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
)
:
(
<
CaretRightOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
),
expandedRowRender
}
}
dataSource=
{
materialTableData
}
tableLayout=
"fixed"
scroll=
{
{
x
:
2022
}
}
scroll=
{
{
x
:
'100%'
}
}
/>
</
BaseInfo
>
<
BaseInfo
className=
'mt-16'
title=
{
Remarks
.
name
}
id=
{
Remarks
.
key
}
cols=
{
1
}
>
<
Form
.
Item
name=
'remark'
rules=
{
[
{
required
:
tru
e
,
message
:
'请输入'
}
{
required
:
fals
e
,
message
:
'请输入'
}
]
}
>
<
Input
.
TextArea
rows=
{
4
}
maxLength=
{
300
}
placeholder=
{
DeliveryPlanRemark
}
/>
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanQuery/details.tsx
View file @
6fb1665c
...
...
@@ -10,8 +10,7 @@ import { Steps, Table, Tag } from 'antd'
import
AnchorPage
,
{
AnchorsItem
}
from
"@/components/AnchorPage"
import
BaseInfo
from
'@/components/BaseInfo/BaseInfo'
import
{
BaseInfo
as
base_Info
,
Circulation
,
ConfirmDeliveryPlan
,
ExternalRoamRecord
,
ExternalState
,
PlanMaterial
,
PlannedDelivery
,
PlanningCycle
,
PlanNumber
,
PlanSummary
,
Purchaser
,
SubmitDeliveryPlan
,
Supplier
,
SupplyMember
,
SupplyMembersLabel
,
}
from
'../../constants'
import
{
ExternalRoamRecordTableColumn
}
from
'../../constants/page-table-column'
import
{
BrandColumn
,
ClassColumn
,
CommodityNoColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
MaterialModelColumn
,
MaterialNameColumn
,
MaterialNoColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderNumColumn
,
OrderSummaryColumn
,
PlannedDeliveryNumColumn
,
TradeNameColumn
,
TransitNumColumn
,
UntilColumn
}
from
'../../constants/table-column'
import
{
columnB2B
,
columnSRM
,
initExpandIconColumn
,
ExternalRoamRecordTableColumn
}
from
'../../constants/page-table-column'
import
{
getDayAll
,
godAtob
,
integrationArrToObj
,
integrationOjb
,
TagStatus
}
from
'../../utils'
import
{
getOrderDeliveryPlanDeliveryHistory
,
getOrderDeliveryPlanDetail
,
getOrderDeliveryPlanDetailProductPage
}
from
'@/services/OrderNewV2Api'
import
CustomizedTableItem
from
'../../components/CustomizedTableItem'
...
...
@@ -20,32 +19,6 @@ import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons'
const
intl
=
getIntl
();
const
columnB2B
=
[
{
...
CommodityNoColumn
,
dataIndex
:
'skuId'
,
width
:
80
,
ellipsis
:
true
,
},
{
...
TradeNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
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
,
},
{
...
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
,
},
]
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
,
},
{
...
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
,
},
]
const
tagStatus
=
new
TagStatus
()
const
statusTxt
=
new
Map
([[
1
,
'待提交'
],
[
2
,
'待确认'
],
[
3
,
'待修订'
],
[
4
,
'已确认'
],
[
5
,
'已删除'
]])
...
...
@@ -65,18 +38,11 @@ const DeliveryPlanManagementDetails: React.FC = () => {
const
[
tableColumn
,
setTableColumn
]
=
useState
<
any
>
([])
// 动态 expandIconColumn
// const dynamicWidth = deliveryPlanType === '1' ? 214 : 342
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
([
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
80
,
ellipsis
:
true
,
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
160
,
ellipsis
:
true
,
},
{
...
OrderCreatedAtColumn
,
dataIndex
:
'createTime'
,
width
:
120
,
ellipsis
:
true
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCount'
,
width
:
96
,
ellipsis
:
true
,
},
{
...
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
,
},
])
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
(
initExpandIconColumn
)
const
expandedRowRender
=
(
record
)
=>
{
return
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
/>
return
<
div
>
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
scroll=
{
{
x
:
'100%'
}
}
/>
</
div
>
}
// 详情
...
...
@@ -181,7 +147,7 @@ const DeliveryPlanManagementDetails: React.FC = () => {
{
/* B2B 显示计划送货物料,SRM显示计划送货商品 */
}
<
Table
// defaultExpandAllRows
rowKey=
{
'
sku
Id'
}
rowKey=
{
'
planProduct
Id'
}
columns=
{
tableColumn
}
expandable=
{
{
expandIcon
:
({
expanded
,
onExpand
,
record
})
=>
...
...
src/pages/order/deliveryPlanManagement/deliveryPlanQuery/update.tsx
View file @
6fb1665c
...
...
@@ -9,39 +9,13 @@ import moment from 'moment'
import
AnchorPage
,
{
AnchorsItem
}
from
'@/components/AnchorPage'
import
{
BaseInfo
as
base_Info
,
Remarks
,
PlanningCycle
,
SupplyMembersLabel
,
PlanSummary
,
ExternalRoamRecord
,
ExternalState
,
Circulation
,
Purchaser
,
SubmitDeliveryPlan
,
Supplier
,
ConfirmDeliveryPlan
,
PlannedDelivery
,
DeliveryPlanRemark
,
PlanNumber
}
from
'../../constants'
import
{
Button
,
Form
,
Input
,
InputNumber
,
message
,
Space
,
Spin
,
Steps
,
Table
,
Tag
}
from
'antd'
import
{
SaveOutlined
}
from
'@ant-design/icons'
import
{
CaretDownOutlined
,
CaretRightOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
import
BaseInfo
from
'@/components/BaseInfo/BaseInfo'
import
{
ExternalRoamRecordTableColumn
}
from
'../../constants/page-table-column'
import
{
columnB2B
,
columnSRM
,
initExpandIconColumn
,
ExternalRoamRecordTableColumn
}
from
'../../constants/page-table-column'
import
{
afterToday
,
getDayAll
,
godAtob
,
integrationArrToObj
,
integrationOjb
,
limitDecimalsF
,
limitDecimalsP
,
TagStatus
}
from
'../../utils'
import
{
BrandColumn
,
ClassColumn
,
ConsigneeNumColumn
,
DeliveredNumColumn
,
MaterialModelColumn
,
MaterialNameColumn
,
MaterialNoColumn
,
OrderCreatedAtColumn
,
OrderNoColumn
,
OrderSummaryColumn
,
OrderNumColumn
,
PlannedDeliveryNumColumn
,
TransitNumColumn
,
UntilColumn
,
CommodityNoColumn
,
TradeNameColumn
}
from
'../../constants/table-column'
import
{
getOrderDeliveryPlanDeliveryHistory
,
getOrderDeliveryPlanDetail
,
getOrderDeliveryPlanDetailProductPage
,
postOrderDeliveryPlanUpdate
}
from
'@/services/OrderNewV2Api'
const
columnB2B
=
[
{
...
CommodityNoColumn
,
dataIndex
:
'skuId'
,
width
:
80
,
},
{
...
TradeNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
},
{
...
ClassColumn
,
dataIndex
:
'category'
,
width
:
96
,
},
{
...
BrandColumn
,
dataIndex
:
'brand'
,
width
:
96
,
},
{
...
UntilColumn
,
dataIndex
:
'unit'
,
width
:
64
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCountSum'
,
width
:
96
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCountSum'
,
width
:
96
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCountSum'
,
width
:
96
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCountSum'
,
width
:
96
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
128
,
},
]
const
columnSRM
=
[
{
...
MaterialNoColumn
,
dataIndex
:
'skuId'
,
width
:
80
,
},
{
...
MaterialNameColumn
,
dataIndex
:
'productName'
,
width
:
192
,
},
{
...
MaterialModelColumn
,
dataIndex
:
'productName'
,
width
:
128
,
},
{
...
ClassColumn
,
dataIndex
:
'category'
,
width
:
96
,
},
{
...
BrandColumn
,
dataIndex
:
'brand'
,
width
:
96
,
},
{
...
UntilColumn
,
dataIndex
:
'unit'
,
width
:
64
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCountSum'
,
width
:
96
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCountSum'
,
width
:
96
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCountSum'
,
width
:
96
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCountSum'
,
width
:
96
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCountSum'
,
width
:
128
,
},
]
const
formItemLayout
=
{
labelCol
:
{
span
:
6
},
wrapperCol
:
{
span
:
16
}
...
...
@@ -72,16 +46,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
// 动态 TableColumn
const
[
tableColumn
,
setTableColumn
]
=
useState
<
any
>
([])
// 动态 expandIconColumn
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
([
{
...
OrderNoColumn
,
dataIndex
:
'orderNo'
,
width
:
80
,
},
{
...
OrderSummaryColumn
,
dataIndex
:
'orderDigest'
,
width
:
150
,
},
{
...
OrderCreatedAtColumn
,
dataIndex
:
'createTime'
,
width
:
120
,
},
{
...
OrderNumColumn
,
dataIndex
:
'purchaseCount'
,
width
:
86
,
},
{
...
ConsigneeNumColumn
,
dataIndex
:
'receiveCount'
,
width
:
86
,
},
{
...
TransitNumColumn
,
dataIndex
:
'transitCount'
,
width
:
86
,
},
{
...
DeliveredNumColumn
,
dataIndex
:
'leftCount'
,
width
:
86
,
},
{
...
PlannedDeliveryNumColumn
,
dataIndex
:
'planCount'
,
width
:
96
,
},
])
const
[
expandIconColumn
,
setExpandIconColumn
]
=
useState
<
any
>
(
initExpandIconColumn
)
const
expandedRowRender
=
(
record
:
any
)
=>
{
return
<
Table
rowKey=
{
'orderProductId'
}
columns=
{
expandIconColumn
}
dataSource=
{
record
.
orders
}
pagination=
{
false
}
tableLayout=
"fixed"
/>
...
...
@@ -126,7 +91,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
const
inputChange
=
(
val
:
any
,
text
:
any
,
record
:
any
)
=>
{
let
{
day
}
=
text
let
dataArr
=
JSON
.
parse
(
JSON
.
stringify
(
tableDataRef
.
current
))
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
skuId
===
record
.
sku
Id
)
let
index
=
dataArr
.
findIndex
(
f
=>
f
.
planProductId
===
record
.
planProduct
Id
)
let
childIndex
=
dataArr
[
index
].
orders
.
findIndex
(
f
=>
f
.
orderProductId
===
record
.
orderProductId
)
dataArr
[
index
].
orders
[
childIndex
][
`$
${
day
}
`
].
planCount
=
val
tableDataRef
.
current
=
dataArr
...
...
@@ -166,7 +131,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
getOrderDeliveryPlanDetailProductPage
({
id
,
current
:
'1'
,
pageSize
:
'
10
'
pageSize
:
'
999
'
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
const
assemble
=
res
.
data
.
data
.
map
(
item
=>
{
...
...
@@ -216,7 +181,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
return
(
<
Spin
spinning=
{
spinning
}
>
<
AnchorPage
title=
{
details
?.
planNo
}
title=
{
`${details?.digest}|${details?.planNo}`
}
onBack=
{
()
=>
history
.
goBack
()
}
anchors=
{
iAnchors
}
extra=
{
...
...
@@ -263,9 +228,17 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
<
BaseInfo
className=
'mt-16'
title=
{
PlannedDelivery
.
name
}
id=
{
PlannedDelivery
.
key
}
cols=
{
1
}
>
<
Table
// defaultExpandAllRows
rowKey=
{
'
sku
Id'
}
rowKey=
{
'
planProduct
Id'
}
columns=
{
tableColumn
}
expandedRowRender=
{
expandedRowRender
}
expandable=
{
{
expandIcon
:
({
expanded
,
onExpand
,
record
})
=>
expanded
?
(
<
CaretDownOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
)
:
(
<
CaretRightOutlined
onClick=
{
e
=>
onExpand
(
record
,
e
)
}
/>
),
expandedRowRender
}
}
dataSource=
{
tableData
}
tableLayout=
"fixed"
scroll=
{
{
x
:
'100%'
}
}
...
...
@@ -275,7 +248,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
<
Form
.
Item
name=
'remark'
rules=
{
[
{
required
:
tru
e
,
message
:
'请输入'
}
{
required
:
fals
e
,
message
:
'请输入'
}
]
}
>
<
Input
.
TextArea
rows=
{
4
}
maxLength=
{
300
}
placeholder=
{
DeliveryPlanRemark
}
/>
...
...
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