Merge branch 'master' of http://10.124.128.2:8888/eshop/fe_service_ebtp_frontend into 20220413-zjl-公共服务平台

This commit is contained in:
jl-zhoujl2
2022-05-09 17:06:06 +08:00
22 changed files with 1015 additions and 315 deletions

View File

@ -57,6 +57,8 @@ const ProjectDocumentation: React.FC = () => {
render: (_: any, record: any) => {
//标段信息
let sectionFirst = record?.sectionFirst;
//获取字段名称
let openingName = openingTimeText(record?.bidMethodDict, record?.examinationMethodDict);
return (
<>
<Row>
@ -73,7 +75,10 @@ const ProjectDocumentation: React.FC = () => {
<div>
<h4 style={{ marginBottom: '0px' }}>{sectionFirst.bidSectName}</h4>
</div>
{createSection(record)}
{createSection(record, openingName)}
<div>
<text style={{ marginBottom: '0px' }}>{openingName}{isEmpty(sectionFirst.sectionOpenTime) ? '-' : sectionFirst.sectionOpenTime}</text>
</div>
</>
)
}
@ -154,7 +159,7 @@ const ProjectDocumentation: React.FC = () => {
* @param record
* @returns
*/
const createSection = (record: any) => {
const createSection = (record: any, openingName: string) => {
//标段信息
let sectionFirst = record?.sectionFirst;
//是否异常
@ -222,7 +227,7 @@ const ProjectDocumentation: React.FC = () => {
sectionFirst.sectionCount > 1 && (
<Popover
content={(
<ProjectSectionInfo projectId={record.id} bidMethodDict={record.bidMethodDict} />
<ProjectSectionInfo projectId={record.id} bidMethodDict={record.bidMethodDict} openingName={openingName} />
)}
trigger="hover"
overlayStyle={{ width: "45%" }}
@ -236,7 +241,36 @@ const ProjectDocumentation: React.FC = () => {
</div>
)
}
/**
* 开标时间,评审开始时间字段显示
* @param bidMethod
* @param examinationMethod
*/
const openingTimeText = (bidMethod: string, examinationMethod: string | null) => {
const bid = '开标';
const bid_pre = '资审开标';
const comparison = '开启';
const comparison_pre = '资审开启';
const negotiation = '谈判开始';
const review = '评审开始';
if (bidMethod == 'procurement_mode_1' || bidMethod == 'procurement_mode_2') {
if (examinationMethod == 'examination_method_1') { //预审
return bid_pre;
} else {
return bid;
}
} else if (bidMethod == 'procurement_mode_5' || bidMethod == 'procurement_mode_6') {
return negotiation;
} else if (bidMethod == 'procurement_mode_3') {
if (examinationMethod == 'examination_method_1') { //预审
return comparison_pre;
} else {
return comparison;
}
} else {
return review;
}
};
/**
* 项目跟进

View File

@ -8,14 +8,15 @@ import { getBusinessModuleName, getSectionBybidMethodDict, getTagColor } from ".
interface ProjectSectionInfoItem {
projectId: string,
bidMethodDict: string
bidMethodDict: string,
openingName: string,
}
//进度条长度
const progressWidth = {
width: '180px'
}
const ProjectSectionInfo: React.FC<ProjectSectionInfoItem> = (props) => {
const { projectId, bidMethodDict } = props;
const { projectId, bidMethodDict, openingName } = props;
const [listData, setListData] = useState<any[]>([]);
const [loading, setLoading] = useState<boolean>(false);
//获取字典
@ -48,6 +49,9 @@ const ProjectSectionInfo: React.FC<ProjectSectionInfoItem> = (props) => {
</Col>
<Col span={14}>
{createSection(record)}
<div>
<text style={{ marginBottom: '0px' }}>{openingName}{isEmpty(record.sectionOpenTime) ? '-' : record.sectionOpenTime}</text>
</div>
</Col>
</Row>
)
@ -108,7 +112,7 @@ const ProjectSectionInfo: React.FC<ProjectSectionInfoItem> = (props) => {
archiveStatus
? <Tag color="#52c41a">
</Tag>
</Tag>
: <Tag color={getTagColor(sectionFirst?.businessModule)}>
{getBusinessModuleName(dictData, bidMethodDict, sectionFirst?.businessModule)}
</Tag>
@ -120,7 +124,7 @@ const ProjectSectionInfo: React.FC<ProjectSectionInfoItem> = (props) => {
</Tag>
}
{isEmpty(sectionFirst.applyCount) ? "0" : sectionFirst.applyCount}
{isEmpty(sectionFirst.applyCount) ? "0" : sectionFirst.applyCount}
</div>
)
}

View File

@ -0,0 +1,206 @@
import { getUrlRelativePath, isEmpty, isNotEmpty, proTableValueEnum } from '@/utils/CommonUtils';
import { followUpAProjectManager, getDicData, setPurchaseCanOperate } from '@/utils/session';
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
import { Button, message, Popconfirm, Spin } from 'antd';
import React, { useRef, useState } from 'react';
import { useHistory } from 'umi';
import { getFavoritesList, updateReadStatus } from '../service';
interface FavoritesListProps {
projectName?: string | null,
bidMethodDict?: string | null,
current?: string | null,
tabs: string | null,
}
/**
* 监督项目收藏列表
* @param props
* @returns
*/
const FavoritesList: React.FC<FavoritesListProps> = (props) => {
const { projectName, bidMethodDict, current, tabs } = props
const [spin, spinSet] = useState<boolean>(false);
//查询分页数据
const [pageData, pageDataSet] = useState<any>({
pageNo: tabs === 'favoritesList' ? isNotEmpty(current) ? Number(current) : 1 : 1,
pageSize: 10
});
//项目列表参数
const [projectParams, setProjectParams] = useState<string>("");
//获取字典
const getDict: any = getDicData();
const dictData = JSON.parse(getDict);
//标的类型
const procurementTypeEntrust = 'procurement_type=entrust';
//采购方式
const procurementModeEntrust = 'procurement_mode=entrust';
const history = useHistory();
const ref = useRef<ActionType>();
const columns: ProColumns<any>[] = [
{
title: '序号',
valueType: 'index',
width: 50,
},
{
title: '采购方式',
dataIndex: 'bidMethodDict',
width: '8%',
valueEnum: proTableValueEnum(dictData[procurementModeEntrust]),
initialValue: tabs === 'favoritesList' ? isNotEmpty(bidMethodDict) ? bidMethodDict : null : null,
},
{
title: '项目名称',
dataIndex: 'projectName',
initialValue: tabs === 'favoritesList' ? isNotEmpty(projectName) ? projectName : null : null,
},
{
title: '项目编号',
dataIndex: 'ebpProjectNumber',
search: false,
width: '10%',
},
{
title: '采购人',
dataIndex: 'tendereeOrgName',
search: false,
width: '15%',
},
{
title: '建档时间',
dataIndex: 'createDate',
search: false,
width: '10%',
},
{
title: '标的类型',
dataIndex: 'procurementType',
width: '8%',
search: false,
valueEnum: proTableValueEnum(dictData[procurementTypeEntrust]),
},
{
title: '所属区域',
dataIndex: 'regionDictName',
search: false,
width: '10%',
},
{
title: '操作',
valueType: 'option',
width: 150,
render: (_: any, record: any) => [
<Button
key="followUpProject"
type="text"
onClick={() =>
followUpProject(record)
}
>
</Button>,
<Popconfirm
title="您确定要移除收藏吗?"
onConfirm={() => removeFavorites(record)}
okText="确定"
cancelText="取消"
>
<Button
key="remove"
type="text"
>
</Button>
</Popconfirm>,
]
},
]
/**
* 项目跟进
* @param data
*/
const followUpProject = async (data: any) => {
data.returnURL = getReturnURL();
await followUpAProjectManager(data);
setPurchaseCanOperate();
history.push('/ProjectLayout/Manager/HomePageSectionList');
};
/**
* 移除收藏
* @param data
*/
const removeFavorites = async (data: any) => {
const params = {
id: data.notificationId,
projectId: data.id,
status: 'd',
}
spinSet(true);
await updateReadStatus(params).then(res => {
if (res?.code == 200) {
message.success('移除收藏成功');
ref.current?.reload();
}
})
};
/**
* 获取返回路径
* @returns
*/
const getReturnURL = () => {
let projectURLParams = JSON.parse(projectParams);
let params = `${'?current=' + projectURLParams.current}${isEmpty(projectURLParams.projectName) ? '' : '&projectName=' + projectURLParams.projectName}${isEmpty(projectURLParams.bidMethodDict) ? '' : '&bidMethodDict=' + projectURLParams.bidMethodDict}&tabs=favoritesList`;
return getUrlRelativePath() + params;
}
return (
<Spin spinning={spin}>
<div className="zjl-entrust confirm">
<ProTable
columns={columns}
options={false}
bordered={false}
size='small'
actionRef={ref}
search={{ labelWidth: 'auto', span: 6 }}
loading={false}
request={async (params) => {
setProjectParams(JSON.stringify(params));
spinSet(true);
return await getFavoritesList({
...params,
basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize },
}).then((res) => {
const result = {
data: res.data.records,
total: res.data.total,
success: res.success,
pageSize: res.data.size,
current: res.data.current
}
return result;
}).finally(() => {
isNotEmpty(window.location.search) && history.push(window.location.pathname);
spinSet(false);
})
}
}
pagination={{
defaultPageSize: 10,
defaultCurrent: tabs === 'favoritesList' ? isNotEmpty(current) ? Number(current) : 1 : 1,
size: "small",
showSizeChanger: false,
onChange: (page, pageSize) => pageDataSet({ pageNo: page, pageSize: pageSize }),
onShowSizeChange: (current, size) => pageDataSet({ pageNo: current, pageSize: size }),
}}
onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }}
/>
</div>
</Spin>
)
}
export default FavoritesList;

View File

@ -0,0 +1,176 @@
import { getUrlRelativePath, isEmpty, isNotEmpty, proTableValueEnum } from '@/utils/CommonUtils';
import { followUpAProjectManager, getDicData, setPurchaseCanOperate } from '@/utils/session';
import ProTable, { ProColumns } from '@ant-design/pro-table';
import { Button, Spin } from 'antd';
import React, { useState } from 'react';
import { useHistory } from 'umi';
import { getPage } from '../service';
interface ProjectManageProps {
projectName?: string | null,
bidMethodDict?: string | null,
current?: string | null,
tabs: string | null,
}
/**
* 项目管理列表
* @param props
* @returns
*/
const ProjectManage: React.FC<ProjectManageProps> = (props) => {
const { projectName, bidMethodDict, current, tabs } = props
const [spin, spinSet] = useState<boolean>(false);
//查询分页数据
const [pageData, pageDataSet] = useState<any>({
pageNo: tabs === 'projectList' ? isNotEmpty(current) ? Number(current) : 1 : 1,
pageSize: 10
});
//项目列表参数
const [projectParams, setProjectParams] = useState<string>("");
//获取字典
const getDict: any = getDicData();
const dictData = JSON.parse(getDict);
//标的类型
const procurementTypeEntrust = 'procurement_type=entrust';
//采购方式
const procurementModeEntrust = 'procurement_mode=entrust';
const history = useHistory();
const columns: ProColumns<any>[] = [
{
title: '序号',
valueType: 'index',
width: 50,
},
{
title: '采购方式',
dataIndex: 'bidMethodDict',
width: '8%',
valueEnum: proTableValueEnum(dictData[procurementModeEntrust]),
initialValue: tabs === 'projectList' ? isNotEmpty(bidMethodDict) ? bidMethodDict : null : null,
},
{
title: '项目名称',
dataIndex: 'projectName',
initialValue: tabs === 'projectList' ? isNotEmpty(projectName) ? projectName : null : null,
},
{
title: '项目编号',
dataIndex: 'ebpProjectNumber',
search: false,
width: '10%',
},
{
title: '采购人',
dataIndex: 'tendereeOrgName',
search: false,
width: '15%',
},
{
title: '建档时间',
dataIndex: 'createDate',
search: false,
width: '10%',
},
{
title: '标的类型',
dataIndex: 'procurementType',
width: '8%',
search: false,
valueEnum: proTableValueEnum(dictData[procurementTypeEntrust]),
},
{
title: '所属区域',
dataIndex: 'regionDictName',
search: false,
width: '10%',
},
{
title: '操作',
valueType: 'option',
width: 150,
render: (_: any, record: any) =>
(
<>
<Button
key="followUpProject"
type="text"
onClick={() =>
followUpProject(record)
}
>
</Button>
</>
)
},
]
/**
* 项目跟进
* @param data
*/
const followUpProject = async (data: any) => {
data.returnURL = getReturnURL();
await followUpAProjectManager(data);
setPurchaseCanOperate();
history.push('/ProjectLayout/Manager/HomePageSectionList');
};
/**
* 获取返回路径
* @returns
*/
const getReturnURL = () => {
let projectURLParams = JSON.parse(projectParams);
let params = `${'?current=' + projectURLParams.current}${isEmpty(projectURLParams.projectName) ? '' : '&projectName=' + projectURLParams.projectName}${isEmpty(projectURLParams.bidMethodDict) ? '' : '&bidMethodDict=' + projectURLParams.bidMethodDict}&tabs=projectList`;
return getUrlRelativePath() + params;
}
return (
<Spin spinning={spin}>
<div className="zjl-entrust confirm">
<ProTable
columns={columns}
options={false}
bordered={false}
size='small'
search={{ labelWidth: 'auto', span: 6 }}
loading={false}
request={async (params) => {
setProjectParams(JSON.stringify(params));
spinSet(true);
return await getPage({
...params,
basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize },
}).then((res) => {
const result = {
data: res.data.records,
total: res.data.total,
success: res.success,
pageSize: res.data.size,
current: res.data.current
}
return result;
}).finally(() => {
isNotEmpty(window.location.search) && history.push(window.location.pathname);
spinSet(false);
})
}
}
pagination={{
defaultPageSize: 10,
defaultCurrent: tabs === 'projectList' ? isNotEmpty(current) ? Number(current) : 1 : 1,
size: "small",
showSizeChanger: false,
onChange: (page, pageSize) => pageDataSet({ pageNo: page, pageSize: pageSize }),
onShowSizeChange: (current, size) => pageDataSet({ pageNo: current, pageSize: size }),
}}
onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }}
/>
</div>
</Spin>
)
}
export default ProjectManage;

View File

@ -1,136 +1,42 @@
import { proTableValueEnum } from '@/utils/CommonUtils';
import { followUpAProjectManager, getDicData, setPurchaseCanOperate } from '@/utils/session';
import ProTable, { ProColumns } from '@ant-design/pro-table';
import { Button, Card, Spin } from 'antd';
import React, { useEffect, useState } from 'react';
import { useHistory } from 'umi';
import { getPage } from './service';
/**/
import { getURLInformation, getUrlParam, isNotEmpty } from '@/utils/CommonUtils';
import { Card, Radio } from 'antd';
import React, { useState } from 'react';
import FavoritesList from './components/FavoritesList';
import ProjectManage from './components/ProjectManage';
/**
* 监督项目管理
* @returns
*/
const Index: React.FC<{}> = () => {
const [spin, spinSet] = useState<boolean>(false);
//查询分页数据
const [pageData, pageDataSet] = useState<any>({
pageNo: 1,
pageSize: 10
});
//获取字典
const getDict: any = getDicData();
const dictData = JSON.parse(getDict);
//标的类型
const procurementTypeEntrust = 'procurement_type=entrust';
//采购方式
const procurementModeEntrust = 'procurement_mode=entrust';
const history = useHistory();
const columns: ProColumns<any>[] = [
{
title: '序号',
valueType: 'index',
width: 50,
},
{
title: '采购方式',
dataIndex: 'bidMethodDict',
width: '8%',
valueEnum: proTableValueEnum(dictData[procurementModeEntrust]),
},
{
title: '项目名称',
dataIndex: 'projectName',
},
{
title: '项目编号',
dataIndex: 'ebpProjectNumber',
search: false,
width: '10%',
},
{
title: '采购人',
dataIndex: 'tendereeOrgName',
search: false,
width: '15%',
},
{
title: '建档时间',
dataIndex: 'createDate',
search: false,
width: '10%',
},
{
title: '标的类型',
dataIndex: 'procurementType',
width: '8%',
search: false,
valueEnum: proTableValueEnum(dictData[procurementTypeEntrust]),
},
{
title: '所属区域',
dataIndex: 'regionDictName',
search: false,
width: '10%',
},
{
title: '操作',
valueType: 'option',
width: 150,
render: (_: any, record: any) =>
(
<>
<Button
key="followUpProject"
type="text"
onClick={() =>
followUpProject(record)
}
>
</Button>
</>
)
},
]
//================================================================================FUNC
/**
* 项目跟进
* @param data
*/
const followUpProject = async (data: any) => {
await followUpAProjectManager(data);
setPurchaseCanOperate();
history.push('/ProjectLayout/Manager/HomePageSectionList');
//url项目名称
const projectName = getUrlParam("projectName");
//url采购方式
const bidMethodDict = getURLInformation("bidMethodDict");
//url分页信息
const current = getURLInformation("current");
//url标签信息
const tabs = getURLInformation("tabs");
//radio value
const [mode, setMode] = useState<string>(isNotEmpty(tabs) ? String(tabs) : 'projectList');
const handleModeChange = (e: any) => {
const mode = e.target.value;
setMode(mode);
};
return (
<Card title="项目管理" style={{ borderRadius: 6 }} bodyStyle={{ padding: '1px 24px 0px' }}>
<Spin spinning={spin}>
<ProTable
columns={columns}
options={false}
bordered={false}
size='small'
search={{ labelWidth: 'auto', span: 6 }}
request={(params) =>
getPage({
...params,
basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize },
}).then((res) => {
const result = {
data: res.data.records,
total: res.data.total,
success: res.success,
pageSize: res.data.size,
current: res.data.current
}
return result;
})
}
pagination={{
defaultPageSize: 10,
showSizeChanger: false,
onChange: (page, pageSize) => pageDataSet({ pageNo: page, pageSize: pageSize }),
onShowSizeChange: (current, size) => pageDataSet({ pageNo: current, pageSize: size }),
}}
onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }}
/>
</Spin>
<Card style={{ borderRadius: 6 }} bodyStyle={{ padding: '16px 24px 0px' }}>
<Radio.Group onChange={handleModeChange} value={mode} buttonStyle="solid">
<Radio.Button value="projectList"></Radio.Button>
<Radio.Button value="favoritesList"></Radio.Button>
</Radio.Group>
{
mode === 'projectList' ? (
<ProjectManage projectName={projectName} bidMethodDict={bidMethodDict} current={current} tabs={tabs} />
) : (
<FavoritesList projectName={projectName} bidMethodDict={bidMethodDict} current={current} tabs={tabs} />
)
}
</Card>
)
}

View File

@ -4,9 +4,29 @@ import request from '@/utils/request';
* @param params
*/
export async function getPage(params?: any) {
return request('/api/biz-service-ebtp-project/v1/projectRecord/supervisor/getPage',{
return request('/api/biz-service-ebtp-project/v1/projectRecord/supervisor/getPage', {
method: 'POST',
data:params,
data: params,
});
}
/**
* 查询项目监督收藏列表
* @param params
*/
export async function getFavoritesList(params?: any) {
return request('/api/biz-service-ebtp-project/v1/notification/supervisor/getPage', {
method: 'POST',
data: params,
});
}
/**
* 收藏用-变更收藏状态0-已收藏 d-未收藏)
* @param params
* @returns
*/
export async function updateReadStatus(params: any) {
return request('/api/biz-service-ebtp-project/v1/notification/addOrUpdate', {
method: 'POST',
data: { ...params },
});
}