import { Button, Descriptions, Modal, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; import React from 'react'; import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, GetFileModel, showFiles } from '../../../utils/common'; import ReactToPrint from 'react-to-print'; import { connect } from 'dva'; import moment from 'moment'; import { message } from 'antd/lib/index'; import styles from '../../../components/CustomPages/HI/StepForm.css'; import config from '../../../config.js'; import FormPage from '../../FormPage' class WB023ShowPrint extends React.Component { constructor(props) { super(props); this.state = { data: null, btndisplay: 'none', isCheck: false, //是否待办 审批 BtnAgreeDisplay: 'table', isSign: true, fileData: [], 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(); } onTableBtnAgree() { let json = initFilter(this.props.login.OrgId); json.Parameter1 = this.props.data.id; json.Parameter2 = this.props.data.TaskID; json.Parameter3 = this.props.login.userId; this.props.dispatch({ type: 'app/getDataByPost', url: 'WB/WBDangerousJob/recordSign', payload: json, onComplete: (ret) => { if (ret) { message.success('确认成功!'); this.state.isSign = false; this.BtnClose(); } } }) } loadData = (id) => { var orgId = this.props.login ? this.props.login.OrgId : ''; let json = initFilter(orgId); extendRule(json, 'ID', 1, id); extendInclude(json, 'Nav_Project') extendInclude(json, 'Nav_Type') extendInclude(json, 'Nav_User') extendInclude(json, 'Nav_Users.Nav_User') extendInclude(json, 'Nav_DisCloseUsers.Nav_User') extendInclude(json, 'Nav_RecordDetails.Nav_Files.Nav_ImgFile') extendInclude(json, 'Nav_DisCloseFiles.Nav_ImgFile') json.IgnoreDataRule = true; this.props.dispatch({ type: 'app/getDataByPost', payload: json, url: 'WB/DangerousJob/Get', onComplete: (ret) => { if (ret) { ret.Nav_RecordDetails.sort((a, b) => a.ROW_NUM - b.ROW_NUM); if (this.props.data.tableKey == "2" || this.props.data.tableKey == undefined) { this.setState({ BtnAgreeDisplay: 'none' }) } else { this.setState({ BtnAgreeDisplay: 'table' }) } if (ret.Nav_Users && ret.Nav_Users.length > 0) { var userNmaes = '' ret.Nav_Users.forEach(item => { userNmaes = (userNmaes.length > 0 ? " " : "") + item.Nav_User.NAME }); ret.userNmaes = userNmaes } this.setState({ data: ret, }) } } }); } render() { const { data } = this.state; const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; const tableKey = this.props.data.tableKey return
{this.state.isSign && (tableKey != null && (tableKey == "1" || tableKey == "4")) && ( <> )}
} content={() => this.componentRef} />
(this.componentRef = el)} style={{ padding: '20px', paddingTop: '20px' }} id={'tableId' + this.props.data.id}>

外包工程危险作业记录

{ data ?
{data.Nav_Project.NAME} {data.Nav_Project.UNIT_NAME} {data.Nav_Type.NAME} {data.DANGEROUS_JOB_NAME} {data.DANGEROUS_JOB_ITEM} {data.JOB_RISK_IDENTIFY} {data.START_TIME} {data.END_TIME} {data.JOB_ADDRESS} {data.userNmaes} {data.Nav_User.NAME} {showFiles(data.Nav_DisCloseFiles, config.picServerHost, this)}
: null } { {data?.Nav_RecordDetails?.map((item, i) => { return })}
序号 安全措施 是否涉及 说明 附件
{item.ROW_NUM} {item.MEASURE} {enums.ISORNOT.enums[item.ISORNOT]} {item.REMARK} {showFiles(data.Nav_Files, config.picServerHost, this)}
}
{ GetFileModel(Modal, FormPage, this, this.state.fileForm.visible) }
} } export default connect(({ login, app }) => ({ login, app }))(WB023ShowPrint)