2023-02-17 16:21:15 +08:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import { Divider, Button, Form, Card, Tabs, Table, Tooltip, Input, Select, Row, Col, message } from 'antd';
|
2020-12-23 11:14:35 +08:00
|
|
|
import './index.less';
|
|
|
|
import { connect } from "dva";
|
2023-02-17 16:21:15 +08:00
|
|
|
import { getProId, getProMethod, getDefId, getQuotationMethodById, getSessionUserData } from '@/utils/session';
|
2022-03-10 14:24:13 +08:00
|
|
|
import { routerRedux } from 'dva/router';
|
|
|
|
import { getURLInformation } from '@/utils/CommonUtils';
|
|
|
|
import { btnAuthority } from '@/utils/authority';
|
2023-02-17 16:21:15 +08:00
|
|
|
import { getMaxTurnSortSupplier } from './components/service';
|
|
|
|
@connect(({ bidev, loading }) => ({
|
2020-12-23 11:14:35 +08:00
|
|
|
...bidev,
|
2023-02-17 16:21:15 +08:00
|
|
|
supplierlistLoading: loading.effects['bidev/fetchSupplierList'],
|
2020-12-23 11:14:35 +08:00
|
|
|
}))
|
|
|
|
class supplier extends PureComponent {
|
2023-02-17 16:21:15 +08:00
|
|
|
state = {
|
|
|
|
pageNo: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
tpId: getProId(),
|
|
|
|
sectionName: "采购包",
|
|
|
|
sectionType: "评审",
|
2022-03-10 14:24:13 +08:00
|
|
|
defId: getDefId(),
|
|
|
|
loading: false,
|
2020-12-23 11:14:35 +08:00
|
|
|
}
|
2023-02-17 16:21:15 +08:00
|
|
|
componentDidMount() {
|
|
|
|
//确定显示字段名称
|
|
|
|
let sectionName = "采购包";
|
|
|
|
let sectionType = "评审";
|
|
|
|
let proMethod = getProMethod();
|
|
|
|
if (proMethod == "procurement_mode_1" || proMethod == "procurement_mode_2") {
|
|
|
|
sectionName = "标段";
|
|
|
|
sectionType = "评标";
|
|
|
|
} else if (proMethod == "procurement_mode_5" || proMethod == "procurement_mode_6") {
|
|
|
|
sectionName = "采购包";
|
|
|
|
sectionType = "谈判";
|
|
|
|
} else if (proMethod == "procurement_mode_4") {
|
|
|
|
sectionName = "包件";
|
|
|
|
}
|
|
|
|
this.setState({
|
|
|
|
sectionName,
|
|
|
|
sectionType
|
|
|
|
})
|
2022-03-10 14:24:13 +08:00
|
|
|
|
2020-12-23 11:14:35 +08:00
|
|
|
this.setState({
|
2023-02-17 16:21:15 +08:00
|
|
|
tpId: getProId()
|
2020-12-23 11:14:35 +08:00
|
|
|
})
|
2023-02-17 16:21:15 +08:00
|
|
|
const { dispatch } = this.props;
|
2020-12-23 11:14:35 +08:00
|
|
|
// const {pageNo,pageSize}=this.state;
|
2023-02-17 16:21:15 +08:00
|
|
|
const params = {
|
|
|
|
pageNo: 1,
|
|
|
|
pageSize: 10,
|
2022-03-10 14:24:13 +08:00
|
|
|
// roomType:this.props.match.params.roomType,
|
|
|
|
roomType: getURLInformation('roomType'),
|
2023-02-17 16:21:15 +08:00
|
|
|
tpId: getProId()//项目id
|
2020-12-23 11:14:35 +08:00
|
|
|
}
|
|
|
|
dispatch({
|
2023-02-17 16:21:15 +08:00
|
|
|
type: "bidev/fetchSupplierList",
|
|
|
|
payload: { ...params }
|
2020-12-23 11:14:35 +08:00
|
|
|
})
|
|
|
|
}
|
2022-03-10 14:24:13 +08:00
|
|
|
|
2023-02-17 16:21:15 +08:00
|
|
|
handleRedirect = async (record) => {
|
|
|
|
sessionStorage.setItem("roomId", record.id)
|
|
|
|
sessionStorage.setItem("roomStatus", record.status)
|
|
|
|
sessionStorage.setItem("groupId", record.chatGroupId)
|
|
|
|
sessionStorage.setItem("expertGroupId", record.expertChatGroupId)
|
|
|
|
this.setState({ loading: true })
|
2022-03-10 14:24:13 +08:00
|
|
|
await getQuotationMethodById(record.id)
|
2023-02-17 16:21:15 +08:00
|
|
|
const res = await getMaxTurnSortSupplier(record.id);//获取最新轮次的供应商信息
|
|
|
|
if (record.bxOneSecondProjectStatus && (record.instFlowType == 2) && (getSessionUserData()?.userId == res?.data[0].bidUserId)) {//比选一阶段二次项目,选择自定义流程
|
|
|
|
sessionStorage.setItem("isBxOneSecondCustom", "1")
|
2023-03-17 17:13:11 +08:00
|
|
|
} else {
|
|
|
|
sessionStorage.setItem("isBxOneSecondCustom", "0")
|
2023-02-17 16:21:15 +08:00
|
|
|
}
|
|
|
|
this.setState({ loading: false })
|
2022-03-10 14:24:13 +08:00
|
|
|
// this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom'))
|
|
|
|
window.open('/EvaRoom')
|
2020-12-23 11:14:35 +08:00
|
|
|
}
|
2023-02-17 16:21:15 +08:00
|
|
|
render() {
|
|
|
|
const { supplierList, supplierlistLoading } = this.props;
|
|
|
|
const { pageNo, pageSize, tpId, sectionType, sectionName, defId, loading } = this.state;
|
2020-12-23 11:14:35 +08:00
|
|
|
const pagination = {
|
|
|
|
current: pageNo,
|
2023-02-17 16:21:15 +08:00
|
|
|
total: supplierList && supplierList.total,
|
2020-12-23 11:14:35 +08:00
|
|
|
// showSizeChanger: true,
|
2023-02-17 16:21:15 +08:00
|
|
|
showQuickJumper: true,
|
|
|
|
showTotal: (total, range) => `共 ${total} 条记录,第${range.slice(',')[0]}-${range.slice(',')[1]}条`,
|
|
|
|
onChange: (page, pageSize) => {
|
2020-12-23 11:14:35 +08:00
|
|
|
this.setState({
|
2023-02-17 16:21:15 +08:00
|
|
|
pageNo: page,
|
|
|
|
pageSize: pageSize,
|
2020-12-23 11:14:35 +08:00
|
|
|
});
|
2023-02-17 16:21:15 +08:00
|
|
|
const params = {
|
|
|
|
pageNo: page,
|
|
|
|
pageSize: pageSize,
|
2022-03-10 14:24:13 +08:00
|
|
|
// roomType:this.props.match.params.roomType,
|
|
|
|
roomType: getURLInformation('roomType'),
|
2023-02-17 16:21:15 +08:00
|
|
|
tpId: tpId//项目id
|
2020-12-23 11:14:35 +08:00
|
|
|
}
|
|
|
|
this.props.dispatch({
|
2023-02-17 16:21:15 +08:00
|
|
|
type: "bidev/fetchSupplierList",
|
|
|
|
payload: { ...params }
|
2020-12-23 11:14:35 +08:00
|
|
|
})
|
|
|
|
},
|
|
|
|
onShowSizeChange: (current, pageSize) => {
|
|
|
|
this.setState({
|
2023-02-17 16:21:15 +08:00
|
|
|
pageNo: 1,
|
|
|
|
pageSize: pageSize,
|
2020-12-23 11:14:35 +08:00
|
|
|
});
|
2023-02-17 16:21:15 +08:00
|
|
|
const params = {
|
|
|
|
pageNo: 1,
|
|
|
|
pageSize: pageSize,
|
2022-03-10 14:24:13 +08:00
|
|
|
// roomType:this.props.match.params.roomType,
|
|
|
|
roomType: getURLInformation('roomType'),
|
2023-02-17 16:21:15 +08:00
|
|
|
tpId: tpId//项目id
|
2020-12-23 11:14:35 +08:00
|
|
|
}
|
|
|
|
this.props.dispatch({
|
2023-02-17 16:21:15 +08:00
|
|
|
type: "bidev/fetchSupplierList",
|
|
|
|
payload: { ...params }
|
2020-12-23 11:14:35 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2023-02-17 16:21:15 +08:00
|
|
|
const columns = [
|
|
|
|
{
|
|
|
|
title: '序号', dataIndex: 'id', width: '10%',
|
|
|
|
render: (text, record, index) => {
|
|
|
|
return (index + 1)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ title: `${sectionName}名称`, dataIndex: 'sectionName', width: '10%' },
|
|
|
|
{ title: `${sectionName}编号`, dataIndex: 'sectionNum', width: '10%' },
|
|
|
|
{
|
|
|
|
title: `${sectionType}次数`, dataIndex: 'roomSort', width: '10%',
|
|
|
|
render: (text, record, index) => {
|
|
|
|
return defId == "recruit_multi" ? <>第{text}轮</> : record.reviewMark == 1 ? <>第{text + record.reviewSort}次{sectionType}</> : <>第{text}次{sectionType}</>
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ title: `${sectionType}开始时间`, dataIndex: 'openTime', width: '10%' },
|
|
|
|
{
|
|
|
|
title: '状态', dataIndex: 'status', width: '10%',
|
|
|
|
render: (text, record, index) => {
|
2022-03-10 14:24:13 +08:00
|
|
|
let txt = record.status
|
2023-02-17 16:21:15 +08:00
|
|
|
return txt == 0 || txt == 1 ? `准备${sectionType}` : (txt == 2 ? `正在${sectionType}` : (txt == 3 ? `${sectionType}结束` : null))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '操作', dataIndex: 'operation', width: '10%',
|
|
|
|
render: (text, record, index) => {
|
|
|
|
return <><Button type="text" onClick={() => { this.handleRedirect(record) }} hidden={btnAuthority(["ebtp-supplier"])}>进入{sectionType}室</Button></>
|
|
|
|
}
|
|
|
|
}
|
2022-03-10 14:24:13 +08:00
|
|
|
]
|
|
|
|
|
2020-12-23 11:14:35 +08:00
|
|
|
return <>
|
2023-02-17 16:21:15 +08:00
|
|
|
<Card bodyStyle={{ padding: '24px 24px 0px' }} style={{ borderRadius: 6 }} bordered={false}>
|
|
|
|
<Table
|
|
|
|
loading={supplierlistLoading || loading}
|
|
|
|
columns={columns}
|
|
|
|
dataSource={supplierList != "" && supplierList.records}
|
|
|
|
pagination={pagination}
|
|
|
|
size="small"
|
|
|
|
/>
|
|
|
|
</Card>
|
2020-12-23 11:14:35 +08:00
|
|
|
</>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export default supplier;
|