import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd'; import React from 'react'; import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } from "../../../utils/common"; import ReactToPrint from "react-to-print"; import stylesStep from '../HI/StepForm.css'; import config from "../../../config"; import XLSX from 'xlsx'; import { connect } from 'dva'; import moment from 'moment'; import { message } from "antd/lib/index"; import FormPage from '../../../components/FormPage' class SK043ShowPrint extends React.Component { constructor(props) { super(props); this.state = { data: null, BtnAgreeDisplay: 'none', tmpData: {}, }; }; 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 = (dataId) => { let that=this; let json = initFilter(that.props.login.OrgId); extendRule(json, 'ID', 1, dataId); extendInclude(json, 'Nav_Type'); extendInclude(json, 'Nav_Area'); extendInclude(json, 'Nav_Measures.Nav_Levels'); extendInclude(json, 'Nav_Contents.Nav_Contents'); extendInclude(json, 'Nav_Hiddens'); extendIgnoreDataRule(json) that.props.dispatch({ type: 'app/getDataByPost', payload: json, url: 'SK/BasicLibraryTemp/Get', onComplete: (ret) => { if (ret) { if(that.props.data && that.props.data.loadDataDeal) { that.props.data.loadDataDeal(1); } that.setState({ data: ret }); if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) { that.setState({ BtnAgreeDisplay: 'none' }) }else{ that.setState({ BtnAgreeDisplay: 'inline' }) } this.onClickApprove(false); //归档才显示打印和导出按钮 // if(ret.PRE_MEETING_STATUS==5){ // this.setState({ isFinished: 'inline' }) // } } else { message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');} } }); } onTableBtnExport() { const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ; 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") } onClickApprove=(appVisible)=>{ const newtmpData = { data: { id: this.props.data.id, isShow: true,key:guid(),param:this.props.data.param,appVisible:appVisible,BtnAgreeDisplay:'inline'}, formCode: "PF123", } this.setState({ tmpData: newtmpData, }); } render() { const { data } = this.state; const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ; // let aaa = Math.random(); return