From 49be1aa091bd551a425745413b34ea8d2b930ba6 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: Fri, 3 Apr 2026 17:14:47 +0800 Subject: [PATCH] =?UTF-8?q?=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/SK/SK080ShowPrint.js | 138 ++++++++++++++++++ src/files/edit/SK080.js | 17 +++ src/utils/customConfig.js | 2 + 3 files changed, 157 insertions(+) create mode 100644 src/components/CustomPages/SK/SK080ShowPrint.js create mode 100644 src/files/edit/SK080.js diff --git a/src/components/CustomPages/SK/SK080ShowPrint.js b/src/components/CustomPages/SK/SK080ShowPrint.js new file mode 100644 index 0000000..b994287 --- /dev/null +++ b/src/components/CustomPages/SK/SK080ShowPrint.js @@ -0,0 +1,138 @@ +import { message } from "antd/lib/index"; +import { Button, Descriptions, Popconfirm, Row, Col, Form, Input, Select, Modal } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude, extendIgnoreDataRule, setDataFieldValue, guid, showFiles, showUserSign, showFileImg, GetFileModel } from "../../../utils/common"; +import ReactToPrint from "react-to-print"; +import config from "../../../config"; +import XLSX from 'xlsx'; +import { connect } from 'dva'; +import stylesStep from '../HI/StepForm.css'; +import FormPage from '../../FormPage' +import moment from 'moment'; +class SK080ShowPrint 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, this.props.data?.TaskID); + } + + componentWillReceiveProps(NextProps) { + if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { + this.loadData(NextProps.data?.id, this.props.data?.TaskID); + } + } + + BtnClose = () => { + if (typeof this.props.data.onCancel != "undefined" && typeof this.props.data.onCancel == 'function') + this.props.data.onCancel(); + } + + loadData = (dataId, taskID) => { + 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: 'SK/SKMajorAccidentHazardManage/SKGet', + 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' }) + } + this.onClickApprove(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") + } + 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; + return