import { Button, Descriptions } from 'antd'; import React from 'react'; import { initFilter, extendRule, guid, extendInclude, extendIgnoreDataRule } from "../../../utils/common"; import ReactToPrint from "react-to-print"; import { ExportToExcel } from '@woowalker/feui' import XLSX from 'xlsx'; import { connect } from 'dva'; import config from "../../../config.js"; import FormPage from '../../../components/FormPage' class BS049ShowPrint extends React.Component { constructor(props) { super(props); this.state = { data: null, 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); } } loadData = () => { let json = initFilter(this.props.login.OrgId); extendRule(json, 'ID', 1, this.props.data.id); extendInclude(json, 'Nav_UserDeal.Nav_Department'); extendInclude(json, 'Nav_UserActualDeal'); extendIgnoreDataRule(json) this.props.dispatch({ type: 'app/getDataByPost', payload: json, url: 'BS/RiskSubmitContent/Get', onComplete: (ret) => { if (ret) { this.setState({ //设置setState全局变量 data: ret, //将ret对象赋值给data, data供页面调用 }) } } }); } 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 } = this.state; return
} content={() => this.componentRef} pageStyle={"#tableId" + this.props.data.id + " { padding:0 40px;} img{width :120px}"} />
{/* 检查表制定 */}
(this.componentRef = el)} style={{ padding: '20px', paddingTop: '20px' }} id={'tableId' + this.props.data.id}>

指定整改落实人

{ data ?
{data.CODE} {data.NAME} {data.LastDateUser} {data.Nav_UserDeal.Nav_Department.NAME} {data.Nav_UserDeal.NAME} {data.Nav_UserActualDeal.NAME}
: null }
} } export default connect(({ login, app }) => ({ login, app }))(BS049ShowPrint)