From 7c3e7d9ad59019d15a610e0f8dfd32af21711456 Mon Sep 17 00:00:00 2001 From: fuqingji <51312040@qq.com> Date: Fri, 20 May 2022 13:42:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E3=80=904411=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=E6=94=B9=E7=9B=91=E7=9D=A3=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=81=E5=A2=9E=E5=8A=A0=E5=AE=A1=E6=9F=A5?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/router.config.ts | 5 + .../Examination/components/ProjectManage.tsx | 175 ++++++++++++++++++ .../ProjectManage/Examination/index.tsx | 33 ++++ .../ProjectManage/Examination/service.ts | 11 ++ .../Supervision/components/FavoritesList.tsx | 99 +++++++++- .../Supervision/components/ProjectManage.tsx | 91 +++++++-- .../ProjectManage/Supervision/service.ts | 23 +++ 7 files changed, 418 insertions(+), 19 deletions(-) create mode 100644 src/pages/Project/ProjectManage/Examination/components/ProjectManage.tsx create mode 100644 src/pages/Project/ProjectManage/Examination/index.tsx create mode 100644 src/pages/Project/ProjectManage/Examination/service.ts diff --git a/config/router.config.ts b/config/router.config.ts index a63478c..2ef632b 100644 --- a/config/router.config.ts +++ b/config/router.config.ts @@ -227,6 +227,11 @@ export default [ name: 'Supervision', path: '/Supervision', component: './Project/ProjectManage/Supervision' + }, + {//审查人员 项目管理页 + name: 'Examination', + path: '/Examination', + component: './Project/ProjectManage/Examination' }, {//招标项目评审-评委 path: '/ExpertReview/Review', diff --git a/src/pages/Project/ProjectManage/Examination/components/ProjectManage.tsx b/src/pages/Project/ProjectManage/Examination/components/ProjectManage.tsx new file mode 100644 index 0000000..dc12e65 --- /dev/null +++ b/src/pages/Project/ProjectManage/Examination/components/ProjectManage.tsx @@ -0,0 +1,175 @@ +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 +} +/** + * 项目管理列表 + * @param props + * @returns + */ +const ProjectManage: React.FC = (props) => { + const { projectName, bidMethodDict, current } = props + + const [spin, spinSet] = useState(false); + //查询分页数据 + const [pageData, pageDataSet] = useState({ + pageNo: isNotEmpty(current) ? Number(current) : 1, + pageSize: 10 + }); + //项目列表参数 + const [projectParams, setProjectParams] = useState(""); + //获取字典 + 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[] = [ + { + title: '序号', + valueType: 'index', + width: 50, + }, + { + title: '采购方式', + dataIndex: 'bidMethodDict', + width: '8%', + valueEnum: proTableValueEnum(dictData[procurementModeEntrust]), + initialValue: isNotEmpty(bidMethodDict) ? bidMethodDict : null , + }, + { + title: '项目名称', + dataIndex: 'projectName', + initialValue: isNotEmpty(projectName) ? projectName : 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) => + ( + <> + + + ) + }, + ] + + /** + * 项目跟进 + * @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 ( + +
+ { + 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: isNotEmpty(current) ? Number(current) : 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 }) }} + /> +
+
+ ) +} +export default ProjectManage; \ No newline at end of file diff --git a/src/pages/Project/ProjectManage/Examination/index.tsx b/src/pages/Project/ProjectManage/Examination/index.tsx new file mode 100644 index 0000000..c57ef86 --- /dev/null +++ b/src/pages/Project/ProjectManage/Examination/index.tsx @@ -0,0 +1,33 @@ +import { getURLInformation, getUrlParam } from '@/utils/CommonUtils'; +import { Card } from 'antd'; +import React from 'react'; +import ProjectManage from './components/ProjectManage'; +/** + * 监督项目管理 + * @returns + */ +const Index: React.FC<{}> = () => { + //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(isNotEmpty(tabs) ? String(tabs) : 'projectList'); + + // const handleModeChange = (e: any) => { + // const mode = e.target.value; + // setMode(mode); + // }; + + return ( + + + + + ) +} +export default Index; \ No newline at end of file diff --git a/src/pages/Project/ProjectManage/Examination/service.ts b/src/pages/Project/ProjectManage/Examination/service.ts new file mode 100644 index 0000000..11d2fcb --- /dev/null +++ b/src/pages/Project/ProjectManage/Examination/service.ts @@ -0,0 +1,11 @@ +import request from '@/utils/request'; +/** + * 查询数据并分页 + * @param params + */ +export async function getPage(params?: any) { + return request('/api/biz-service-ebtp-project/v1/projectRecord/examination/getPage', { + method: 'POST', + data: params, + }); +} \ No newline at end of file diff --git a/src/pages/Project/ProjectManage/Supervision/components/FavoritesList.tsx b/src/pages/Project/ProjectManage/Supervision/components/FavoritesList.tsx index 14c24fe..e76352a 100644 --- a/src/pages/Project/ProjectManage/Supervision/components/FavoritesList.tsx +++ b/src/pages/Project/ProjectManage/Supervision/components/FavoritesList.tsx @@ -1,10 +1,10 @@ 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 { Button, message, Popconfirm, Spin, Space, Tag } from 'antd'; import React, { useRef, useState } from 'react'; import { useHistory } from 'umi'; -import { getFavoritesList, updateReadStatus } from '../service'; +import { getFavoritesList, removePublic, toPublic, updateReadStatus } from '../service'; interface FavoritesListProps { projectName?: string | null, @@ -35,14 +35,13 @@ const FavoritesList: React.FC = (props) => { const procurementTypeEntrust = 'procurement_type=entrust'; //采购方式 const procurementModeEntrust = 'procurement_mode=entrust'; + //选中 + const [selectedRows, setSelectedRows] = useState([]); + + const history = useHistory(); const ref = useRef(); const columns: ProColumns[] = [ - { - title: '序号', - valueType: 'index', - width: 50, - }, { title: '采购方式', dataIndex: 'bidMethodDict', @@ -50,6 +49,27 @@ const FavoritesList: React.FC = (props) => { valueEnum: proTableValueEnum(dictData[procurementModeEntrust]), initialValue: tabs === 'favoritesList' ? isNotEmpty(bidMethodDict) ? bidMethodDict : null : null, }, + { + title: '项目阶段', + dataIndex: 'businessModule', + hideInTable: true, + valueType: 'select', + valueEnum: proTableValueEnum(dictData['business_module=procurement_mode_1']) + // { + // 1: 建档, + // 2: 资审招标, + // 3: 资审投标, + // 4: 资审开标, + // 5: 资审评标, + // 6: 资审定标, + // 7: 招标, + // 8: 投标, + // 9: 开标, + // 10: 评标, + // 11: 定标, + // 12: 归档, + // } + }, { title: '项目名称', dataIndex: 'projectName', @@ -86,6 +106,20 @@ const FavoritesList: React.FC = (props) => { search: false, width: '10%', }, + { + title: '公开状态', + dataIndex: 'isPublic', + width: '10%', + valueEnum: { + 0: { + text: 未公开 + }, + 1: { + text: 已公开 + }, + } + + }, { title: '操作', valueType: 'option', @@ -147,6 +181,31 @@ const FavoritesList: React.FC = (props) => { }) }; + /** + * 取消公开 + */ + const removePublicProject = async () => { + spinSet(true); + await removePublic(selectedRows).then(res => { + if (res?.code == 200) { + message.success('取消成功'); + ref.current?.reload(); + } + }) + }; + + /** + * 项目公开 + */ + const toPublicProject = async () => { + spinSet(true); + await toPublic(selectedRows).then(res => { + if (res?.code == 200) { + message.success('设置成功'); + ref.current?.reload(); + } + }) + }; /** * 获取返回路径 * @returns @@ -191,13 +250,37 @@ const FavoritesList: React.FC = (props) => { } pagination={{ defaultPageSize: 10, + pageSizeOptions: [10, 20, 30, 50], defaultCurrent: tabs === 'favoritesList' ? isNotEmpty(current) ? Number(current) : 1 : 1, size: "small", - showSizeChanger: false, + showSizeChanger: true, onChange: (page, pageSize) => pageDataSet({ pageNo: page, pageSize: pageSize }), onShowSizeChange: (current, size) => pageDataSet({ pageNo: current, pageSize: size }), }} onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }} + rowKey={"id"} + rowSelection={{ + selectedRowKeys: selectedRows, + onChange: (_, selectedRows) => setSelectedRows(_), + }} + tableAlertRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => ( + + + 已选 {selectedRowKeys.length} 项 + + 取消选择 + + + + )} + tableAlertOptionRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => { + return ( + + { toPublicProject(); onCleanSelected() }}>公开项目 + { removePublicProject(); onCleanSelected() }}>取消公开 + + ); + }} /> diff --git a/src/pages/Project/ProjectManage/Supervision/components/ProjectManage.tsx b/src/pages/Project/ProjectManage/Supervision/components/ProjectManage.tsx index e556efa..d46fa28 100644 --- a/src/pages/Project/ProjectManage/Supervision/components/ProjectManage.tsx +++ b/src/pages/Project/ProjectManage/Supervision/components/ProjectManage.tsx @@ -1,10 +1,10 @@ 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 ProTable, { ActionType, ProColumns } from '@ant-design/pro-table'; +import { Button, message, Space, Spin, Tag } from 'antd'; +import React, { useRef, useState } from 'react'; import { useHistory } from 'umi'; -import { getPage } from '../service'; +import { getPage, removePublic, toPublic } from '../service'; interface ProjectManageProps { projectName?: string | null, @@ -35,14 +35,13 @@ const ProjectManage: React.FC = (props) => { const procurementTypeEntrust = 'procurement_type=entrust'; //采购方式 const procurementModeEntrust = 'procurement_mode=entrust'; - const history = useHistory(); + //选中 + const [selectedRows, setSelectedRows] = useState([]); + const history = useHistory(); + const ref = useRef(); const columns: ProColumns[] = [ - { - title: '序号', - valueType: 'index', - width: 50, - }, + { title: '采购方式', dataIndex: 'bidMethodDict', @@ -50,6 +49,13 @@ const ProjectManage: React.FC = (props) => { valueEnum: proTableValueEnum(dictData[procurementModeEntrust]), initialValue: tabs === 'projectList' ? isNotEmpty(bidMethodDict) ? bidMethodDict : null : null, }, + { + title: '项目阶段', + dataIndex: 'businessModule', + hideInTable: true, + valueType: 'select', + valueEnum: proTableValueEnum(dictData['business_module=procurement_mode_1']) + }, { title: '项目名称', dataIndex: 'projectName', @@ -86,6 +92,20 @@ const ProjectManage: React.FC = (props) => { search: false, width: '10%', }, + { + title: '公开状态', + dataIndex: 'isPublic', + width: '10%', + valueEnum: { + 0: { + text: 未公开 + }, + 1: { + text: 已公开 + }, + } + + }, { title: '操作', valueType: 'option', @@ -127,7 +147,31 @@ const ProjectManage: React.FC = (props) => { let params = `${'?current=' + projectURLParams.current}${isEmpty(projectURLParams.projectName) ? '' : '&projectName=' + projectURLParams.projectName}${isEmpty(projectURLParams.bidMethodDict) ? '' : '&bidMethodDict=' + projectURLParams.bidMethodDict}&tabs=projectList`; return getUrlRelativePath() + params; } + /** + * 取消公开 + */ + const removePublicProject = async () => { + spinSet(true); + await removePublic(selectedRows).then(res => { + if (res?.code == 200) { + message.success('取消成功'); + ref.current?.reload(); + } + }) + }; + /** + * 项目公开 + */ + const toPublicProject = async () => { + spinSet(true); + await toPublic(selectedRows).then(res => { + if (res?.code == 200) { + message.success('设置成功'); + ref.current?.reload(); + } + }) + }; return (
@@ -136,6 +180,7 @@ const ProjectManage: React.FC = (props) => { options={false} bordered={false} size='small' + actionRef={ref} search={{ labelWidth: 'auto', span: 6 }} loading={false} request={async (params) => { @@ -161,13 +206,37 @@ const ProjectManage: React.FC = (props) => { } pagination={{ defaultPageSize: 10, + pageSizeOptions: [10, 20, 30, 50], defaultCurrent: tabs === 'projectList' ? isNotEmpty(current) ? Number(current) : 1 : 1, size: "small", - showSizeChanger: false, + showSizeChanger: true, onChange: (page, pageSize) => pageDataSet({ pageNo: page, pageSize: pageSize }), onShowSizeChange: (current, size) => pageDataSet({ pageNo: current, pageSize: size }), }} onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }} + rowKey={"id"} + rowSelection={{ + selectedRowKeys: selectedRows, + onChange: (_, selectedRows) => setSelectedRows(_), + }} + tableAlertRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => ( + + + 已选 {selectedRowKeys.length} 项 + + 取消选择 + + + + )} + tableAlertOptionRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => { + return ( + + { toPublicProject(); onCleanSelected() }}>公开项目 + { removePublicProject(); onCleanSelected() }}>取消公开 + + ); + }} />
diff --git a/src/pages/Project/ProjectManage/Supervision/service.ts b/src/pages/Project/ProjectManage/Supervision/service.ts index 2b3a22f..d2c6462 100644 --- a/src/pages/Project/ProjectManage/Supervision/service.ts +++ b/src/pages/Project/ProjectManage/Supervision/service.ts @@ -29,4 +29,27 @@ export async function updateReadStatus(params: any) { method: 'POST', data: { ...params }, }); +} +/** + * 取消公开项目 + * @param params + * @returns + */ +export async function removePublic(params: any) { + return request('/api/biz-service-ebtp-project/v1/projectRecord/examination/private', { + method: 'POST', + data: params, + }); +} + +/** + * 公开项目 + * @param params + * @returns + */ +export async function toPublic(params: any) { + return request('/api/biz-service-ebtp-project/v1/projectRecord/examination/public', { + method: 'POST', + data: params, + }); } \ No newline at end of file