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

feat:确认归档

parent 4edf8320
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 ReadyConfirmReturnOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderReceiptOrderConfirmedAll)
// 提交表单
const handleSubmit = 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={handleSubmit} loading={loading}>
确认全部已回单
</Button>
} />
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext} type='saleOrder'/>
</PreLoading>
</OrderDetailWrapper>
</OrderDetailContext.Provider>
</div>
);
};
......
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 ReadyConfirmReturnDocumentOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderOfOrdersToBeFiled)
// 提交表单
const handleSubmit = useCallback(async () => {
const params = {
id: Number(id)
}
const result = await run(params)
if (result.code === 1000) {
history.goBack()
}
}, [])
const ReadyReturnDocumentDetail: React.FC = () => {
return (
<div>
待确认归档详情
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader detailList={detailList} detailData={formContext.data} extraRight={
<Button type='primary' onClick={handleSubmit} loading={loading}>
确认归档
</Button>
} />
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext} type='saleOrder'/>
</PreLoading>
</OrderDetailWrapper>
</OrderDetailContext.Provider>
</div>
);
};
export default ReadyReturnDocumentDetail;
\ No newline at end of file
export default ReadyConfirmReturnDocumentOrderDetail;
\ 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