10.25 增加预约人员会议室预约页面,原有预约管理增加操作项控制
This commit is contained in:
@ -6,6 +6,7 @@ import { useRef } from 'react';
|
||||
import MeetingReservation from '@/components/ElecBidEvaluation/MeetingReservation';
|
||||
import { getRecordData, getSiteList } from './service';
|
||||
import { isEmpty } from '@/utils/CommonUtils';
|
||||
import { getSessionRoleData } from '@/utils/session';
|
||||
|
||||
const orange_bg = { background: '#ffbc83', color: '#333333', cursor: 'pointer', width: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' };
|
||||
const light_orange_bg = { background: '#faf7e5' };
|
||||
@ -14,6 +15,7 @@ const tag_size = { height: '20px', width: '20px' };
|
||||
const panel_title = { fontWeight: 500 };
|
||||
const panel_sub_title = { ...panel_title, color: '#999999' };
|
||||
const { Panel } = Collapse;
|
||||
const roleCode = getSessionRoleData()?.roleCode;//获取角色
|
||||
|
||||
const ScreenTable = (props: { record: any, onCellClick: (id: any) => void, refresh: number }) => {
|
||||
const { record, onCellClick, refresh } = props;
|
||||
@ -43,7 +45,7 @@ const ScreenTable = (props: { record: any, onCellClick: (id: any) => void, refre
|
||||
onCell: (record) => {
|
||||
return {
|
||||
style: record[ite.id]?.iskssj ? orange_bg : light_orange_bg,
|
||||
onClick: record[ite.id]?.iskssj ? () => onCellClick(record[ite.id]?.id) : void 0,
|
||||
onClick: record[ite.id]?.iskssj ? () => onCellClick(record[ite.id]) : void 0,
|
||||
}
|
||||
},
|
||||
render: (_: any, record: any) => {
|
||||
@ -93,8 +95,8 @@ const ScreenTable = (props: { record: any, onCellClick: (id: any) => void, refre
|
||||
</Button>
|
||||
</Space>
|
||||
<Space size="middle">
|
||||
<div style={align_middle}><Tag color="#faf7e5" style={tag_size}></Tag>可预约电子评标室</div>
|
||||
<div style={align_middle}><Tag color="#ffbc83" style={tag_size}></Tag>已预约电子评标室</div>
|
||||
<div style={align_middle}><Tag color="#faf7e5" style={tag_size}></Tag>可预约{roleCode == "ebtp-appointment" ? "会议室" : "电子评标室"}</div>
|
||||
<div style={align_middle}><Tag color="#ffbc83" style={tag_size}></Tag>已预约{roleCode == "ebtp-appointment" ? "会议室" : "电子评标室"}</div>
|
||||
</Space>
|
||||
</div>
|
||||
)}
|
||||
@ -124,8 +126,8 @@ export default () => {
|
||||
const [expandedRowKeys, setExpandedRowKeys] = useState<any[]>([]);
|
||||
//预约状态
|
||||
const [meetStatus, setMeetStatus] = useState<string>("2");
|
||||
//预约id
|
||||
const [meetId, setMeetId] = useState<string>("");
|
||||
//单条预约数据
|
||||
const [meetData, setMeetData] = useState<any>({});
|
||||
//刷新参数
|
||||
const [refresh, setRefresh] = useState<number>(0);
|
||||
|
||||
@ -144,34 +146,44 @@ export default () => {
|
||||
//新建预约
|
||||
const createMeet = () => {
|
||||
setMeetStatus("0");
|
||||
setMeetId("");
|
||||
setMeetData({});
|
||||
setModalVisible(true);
|
||||
}
|
||||
//查看预约
|
||||
const viewMeet = (id: any) => {
|
||||
const viewMeet = (record: any) => {
|
||||
setMeetStatus("2");
|
||||
setMeetId(id);
|
||||
setMeetData(record);
|
||||
setModalVisible(true);
|
||||
}
|
||||
//查看预约详情跳转
|
||||
const viewMeetContent = () => {
|
||||
window.open("/ElecEvaluation/ElecEvalReserve");
|
||||
}
|
||||
//预约人员-我的预约跳转
|
||||
const MyReserveContent = () => {
|
||||
window.open("/ElecEvaluation/MyReserve");
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getSiteListData("0");
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Card title="评标室预约情况" bodyStyle={{ padding: '16px 0px', height: window.innerHeight - 120, overflowY: 'auto' }}>
|
||||
<Card title={roleCode == "ebtp-appointment" ? "会议室预约情况" : "评标室预约情况"} bodyStyle={{ padding: '16px 0px', height: window.innerHeight - 120, overflowY: 'auto' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '0 36px 16px' }}>
|
||||
<Space>
|
||||
<Button key="yuyue" type="primary" onClick={() => createMeet()}>
|
||||
预约
|
||||
</Button>
|
||||
<Button key="yuyueconfirm" onClick={() => viewMeetContent()}>
|
||||
查看预约详情
|
||||
</Button>
|
||||
{roleCode == "ebtp-appointment" ? (//预约人员
|
||||
<Button key="myyuyue" onClick={() => MyReserveContent()}>
|
||||
我的预约
|
||||
</Button>
|
||||
) : (
|
||||
<Button key="yuyueconfirm" onClick={() => viewMeetContent()}>
|
||||
查看预约详情
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
</div>
|
||||
<Collapse activeKey={expandedRowKeys} onChange={(value) => setExpandedRowKeys(value as any[])} className="screen-reserve-collapse" style={{ margin: '0 36px' }}>
|
||||
@ -192,7 +204,7 @@ export default () => {
|
||||
</Panel>
|
||||
))}
|
||||
</Collapse>
|
||||
{modalVisible && <MeetingReservation modalVisible={modalVisible} onCancel={() => { setModalVisible(false); getSiteListData("1") }} roomList={siteListData} status={meetStatus} meetId={meetId} onSubmit={() => { setModalVisible(false); setRefresh(refresh => refresh + 1) }} />}
|
||||
{modalVisible && <MeetingReservation modalVisible={modalVisible} onCancel={() => { setModalVisible(false); getSiteListData("1") }} roomList={siteListData} status={meetStatus} meetData={meetData} onSubmit={() => { setModalVisible(false); setRefresh(refresh => refresh + 1) }} />}
|
||||
</Card >
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user