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

feat:销售订单-提交审核

parent bed1cdf6
...@@ -9,3 +9,20 @@ export const orderTypeLabel = ['', ...@@ -9,3 +9,20 @@ export const orderTypeLabel = ['',
'渠道现货', '渠道现货',
'渠道现货', '渠道现货',
] ]
/**
* 销售订单状态枚举
*/
export enum SALE_ORDER_STATUS {
PREVIEW_ORDER = -1,
READY_APPROVED_ORDER,
ONE_LEVEL_APPROVED_ORDER,
TWO_LEVEL_APPROVED_ORDER,
CONFIRM_ORDER,
CONFIRM_PAY_RESULT_ORDER,
ADD_SALE_ORDER,
ADD_LOG_ORDER,
CONFIRM_DELIVE_GOODS_ORDER,
CONFIRM_RETURN_ORDER,
RETURN_DOCUMENT_ORDER
}
\ No newline at end of file
import React from 'react' import React, { useRef } from 'react'
import { useCallback, useState, useEffect } from 'react' import { useCallback, useState, useEffect } from 'react'
import { usePageStatus } from '@/hooks/usePageStatus' import { usePageStatus } from '@/hooks/usePageStatus'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
...@@ -18,21 +18,21 @@ export const useOrderDetail = (options: OrderDetailHookProps) => { ...@@ -18,21 +18,21 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
// 订单详情内容 // 订单详情内容
const [formData, setFormData] = useState<any>(null) const [formData, setFormData] = useState<any>(null)
// 支付信息列表 // 支付信息列表
const [payList, setPaylist] = useState<any[]>([]) const [payList, setPaylist] = useState<any[]>([])
const { id } = usePageStatus() const { id } = usePageStatus()
const { type } = options const { type } = options
const dataRef = useRef<any>([
const detailList = [
{ label: '对应报价单号', name: 'quotationNo', span: 8, render: text => <Link to={'/'}>{text}</Link> }, { label: '对应报价单号', name: 'quotationNo', span: 8, render: text => <Link to={'/'}>{text}</Link> },
{ label: '订单摘要', name: 'orderThe', span: 8 }, { label: '订单摘要', name: 'orderThe', span: 8 },
{ label: '供应会员', name: 'supplyMembersName', span: 8 }, { label: '供应会员', name: 'supplyMembersName', span: 8 },
{ label: '下单模式', name: 'orderModel', span: 8, render: text => GlobalConfig.web.orderMode.find(v => v.value === text)?.label || '' }, { label: '下单模式', name: 'orderModel', span: 8, render: text => GlobalConfig.web.orderMode.find(v => v.value === text)?.label || '' },
{ label: '订单类型', name: 'type', span: 8, render: text => orderTypeLabel[text] }, { label: '订单类型', name: 'type', span: 8, render: text => orderTypeLabel[text] },
{ label: '下单时间', name: 'createTime', span: 8, render: text => formatTimeString(text) }, { label: '下单时间', name: 'createTime', span: 8, render: text => formatTimeString(text) },
{ label: '外部状态', name: 'externalState', span: 8, render: text => <StatusColors type='out' status={text} /> }, { label: '外部状态', name: 'externalState', span: 8, render: text => <StatusColors type='out' status={text}/> },
{ label: '内部状态', name: 'interiorState', span: 8, render: text => <StatusColors type='inside' status={text} /> }, { label: '内部状态', name: type === 'saleOrder' ? 'purchaseOrderInteriorState' : 'interiorState', span: 8, render: text => <StatusColors type={type === 'saleOrder' ? 'saleInside' : 'inside'} status={text}/> },
] ])
useEffect(() => { useEffect(() => {
reloadFormData() reloadFormData()
...@@ -76,6 +76,6 @@ export const useOrderDetail = (options: OrderDetailHookProps) => { ...@@ -76,6 +76,6 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
return { return {
formContext, formContext,
id, id,
detailList detailList: dataRef.current
} }
} }
\ No newline at end of file
...@@ -2,16 +2,18 @@ import React from 'react' ...@@ -2,16 +2,18 @@ import React from 'react'
import AuditProcess from '@/components/AuditProcess' import AuditProcess from '@/components/AuditProcess'
import { findLastIndexFlowState } from '../../_public/order/utils' import { findLastIndexFlowState } from '../../_public/order/utils'
import OrderProductTable from '../../components/orderProductTable' import OrderProductTable from '../../components/orderProductTable'
import SaleOrderProductTable from '../../components/saleOrderProductTable'
import OrderPayTabs from '../../components/OrderPayTabs' import OrderPayTabs from '../../components/OrderPayTabs'
import OrderMergeInfo from '../../components/OrderMergeInfo' import OrderMergeInfo from '../../components/OrderMergeInfo'
import OrderDeleveRecord from '../../components/OrderDeleveRecord' import OrderDeleveRecord from '../../components/OrderDeleveRecord'
import OrderTransformRecord from '../../components/OrderTransformRecord' import OrderTransformRecord from '../../components/OrderTransformRecord'
export interface OrderDetailSectionProps { export interface OrderDetailSectionProps {
formContext: any formContext: any,
type?: 'purchaseOrder' | 'saleOrder'
} }
const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext}) => { const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext, type = 'purchaseOrder'}) => {
return ( return (
formContext.data && <div className='gray-wrap'> formContext.data && <div className='gray-wrap'>
<AuditProcess <AuditProcess
...@@ -23,7 +25,7 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext}) => ...@@ -23,7 +25,7 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext}) =>
innerVerifySteps={formContext.data.interiorWorkflowFlowRecordLogResponses || []} innerVerifySteps={formContext.data.interiorWorkflowFlowRecordLogResponses || []}
></AuditProcess> ></AuditProcess>
<OrderProductTable editable /> { type === 'saleOrder' ? <SaleOrderProductTable/> : <OrderProductTable editable /> }
<OrderPayTabs /> <OrderPayTabs />
......
...@@ -3,6 +3,7 @@ import { Modal } from 'antd' ...@@ -3,6 +3,7 @@ import { Modal } from 'antd'
import { OrderDetailContext } from '../../_public/order/context' import { OrderDetailContext } from '../../_public/order/context'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { history } from 'umi' import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest'
export interface OrderElectronModalProps { export interface OrderElectronModalProps {
currentRef: any, currentRef: any,
...@@ -12,6 +13,7 @@ export interface OrderElectronModalProps { ...@@ -12,6 +13,7 @@ export interface OrderElectronModalProps {
const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const { currentRef } = props const { currentRef } = props
const { data } = useContext(OrderDetailContext) const { data } = useContext(OrderDetailContext)
const { run, loading } = useHttpRequest(PublicApi.postOrderElectronicContractsAffirm)
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
useEffect(() => { useEffect(() => {
currentRef.current = { currentRef.current = {
...@@ -24,7 +26,7 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { ...@@ -24,7 +26,7 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const params = { const params = {
id: parseInt(data.id), id: parseInt(data.id),
} }
const { code } = await PublicApi.postOrderElectronicContractsAffirm(params) const { code } = await run(params)
if (code === 1000) { if (code === 1000) {
setVisible(false) setVisible(false)
history.goBack() history.goBack()
...@@ -39,11 +41,15 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { ...@@ -39,11 +41,15 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
cancelText='不签署' cancelText='不签署'
visible={visible} visible={visible}
onOk={handleSubmit} onOk={handleSubmit}
confirmLoading={loading}
onCancel={() => setVisible(false)} onCancel={() => setVisible(false)}
> >
<div style={{height: 600, position: 'relative'}}> {
data && <div style={{height: 600, position: 'relative'}}>
<iframe src={data.electronicContractUrl} style={{position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', display: 'block'}}/> <iframe src={data.electronicContractUrl} style={{position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', display: 'block'}}/>
</div> </div>
}
</Modal> </Modal>
) )
} }
......
.cancel {
color: #909399;
font-size: 12px;
cursor: pointer;
margin: 0 4px;
}
.confirm {
color: #00B37A;
font-size: 12px;
cursor: pointer;
}
\ No newline at end of file
...@@ -6,34 +6,17 @@ import OrderDetailHeader from '@/pages/transaction/components/OrderDetailHeader' ...@@ -6,34 +6,17 @@ import OrderDetailHeader from '@/pages/transaction/components/OrderDetailHeader'
import OrderDetailWrapper from '@/pages/transaction/components/OrderDetailWrapper'; import OrderDetailWrapper from '@/pages/transaction/components/OrderDetailWrapper';
import PreLoading from '@/components/PreLoading'; import PreLoading from '@/components/PreLoading';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail'; import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi' import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest'; import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../../components/orderDetailSection'; import OrderDetailSection from '../../../components/orderDetailSection';
import OrderElectronModal from '@/pages/transaction/components/orderElectronModal';
const FirstApprovedOrderDetail: React.FC = () => { const ReadyApprovedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'purchaseOrder'}) const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderProcurementOrderReviewed) const electronRef = useRef<any>({})
const approvedRef = useRef<any>({})
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
approvedRef.current.setVisible(true) electronRef.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()
}
})
}, []) }, [])
return ( return (
...@@ -47,19 +30,17 @@ const FirstApprovedOrderDetail: React.FC = () => { ...@@ -47,19 +30,17 @@ const FirstApprovedOrderDetail: React.FC = () => {
<OrderDetailWrapper> <OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}> <PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext}/> <OrderDetailSection formContext={formContext} type='saleOrder'/>
</PreLoading> </PreLoading>
</OrderDetailWrapper> </OrderDetailWrapper>
{/* 提交时触发的弹窗集合 */} {/* 提交时触发的弹窗集合 */}
<ApprovedOrderModal <OrderElectronModal
currentRef={approvedRef} currentRef={electronRef}
onConfirm={handleSubmit}
loading={loading}
/> />
</OrderDetailContext.Provider> </OrderDetailContext.Provider>
</div> </div>
); );
}; };
export default FirstApprovedOrderDetail; export default ReadyApprovedOrderDetail;
\ No newline at end of file \ No newline at end of file
import React from 'react' import React from 'react'
import { history } from 'umi' import { Card, Button, Space, message } from 'antd'
import { Card, Button, Space, Dropdown, Menu, message } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { PlusCircleOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons'
import DropDeleteDown from '@/components/DropDeleteDown'
import { tableListSchema } from './schema' import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
...@@ -13,7 +10,6 @@ import Submit from '@/components/NiceForm/components/Submit' ...@@ -13,7 +10,6 @@ import Submit from '@/components/NiceForm/components/Submit'
import { DatePicker } from '@formily/antd-components' import { DatePicker } from '@formily/antd-components'
import { useSelfTable } from './model/useSelfTable' import { useSelfTable } from './model/useSelfTable'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState } from '@/constants'
// 待提交审核订单 // 待提交审核订单
......
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