From 652088f18dc87a972e8da153bbf6f8fb305f2062 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, 14 Nov 2025 17:17:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/FO/FO043ShowPrint.js | 153 ++++++++++++++++++ .../CustomPages/FO/FO045ShowPrint.js | 153 ++++++++++++++++++ 2 files changed, 306 insertions(+) create mode 100644 src/components/CustomPages/FO/FO043ShowPrint.js create mode 100644 src/components/CustomPages/FO/FO045ShowPrint.js diff --git a/src/components/CustomPages/FO/FO043ShowPrint.js b/src/components/CustomPages/FO/FO043ShowPrint.js new file mode 100644 index 0000000..49a7819 --- /dev/null +++ b/src/components/CustomPages/FO/FO043ShowPrint.js @@ -0,0 +1,153 @@ +import { message } from "antd/lib/index"; +import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showFiles, GetFileModel,showUserSign } 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'; +class FO043ShowPrint extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + enumData: 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); + } + } + + + onTableBtnAgree() { + this.props.dispatch({ + type: 'app/getDataByPost', + url: 'FO/FOLeaderWellRecord/PersonalAgree', + payload: { + ID: this.props.data.id, + TaskID: this.props.data.TaskID, + }, + onComplete: (ret) => { + if (ret) { + message.success('确认成功!'); + this.setState({ BtnAgreeDisplay: 'none' }) + this.BtnClose(); + } + } + }) + } + + 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); + extendRule(json, 'ID', 1, dataId); + extendIgnoreDataRule(json) + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'FO/FOLeaderWellRecord/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' }) + } + } + else + { message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');} + } + }); + } + + 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=".printDIV { padding:0 40px;} img{width :120px}" + /> + + +
+ + + {/* */} +
(this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV"> + +

领导带班下井记录

+ { + data ? +
+ + {data.CODE} + {data.NAME} + {data.DISCLOSURE_DATE} + {data.JOB_LOCATION} + {data.Nav_User ? data.Nav_User.NAME : ''} + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (i == (data.Nav_Person.length - 1)) { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + } else { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + ' ' + } + }) + } + {data.DisclosureContent} + { + (data.Nav_User && data.Nav_User.FILE_PATH)? + showUserSign(data.Nav_User, config.picServerHost):null + + } + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (item.DEAL_STATUS == 1) { + showUserSign(item.Nav_User, config.picServerHost) + } + }) + } + +
: null + } +
+
+ } + +} +export default connect(({ login }) => ({ login }))(FO043ShowPrint) \ No newline at end of file diff --git a/src/components/CustomPages/FO/FO045ShowPrint.js b/src/components/CustomPages/FO/FO045ShowPrint.js new file mode 100644 index 0000000..a80fc6e --- /dev/null +++ b/src/components/CustomPages/FO/FO045ShowPrint.js @@ -0,0 +1,153 @@ +import { message } from "antd/lib/index"; +import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showFiles, GetFileModel,showUserSign } 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'; +class FO045ShowPrint extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + enumData: 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); + } + } + + + onTableBtnAgree() { + this.props.dispatch({ + type: 'app/getDataByPost', + url: 'FO/FOLeaderWellRecord/PersonalAgree', + payload: { + ID: this.props.data.id, + TaskID: this.props.data.TaskID, + }, + onComplete: (ret) => { + if (ret) { + message.success('确认成功!'); + this.setState({ BtnAgreeDisplay: 'none' }) + this.BtnClose(); + } + } + }) + } + + 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); + extendRule(json, 'ID', 1, dataId); + extendIgnoreDataRule(json) + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'FO/FOLeaderWellRecord/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' }) + } + } + else + { message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');} + } + }); + } + + 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=".printDIV { padding:0 40px;} img{width :120px}" + /> + + +
+ + + {/* */} +
(this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV"> + +

领导带班下井记录

+ { + data ? +
+ + {data.CODE} + {data.NAME} + {data.DISCLOSURE_DATE} + {data.JOB_LOCATION} + {data.Nav_User ? data.Nav_User.NAME : ''} + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (i == (data.Nav_Person.length - 1)) { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + } else { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + ' ' + } + }) + } + {data.DisclosureContent} + { + (data.Nav_User && data.Nav_User.FILE_PATH)? + showUserSign(data.Nav_User, config.picServerHost):null + + } + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (item.DEAL_STATUS == 1) { + showUserSign(item.Nav_User, config.picServerHost) + } + }) + } + +
: null + } +
+
+ } + +} +export default connect(({ login }) => ({ login }))(FO045ShowPrint) \ No newline at end of file