Commit 1426eb9b authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞 fix: 修复采购确认报价比价的BUG

parent 2cfa3314
import React, { useContext } from 'react';
import { Row, Col, Checkbox, InputNumber, Divider, Form, Typography } from 'antd';
import { Row, Col, Checkbox, InputNumber, Divider, Form, Typography, message } from 'antd';
import style from './index.less';
import { useBidTable } from '../../../effects/useBidTable';
import { BidDetailContext } from '../context'
......@@ -7,6 +7,7 @@ import level1 from '@/assets/icons/the_first.png';
import level2 from '@/assets/icons/the_second.png';
import level3 from '@/assets/icons/the_third.png';
import { CheckCircleOutlined } from '@ant-design/icons';
import { sumBy } from 'lodash';
export interface ReduxProps {
redux?(e: any),
......@@ -66,7 +67,7 @@ const BidTable: React.FC<ReduxProps> = (props: any) => {
const bidDetailContext = useContext(BidDetailContext);
const onChangeInput = (v, index, idx) => {
setAwardTaxProbability(v, index, idx)
setAwardTaxProbability(v, index, idx, true);
}
const chanegChecked = (e, index, idx) => {
......@@ -215,8 +216,8 @@ const BidTable: React.FC<ReduxProps> = (props: any) => {
)}
{preview && (
<div style={{ display: 'flex', alignItems: 'center' }}>
<Typography.Text>{ it.isPrize ? `${it.awardTaxProbability}%` : '-'}</Typography.Text>
{ it.isPrize && <CheckCircleOutlined style={{ color: '#00B37A', fontSize: '12px', marginLeft: '4px' }} /> }
<Typography.Text>{it.isPrize ? `${it.awardTaxProbability}%` : '-'}</Typography.Text>
{ it.isPrize && <CheckCircleOutlined style={{ color: '#00B37A', fontSize: '12px', marginLeft: '4px' }} />}
</div>
)}
</div>
......
......@@ -12,6 +12,7 @@ import { UPLOAD_TYPE } from '@/constants'
import style from './index.less'
import { PublicApi } from '@/services/api';
import { BidDetailContext } from '../components/context';
import { isEmpty, sumBy } from 'lodash';
const { TextArea } = Input;
......@@ -115,6 +116,13 @@ const BidModal: React.FC<IProps> = (props: any) => {
urls: files,
priceParityInfos,
}
for(let i = 0; i < dataSource.length; i++) {
const count = sumBy(dataSource[i].company, 'awardTaxProbability');
if (count > 100 || count < 100) {
message.warning(`${dataSource[i].number}授标百分比分配不准确,请核对!`);
return
}
}
PublicApi.postPurchaseConfirmQuotedPriceSubmitContrastPrice(params).then(res => {
if (res.code === 1000) {
handleConfirm();
......
......@@ -49,6 +49,7 @@ const ContrastPrice = () => {
const [path] = useState<string>(pathname.split('/')[pathname.split('/').length - 2]);
const [companyJoinUs, setCompanyJoinUs] = useState<any>([])
const [bid, setBid] = useState<any>({});
const [disabled, setDisabled] = useState<boolean>(true);
const handleBasicEffect = (data: any) => {
setBasicEffect([
......@@ -150,11 +151,14 @@ const ContrastPrice = () => {
const handleContrastLyoutData = (data: any) => {
let company = [];
data[0].company.forEach(item => {
if (item.isPrize) {
company.push(`${item.memberName}(中标总金额(含税):¥${item.sumPrice})`)
}
data.forEach(it => {
it.company.forEach(item => {
if (item.isPrize) {
company.push(`${item.memberName}(中标总金额(含税):¥${item.sumPrice})`)
}
})
})
setDisabled(false)
setCompanyJoinUs(company)
setAuditDataSource(data)
}
......@@ -187,6 +191,7 @@ const ContrastPrice = () => {
link === 'preview' ? null :
<Button
type='primary'
disabled={disabled}
onClick={() => setVisible(true)}
>
<CheckCircleOutlined />
......
import React from 'react';
import { history } from 'umi';
import Table from '../../components/table'
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Button, Badge, Space, Typography } from 'antd';
import { Badge, Space, Typography } from 'antd';
import {
OFFTER_INTERNALSTATE_COLOR,
} 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