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

feat:抽离订单共用部分

parent 4e914a28
export const orderTypeLabel = ['',
'现货采购',
'现货采购',
'询价采购',
'需求采购',
'集采',
'渠道直采',
'渠道直采',
'渠道现货',
'渠道现货',
]
\ No newline at end of file
......@@ -4,9 +4,9 @@ import { usePageStatus } from '@/hooks/usePageStatus'
import { PublicApi } from '@/services/api'
import { Link } from 'umi'
import { GlobalConfig } from '@/global/config'
import { orderTypeLabel } from '../../orderCollect/constant'
import { orderTypeLabel } from '../constant'
import { formatTimeString } from '@/utils'
import StatusColors from '../../components/StatusColors'
import StatusColors from '../../../components/StatusColors'
interface OrderDetailHookProps {
// 采购、销售
......
......@@ -2,7 +2,7 @@ import React, { useContext } from 'react'
import { Tabs, Table, Button } from 'antd'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { formatTimeString } from '@/utils'
import { OrderDetailContext } from '../../context'
import { OrderDetailContext } from '../../_public/order/context'
import MellowCard from '@/components/MellowCard'
import NestTable from '@/components/NestTable'
import { SaleOrderInsideWorkState, DeliverySideState } from '@/constants'
......
import React from 'react'
import AuditProcess from '@/components/AuditProcess'
import { findLastIndexFlowState } from '../../utils'
import OrderProductTable from '../../public/components/orderProductTable'
import OrderPayTabs from '../../public/components/OrderPayTabs'
import OrderMergeInfo from '../../public/components/OrderMergeInfo'
import OrderDeleveRecord from '../../public/components/OrderDeleveRecord'
import OrderTransformRecord from '../../public/components/OrderTransformRecord'
import { findLastIndexFlowState } from '../../_public/order/utils'
import OrderProductTable from '../../components/orderProductTable'
import OrderPayTabs from '../../components/OrderPayTabs'
import OrderMergeInfo from '../../components/OrderMergeInfo'
import OrderDeleveRecord from '../../components/OrderDeleveRecord'
import OrderTransformRecord from '../../components/OrderTransformRecord'
export interface OrderDetailSectionProps {
formContext: any
......
import React, { useEffect, useState, useContext } from 'react'
import { Modal } from 'antd'
import { OrderDetailContext } from '../../context'
import { OrderDetailContext } from '../../_public/order/context'
import { PublicApi } from '@/services/api'
import { history } from 'umi'
......
import React, { useContext, useEffect, useState, useMemo } from 'react'
import React, { useContext } from 'react'
import { Row, Col, Tag } from 'antd'
import MellowCard from '@/components/MellowCard'
import { OrderDetailContext } from '../../context'
import { OrderDetailContext } from '../../_public/order/context'
import { formatTimeString } from '@/utils'
import { DELIVERY_TYPE } from '@/constants'
import style from './index.less'
import { PublicApi } from '@/services/api'
import ContractList from '../../../../components/ContractList'
import ContractList from '../ContractList'
import cx from 'classnames'
export interface OrderMergeInfoProps { }
......
import React, { useState, useEffect, useContext, useRef } from 'react'
import { Modal, Steps, Row, Col, Radio, message, Upload, Button } from 'antd'
import style from './index.less'
import { OrderDetailContext } from '../../context'
import { OrderDetailContext } from '../../_public/order/context'
import cx from 'classnames'
import { UploadOutlined } from '@ant-design/icons'
import { UPLOAD_TYPE } from '@/constants'
......
import React, { useContext, useEffect, useState } from 'react'
import style from './index.less'
import { Tabs, Row, Col } from 'antd'
import { OrderDetailContext } from '../../context'
import { OrderDetailContext } from '../../_public/order/context'
import MellowCard from '@/components/MellowCard'
import StatusColors from '../../../components/StatusColors'
import { PublicApi } from '@/services/api'
import StatusColors from '../StatusColors'
export interface OrderPayTabsProps {}
......
import React, { useContext, useState, useRef, useEffect } from 'react'
import { StandardTable } from 'god'
import { Card, Table, Form, Input, Row, Col, Button, Modal } from 'antd'
import { OrderDetailContext } from '../../context'
import { OrderDetailContext } from '../../_public/order/context'
import { EditOutlined, SettingOutlined } from '@ant-design/icons'
import style from './index.less'
import { PublicApi } from '@/services/api'
......
import React, { useContext } from 'react'
import { Tabs, Table } from 'antd'
import StatusColors from '../../../components/StatusColors'
import StatusColors from '../StatusColors'
import { formatTimeString } from '@/utils'
import { OrderDetailContext } from '../../context'
import { OrderDetailContext } from '../../_public/order/context'
import MellowCard from '@/components/MellowCard'
export interface OrderTransformRecordProps {}
......
import React, { useState, useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../public/context';
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/effects/useOrderDetail';
import ApprovedOrderModal from '../../public/components/approvedOrderModal';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../components/orderDetailSection';
import OrderDetailSection from '../../../components/orderDetailSection';
const FirstApprovedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'})
......
import React, { useState, useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../public/context';
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/effects/useOrderDetail';
import ApprovedOrderModal from '../../public/components/approvedOrderModal';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../components/orderDetailSection';
import OrderDetailSection from '../../../components/orderDetailSection';
const ReadySubmitOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'})
......
import React, { useState, useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../public/context';
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/effects/useOrderDetail';
import ApprovedOrderModal from '../../public/components/approvedOrderModal';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../components/orderDetailSection';
import OrderDetailSection from '../../../components/orderDetailSection';
const SecondApprovedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'})
......
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 ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../../components/orderDetailSection';
const FirstApprovedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewed)
const approvedRef = useRef<any>({})
const handleClick = useCallback(() => {
approvedRef.current.setVisible(true)
}, [])
// 提交表单
const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async ({values}) => {
const params = {
id: Number(id),
...values
}
const result = await run(params)
if (result.code === 1000) {
approvedRef.current.setVisible(false)
history.goBack()
}
})
}, [])
const ReadyApprovedOrderDetail: React.FC = () => {
return (
<div>
待审核订单详情
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader detailList={detailList} detailData={formContext.data} extraRight={
<Button type='primary' onClick={handleClick}>
提交审核
</Button>
} />
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext}/>
</PreLoading>
</OrderDetailWrapper>
{/* 提交时触发的弹窗集合 */}
<ApprovedOrderModal
currentRef={approvedRef}
onConfirm={handleSubmit}
loading={loading}
/>
</OrderDetailContext.Provider>
</div>
);
};
export default ReadyApprovedOrderDetail;
\ No newline at end of file
export default FirstApprovedOrderDetail;
\ No newline at end of file
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