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
bcb68bc6
Commit
bcb68bc6
authored
Oct 30, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:控制发货与收货显示
parent
536394bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
index.tsx
src/pages/transaction/components/orderDeleveRecord/index.tsx
+6
-2
index.tsx
src/pages/transaction/components/orderSaleRecord/index.tsx
+7
-3
No files found.
src/pages/transaction/components/orderDeleveRecord/index.tsx
View file @
bcb68bc6
...
...
@@ -155,6 +155,10 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
const
pathname
=
history
.
location
.
pathname
const
isPreview
=
pathname
.
lastIndexOf
(
'/preview'
)
!==
-
1
// 是否是确认收货页
const
isReceived
=
pathname
.
indexOf
(
'readyReceiveOrder'
)
!==
-
1
// 是否是确认回单页
const
isReturn
=
pathname
.
indexOf
(
'readyConfirmReturnOrder'
)
!==
-
1
// 用于储存已经修改过的订单id
const
dataRef
=
useRef
<
any
>
([])
...
...
@@ -219,8 +223,8 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
/* todo 需根据内部状态判断显示哪个按钮 */
}
{
!
isPreview
&&
!
dataRef
.
current
.
includes
(
record
.
id
)
&&
record
.
interiorState
===
DeliverySideState
.
CONFIRM_RECEIPT_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleReturn
(
record
)
}
>
确认回单
</
Button
>
}
{
!
isPreview
&&
!
dataRef
.
current
.
includes
(
record
.
id
)
&&
record
.
interiorState
===
DeliverySideState
.
WAREHOUSE_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认收货
</
Button
>
}
{
!
isPreview
&&
isReturn
&&
!
dataRef
.
current
.
includes
(
record
.
id
)
&&
record
.
interiorState
===
DeliverySideState
.
CONFIRM_RECEIPT_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleReturn
(
record
)
}
>
确认回单
</
Button
>
}
{
!
isPreview
&&
isReceived
&&
!
dataRef
.
current
.
includes
(
record
.
id
)
&&
record
.
interiorState
===
DeliverySideState
.
WAREHOUSE_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认收货
</
Button
>
}
</>
},
]
...
...
src/pages/transaction/components/orderSaleRecord/index.tsx
View file @
bcb68bc6
...
...
@@ -154,11 +154,15 @@ const sideChildrenCols: any[] = [
const
OrderSaleRecord
:
React
.
FC
<
OrderSaleRecordProps
>
=
(
props
)
=>
{
const
pathname
=
history
.
location
.
pathname
const
isPreview
=
pathname
.
lastIndexOf
(
'/preview'
)
!==
-
1
// 是否是确认发货页
const
isDeleved
=
pathname
.
indexOf
(
'readyConfirmDelevedOrder'
)
!==
-
1
// 是否是确认回单页
const
isReturn
=
pathname
.
indexOf
(
'readyConfirmReturnOrder'
)
!==
-
1
// 用于储存已经修改过的订单id
const
dataRef
=
useRef
<
any
>
([])
const
{
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
orderReceivingStatisticsResponses
,
orderDeliveryDetailsResponses
}
=
data
console
.
log
(
dataRef
,
isPreview
)
const
sideOrderCols
:
any
[]
=
[
{
title
:
'发货批次'
,
...
...
@@ -217,8 +221,8 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
align
:
'center'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
!
isPreview
&&
!
dataRef
.
current
.
includes
(
record
.
id
)
&&
record
.
interiorState
===
DeliverySideState
.
CONFIRM_RECEIPT_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleReturn
(
record
)
}
>
确认回单
</
Button
>
}
{
!
isPreview
&&
!
dataRef
.
current
.
includes
(
record
.
id
)
&&
record
.
interiorState
===
DeliverySideState
.
ADD_LOGISTICS_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认发货
</
Button
>
}
{
!
isPreview
&&
isReturn
&&
!
dataRef
.
current
.
includes
(
record
.
id
)
&&
record
.
interiorState
===
DeliverySideState
.
CONFIRM_RECEIPT_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleReturn
(
record
)
}
>
确认回单
</
Button
>
}
{
!
isPreview
&&
isDeleved
&&
!
dataRef
.
current
.
includes
(
record
.
id
)
&&
record
.
interiorState
===
DeliverySideState
.
ADD_LOGISTICS_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认发货
</
Button
>
}
</>
},
]
...
...
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