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

feat:销售订单-确认发货

parent 2294e27c
......@@ -7,7 +7,7 @@ import { history } from 'umi'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import { PublicApi } from '@/services/api'
import { useHttpRequest } from '@/hooks/useHttpRequest'
import { OrderDetailContext } from '../_public/order/context'
import { OrderDetailContext } from '../../_public/order/context'
import moment from 'moment'
export interface OrderHandDeleveModalProps {
......
......@@ -18,7 +18,7 @@ const ReadyReceiveOrderDetail: React.FC = () => {
const approvedRef = useRef<any>({})
// 是否是手工收货
const isHeadReceipt = formContext.data.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER
const isHeadReceipt = formContext && formContext.data.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER
const handleClick = useCallback(() => {
if (isHeadReceipt) {
......
import React from 'react';
import React, { useState, useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../../_public/order/context';
import { PublicApi } from '@/services/api';
import { Button } from 'antd';
import OrderDetailHeader from '@/pages/transaction/components/OrderDetailHeader';
import OrderDetailWrapper from '@/pages/transaction/components/OrderDetailWrapper';
import PreLoading from '@/components/PreLoading';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import OrderHandDeleved from '../../../components/orderHandDeleved';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../../components/orderDetailSection';
import { SaleOrderInsideWorkState } from '@/constants';
const ReadyConfirmDelevedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
// 是否是手工发货
const isHandDeleved = formContext && formContext.data.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER
const approvedRef = useRef<any>({})
const handleClick = useCallback(() => {
if (isHandDeleved) {
const deleveBox = document.querySelector('#deleveBox') as any
window.scrollTo(0, deleveBox.offsetTop)
} else {
approvedRef.current.setVisible(true)
}
}, [isHandDeleved])
return (
<div>
待确认发货订单详情
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader detailList={detailList} detailData={formContext.data} extraRight={
<Button type='primary' onClick={handleClick}>
{ isHandDeleved ? '确认手工发货' : '去发货' }
</Button>
} />
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext} type='saleOrder'/>
</PreLoading>
</OrderDetailWrapper>
{/* 提交时触发的弹窗集合 */}
<OrderHandDeleved
currentRef={approvedRef}
/>
</OrderDetailContext.Provider>
</div>
);
};
......
This diff is collapsed.
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