Commit bcb68bc6 authored by 前端-许佳敏's avatar 前端-许佳敏

fix:控制发货与收货显示

parent 536394bf
......@@ -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> }
</>
},
]
......
......@@ -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> }
</>
},
]
......
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