预约评标室

This commit is contained in:
517612449@qq.com
2022-08-12 17:08:43 +08:00
parent a7ff7ccd9d
commit 64b401eda5
2 changed files with 209 additions and 180 deletions

View File

@ -1,165 +1,185 @@
import React, { useState, useRef } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import { Button, Tabs, Form, Input, Modal, Space, Checkbox, message, PageHeader, Popconfirm, Progress, Tag, Spin } from 'antd'; import { Button, Tabs, PageHeader } from 'antd';
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table'; import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
import { reserveList } from './service'; import { reserveList, roomList } from './service';
import '@/assets/ld_style.less'; import '@/assets/ld_style.less';
import { getProjectTypeCode, getURLInformation, getUrlParam, isNotEmpty } from '@/utils/CommonUtils'; import { getURLInformation, isNotEmpty } from '@/utils/CommonUtils';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const Index: React.FC<{}> = () => { const Index: React.FC<{}> = () => {
const checkRelationRef = useRef<ActionType>(); //操作数据后刷新列表 const checkRelationRef = useRef<ActionType>(); //操作数据后刷新列表
const [areaNameList, setAreaNameList] = useState({});
/*拉取数据*/
useEffect(() => {
initAreaNameList();
}, []);
const initAreaNameList = async () => {
await roomList().then((res) => {
if (res.success ==true) {
// let areaNameList: any[] = [];
// console.log(res.data)
// res.data.forEach((item: { areaName: string; id: string; }) => {
// const tempDetail = { label: '', value: '', };
// tempDetail.label = item.areaName;
// tempDetail.value = item.id;
// areaNameList.push(tempDetail);
// })
let areaNameList = {};
//将拿到的返回值遍历
res.data.map((item: { id: string | number; areaName: any; })=>{
//使用接口返回值的id做为 代替原本的01
areaNameList[item.id]={
//使用接口返回值中的overdueValue属性作为原本的text:后面的值
text: item.areaName,
}
})
setAreaNameList(areaNameList)
}
})
};
const current = getURLInformation('current');
const columns: any = [
//存储当前页面项目类型 // 我参与的项目
let proTypeCode = getProjectTypeCode();
const current = getURLInformation("current");
const columns: any = [ // 我参与的项目
{ {
title: '序号', title: '序号',
dataIndex: 'index', dataIndex: 'index',
valueType: 'index', valueType: 'index',
search: false, search: false,
width: '2%', width: '3%',
}, },
{ {
title: '评标室', title: '评标室',
dataIndex: 'areaName', dataIndex: 'areaId',
valueType: 'select',
valueEnum: areaNameList,
search: true, search: true,
width: '15%', width: '10%',
}, },
{ {
title: '预约开始时间', title: '预约开始时间',
dataIndex: 'reserveStartDate', dataIndex: 'reserveStartDate',
search: true, search: true,
valueType: 'dateTime', valueType: 'dateTime',
width: '15%', width: '10%',
}, },
{ {
title: '预约结束时间', title: '预约结束时间',
dataIndex: 'reserveEndDate', dataIndex: 'reserveEndDate',
search: true, search: true,
valueType: 'dateTime', valueType: 'dateTime',
width: '15%', width: '10%',
}, },
{ {
title: '预约人', title: '预约人',
dataIndex: 'reserveBy', dataIndex: 'reserveBy',
width: '5%', width: '5%',
search: false search: false,
}, },
{ {
title: '预约人联系方式', title: '预约人联系方式',
dataIndex: 'reserveContactNumber', dataIndex: 'reserveContactNumber',
width: '5%', width: '5%',
search: false search: false,
}, },
{ {
title: '项目名称', title: '项目名称',
dataIndex: 'projectName', dataIndex: 'projectName',
search: false, search: false,
width: '10%' width: '10%',
}, },
{ {
title: '标段名称', title: '标段名称',
dataIndex: 'sectionNames', dataIndex: 'sectionNames',
search: false, search: false,
width: '10%' width: '10%',
}, },
{ {
title: '操作', title: '操作',
width: '7%', width: '7%',
search: false, search: false,
render: (text: any, record: any) => { render: (text: any, record: any) => {
return ( return (
<> <>
<Button hidden={btnAuthority(['ebtp-supplier'])} type="text" onClick={() => {}} danger></Button> <Button hidden={btnAuthority(['ebtp-supplier'])} type="text" onClick={() => {}} danger>
</Button>
</> </>
) );
},
}
}, },
]; ];
const otherColumns: any[] = [ //会议室预约 const otherColumns: any[] = [
//会议室预约
{ {
title: '序号', title: '序号',
dataIndex: 'index', dataIndex: 'index',
valueType: 'index', valueType: 'index',
search: false, search: false,
width: 50, width: '3%',
}, },
{ {
title: '会议室名称', title: '会议室名称',
dataIndex: 'areaName', dataIndex: 'areaName',
search: true,
width: '10%',
}, },
{ {
title: '预约开始时间', title: '预约开始时间',
dataIndex: 'reserveStartDate', dataIndex: 'reserveStartDate',
search: false, search: true,
width: '5%', width: '10%',
}, },
{ {
title: '预约结束时间', title: '预约结束时间',
dataIndex: 'reserveEndDate', dataIndex: 'reserveEndDate',
search: false, search: true,
width: '7%', width: '10%',
}, },
{ {
title: '预约人', title: '预约人',
dataIndex: 'reserveBy', dataIndex: 'reserveBy',
width: '20%', width: '5%',
search: false search: false,
}, },
{ {
title: '预约人联系方式', title: '预约人联系方式',
dataIndex: 'reserveContactNumber', dataIndex: 'reserveContactNumber',
width: '10%', width: '5%',
search: false search: false,
}, },
{ {
title: '操作', title: '操作',
width: '7%', width: '7%',
search: false, search: false,
render: (text: any, record: any) => { render: (text: any, record: any) => {
return ( return (
<> <>
<Button hidden={btnAuthority(['ebtp-supplier'])} type="text" onClick={() => {}} danger></Button> <Button hidden={btnAuthority(['ebtp-supplier'])} type="text" onClick={() => {}} danger>
</Button>
</> </>
) );
},
}
}, },
]; ];
return ( return (
<> <>
<PageHeader <PageHeader title="预约管理" />
title="预约管理"
/>
<Tabs defaultActiveKey="1"> <Tabs defaultActiveKey="1">
<TabPane tab="评标预约" key="1"> <TabPane tab="评标预约" key="1">
<ProTable <ProTable
actionRef={checkRelationRef} actionRef={checkRelationRef}
className="proSearch" className="proSearch"
columns={columns} columns={columns}
params={{ "reserveType": "eval" }} params={{ reserveType: 'eval' }}
size='small' size="small"
request={async (params) => request={async (params) =>
await reserveList(params).then((res) => { await reserveList(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -180,16 +200,15 @@ const Index: React.FC<{}> = () => {
}) })
} }
search={{ search={{
filterType: "query", filterType: 'query',
optionRender: (searchConfig: any, { form }) => { optionRender: (searchConfig: any, { form }) => {
return [ return [
<Button <Button
key="resetText" key="resetText"
onClick={() => { onClick={() => {
form?.setFieldsValue({ form?.setFieldsValue({
current: 1, current: 1,
}) });
form?.submit(); form?.submit();
}} }}
> >
@ -207,18 +226,20 @@ const Index: React.FC<{}> = () => {
]; ];
}, },
}} }}
pagination={{ defaultCurrent: isNotEmpty(current) ? Number(current) : 1, defaultPageSize: 10, showSizeChanger: false }}//默认显示条数 pagination={{
defaultCurrent: isNotEmpty(current) ? Number(current) : 1,
defaultPageSize: 10,
showSizeChanger: false,
}} //默认显示条数
toolBarRender={false} toolBarRender={false}
/> />
</TabPane> </TabPane>
<TabPane tab="会议预约" key="2"> <TabPane tab="会议预约" key="2">
<ProTable <ProTable
className="proSearch" className="proSearch"
columns={otherColumns} columns={otherColumns}
params={{ "reserveType": "meeting" }} params={{ reserveType: 'meeting' }}
size='small' size="small"
request={async (params) => request={async (params) =>
await reserveList(params).then((res) => { await reserveList(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -238,14 +259,14 @@ const Index: React.FC<{}> = () => {
}); });
}) })
} }
pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数 pagination={{ defaultPageSize: 10, showSizeChanger: false }} //默认显示条数
toolBarRender={false} toolBarRender={false}
/> />
</TabPane> </TabPane>
</Tabs> </Tabs>
</> </>
) );
} };
export default Index export default Index

View File

@ -7,10 +7,18 @@ export async function reserveList(data: any) { // 查询会议室/评标室预
}); });
} }
export async function roomList(data: any) { // 查询评标室列表 export async function roomList() { // 查询评标室列表
///api/biz-service-ebtp-evaluation ///api/biz-service-ebtp-evaluation
return request('http://localhost:18017/v1/elec/eval/room/list', { return request('/v1/elec/eval/room/list', {
method: 'get',
params: {}
});
}
export async function cancelReserve(id: any) { // 取消预约
///api/biz-service-ebtp-evaluation
return request('/v1/eval/room/reserve/cancel'+`${id}`, {
method: 'get', method: 'get',
params: data
}); });
} }