Commit 7951d9ef authored by 卢均锐's avatar 卢均锐

feat: 采购竞价单审核 修改逻辑 增加审核按钮判断

parent fa4bb8de
...@@ -15,8 +15,10 @@ const { Text } = Typography; ...@@ -15,8 +15,10 @@ const { Text } = Typography;
const BidProgressDrawer: React.FC<BidProgressDrawerProps> = (props: any) => { const BidProgressDrawer: React.FC<BidProgressDrawerProps> = (props: any) => {
const { visible, onClose, awardProcess = [] } = props; const { visible, onClose, awardProcess = [] } = props;
const [activeItem, setActiveItem] = useState<any>(awardProcess ? awardProcess[0] : {}); const [activeItem, setActiveItem] = useState<any>(awardProcess ? awardProcess[0] : {});
const [activeIndex, setActiveIndex] = useState<any>(awardProcess ? 0 : '');
useEffect(() => { useEffect(() => {
awardProcess && setActiveItem(awardProcess[0]) awardProcess && setActiveItem(awardProcess[0]);
awardProcess && setActiveIndex(0);
}, [awardProcess]) }, [awardProcess])
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
title: '序号', title: '序号',
...@@ -81,9 +83,10 @@ const BidProgressDrawer: React.FC<BidProgressDrawerProps> = (props: any) => { ...@@ -81,9 +83,10 @@ const BidProgressDrawer: React.FC<BidProgressDrawerProps> = (props: any) => {
render: (text: any, record: any) => ${text}`, render: (text: any, record: any) => ${text}`,
}]; }];
const chooseItem = (item: any) => { const chooseItem = (item: any, index: number) => {
if (item.id !== activeItem.id) { if (index !== activeIndex) {
setActiveItem(item); setActiveItem(item);
setActiveIndex(index);
} }
} }
...@@ -104,8 +107,8 @@ const BidProgressDrawer: React.FC<BidProgressDrawerProps> = (props: any) => { ...@@ -104,8 +107,8 @@ const BidProgressDrawer: React.FC<BidProgressDrawerProps> = (props: any) => {
<Row gutter={[8, 8]} style={{ marginBottom: '10px' }}> <Row gutter={[8, 8]} style={{ marginBottom: '10px' }}>
{awardProcess?.length > 0 && awardProcess?.map((item, index) => { {awardProcess?.length > 0 && awardProcess?.map((item, index) => {
return ( return (
<Col span={7} key={item.id} onClick={() => { chooseItem(item) }}> <Col span={7} key={item.id} onClick={() => { chooseItem(item, index) }}>
<BtnItem detail={item} active={item?.id === activeItem?.id} /> <BtnItem detail={item} active={index === activeIndex} />
</Col> </Col>
) )
})} })}
......
import React, { useRef, useImperativeHandle } from 'react'; import React, { useRef, useCallback, useEffect } from 'react';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions, FormEffectHooks } from '@formily/antd'; import { createFormActions, FormEffectHooks } from '@formily/antd';
...@@ -15,8 +15,11 @@ const { Text } = Typography; ...@@ -15,8 +15,11 @@ const { Text } = Typography;
const formActions = createFormActions(); const formActions = createFormActions();
const QuotationDetailsDrawer = (props: any) => { const QuotationDetailsDrawer = (props: any) => {
const { visible, onClose, schemaType, effects, reload, fetch, quotationDetailsId, number } = props; const { visible, onClose, schemaType, effects, fetch, quotationDetailsId, number } = props;
const tableRef = useRef<any>({}); const tableRef = useRef<any>({});
useEffect(() => {
tableRef.current?.reload && tableRef.current?.reload();
}, [quotationDetailsId])
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
title: '序号', title: '序号',
align: 'center', align: 'center',
...@@ -77,17 +80,17 @@ const QuotationDetailsDrawer = (props: any) => { ...@@ -77,17 +80,17 @@ const QuotationDetailsDrawer = (props: any) => {
title: '金额(含税)', title: '金额(含税)',
key: 'price', key: 'price',
dataIndex: 'price', dataIndex: 'price',
render: (text: any, record: any) => ${text}`, render: (text: any, record: any) => ${text}`,
}]; }];
/** 列表数据 */ /** 列表数据 */
const fetchData = (params?: any) => { const fetchData = useCallback((params?: any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
visible && fetch({ id: quotationDetailsId, number: number, ...params }).then(res => { visible && fetch({ id: quotationDetailsId, number: number, ...params }).then(res => {
resolve(res.data) resolve(res.data)
}) })
}) })
} }, [quotationDetailsId, number])
// 搜索 // 搜索
const search = (values: any) => { const search = (values: any) => {
...@@ -120,9 +123,9 @@ const QuotationDetailsDrawer = (props: any) => { ...@@ -120,9 +123,9 @@ const QuotationDetailsDrawer = (props: any) => {
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, effects, FORM_FILTER_PATH); useStateFilterSearchLinkageEffect($, actions, effects, FORM_FILTER_PATH);
}} }}
// schema={ // schema={
// schemaType && SchemaRender() // schemaType && SchemaRender()
// } // }
> >
</NiceForm> </NiceForm>
} }
......
...@@ -252,11 +252,17 @@ const SearchDetail = () => { ...@@ -252,11 +252,17 @@ const SearchDetail = () => {
}, []) }, [])
const _returnTopButton = () => { const _returnTopButton = () => {
return ( switch (pathPci) {
<Button onClick={() => setVisible(true)} type='primary'> case 'examineSearch':
<CheckCircleOutlined /> 单据审核 return (
</Button> <Button onClick={() => setVisible(true)} type='primary'>
) <CheckCircleOutlined /> 单据审核
</Button>
)
default:
return null;
}
} }
const fetchLink = () => { const fetchLink = () => {
......
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