From 228837ceade5fd1246342f983bb6de221e8c1971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Thu, 4 Jun 2026 15:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E4=BF=A1=E6=81=AF=E7=99=BB?= =?UTF-8?q?=E8=AE=B0=E8=A1=A8=E6=9F=A5=E7=9C=8B=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/FO/FO055ShowPrint.js | 137 ++++++++++++++++++ src/utils/customConfig.js | 4 +- 2 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 src/components/CustomPages/FO/FO055ShowPrint.js diff --git a/src/components/CustomPages/FO/FO055ShowPrint.js b/src/components/CustomPages/FO/FO055ShowPrint.js new file mode 100644 index 0000000..0393743 --- /dev/null +++ b/src/components/CustomPages/FO/FO055ShowPrint.js @@ -0,0 +1,137 @@ +import { message } from "antd/lib/index"; +import { Button, Descriptions, Popconfirm, Row, Col, Form, Input, Select,Modal, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude, extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter, showFiles, GetFileModel, showUserSign, approveView } 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 moment from 'moment'; +import FormPage from '../../../components/FormPage' +class FO055ShowPrint extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + enumData: null, + BtnAgreeDisplay: 'none', + 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); + } + } + + + + 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); + json.Parameter22 = this.props.data.ORG_ID_HV; + extendRule(json, 'ID', 1, dataId); + extendIgnoreDataRule(json) + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'FO/FOEnterpriseInformationRegistration/GetEdit', + onComplete: (ret) => { + if (ret) { + if (this.props.data && this.props.data.loadDataDeal) { + this.props.data.loadDataDeal(1); + } + this.setState({ data: ret }) + if (this.props.data.tableKey == "2" || this.props.data.tableKey == undefined) { + this.setState({ BtnAgreeDisplay: 'none' }) + } else { + this.setState({ BtnAgreeDisplay: 'inline' }) + } + approveView(this, 'inline', false); + } + + } + }); + } + 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; + const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; + return
+
+ } + content={() => this.componentRef} + pageStyle=".printDIV { padding:0 40px;} img{width :120px}" + /> + +
+ + + {/* */} +
(this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV"> + +

企业信息登记表

+ { + data ? +
+ + {data.COMPANY_NAME} + {data.IDENTIFY_CODE} + {data.USER_NAME} + + {data.WORK_DATE?moment(data?.WORK_DATE).format('YYYY-MM-DD'):null} + {data.WORK_END_DATE?moment(data.WORK_END_DATE).format('YYYY-MM-DD'):null} + {data.NAME} + {data.TYPE} + {enums.FOMethodEnum.enums[data.METHOD]} + { data.Nav_ProUnits && data.Nav_ProUnits.map((item, i) => { + return item.Nav_ProUnit?.NAME + ' ' + })} + {data.MODE} + {data.AREA} + {data.ALLOW_NO} + {data.ALLOW_DATE?moment(data.ALLOW_DATE).format('YYYY-MM-DD'):null} + {data.ALLOW_END_DATE?moment(data.ALLOW_END_DATE).format('YYYY-MM-DD'):null} + {data.NSAFE_ALLOW_NO} + {data.SAFE_ALLOW_DATE?moment(data.SAFE_ALLOW_DATE).format('YYYY-MM-DD'):null} + {data.SAFE_ALLOW_END_DATE?moment(data.SAFE_ALLOW_END_DATE).format('YYYY-MM-DD'):null} + {data.COMPANY_DESCRIPTION} + {showFiles(data.Nav_WorkFiles, config.picServerHost, this)} + {showFiles(data.Nav_AllowFiles, config.picServerHost, this)} + {showFiles(data.Nav_SafeFiles, config.picServerHost, this)} + {showFiles(data.Nav_Files, config.picServerHost, this)} + + +
: null + + } +
+ { + GetFileModel(Modal, FormPage, this, this.state.fileForm.visible) + } +
+ } + +} +export default connect(({ login, app }) => ({ login, app }))(FO055ShowPrint) \ No newline at end of file diff --git a/src/utils/customConfig.js b/src/utils/customConfig.js index f9d0b4b..fd49137 100644 --- a/src/utils/customConfig.js +++ b/src/utils/customConfig.js @@ -112,7 +112,7 @@ const FO037ShowPrint = createLoadableComponent(() => import('../components/Custo const FO041ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO041ShowPrint')); const FO043ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO043ShowPrint')); const FO045ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO045ShowPrint')); - +const FO055ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO055ShowPrint')); const PreMeetingTask = createLoadableComponent(() => import('../components/CustomPages/Mobile/PreMeetingTask')); const PreOperSchTask = createLoadableComponent(() => import('../components/CustomPages/Mobile/PreOperSchTask')); const PF132ShowPrint = createLoadableComponent(() => import('../components/CustomPages/PF/PF132ShowPrint')); @@ -359,7 +359,7 @@ export default function (componentName, formId, formParam, data, formCode, formD FO041ShowPrint: , FO043ShowPrint: , FO045ShowPrint: , - + FO055ShowPrint: , HM104ShowPrint: , HM087ShowPrint: , HM109ShowPrint: ,