import React, { Component } from 'react';
import { connect } from 'dva';
import {
Input,
Button,
Table,
Select,
Alert,
DatePicker,
notification,
Modal
} from 'antd';
import moment from "moment";
import { withRouter } from 'dva/router';
import PTable from '../../../../components/Pro/PTable';
import DownloadXls from '../../../../components/DownloadXls'
import { getCommitBayzgzSbList, systemComDepartGetTreeDepart, revokeBayzgzSbApply } from '../../../../services/api';
import SubDrawer from './SubDrawer';
const { Option } = Select;
const { RangePicker } = DatePicker;
const dateFormat = "YYYY-MM-DD";
@connect(state => ({
global: state.global
}))
@withRouter
export default class Submitted extends Component {
constructor(props, context) {
super(props, context);
this.state = {
forceUpdate: false, //刷新数据
name: '', //姓名
mobilePhone: '',//手机号
idCardNo: '',//身份证
approvalStatus: '',//审核状态
examResult: '',//考试结果
startDate: '',//开始日期
endDate: '',//结束日期
payStatus: '', //缴费状态
// 搜索部分
searchData: { // 表格数据请求参数
name: '', //姓名
mobilePhone: '',//手机号
idCardNo: '',//身份证
approvalStatus: '',//审核状态
examResult: '',//考试结果
payStatus: '',//缴费状态
startDate: '',//开始日期
endDate: '',//结束日期
pageNumber: 1, // 页
pageSize: 10 //条目
},
// keyWord: '', //关键字
// departId: '', //部门id
// treeData: [ // 部门数据
// //树
// { title: '', key: '' }
// ],
approvaltList: [{ label: '全部', value: '' },
// { label: '未提交', value: '001' },
{ label: '待审批', value: '002' }, { label: '审批通过', value: '003' }, { label: '审批不通过', value: '004' }, { label: '审批中', value: '005' }],
examList: [{ label: '全部', value: '' }, { label: '考试不通过', value: '0' }, { label: '考试通过', value: '1' }, { label: '未考试', value: '2' }],
// 表格部分
tableList: [], // 表格数据
pagination: { //分页数据
total: 1,
current: 1,
pageSize: 10,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: ['10', '50', '100', '500'],
},
//抽屉
drawerVisble: false,
bayzgzSbId: null,
currentPtableData: [],//当前表格显示的人员信息
};
}
componentDidMount() {
}
_renderCancel(record) {
const _this = this;
//payStatus 0 未缴费 1已缴费
//approvalStatus 未提交001 待审批002 审批通过 003 审批不通过004 审批中005
// backgroundScreenStatus 未筛查001 筛查通过003 筛选不通过004 未审查''
const { payStatus, bayzgzSbId, approvalStatus, backgroundScreenStatus } = record;
if (payStatus == '0' && (approvalStatus == '002' || approvalStatus == '005') && backgroundScreenStatus == '003') {
return (
{
// const _this = this;
Modal.confirm({
title: '确定撤销?',
okText: '确定',
cancelText: '取消',
maskClosable: true,
// content: 确定撤销?
,
onOk() {
revokeBayzgzSbApply({ bayzgzSbIds: bayzgzSbId, revokeReason: '报名方撤销申报' }).then(res => {
const { failList } = res.data;
if (failList.length > 0) {
notification.error({
message: failList[0].message
});
} else {
_this.setState({
forceUpdate: true
}, () => {
_this.setState({
forceUpdate: false
});
});
notification.success({
message: '操作成功'
});
}
});
},
onCancel() { }
});
}}
>撤销
);
}
return '';
}
// 表格渲染
renderOrderList = () => {
const columns = [
{
title: '姓名',
dataIndex: 'name',
key: 'name'
},
{
title: '手机号码',
dataIndex: 'mobilePhone',
key: 'mobilePhone',
render: text => text.replace(/(\d{3})\d{4}(\d{4})/,'$1****$2')
},
{
title: '身份证号',
dataIndex: 'idCardNo',
key: 'idCardNo',
render: text => text.replace(/(\d{4}).*(\d{3})/,'$1***********$2')
},
{
title: '报名时间',
dataIndex: 'submitTime',
key: 'submitTime'
},
{
title: '背景筛查',
dataIndex: 'backgroundScreenStatus',
key: 'backgroundScreenStatus',
render: (text, record) => {
return {text === '001' ? '未筛查' : text === '003' ? '筛查通过' : text === '004' ? '筛选不通过' : '未审查'};
}
},
{
title: '审批状态',
dataIndex: 'approvalStatus',
key: 'approvalStatus',
render: (text, record) => {
return {text === '001' ? '未提交' : text === '002' ? '待审批' : text === '003' ? '审批通过' : text === '004' ? '审批不通过' : text === '005' ? '审批中' : text};
}
},
{
title: '缴费状态',
dataIndex: 'payStatus',
key: 'payStatus',
render: (text, record) => {
return {text === '0' ? '未缴费' : text === '1' ? '已缴费' : '未缴费'};
}
},
{
title: '考试安排',
dataIndex: 'isArrangeExam',
key: 'isArrangeExam',
render: (text, record) => {
return {text === '0' ? '未安排考试' : text === '1' ? '已安排考试' : '未安排'};
}
},
{
title: '考试结果',
dataIndex: 'examResult',
key: 'examResult',
render: (text, record) => {
let color = '';
let txt = '-';
if(text === '0') {
color = 'red';
txt = '考试不通过';
}else if(text === '1') {
color = 'green';
txt = '考试通过';
}else if(text === '2') {
color = '#999';
txt = '未考试';
}
return {txt};
}
},
{
title: '理论成绩',
dataIndex: 'writtenScore',
key: 'writtenScore',
render: (text, record) => {
return {text ? text : '-'};
}
},
{
title: '实操成绩',
dataIndex: 'operateScore',
key: 'operateScore'
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
render: (text, record) => (
{
console.log(record)
// this.setState({
// drawerVisble: true
// });
// this.props.history.push('/PoliceDeclare/sign-up/fill-in');
this.setState({
drawerVisble: true,
bayzgzSbId: record.bayzgzSbId
});
}}
>
查看
{this._renderCancel(record)}
{/* {(() => {
const _this = this;
//payStatus 0 未缴费 1已缴费
//approvalStatus 未提交001 待审批002 审批通过 003 审批不通过004 审批中005
// backgroundScreenStatus 未筛查001 筛查通过003 筛选不通过004 未审查''
const { payStatus, bayzgzSbId, approvalStatus, backgroundScreenStatus } = record;
if (payStatus == '0' && (approvalStatus == '002' || approvalStatus == '005') && backgroundScreenStatus == '003') {
return (
{
// const _this = this;
Modal.confirm({
title: '确定撤销?',
okText: '确定',
cancelText: '取消',
maskClosable: true,
// content: 确定撤销?
,
onOk() {
revokeBayzgzSbApply({ bayzgzSbIds: bayzgzSbId, revokeReason: '报名方撤销申报' }).then(res => {
const { failList } = res.data;
if (failList.length > 0) {
notification.error({
message: failList[0].message
});
} else {
_this.setState({
forceUpdate: true
}, () => {
_this.setState({
forceUpdate: false
});
});
notification.success({
message: '操作成功'
});
}
});
},
onCancel() { }
});
}}
>撤销
);
}
return '';
})()} */}
)
}
];
return (
{ this.setState({ currentPtableData: e.data }) }}
/>
);
};
render() {
const { approvalStatus, examResult, startDate, endDate, name, mobilePhone, idCardNo, payStatus } = this.state.searchData;
return (
人员若存在待提交/待审批/审批中/审批通过的报名记录,则无法再重新报名;审核不通过的需要重新提交报名申报。
}
type="warning"
showIcon
style={{ marginBottom: '15px' }}
/>
0}
url='/public/bayzgz-sb/export-committed-bayzgz-sb-info'
searchData={{
approvalStatus,
examResult,
payStatus,
startDate,
endDate,
name,
mobilePhone,
idCardNo
}}
fileName={`[` + this.props.global.companyInfo.comName + `]_报名数据_[` + moment().format('YYYY-MM-DD HH:mm:ss') + `].xls`}>
{this.renderOrderList()}
{/* 修改弹窗 */}
{
this.setState({
drawerVisble: false,
bayzgzSbId: null
});
}}
/>
);
}
}