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

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

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