Commit 660b333d authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞 fix(): 修改采购询价BUG

parent f732e3e2
...@@ -85,7 +85,14 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => { ...@@ -85,7 +85,14 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
{ {
title: '含税/税率', title: '含税/税率',
key: 'isTax', key: 'isTax',
dataIndex: 'isTax' dataIndex: 'isTax',
render: (text: any, record: any) => (
<>
<Typography.Text>{text ? '是' : '否'}</Typography.Text>
&nbsp;
<Typography.Text type="secondary">{`(${record.taxProbability})`}</Typography.Text>
</>
)
}, },
{ {
title: '单价(含税)', title: '单价(含税)',
......
...@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useState } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useState } from 'react';
import Card from '../../../card'; import Card from '../../../card';
import { PRICECONTRAST_TYPE } from '../../../../constants'; import { PRICECONTRAST_TYPE } from '../../../../constants';
import { history } from 'umi'; import { history } from 'umi';
import { Space, Button, Tabs, message, Row, Col, Typography, Skeleton, Divider, Empty } from 'antd'; import { Space, Button, Tabs, message, Row, Col, Typography, Skeleton, Divider, Empty, Pagination } from 'antd';
import { FilePdfOutlined } from '@ant-design/icons'; import { FilePdfOutlined } from '@ant-design/icons';
import RowLayout from './rowLayout'; import RowLayout from './rowLayout';
import { Context, BidDetailContext } from '../context'; import { Context, BidDetailContext } from '../context';
...@@ -52,10 +52,8 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => { ...@@ -52,10 +52,8 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
const context = useContext(Context); const context = useContext(Context);
const [count, setCount] = useState<any>([]); const [count, setCount] = useState<any>([]);
const [soure, setSoure] = useState<any>({}); const [soure, setSoure] = useState<any>({});
const [size, setSize] = useState<SizeType>({ const [total, setTotal] = useState<number>(0);
pageSize: '4', const [current, setCurrent] = useState<string>('1');
current: '1'
})
const [type, setType] = useState<string>(''); const [type, setType] = useState<string>('');
const [visible, setVisible] = useState<boolean>(false); const [visible, setVisible] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
...@@ -177,17 +175,19 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => { ...@@ -177,17 +175,19 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
* t: 轮次 * t: 轮次
* i: 当前tab 下标 * i: 当前tab 下标
*/ */
const fetchTableData = async (t: string, i?: number) => { const fetchTableData = async (t: string, i?: number, page?: any) => {
const params = { const params = {
id, id,
turn: t, turn: t,
...size, pageSize: "4",
current: page ? page : current,
} }
await PublicApi.getPurchaseConfirmQuotedPriceQuotedPriceInfo({ ...params }).then(res => { await PublicApi.getPurchaseConfirmQuotedPriceQuotedPriceInfo({ ...params }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
return return
} }
const { data } = res.data; const { data } = res.data;
setTotal(res.data.totalCount);
const params = { ...rowSource }; const params = { ...rowSource };
params[i] = [...data] params[i] = [...data]
if (data.length > 0) { if (data.length > 0) {
...@@ -255,6 +255,10 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => { ...@@ -255,6 +255,10 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
} }
} }
const handlePagination = (page) => {
fetchTableData(turn, idx, page);
}
return ( return (
<BidDetailContext.Provider value={soure[idx]}> <BidDetailContext.Provider value={soure[idx]}>
<Card <Card
...@@ -288,7 +292,20 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => { ...@@ -288,7 +292,20 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
data-index={index} data-index={index}
tab={`第${chNum[item]}轮`} tab={`第${chNum[item]}轮`}
> >
{(rowSource[idx] && rowSource[idx].length > 0 ) ? <RowLayout priceContrast={context.priceContrast} encrypt={encrypt} rowSource={rowSource[idx]} /> : {(rowSource[idx] && rowSource[idx].length > 0 ) ?
<RowLayout
priceContrast={context.priceContrast}
encrypt={encrypt} rowSource={rowSource[idx]}
pagination={
<Pagination
simple
defaultPageSize={4}
defaultCurrent={1}
total={total}
onChange={handlePagination}
/>
}
/> :
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
} }
<Skeleton <Skeleton
......
.divider { .divider {
font-size: 12px; font-size: 12px;
margin-bottom: 12px; margin-bottom: 12px;
display: flex;
justify-content: space-between;
.vertical { .vertical {
width: 2px; width: 2px;
height: 16px; height: 16px;
......
import React, { Fragment } from 'react'; import React, { Fragment, ReactNode } from 'react';
import { Row, Col, Typography, Divider, Tooltip } from 'antd'; import { Row, Col, Typography, Divider, Tooltip } from 'antd';
import moment from 'moment'; import moment from 'moment';
import style from './index.less'; import style from './index.less';
...@@ -11,10 +11,12 @@ export interface IProps { ...@@ -11,10 +11,12 @@ export interface IProps {
encrypt?: number, encrypt?: number,
/** 比价方式 */ /** 比价方式 */
priceContrast?: number, priceContrast?: number,
/** 分页 */
pagination?: ReactNode,
} }
const RowLayout: React.FC<IProps> = (props: any) => { const RowLayout: React.FC<IProps> = (props: any) => {
const { rowSource, encrypt, priceContrast } = props; const { rowSource, encrypt, priceContrast, pagination } = props;
const format = (text, fmt?: string) => { const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</> return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
} }
...@@ -23,7 +25,12 @@ const RowLayout: React.FC<IProps> = (props: any) => { ...@@ -23,7 +25,12 @@ const RowLayout: React.FC<IProps> = (props: any) => {
return ( return (
<Fragment> <Fragment>
<div className={style.divider}><Divider type='vertical' className={style.vertical} />供应商信息</div> <div className={style.divider}>
<div>
<Divider type='vertical' className={style.vertical} />供应商信息
</div>
{pagination}
</div>
<Row gutter={[12, 0]}> <Row gutter={[12, 0]}>
{rowSource.map((item: any) => ( {rowSource.map((item: any) => (
<Col span={6} key={item.id}> <Col span={6} key={item.id}>
......
...@@ -116,7 +116,7 @@ const DemandDetailed = () => { ...@@ -116,7 +116,7 @@ const DemandDetailed = () => {
href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`} href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`}
target="_blank" target="_blank"
> >
<LinkOutlined /> <LinkOutlined style={{ marginRight: '5px' }} />
{item.name} {item.name}
</Typography.Link> </Typography.Link>
))} ))}
......
...@@ -94,7 +94,7 @@ const QuoteDetails = () => { ...@@ -94,7 +94,7 @@ const QuoteDetails = () => {
href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`} href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`}
target="_blank" target="_blank"
> >
<LinkOutlined /> <LinkOutlined style={{ marginRight: '5px' }} />
{item.name} {item.name}
</Typography.Link> </Typography.Link>
))} ))}
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Form, Button, Upload, message } from 'antd'; import { Form, Button, Upload, message, Typography } from 'antd';
import UploadProps from '@/pages/transaction/common/uploadProps'; import UploadProps from '@/pages/transaction/common/uploadProps';
import styles from './index.less'; import styles from './index.less';
import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons'; import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons';
...@@ -107,8 +107,7 @@ const File: React.FC<IProps> = (props) => { ...@@ -107,8 +107,7 @@ const File: React.FC<IProps> = (props) => {
{fileForEach().length > 0 && fileForEach().map((v, index) => ( {fileForEach().length > 0 && fileForEach().map((v, index) => (
<div key={index} className={styles.upload_item}> <div key={index} className={styles.upload_item}>
<div className={styles.upload_left}> <div className={styles.upload_left}>
<LinkOutlined /> <Typography.Link href={v.url} target="_blank"><LinkOutlined style={{ marginRight: '5px' }} />{v.name}</Typography.Link>
<span>{v.name}</span>
</div> </div>
{checkRound === round && ( {checkRound === round && (
<div className={styles.upload_right} onClick={() => removeFiles(index)}> <div className={styles.upload_right} onClick={() => removeFiles(index)}>
......
...@@ -131,7 +131,6 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -131,7 +131,6 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
useEffect(() => { useEffect(() => {
if (preview && Object.keys(record).length > 0) { if (preview && Object.keys(record).length > 0) {
console.log(record, "测试")
setProduct({ setProduct({
id: record.productId, id: record.productId,
name: record.productName, name: record.productName,
...@@ -139,6 +138,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -139,6 +138,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
customerCategoryName: record.customerCategoryName, customerCategoryName: record.customerCategoryName,
}) })
GetCommodityAttribute(record.productId); GetCommodityAttribute(record.productId);
record.enclosureUrls && setFiles(record.enclosureUrls)
} }
}, [preview, record]) }, [preview, record])
...@@ -377,12 +377,13 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -377,12 +377,13 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
{files.length > 0 && files.map((v, index) => ( {files.length > 0 && files.map((v, index) => (
<div key={index} className={style.upload_item}> <div key={index} className={style.upload_item}>
<div className={style.upload_left}> <div className={style.upload_left}>
<LinkOutlined /> <Typography.Link href={v.url} target="_blank"><LinkOutlined style={{ marginRight: '5px' }} />{v.name}</Typography.Link>
<span>{v.name}</span>
</div> </div>
{!preview && (
<div className={style.upload_right} onClick={() => removeFiles(index)}> <div className={style.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined /> <DeleteOutlined />
</div> </div>
)}
</div> </div>
))} ))}
</div> </div>
......
...@@ -110,7 +110,7 @@ const DemandDetailed = () => { ...@@ -110,7 +110,7 @@ const DemandDetailed = () => {
target="_blank" target="_blank"
href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`} href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`}
> >
<LinkOutlined /> <LinkOutlined style={{ marginRight: '5px' }} />
{item.name} {item.name}
</Typography.Link> </Typography.Link>
))} ))}
......
...@@ -128,7 +128,7 @@ const QuoteDetails = () => { ...@@ -128,7 +128,7 @@ const QuoteDetails = () => {
key={`link_${index + 1}`} key={`link_${index + 1}`}
href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`} href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`}
> >
<LinkOutlined /> <LinkOutlined style={{ marginRight: '5px' }} />
{item.name} {item.name}
</Typography.Link> </Typography.Link>
))} ))}
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Form, Button, Upload, message } from 'antd'; import { Form, Button, Upload, message, Typography } from 'antd';
import styles from './index.less'; import styles from './index.less';
import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons'; import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons';
import UploadProps from '@/pages/transaction/common/uploadProps'; import UploadProps from '@/pages/transaction/common/uploadProps';
...@@ -85,8 +85,7 @@ const File: React.FC<IProps> = (props) => { ...@@ -85,8 +85,7 @@ const File: React.FC<IProps> = (props) => {
{files.length > 0 && files.map((v, index) => ( {files.length > 0 && files.map((v, index) => (
<div key={index} className={styles.upload_item}> <div key={index} className={styles.upload_item}>
<div className={styles.upload_left}> <div className={styles.upload_left}>
<LinkOutlined /> <Typography.Link href={v.url} target="_blank"><LinkOutlined style={{ marginRight: '5px' }} />{v.name}</Typography.Link>
<span>{v.name}</span>
</div> </div>
<div className={styles.upload_right} onClick={() => removeFiles(index)}> <div className={styles.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined /> <DeleteOutlined />
......
...@@ -12,7 +12,8 @@ import { ...@@ -12,7 +12,8 @@ import {
message, message,
Cascader, Cascader,
Spin, Spin,
InputNumber InputNumber,
Typography
} from 'antd'; } from 'antd';
import style from './index.less'; import style from './index.less';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
...@@ -424,8 +425,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -424,8 +425,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
{files.length > 0 && files.map((v, index) => ( {files.length > 0 && files.map((v, index) => (
<div key={index} className={style.upload_item}> <div key={index} className={style.upload_item}>
<div className={style.upload_left}> <div className={style.upload_left}>
<LinkOutlined /> <Typography.Link href={v.url} target="_blank"><LinkOutlined style={{ marginRight: '5px' }} />{v.name}</Typography.Link>
<span>{v.name}</span>
</div> </div>
{!preview && <div className={style.upload_right}> {!preview && <div className={style.upload_right}>
<DeleteOutlined /> <DeleteOutlined />
......
...@@ -119,7 +119,7 @@ const DemandDetailed = () => { ...@@ -119,7 +119,7 @@ const DemandDetailed = () => {
href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`} href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`}
target="_blank" target="_blank"
> >
<LinkOutlined /> <LinkOutlined style={{ marginRight: '5px' }} />
{item.name} {item.name}
</Typography.Link> </Typography.Link>
))} ))}
......
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