import { message } from "antd/lib/index"; import { Button, Popconfirm, Row, Col, Form, Input, Select, Table, Modal} from 'antd'; import React from 'react'; import { initFilter, extendRule, extendInclude, showFiles, GetFileModel } from "../../../utils/common"; import ReactToPrint from "react-to-print"; import styles from '../HI/StepForm.css'; import config from "../../../config"; import XLSX from 'xlsx'; import { connect } from 'dva'; import FormPage from '../../../components/FormPage' class FO003ShowPrintJD extends React.Component { constructor(props) { super(props); this.state = { data: null, enumData: null, BtnAgreeDisplay: 'none', isFinished: 'none', isMobile: false, fileForm: { title: "", visible: false, }, }; }; componentDidMount() { if (window.navigator.userAgent.indexOf("Windows") < 1) { this.setState({ isMobile: true }) } 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); } } onTableBtnAgree() { this.props.dispatch({ type: 'app/getDataByPost', url: 'FO/FOPreShiftMeetingRecord/PersonalAgree', payload: { ID: this.props.data.id, TaskID: this.props.data.TaskID, IgnoreDataRule: true }, onComplete: (ret) => { if (ret) { message.success('签到成功!'); this.setState({ BtnAgreeDisplay: 'none' }) this.BtnClose(); } } }) } BtnClose = () => { if (typeof this.props.data.onCancel != "undefined" && typeof this.props.data.onCancel == 'function') this.props.data.onCancel(); } loadData = (dataId) => { let json = initFilter(this.props.login.OrgId); extendRule(json, 'ID', 1, dataId); extendInclude(json, 'Nav_Team'); extendInclude(json, 'Nav_Class'); extendInclude(json, 'Nav_User'); extendInclude(json, 'Nav_Monitor'); extendInclude(json, 'Nav_Record'); extendInclude(json, 'Nav_Users.Nav_User'); extendInclude(json, 'Nav_Files.Nav_ImgFile.Nav_File'); extendInclude(json, 'Nav_Details.Nav_DetailPosts.Nav_Post'); this.props.dispatch({ type: 'app/getDataByPost', payload: json, url: 'FO/PreShiftMeetingRecord/Get', onComplete: (ret) => { if (ret) { this.setState({ data: ret }) if (this.props.data.tableKey == "2" || this.props.data.tableKey == undefined) { this.setState({ BtnAgreeDisplay: 'none' }) } else { this.setState({ BtnAgreeDisplay: 'inline' }) } //归档才显示打印和导出按钮 if (ret.PRE_MEETING_STATUS == 5) { this.setState({ isFinished: 'inline' }) } } else { message.error('数据加载获取失败,请联系管理员排查!'); } } }); } onTableBtnExport() { let TableWrap = document.getElementById('tableId' + this.props.data.id); let Table = TableWrap.getElementsByTagName('table')[0]; const wb = XLSX.utils.table_to_book(Table); XLSX.writeFile(wb, this.state.data.Nav_Team.NAME + ".xlsx") } render() { const { data, isMobile } = this.state; return
} content={() => this.componentRef} pageStyle=".printDIV { padding:0 40px;} img{width :120px}" />
{/* 班前会议记录表 */}
(this.componentRef = el)} id={'tableId' + this.props.data.id} style={{ padding: isMobile ? '0px 0px 20px 0px' : '20px' }} className="printDIV">

班前会议记录表

{ data ?
班组 {data.Nav_Team ? data.Nav_Team.NAME : ''} 班长 {data.Nav_Monitor ? data.Nav_Monitor.NAME : ''} 会议时间 {data.MEETING_TIME.substring(0, 10)} 班次 {data.Nav_Class ? data.Nav_Class.NAME : ''} 地点 {data.LOCATION} 主持人 {data.Nav_User ? data.Nav_User.NAME : ''} 记录人 {data.Nav_Record ? data.Nav_Record.NAME : ''}
参会人员 { data.Nav_Users && data.Nav_Users.map((item, i) => { if (i == (data.Nav_Users.length - 1)) { if (item.DEAL_STATUS == 0) return else return item.Nav_User.NAME } else { if (item.DEAL_STATUS == 0) return else return item.Nav_User.NAME + ' ' } }) }
应出勤人数 {data.SHOULD_QTY} 实际出勤人数 {data.ACTUAL_QTY} 迟到人数 {data.LATE_QTY} 请假人数 {data.LEAVE_QTY} 异常原因 {data.ABNORMAL_CAUSE}
问候语 {data.GREETING}
班组口号 {data.SLOGAN}
欢迎新同事 {data.WELCOME}
附件 { showFiles(data?.Nav_Files, config.picServerHost, this) }
: null } { data ? { data.Nav_Details && data.Nav_Details.map((item, i) => { return }) }
序号 指标 目标 实际 达成率 原因 改善对策 涉及岗位
{i + 1} {item.QUOTA} {item.PURPOSE} {item.ACTUAL} { item.RATE } { item.REASON } { item.IMPROVE } { item.Nav_DetailPosts && item.Nav_DetailPosts.map((item1, i) => { return item1.Nav_Post?.NAME + ' ' }) }
: null } { data ?
今日计划及关注点 {data.TODAY_PLAN}
公司信息传递及学习内容 {data.LEARNING}
其他事项 {data.OTHER_CONTENT}
一分钟表扬 {data.PRAISE}
优秀员工分享 {data.SHARE}
安全环保事项(危险识别) {data.DANGER}
员工提出困难或建议 {data.DIFFICULTY}
安全宣誓 {data.SAFETY_OATH}
附件 { showFiles(data?.Nav_Files, config.picServerHost, this) }
会议签到区 { // showUsersSign(data?.Nav_Users, config.picServerHost, 150, 150) data.Nav_Users && data.Nav_Users.map((item, i) => { if (item.DEAL_STATUS == 1) { if (item.Nav_User != null && item.Nav_User.FILE_PATH != null && item.Nav_User.FILE_PATH.length > 0) return {item.Nav_User.NAME} else return } }) }
: null }
{ GetFileModel(Modal, FormPage, this, this.state.fileForm.visible) }
} } export default connect(({ login }) => ({ login }))(FO003ShowPrintJD)