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

fix:调整提交订单

parent f1486aeb
import React from 'react';
import React, { useState, useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../public/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 { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../components/orderDetailSection';
const ReadySubmitOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderSubmit)
const approvedRef = useRef<any>({})
const handleClick = useCallback(async () => {
const params = {
id: Number(id),
state: -1
}
const result = await run(params)
if (result.code === 1000) {
history.goBack()
}
}, [])
return (
<div>
待提交订单详情
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader detailList={detailList} detailData={formContext.data} extraRight={
<Button type='primary' onClick={handleClick} loading={loading}>
提交订单
</Button>
} />
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext}/>
</PreLoading>
</OrderDetailWrapper>
</OrderDetailContext.Provider>
</div>
);
};
......
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