在线监督和事后监督,查看详情,增加签到状态和签到时间

This commit is contained in:
袁帅
2022-09-08 09:36:35 +08:00
parent 5710e80cde
commit 744978b25f
2 changed files with 81 additions and 58 deletions

View File

@ -1,27 +1,28 @@
import { Spin, Modal, Descriptions, Table, message } from 'antd';
import type { ColumnsType } from 'antd/es/table';
import { Spin, Modal, Descriptions, message } from 'antd';
// import type { ColumnsType } from 'antd/es/table';
import React, { useState, useImperativeHandle, forwardRef } from 'react';
import { getReservationInfo, getReportInfo } from './service';
import ProTable from '@ant-design/pro-table';
interface ViewDetailsProps {
modalVisible: boolean; //开启关闭控制
onCancel: () => void; //关闭方法传入
}
interface ReportInfo {
expertAmount ?: string;
purchaseExpertAmount ?: string;
manageAmount ?: string;
userList ?: DataType[];
}
// interface ReportInfo {
// expertAmount ?: string;
// purchaseExpertAmount ?: string;
// manageAmount ?: string;
// userList ?: DataType[];
// }
interface DataType {
key ?: string;
userName ?: string;
status: number;
reportStatus ?: string;
signDate ?: string;
}
// interface DataType {
// key ?: string;
// userName ?: string;
// status: number;
// reportStatus ?: string;
// signDate ?: string;
// }
interface ReservationInfo {
projectName ?: string;
@ -35,27 +36,49 @@ interface ReservationInfo {
realEndDate ?: string;
}
const columns: ColumnsType<DataType> = [
const columns: any = [
{
title: '序号',
dataIndex: 'key',
key: 'key',
},
{
title: '人员',
dataIndex: 'userName',
key: 'userName',
},
{
title: '报到状态',
dataIndex: 'reportStatus',
key: 'reportStatus',
},
{
title: '报到时间',
dataIndex: 'signDate',
key: 'signDate',
},
valueType: 'index',
width: 80,
hideInSearch: true,
},
{
title: '人员',
dataIndex: 'userName',
hideInSearch: true,
},
{
title: '报道状态',
dataIndex: 'status',
hideInSearch: true,
valueEnum: {
0: { text: '未报道' },
1: { text: '已报道' },
},
},
{
title: '报道时间',
dataIndex: 'signDate',
valueType: 'dateTime',
hideInSearch: true,
},
{
title: '签到状态',
dataIndex: 'loginStatus',
hideInSearch: true,
valueEnum: {
1: { text: '未签到' },
2: { text: '已签到' },
3: { text: '已申请回避' },
},
},
{
title: '签到时间',
dataIndex: 'loginDate',
valueType: 'dateTime',
hideInSearch: true,
},
];
/**
@ -67,7 +90,7 @@ const columns: ColumnsType<DataType> = [
const [initReservationInfo, setInitReservationInfo] = useState<boolean>(false);
const [initReportInfo, setInitReportInfo] = useState<boolean>(false);
const [reservationInfo, setReservationInfo] = useState<ReservationInfo>();
const [reportInfo, setReportInfo] = useState<ReportInfo>();
const [reportInfo, setReportInfo] = useState<any>({});
const InitData = (id:string) => {
setInitReservationInfo(true);
setInitReportInfo(true);
@ -88,19 +111,13 @@ const columns: ColumnsType<DataType> = [
});
//获取报道信息
getReportInfo(id)
.then((res) => {
.then(res => {
if (res.code == 200) {
let _data: DataType[] = res.data.userList;
_data?.forEach((item, index) =>{
item.key = (index + 1).toString();
item.reportStatus = getReportStatus(item.status);
})
setReportInfo(res.data);
}else{
} else {
message.error(res.message);
}
})
.catch(res => {
}).catch(res => {
message.error(res.message);
})
.finally(() => {
@ -134,18 +151,18 @@ const columns: ColumnsType<DataType> = [
}
return result;
}
const getReportStatus = (state:number) => {
let result = '';
switch(state){
case 0:
result = '未报道';
break;
case 1:
result = '已报道';
break;
}
return result;
}
// const getReportStatus = (state:number) => {
// let result = '';
// switch(state){
// case 0:
// result = '未报道';
// break;
// case 1:
// result = '已报道';
// break;
// }
// return result;
// }
return (<Modal
destroyOnClose = {true}
visible = {modalVisible}
@ -173,7 +190,13 @@ const columns: ColumnsType<DataType> = [
<Descriptions.Item label="招标代理机构">{reportInfo?.manageAmount}</Descriptions.Item>
</Descriptions>
<h3></h3>
<Table columns={columns} dataSource={reportInfo?.userList} />
<ProTable
options={false}
size='small'
search={false}
pagination={false}
columns={columns}
dataSource={reportInfo?.userList} />
</Spin>
</Modal>)
})

View File

@ -25,7 +25,7 @@ export async function getPage(params?: any) {
* @param params
*/
export async function getReportInfo(params?: string) {
return request('/api/biz-service-ebtp-evaluation/v1/eleceval/user/number/report/' + params, {
return request('/api/biz-service-ebtp-evaluation/v1/eleceval/expert/number/report/' + params, {
method: 'GET'
});
}