Commit 164db64d authored by Bill's avatar Bill

Merge branch 'dev-srm' of 10.0.0.22:lingxi/lingxi-business-paltform into dev-srm

parents 4d563ba1 1426eb9b
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 />
......
......@@ -132,7 +132,7 @@ const BasicInfo: React.FC<IProps> = (props: any) => {
<Form.Item name='telPrefix' rules={[{ required: true, message: '请选择区号' }]}>
<Select placeholder="+86">
{telCode.map((item: any) => (
<Option value={item}>{item}</Option>
<Option key={item} value={item}>{item}</Option>
))}
</Select>
</Form.Item>
......
......@@ -91,7 +91,7 @@ const AuditOffterOne = () => {
<>
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/offter/auditOffterOne/detail?id=${record.id}&number=${record.quotedPriceNo}`)}
onClick={() => history.push(`/memberCenter/procurementAbility/offter/auditOffterOne/detail?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`)}
>
审核
</Button>
......
......@@ -92,7 +92,7 @@ const AuditOffterTwo = () => {
<>
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/offter/auditOffterTwo/detail?id=${record.id}&number=${record.quotedPriceNo}`)}
onClick={() => history.push(`/memberCenter/procurementAbility/offter/auditOffterTwo/detail?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`)}
>
审核
</Button>
......
......@@ -39,8 +39,8 @@ const Inquiry = () => {
render: (text: any, record: any) => format(text)
}, {
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
key: 'offerEndTime',
dataIndex: 'offerEndTime',
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
......
......@@ -15,7 +15,6 @@ import BidCommonLayout from '../../components/detail/components/bidCommonLayout'
import TableCommonLayout from '../../components/detail/components/tableCommonLayout';
import LowestQuotationRecordLayout from '../../components/detail/components/lowestQuotationRecordLayout';
import BidProgressDrawer from '../../components/detail/components/bidProgressDrawer';
import QuotationDetailsDrawer from '../../components/detail/components/quotationDetailsDrawer';
import ThankModal from './components/thank';
......@@ -55,12 +54,10 @@ const SearchDetail = () => {
} = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
// 报价明细
const [quotationDetailsVisible, setQuotationDetailsVisible] = useState<boolean>(false);
const [quotationDetailsId, setQuotationDetailsId] = useState<number>();
// 竞价过程
const [progressVisible, setProgressVisible] = useState<boolean>(false);
const [progressData, setProgressData] = useState<any>([]);
// 详情数据
const [dataSource, setDataSource] = useState<any>({});
// 流转数据数据
const [progressEffect, setProgressEffect] = useState<any>([]);
......@@ -74,8 +71,7 @@ const SearchDetail = () => {
const [signUpEffect, setSignUpEffect] = useState<any>([]);
// 交易条件
const [conditionEffect, setConditionEffect] = useState<any>([]);
// 授标结果
const [awardResult, setAwardResult] = useState<any>({});
// 感谢函
const [thankVisAble, seTthankVisAble] = useState<boolean>(false);
......@@ -117,7 +113,7 @@ const SearchDetail = () => {
setResultEffect([
{
col: [
{ label: '中标金额(含税)', extra: priceFormat(data?.sumAwardPrice), type: 'text' },
{ label: '中标金额(含税)', extra: data?.sumAwardPrice ? priceFormat(data?.sumAwardPrice) : '-', type: 'text' },
{ label: '中标理由', extra: '价格最低', type: 'text' },
]
},
......@@ -194,15 +190,6 @@ const SearchDetail = () => {
])
}
const handleAwardResult = (data: any) => {
setAwardResult(
{
list: data.awardsFruits || [],
signUpIdea: data.signUpIdea
}
)
}
const fetchDataSource = async () => {
const params = {
id,
......@@ -222,9 +209,8 @@ const SearchDetail = () => {
handleRulesEffect(data);
handleSignUpEffect(data);
handleConditionEffect(data);
// handleAwardResult(data)
handleResultEffect(data);
if (data.externalState === 999 && isPrize !== 0 && isPrize) {
if (data.externalState === 99 && isPrize != 1 && isPrize) {
seTthankVisAble(true)
}
})
......@@ -310,12 +296,6 @@ const SearchDetail = () => {
)
}
const _openQuotationDetailsDrawer = (id: number) => {
setQuotationDetailsId(id);
setQuotationDetailsVisible(true);
}
return (
<Context.Provider value={dataSource}>
......@@ -343,15 +323,6 @@ const SearchDetail = () => {
visible={progressVisible}
onClose={() => { setProgressVisible(false) }}
/>
<QuotationDetailsDrawer
fetch={PublicApi.getPurchaseBiddingQuotedPriceDetaild}
quotationDetailsId={quotationDetailsId}
number={number}
effects='id'
title="报价明细"
visible={quotationDetailsVisible}
onClose={() => setQuotationDetailsVisible(false)}
/>
<ThankModal
visible={thankVisAble}
detail={dataSource}
......
......@@ -240,7 +240,7 @@ const SearchDetail = () => {
pageSize: '1'
}
const _fetch = pathPci === 'readySubmitExaminResult' ? PublicApi.getPurchaseBiddingStaySubmitDetails : PublicApi.getPurchaseBiddingDetails
const _fetch = pathPci === 'readySubmitExamineResult' ? PublicApi.getPurchaseBiddingStaySubmitDetails : PublicApi.getPurchaseBiddingDetails
await _fetch({ ...params }).then(res => {
if (res.code !== 1000) {
......
......@@ -32,6 +32,10 @@ const BidRules: React.FC<Iprops> = (props: any) => {
const [isMinPrice, setIsMinPrice] = useState<boolean>(true)
const [isOpenPurchase, setIsOpenPurchase] = useState<boolean>(false)
const [isOpenRanking, setIsOpenRanking] = useState<boolean>(false)
const [startingPrice, setStartingPrice] = useState<any>('');
const [targetPrice, setTargetPrice] = useState<any>('');
const [minPrice, setMinPrice] = useState<any>('');
const [allowPurchaseCount, setAllowPurchaseCount] = useState<any>('');
const [form] = Form.useForm();
useEffect(() => {
currentRef.current = {
......@@ -72,6 +76,10 @@ const BidRules: React.FC<Iprops> = (props: any) => {
fetchdata.isMinPrice != undefined && setIsMinPrice(!!fetchdata.isMinPrice);
setIsOpenPurchase(!!fetchdata.isOpenPurchase);
setIsOpenRanking(!!fetchdata.isOpenRanking);
setStartingPrice(fetchdata.startingPrice);
setTargetPrice(fetchdata.targetPrice);
setMinPrice(fetchdata.minPrice);
setAllowPurchaseCount(fetchdata.allowPurchaseCount);
form.setFieldsValue({
biddingTime: [fetchdata.biddingStartTime ? moment(fetchdata.biddingStartTime) : '', fetchdata.biddingEndTime ? moment(fetchdata.biddingEndTime) : ''],
isStartingPrice: !!fetchdata.isStartingPrice,
......@@ -104,9 +112,9 @@ const BidRules: React.FC<Iprops> = (props: any) => {
label='竞价时间'
name='biddingTime'
rules={[
{ required: true, message: '请选择竞价时间' }, () => ({
{ required: true, message: '请选择竞价时间' }, () => ({
async validator(_, value) {
let _exVal = await exRef.current.signUpTime();
let _exVal = await exRef.current.signUpTime();
if (_exVal[1] && moment(value[0]).isBefore(_exVal[1])) {
return Promise.reject(new Error('竞价开始时间需要晚于报名截止时间'));
}
......@@ -159,7 +167,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]}
>
<Input addonBefore={'¥'} />
<Input addonBefore={'¥'} value={startingPrice} onChange={(e) => {
let _val = e.target.value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
setStartingPrice(_val);
form.setFieldsValue({ startingPrice: _val });
}} />
</Form.Item>)}
<Form.Item
label={<Tooltip placement="right" title='期望成交价格'>目标价<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip>}
......@@ -192,7 +204,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]}
>
<Input addonBefore={'¥'} />
<Input addonBefore={'¥'} value={targetPrice} onChange={(e) => {
let _val = e.target.value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
setTargetPrice(_val);
form.setFieldsValue({ targetPrice: _val });
}} />
</Form.Item>)}
<Form.Item
label={<Tooltip placement="right" title='每次报价降价幅度须大于或等于最小价差'>最小价差<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip>}
......@@ -225,7 +241,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]}
>
<Input addonBefore={'¥'} />
<Input addonBefore={'¥'} value={minPrice} onChange={(e) => {
let _val = e.target.value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
setMinPrice(_val);
form.setFieldsValue({ minPrice: _val });
}}/>
</Form.Item>)}
<Form.Item
label={<Tooltip placement="right" title='允许每个供应商最多可以报价的次数'>允许报价次数<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip>}
......@@ -252,7 +272,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]}
>
<Input />
<Input value={allowPurchaseCount} onChange={(e) => {
let _val = e.target.value.replace(/[^\d]/g, '').replace(/^0{1,}/g, '');
setAllowPurchaseCount(_val);
form.setFieldsValue({ allowPurchaseCount: _val });
}} />
</Form.Item>
<Form.Item
label={<Tooltip placement="right" title='选择公开当前最低报价,竞价过程中将供应商所报当前最低价在竞价页面即时公开。'>公开当前最低报价<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip>}
......
......@@ -73,22 +73,24 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => {
]
const _changeTax = (record: any, value: any) => {
let _val = value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
let _dataSource = [...dataSource2];
const _i = _dataSource.findIndex((item) => item.id === record.id);
let _item = { ..._dataSource[_i] };
_item.taxRate = value;
_item.isTax = value != 0 ? 1 : 0;
_item.taxRate = _val;
_item.isTax = _val != 0 ? 1 : 0;
_dataSource[_i] = _item;
setDataSource(_dataSource);
setDataSource2(_dataSource)
}
const _changeUnitPrice = (record: any, value: any) => {
let _val = value.replace(/^\D*(\d*(?:\.\d{0,3})?).*$/g, '$1');
let _dataSource = [...dataSource2];
const _i = _dataSource.findIndex((item) => item.id === record.id);
let _item = { ..._dataSource[_i] };
_item.unitPrice = value;
_item.price = _calcTotal(value, _dataSource[_i].purchaseCount);
_item.unitPrice = _val;
_item.price = _calcTotal(_val, _dataSource[_i].purchaseCount);
_dataSource[_i] = _item;
setDataSource(_dataSource);
setDataSource2(_dataSource)
......
......@@ -33,7 +33,7 @@ interface Iprops {
currentRef: any,
fetchdata: { [key: string]: any },
onBadge?: Function,
badgeIndex? : number
badgeIndex?: number
}
const { Link } = Typography
......@@ -54,7 +54,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
const [menberVisible, setMenberVidible] = useState<boolean>(false);
const [rowCtl, setRowCtl] = useState<any>([])
const handleGetSwitch = (e: any, index: number) => {
const handleGetSwitch = (e: any, index: number) => {
const state = e ? 1 : 0;
const params = [...rowCtl];
params[index].state = state;
......@@ -93,14 +93,27 @@ const Demand: React.FC<Iprops> = (props: any) => {
key: 'membershipOrNot',
dataIndex: 'membershipOrNot',
render: (_text: any, _record: any) => <>
{ value === 3 && <Typography.Text type='success'></Typography.Text> }
{ value === 3 && <Typography.Text type='success'></Typography.Text>}
</>
},
{
title: '状态',
title: (
<>
<span>需求发送</span>
<Tooltip placement="top" title='打开开关,审核通过后,将发送需求至选择的归属会员'>
<QuestionCircleOutlined
style={{
marginLeft: '5px',
fontSize: '14px',
color: '#909399'
}}
/>
</Tooltip>
</>
),
key: 'state',
dataIndex: 'state',
render: (_text: any, _record: any, index:number) => (
render: (_text: any, _record: any, index: number) => (
<Form.Item
style={{ marginBottom: 0 }}
>
......@@ -302,7 +315,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
<Store
visible={visible}
storeList={storeList}
onCancel={() => handleCancel() }
onCancel={() => handleCancel()}
getStroeList={handleStoreIds}
/>
<SelectMenber
......@@ -316,7 +329,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
}
Demand.defaultProps = {
badgeIndex : 3
badgeIndex: 3
}
export default Demand;
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