import { Button, Descriptions, Modal, Popconfirm, Row, Col, Form, Input, Select, Table, Icon } from 'antd'; import React from 'react'; import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, GetFileModel, showFiles } from '../../../utils/common'; import ReactToPrint from 'react-to-print'; import { ExportToExcel } from '@woowalker/feui' import XLSX from 'xlsx'; import { connect } from 'dva'; import moment from 'moment'; import { message } from 'antd/lib/index'; import styles from '../../../components/CustomPages/HI/StepForm.css'; import config from '../../../config.js'; import FormPage from '../../FormPage' class SE061ShowPrint extends React.Component { constructor(props) { super(props); this.state = { data: null, btndisplay: 'none', isCheck: false, //是否待办 审批 //弹窗参数 detailForm: { isShow: false, formCode: "SE061_PAPERPAGE", title: "三级安全教育记录", ID: '' }, isShow1: "none", isShow2: "none", fileData: [], fileForm: { title: "", visible: false, }, } } componentDidMount() { if (this.props.data?.id) this.loadData(this.props.data?.id); } componentWillReceiveProps(NextProps) { if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { this.loadData(NextProps.data?.id); } } onTableBtnExport() { let TableWrap = document.getElementById('table1'); let Table = TableWrap.getElementsByTagName('table1')[0]; const wb = XLSX.utils.table_to_book(Table); XLSX.writeFile(wb, this.props.record.Nav_Department.NAME + '.xlsx') } returnModel(level) { let str = ''; if (level == undefined) { return str; } if (level.indexOf('1') >= 0) { str += '讲授法 '; } if (level.indexOf('2') >= 0) { str += '视听法 '; } if (level.indexOf('3') >= 0) { str += '研讨法 '; } if (level.indexOf('4') >= 0) { str += '演示法 '; } return str; } //显示详情弹窗 showDetailModal = (ID) => { const newtmpData = { data: { id: ID, }, formCode: "SE061_PAPERPAGE", }; this.setState({ tmpData: newtmpData }, () => { var detailForm = { isShow: true, title: "查看成绩单", }; this.setState({ detailForm: detailForm, }); }); }; //详情弹窗关闭(隐藏) detailFormClose = () => { var detailForm = { isShow: false, }; this.setState({ detailForm: detailForm, }); }; loadData = (id) => { var orgId = this.props.login ? this.props.login.OrgId : ''; let json = initFilter(orgId); extendRule(json, 'ID', 1, id); extendInclude(json, 'Nav_Department') extendInclude(json, 'Nav_User') extendInclude(json, 'Nav_Content') extendInclude(json, 'Nav_Files.Nav_ImgFile') extendInclude(json, 'Nav_NewUserDetail.Nav_User') extendInclude(json, 'Nav_NewUserDetail.Nav_Department') extendInclude(json, 'Nav_NewUserDetail.Nav_Post') extendInclude(json, 'Nav_NewUserDetail.Nav_Files.Nav_ImgFile') this.props.dispatch({ type: 'app/getDataByPost', payload: json, url: 'SE/NewUsers/Get', onComplete: (ret) => { if (ret) { this.setState({ data: ret, }) if (ret.IS_CREATETEST) { this.state.isShow1 = "table-cell"; } else { this.state.isShow2 = "table-cell"; } } } }); } render() { const { data } = this.state; const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; return
} content={() => this.componentRef} />
(this.componentRef = el)} style={{ padding: '20px', paddingTop: '20px' }} id={'tableId' + this.props.data.id}>

三级安全教育记录

{ data ?
{data.Nav_Department.NAME} {data.Nav_User.NAME} {enums.SEThreeLevelSafeTrainType.enums[data.TRAIN_STATUS]} {data.START_TIME} {data.END_TIME} {data.TRAINNING_TIME} {data.TAINNING_ADDR} {data.TEACHER} {data ? this.returnModel(data.TRAIN_MODEL) : null} {data.Nav_Content.NAME} {showFiles(data.Nav_Files, config.picServerHost, this)} {data.IS_CREATETEST ? "是" : "否"}
: null } { (data?.Nav_NewUserDetail && data?.Nav_NewUserDetail.length > 0) ? {data?.Nav_NewUserDetail?.map((item, i) => { return })}
三级安全教育详细
工号 姓名 身份证号 入职时间 分数 部门 岗位 考核结果 查看试卷 附件
{item.CODE} {item.Nav_User?.NAME} {item.ID_CARD_NUMBER} {moment(item.IN_TIME).format('YYYY-MM-DD')} {item.SCORE} {item.Nav_Department?.NAME} {item.Nav_Post?.NAME} {enums.SEExaminationResultsEnum.enums[item.EXAMINATION_RESULTS]}
this.showDetailModal(item.ID)}>
{showFiles(item.Nav_Files, config.picServerHost, this)}
: null }

{ GetFileModel(Modal, FormPage, this, this.state.fileForm.visible) }
} } export default connect(({ login, app }) => ({ login, app }))(SE061ShowPrint)