Commit 90aa2981 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

比价接口接入

parent 994f70a4
......@@ -6,10 +6,10 @@ import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button, Tag, Space, Typography, Rate } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE,
OFFTER_INTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE_COLOR,
OFFTER_EXTERNALSTATE_TYPE,
CHNUM_TYPE
} from '../../constants';
const { Text } = Typography;
......@@ -73,12 +73,19 @@ const AuditResultsOne = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[text]}>{OFFTER_CONFIRMINTERIORSTATE[text]}</Tag>
render: (text: any, record: any) => (
<>
{ record.externalState === OFFTER_EXTERNALSTATE_TYPE.WAITSUBMIOFFER_TYPE ?
<Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{record.interiorStateName}</Tag> :
<Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[record.confirmInteriorState]}>{record.confirmInteriorStateName}</Tag>
}
</>
)
}, {
title: '操作',
key: 'operate',
......
......@@ -6,10 +6,10 @@ import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button, Tag, Space, Typography, Rate } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE,
OFFTER_INTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE_COLOR,
OFFTER_EXTERNALSTATE_TYPE,
CHNUM_TYPE
} from '../../constants';
const { Text } = Typography;
......@@ -73,12 +73,19 @@ const AuditResultsTwo = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[text]}>{OFFTER_CONFIRMINTERIORSTATE[text]}</Tag>
render: (text: any, record: any) => (
<>
{ record.externalState === OFFTER_EXTERNALSTATE_TYPE.WAITSUBMIOFFER_TYPE ?
<Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{record.interiorStateName}</Tag> :
<Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[record.confirmInteriorState]}>{record.confirmInteriorStateName}</Tag>
}
</>
)
}, {
title: '操作',
key: 'operate',
......
......@@ -7,10 +7,10 @@ import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE,
OFFTER_INTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE_COLOR,
OFFTER_EXTERNALSTATE_TYPE,
CHNUM_TYPE
} from '../../constants';
......@@ -74,12 +74,19 @@ const ConfirmResults = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[text]}>{OFFTER_CONFIRMINTERIORSTATE[text]}</Tag>
render: (text: any, record: any) => (
<>
{ record.externalState === OFFTER_EXTERNALSTATE_TYPE.WAITSUBMIOFFER_TYPE ?
<Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{record.interiorStateName}</Tag> :
<Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[record.confirmInteriorState]}>{record.confirmInteriorStateName}</Tag>
}
</>
)
}, {
title: '操作',
key: 'operate',
......
......@@ -62,20 +62,6 @@
.god-table-control {
margin-bottom: 0;
}
.ant-table table {
border: 3px solid #F4F5F7 !important;
border-bottom: 2px !important;
}
.ant-table-thead {
.ant-table-cell {
background-color: #F4F5F7;
}
}
.ant-table-tbody {
.ant-table-cell {
border-bottom: 3px solid #F4F5F7;
}
}
}
.list {
display: flex;
......@@ -93,9 +79,9 @@
:global {
.ant-form-item-control-input-content {
display: flex;
.ant-input-group-wrapper {
.ant-input-number {
margin-left: 16px;
width: 96px;
width: 64px;
}
}
}
......@@ -116,3 +102,41 @@
color: #909399;
margin-right: 5px;
}
.affix_title {
font-size: 12px;
margin-bottom: 12px;
.divider_style {
width: 2px;
height: 16px;
margin: 0px 5px 0px 0px ;
background-color: #00B37A;
}
}
// .tableCard {
// :global {
// .ant-table table {
// border: 3px solid #F4F5F7 !important;
// border-bottom: 2px !important;
// }
// .ant-table-thead {
// .ant-table-cell {
// background-color: #F4F5F7;
// }
// }
// .ant-table-tbody {
// .ant-table-cell {
// border-bottom: 3px solid #F4F5F7;
// }
// }
// }
// }
.percentum_icon {
width: 32px;
height: 32px;
text-align: center;
line-height: 30px;
background-color: #F7F8FA;
color: #909399;
border: 1px solid #d9d9d9;
border-left: none;
}
......@@ -13,9 +13,13 @@ import {
Space,
Button,
Checkbox,
Input,
InputNumber,
Form,
Image
Image,
Divider,
Typography,
message,
Skeleton
} from 'antd';
import style from './index.less';
import { ArrowLeftOutlined, QuestionCircleOutlined } from '@ant-design/icons';
......@@ -25,7 +29,8 @@ import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
OFFTER_INTERNALSTATE_COLOR,
PRICECONTRAST_TYPE
} from '../../constants';
import {
EXTERNALLOGS,
......@@ -36,10 +41,13 @@ import Label from '../../components/label';
import Thefirst from '@/assets/icons/the_first.png';
import Thesecond from '@/assets/icons/the_second.png';
import Thethird from '@/assets/icons/the_third.png';
import { StandardTable } from 'god';
import EyePreview from '@/components/EyePreview';
const { TabPane } = Tabs;
const { Link } = Anchor;
const { Step } = Steps;
const { Text } = Typography;
const activeAnchorClassName = 'ant-anchor-link-active'
const LogType = {
......@@ -78,10 +86,42 @@ const Detail = () => {
const [data, setData] = useState<any>({});
const [logStatesStatus, setLogStatesStatus] = useState<number>(LogStatesType.externalLogStates);
const [logStatus, setLogStatus] = useState<number>(LogType.externalLogs);
const [dataSource, setDataSource] = useState<any>([])
const [dataSource, setDataSource] = useState<any>([]);
const [priceParityInfos, setPriceParityInfos] = useState<any>([]);
const [disivble, setDisivble] = useState<boolean>(false);
const [loading, setloading] = useState<boolean>(false);
const [columns, setColumns] = useState<any>([
{
title: "采购物料",
key: "name",
dataIndex: "name",
width: 150,
render: (_t: any, _r: any) => (
<>
<Label label='物料编号' text={_r.number} />
<Label label='物料名称' text={_r.name} />
<Label label='规格型号' text={_r.model} />
<Label label='品类' text={_r.category} />
<Label label='品牌' text={_r.brand} />
</>
)
},
{
title: "采购数量",
key: "purchaseCount",
dataIndex: "purchaseCount",
width: 100,
render: (_t: any, _r: any) => (
<>
<div>{_t}</div>
{ _r.unit && <div>{_r.unit}</div>}
</>
)
},
]);
/** 数据格式化 */
const handleGetDataSource = (resolve:any) => {
const handleGetDataSource = (resolve: any) => {
const arr: any = [];
const info: any = [];
const stats: any = []
......@@ -154,7 +194,7 @@ const Detail = () => {
stats.push(sObje)
})
const source = info.concat(stats);
console.log(source)
console.log(JSON.stringify(source))
setDataSource(source)
}
/** 获取报价详情 */
......@@ -166,28 +206,22 @@ const Detail = () => {
await PublicApi.getPurchaseConfirmQuotedPriceDetails(parmas).then(res => {
if (res.code === 1000) {
setData(res.data)
handleGetDataSource(res.data.priceParityInfos)
}
})
}
/**报价单详情-物料详情列表分页查询 */
const handleGetMaterielDetailed = async () => {
const params = {
id,
turn,
current: '1',
pageSize: '10'
}
await PublicApi.getPurchaseConfirmQuotedPriceQuotedPriceInfo(params).then(res => {
const handleGetMaterielDetailed = (params: any) => {
return new Promise(resolve => {
PublicApi.getPurchaseConfirmQuotedPriceQuotedPriceInfo({ ...params, id, turn }).then(res => {
if (res.code === 1000) {
console.log(res.data, 10086)
resolve(res.data)
}
})
})
}
useEffect(() => {
setTargetOffset(window.innerHeight / 6);
handleGetQuotedDetail(turn)
handleGetMaterielDetailed()
}, []);
const handleAnchorClick = (e) => {
e.preventDefault()
......@@ -250,23 +284,21 @@ const Detail = () => {
],
}
const chanegChecked = (e: any) => {
if (e.target.checked) {
e.nativeEvent.path[9].style.border = '1px solid #00B37A';
e.nativeEvent.target.parentElement.parentElement.nextSibling.style.display = 'inline-block'
} else {
e.nativeEvent.path[9].style.border = 'none';
e.nativeEvent.path[9].style.borderBottom = '3px solid #F4F5F7';
e.nativeEvent.target.parentElement.parentElement.nextSibling.style.display = 'none'
}
const chanegChecked = (e: any, name: string, index: number, record:any) => {
const { checked } = e.target;
const params = [...dataSource];
const info = {...record};
info[name].checked = checked;
params[index] = {...info};
setDataSource(params);
}
/** 生成公司表头 */
const handleColumns = () => {
let colums: any = []
const resolve = data.priceParityInfos;
useEffect(() => {
let setcolums: any = []
const resolve = priceParityInfos;
resolve && resolve.forEach((item: any, idx: number) => {
const name = `name_${idx + 1}`;
colums.push({
setcolums.push({
title: (
<>
{ idx === 0 ?
......@@ -316,15 +348,45 @@ const Detail = () => {
text={
<Form.Item
className={style.label}
style={{ marginBottom: 0 }}
>
<Form.Item noStyle>
<Checkbox onChange={(e: any) => chanegChecked(e, name, index, _r)} />
</Form.Item>
{_r[name].checked &&
<Form.Item
style={{ marginBottom: '0' }}
name={`awardTaxProbability_${index}_${name}`}
rules={[{ required: true }]}
>
<Checkbox onChange={chanegChecked} />
<Input
size='middle'
addonAfter="%"
style={{ display: 'none' }}
<div className={style.flex}>
<InputNumber
min={1}
max={100}
/>
<div className={style.percentum_icon}>%</div>
</div>
</Form.Item>
}
</Form.Item>
// <Form.Item
// className={style.label}
// >
// <Form.Item >
// </Form.Item>
// <Checkbox onChange={chanegChecked} />
// <div className={style.flex}>
// <InputNumber
// min={1}
// max={100}
// />
// <div className={style.percentum_icon}>%</div>
// </div>
// </Form.Item>
}
/>
</>
}
......@@ -349,38 +411,83 @@ const Detail = () => {
)
})
})
return colums;
}
const columns = [
setColumns([...columns, ...setcolums]);
}, [priceParityInfos])
const StandardTableColumns = [
{
title: "采购物料",
key: "name",
dataIndex: "name",
width: 150,
render: (_t: any, _r: any) => (
<>
<Label label='物料编号' text={_r.number} />
<Label label='物料名称' text={_r.name} />
<Label label='规格型号' text={_r.model} />
<Label label='品类' text={_r.category} />
<Label label='品牌' text={_r.brand} />
</>
title: '报价单号/摘要',
key: 'quotedPriceNo',
dataIndex: 'quotedPriceNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview>{text}</EyePreview>
<Text>{record.details}</Text>
</Space>
)
},
{
title: "采购数量",
key: "purchaseCount",
dataIndex: "purchaseCount",
width: 100,
render: (_t: any, _r: any) => (
<>
<div>{_t}</div>
{ _r.unit && <div>{_r.unit}</div>}
</>
title: '报价会员',
key: 'createMemberName',
dataIndex: 'createMemberName'
},
{
title: '报价时间',
key: 'createTime',
dataIndex: 'createTime',
render: (text: any, record: any) => (
<Text>{format(text)}</Text>
)
},
...handleColumns(),
];
{
title: '报价总额',
key: 'sumPrice',
dataIndex: 'sumPrice'
},
{
title: '联系人/电话',
key: 'contacts',
dataIndex: 'contacts',
render: (text: any, record: any) => (
<Space direction='vertical'>
<Text>{text}</Text>
<Text>{record.tel}</Text>
</Space>
)
},
{
title: '解密状态',
key: 'isDecrypt',
dataIndex: 'isDecrypt',
render: (text: any, record: any) => (
<Text>{text === 1 ? '未加密' : '未解密'}</Text>
)
},
]
/** 立即比价 */
const handlePriceContrast = () => {
const PRICECONTRAST = data.priceContrast;
if (PRICECONTRAST === PRICECONTRAST_TYPE.UNENCRYPTED) {
setloading(true);
setDisivble(true);
const params = {
id,
turn
}
PublicApi.getPurchaseConfirmQuotedPriceRightOffContrastPrice(params).then((res: any) => {
if (res.code === 1000) {
setloading(false);
handleGetDataSource(res.data);
setPriceParityInfos(res.data);
} else {
setDisivble(false);
setloading(false);
}
})
} else {
message.error('当前报价为密封报价,请先解密报价单');
}
}
return (
<div className={style.anchorWrap}>
......@@ -547,7 +654,7 @@ const Detail = () => {
</div>
</div>
{/* 报价信息 */}
<div id='conditions' className='ant-card ant-card-bordered'>
<div id='docking' className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
<div className='ant-card-head-wrapper'>
<div className='ant-card-head-wrapper'>
......@@ -558,13 +665,38 @@ const Detail = () => {
<div style={{ paddingTop: '0' }} className='ant-card-body'>
<Tabs>
<TabPane key='1' tab='第三轮'>
<div className={style.affixTitle}>
<Divider type="vertical" className={style.dividerStyle} />
供应商信息
</div>
<StandardTable
tableProps={{ rowKew: 'id' }}
columns={StandardTableColumns}
fetchTableData={(params: any) => handleGetMaterielDetailed(params)}
/>
<Skeleton
active
loading={loading}
/>
{dataSource.length > 0
&& (
<>
<div className={style.affixTitle}>
<Divider type="vertical" className={style.dividerStyle} />
比价信息
</div>
<Form>
<Table
size='small'
rowKey='id'
columns={columns}
dataSource={dataSource}
pagination={{ hideOnSinglePage: true }}
scroll={{ x: 850 }}
/>
</Form>
</>
)}
</TabPane>
</Tabs>
</div>
......@@ -577,8 +709,8 @@ const Detail = () => {
>
<Space>
<Button>发起下轮报价</Button>
<Button>解密报价单</Button>
<Button type='primary'>立即比价</Button>
{data.priceContrast === PRICECONTRAST_TYPE.UNDECRYPTED && <Button>解密报价单</Button>}
<Button disabled={disivble} onClick={() => handlePriceContrast()} type='primary'>立即比价</Button>
</Space>
</div>
</div>
......
......@@ -7,12 +7,11 @@ import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE,
OFFTER_INTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE_COLOR,
OFFTER_EXTERNALSTATE_TYPE,
CHNUM_TYPE,
OFFTER_EXTERNALSTATE_TYPE
} from '../../constants';
import ModalOperate from '../../components/modalOperate';
......@@ -81,12 +80,19 @@ const OfferInquire = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[text]}>{OFFTER_CONFIRMINTERIORSTATE[text]}</Tag>
render: (text: any, record: any) => (
<>
{ record.externalState === OFFTER_EXTERNALSTATE_TYPE.WAITSUBMIOFFER_TYPE ?
<Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{record.interiorStateName}</Tag> :
<Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[record.confirmInteriorState]}>{record.confirmInteriorStateName}</Tag>
}
</>
)
}, {
title: '操作',
key: 'operate',
......
......@@ -7,11 +7,12 @@ import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE,
OFFTER_INTERNALSTATE_COLOR,
OFFTER_CONFIRMINTERIORSTATE_COLOR,
CHNUM_TYPE
OFFTER_EXTERNALSTATE_TYPE,
OFFTER_CONFIRMINTERNALSTATE_TYPE,
CHNUM_TYPE,
} from '../../constants';
const { Text } = Typography
......@@ -74,25 +75,38 @@ const ToComparePrices = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[text]}>{OFFTER_CONFIRMINTERIORSTATE[text]}</Tag>
render: (text: any, record: any) => (
<>
{ record.externalState === OFFTER_EXTERNALSTATE_TYPE.WAITSUBMIOFFER_TYPE ?
<Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{record.interiorStateName}</Tag> :
<Tag color={OFFTER_CONFIRMINTERIORSTATE_COLOR[record.confirmInteriorState]}>{record.confirmInteriorStateName}</Tag>
}
</>
)
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) =>
<>
{ record.confirmInteriorState === OFFTER_CONFIRMINTERNALSTATE_TYPE.WAITSTHAN_TYPE &&
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/confirmOffer/detail?id=${record.id}&turn=${record.turn}`)}
>
比价
</Button>
<Button type='link'>修改授标结果</Button>
}
{
( record.confirmInteriorState === OFFTER_CONFIRMINTERNALSTATE_TYPE.AUDITNOPASS1_TYPE &&
record.confirmInteriorState === OFFTER_CONFIRMINTERNALSTATE_TYPE.AUDITNOPASS2_TYPE
) && <Button type='link'>修改授标结果</Button>
}
</>
}];
......
......@@ -141,6 +141,29 @@ export enum OFFTER_INTERNALSTATE_TYPE {
SUCCESS_TYPE = 99,
}
export enum OFFTER_CONFIRMINTERNALSTATE_TYPE {
/** 作废 */
ABANDON_TYPE = -1,
/** 待比价 */
WAITSTHAN_TYPE = 1,
/** 待审核授标结果(一级) */
WAITAUDIT1_TYPE,
/** 待审核授标结果(二级) */
WAITAUDIT2_TYPE,
/** 待确认授标结果 */
WAITCONFIRMRESULTS_TYPE,
/** 审核授标结果通过(一级) */
AUDITPASS1_TYPE,
/** 审核授标结果通过(二级) */
AUDITPASS2_TYPE,
/** 审核授标结果不通过(一级) */
AUDITNOPASS1_TYPE,
/** 审核授标结果不通过(二级) */
AUDITNOPASS2_TYPE,
/** 已完成 */
SUCCESS_TYPE = 99,
}
/** 阿拉伯对应中文 */
export const CHNUM_TYPE = {
1: '一',
......@@ -237,3 +260,10 @@ export const OFFTER_CONFIRMINTERIORSTATE_COLOR = {
7: 'error',
8: 'error',
}
export enum PRICECONTRAST_TYPE {
/** 未解密 */
UNDECRYPTED = 1,
/** 未加密 */
UNENCRYPTED
}
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