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

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

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