import { Button, Descriptions, Badge, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; import React from 'react'; import { initFilter, extendRule, extendInclude, extendIgnoreDataRule, setDataFieldValue, showApprove, guid, initQueryFilter, 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 '../HI/StepForm.css'; import config from "../../../config.js"; import FormPage from '../../../components/FormPage' // 隐患上报查看 class BS073ShowPrint extends React.Component { constructor(props) { super(props); this.state = { data: null, listReason: '', BtnAgreeDisplay: 'none', }; }; 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); } } BtnClose = () => { if (typeof this.props.data.onCancel != "undefined" && typeof this.props.data.onCancel == 'function') this.props.data.onCancel(); } loadData = () => { let json = initFilter(this.props.login.OrgId); extendRule(json, 'ID', 1, this.props.data.id); extendInclude(json, 'Nav_Submit.Nav_CheckType'); extendInclude(json, 'Nav_Submit.Nav_CheckTypeLevel.Nav_Enums'); extendInclude(json, 'Nav_Submit.Nav_User'); extendInclude(json, 'Nav_Submit'); extendInclude(json, 'Nav_Files.Nav_ImgFile.Nav_File'); extendInclude(json, 'Nav_CheckProject'); extendInclude(json, 'Nav_CheckProjectCategory'); extendInclude(json, 'Nav_RiskArea'); extendInclude(json, 'Nav_ListRiskQuestionReason.Nav_RiskReason'); extendInclude(json, 'Nav_ListRiskQuestionReason'); extendInclude(json, 'Nav_DepartmentDeal'); extendInclude(json, 'Nav_UserDeal'); extendInclude(json, 'Nav_UserCheck'); extendIgnoreDataRule(json) this.props.dispatch({ type: 'app/getDataByPost', payload: json, url: 'BS/RiskSubmitContent/Get', onComplete: (ret) => { if (ret) { // 制表审核 // 检查结果审核 var listReason = '' ret.Nav_ListRiskQuestionReason.forEach(element => { listReason += ' ' + element.Nav_RiskReason.NAME }); this.setState({ //设置setState全局变量 data: ret, //将ret对象赋值给data, data供页面调用 listReason: listReason }) } } }); } onClickApprove = (appVisible) => { const newtmpData = { data: { id: this.props.data.id, isShow: true, key: guid(), PARAM2: this.props.data.PARAM2, appVisible: appVisible, BtnAgreeDisplay: 'none' }, formCode: "PF123", } this.setState({ tmpData: newtmpData, }); } 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, "手动上报完善.xlsx") } render() { const { data, listReason } = this.state; const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; return