import { Button, Descriptions, Modal, Badge, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; import React from 'react'; import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, ShowDateTime, ShowPrintClose, 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 SE071ShowPrint extends React.Component { constructor(props) { super(props); this.state = { data: null, btndisplay: 'none', isCheck: false, //是否待办 审批 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') } onClickApprove = (appVisible) => { const newtmpData = { data: { id: this.props.data.id, isShow: true, key: guid(), param: this.props.data.param, appVisible: appVisible, BtnAgreeDisplay: 'none' }, formCode: 'PF123', } this.setState({ tmpData: newtmpData, }); } loadData = (id) => { var isCheck = (this.props.data.tableKey != undefined && this.props.data.tableKey == '1') ? true : false 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_Files.Nav_ImgFile.Nav_File') extendInclude(json, 'Nav_ListPlanDetail.Nav_Department') extendInclude(json, 'Nav_ListPlanDetail.Nav_ListDetailDepartment.Nav_Department') extendInclude(json, 'Nav_ListPlanDetail.Nav_TrainTypeEnum') this.props.dispatch({ type: 'app/getDataByPost', payload: json, url: 'SE/SETrainPlan/GetSuit', onComplete: (ret) => { if (ret) { this.setState({ data: ret, }) } } }); } 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.YEAR} {data.LAUNCH_TIME} {data.Nav_Department.NAME} {data.Nav_User?.NAME} {data.PLAN_NAME} {showFiles(data.Nav_Files, config.picServerHost, this)} { data.TYPE == 5 ? {data.GUIDE_PRINCIPLE} : null } { data.TYPE == 5 ? {data.TRAIN_REQUIREMENT} : null }
: null } { (data?.Nav_ListPlanDetail && data?.Nav_ListPlanDetail.length > 0) ? {/* */} { data.TYPE != 5 ? : null } {data?.Nav_ListPlanDetail?.map((item, i) => { return { data.TYPE != 5 ? : null } })}
年度培训计划详情
月份 培训性质 培训类型 培训名称 培训对象 培训形式 考核方式 培训学时 培训组织培训老师被培训组织
{item.MONTH} {enums.TrainInOut.enums[item.IN_OUT]} {item.Nav_TrainTypeEnum.NAME} {item.NAME} {item.OBJECT} {enums.TrainType.enums[item.TRAINTYPE]} {enums.PlanCheckType.enums[item.CHECKTYPE]} {item.CLASSHOUR} {item.Nav_Department.NAME} {item.Nav_ListDetailDepartment?.map((itemtype, j) => { return (j > 0 ? ',' : '') + itemtype.Nav_Department.NAME })}
: null }
{ GetFileModel(Modal, FormPage, this, this.state.fileForm.visible) }
} } export default connect(({ login, app }) => ({ login, app }))(SE071ShowPrint)