评标现场管理

This commit is contained in:
zhangyx
2022-09-01 09:22:51 +08:00
parent a050770b9b
commit 1c2c6a0d8d
7 changed files with 340 additions and 7 deletions

View File

@ -301,15 +301,20 @@ export default [
},
],
},
{//评标现管理
name: 'SitePerson',
icon: 'UnorderedListOutlined',
path: '/SitePerson',
{//评标现管理
name: 'EvalSiteManage',
icon: 'form',
path: '/EvalSiteManage',
routes: [
{//评标现管理->评标场所人员维护
{//评标现管理->评标场所人员维护
name: 'SitePerson',
path: '/SitePerson',
component: './SitePerson'
path: '/EvalSiteManage/SitePerson',
component: './EvalSiteManage/SitePerson'
},
{//评标现场管理->人员报道情况查询
name: 'PersonReport',
path: '/EvalSiteManage/PersonReport',
component: './EvalSiteManage/PersonReport'
},
],
},

View File

@ -0,0 +1,123 @@
import React, { useEffect, useState } from 'react';
import { Form, Input, Modal, Spin, Button, Radio, RadioChangeEvent } from 'antd';
interface PersonReportModalProps {
title: any;
modalVisible: boolean;
values: any;
onCancel: () => void;
}
const layout = {
labelCol: { span: 7 },
wrapperCol: { span: 12 },
};
const PersonReportModal: React.FC<PersonReportModalProps> = (props) => {
const [form] = Form.useForm();
// const weboffice = useRef<Weboffice>(null);
const { title, modalVisible, values, onCancel, } = props;
//loading
const [loading, setLoading] = useState<boolean>(false);
const [value, setValue] = useState<string>("1");
const onChange = (e: RadioChangeEvent) => {
console.log('radio checked', e.target.value);
setValue(e.target.value);
};
useEffect(() => {
if (JSON.stringify(values) !== "{}") {
form.setFieldsValue({
"id": values.id,
"evalPlaceId": {label: values.eroomName,value: values.evalPlaceId},
"facePic": values.facePic,
"sex": values.sex,
"personName": values.personName,
"identityCard": values.identityCard
});
}
}, [values])
const renderFooter = () => {
return (
<>
<Button onClick={onCancel}></Button>
</>
);
}
return (
<Modal
destroyOnClose={true}
title={title}
visible={modalVisible}
onCancel={() => onCancel()}
width={"60%"}
centered
footer={renderFooter()}
>
<Spin spinning={loading}>
<Form
{...layout}
name="nest-messages"
form={form}
preserve={false}
>
<Form.Item name="id" label="id" hidden>
<Input hidden />
</Form.Item>
<Form.Item
label="人员姓名"
name="personName"
rules={[
{
required: true,
message: '当前项不可为空',
},
]}
>
<Input />
</Form.Item>
<Form.Item
label="身份证号"
name="identityCard"
rules={[
{
required: true,
message: '当前项不可为空',
},
{
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
message: '输入的身份证号不正确',
},
]}
>
<Input />
</Form.Item>
<Form.Item
label="性别"
name="sex"
rules={[
{
required: true,
message: '当前项不可为空',
},
]}
>
{/* 1-男性2-女性 */}
<Radio.Group onChange={onChange} value={value}>
<Radio value="1"></Radio>
<Radio value="2"> </Radio>
</Radio.Group>
</Form.Item>
</Form>
</Spin>
</Modal>
);
};
export default PersonReportModal;

View File

@ -0,0 +1,165 @@
import React, { useEffect, useRef, useState } from 'react';
import ProTable, { ActionType } from '@ant-design/pro-table';
import { getList } from './service';
import { Button, Card, Form, message, Spin } from 'antd';
import PersonReportModal from './components/PersonReportModal';
const PersonReport: React.FC<{}> = () => {
const checkRelationRef = useRef<ActionType>(); //操作数据后刷新列表
const [isEditModalVisible, setIsEditModalVisible] = useState<boolean>(false) //控制新增或编辑模态框是否显示
// const [editForm] = Form.useForm();//编辑模块form
//单条数据
const [editForm, setEditForm] = useState<any>({});
const [spinning, setSping] = useState<boolean>(false);//加载遮罩
const columns: any = [
{
title: '序号',
valueType: 'index',
width: 80,
search: false,
},
{
title: '项目名称',
dataIndex: 'projectName',
},
{
title: '项目编号',
dataIndex: 'projectNum',
search: false,
},
{
title: '标段名称',
dataIndex: 'packageNames',
search: false,
},
{
title: '评审室名称',
dataIndex: 'areaName',
search: false,
},
{
title: '评审室状态',
dataIndex: 'status',
valueEnum: {
0: { text: '未开启' },
1: { text: '进行中' },
2: { text: '已结束' },
3: { text: '已取消' },
4: { text: '结束未使用' },
},
},
{
title: '预约开始时间',
dataIndex: 'reserveStartDate',
valueType: 'dateTime',
search: false,
},
{
title: '预约结束时间',
dataIndex: 'reserveEndDate',
valueType: 'dateTime',
search: false,
},
{
title: '报道状态',
dataIndex: 'reportStatus',
search: false,
// render: (text: any, record: any) => {
// return (
// <>
// </>
// )
// }
},
{
title: '操作',
search: false,
render: (text: any, record: any) => {
return (
<>
<a onClick={() => setFormVals(record)}></a>
</>
)
}
},
]
// 编辑页面赋值
const setFormVals = (item: any) => {
setEditForm(item);
setIsEditModalVisible(true)
setSping(false);
}
useEffect(() => {
}, [])
return (
<>
<Spin spinning={spinning}>
<Card title="评标场所人员管理">
<ProTable
actionRef={checkRelationRef}
columns={columns}
options={false}
size='small'
search={{
labelWidth: 100,
// defaultCollapsed: false,//是否展开搜索条件
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
],
}}
request={(params) => {
let trueParams = {
...params,
pageNo: params.current,
}
return new Promise<any>((resolve, reject) => {
getList(trueParams).then(res => {
if (res.code === 200) {
resolve({
data: res.data.records,
success: res.success,
total: res.data.total,
})
} else {
resolve({
data: [],
success: false,
total: 0,
})
}
})
});
}}
pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数
/>
</Card>
{/* 新增及编辑银行账号Modal */}
{
isEditModalVisible ?
<PersonReportModal
title={"人员信息"}
modalVisible={isEditModalVisible}
values={editForm}
onCancel={() => {
setIsEditModalVisible(!isEditModalVisible);
setEditForm({});
}}
></PersonReportModal>
: null
}
</Spin>
</>
);
}
export default PersonReport;

View File

@ -0,0 +1,40 @@
import request from '@/utils/request';
/**
* 查询数据并分页
* @param params
*/
export async function getList(params?: any) {
return request('/api/biz-service-ebtp-evaluation/v1/eleceval/reserve/report/list', {
method: 'post',
data: params,
});
}
export async function getPlaceList() { // 列表
return request('/api/biz-service-ebtp-evaluation/v1/elec/eval/place/userlimit/list', {
method: 'get',
});
}
/**
* 新增
* @param params
*/
export async function saveSitePerson(data?: any) {
return request('/api/biz-service-ebtp-evaluation/v1/eval/room/site/person/save', {
method: 'post',
data: data
});
}
/**
* 删除
* @param params
*/
export async function delSitePerson(id?: any) {
return request('/api/biz-service-ebtp-evaluation/v1/eval/room/site/person/delete?id='+id, {
method: 'post',
});
}