2025-11-14 17:17:37 +08:00
|
|
|
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";
|
2025-11-22 01:42:37 +08:00
|
|
|
import styles from '../HI/StepForm.css';
|
2025-11-14 17:17:37 +08:00
|
|
|
import config from "../../../config";
|
|
|
|
|
import XLSX from 'xlsx';
|
|
|
|
|
import { connect } from 'dva';
|
|
|
|
|
import moment from 'moment';
|
2025-11-22 01:42:37 +08:00
|
|
|
import FormPage from '../../../components/FormPage'
|
2025-11-14 17:17:37 +08:00
|
|
|
class FO043ShowPrint extends React.Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
data: null,
|
|
|
|
|
enumData: null,
|
2025-11-22 12:57:14 +08:00
|
|
|
BtnAgreeDisplay: 'none',
|
|
|
|
|
fileForm: {
|
|
|
|
|
title: "",
|
|
|
|
|
visible: false,
|
|
|
|
|
},
|
2025-11-14 17:17:37 +08:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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',
|
2025-11-21 19:27:10 +08:00
|
|
|
url: 'FO/FOFireJob/IdentityUpdate',
|
2025-11-14 17:17:37 +08:00
|
|
|
payload: {
|
|
|
|
|
ID: this.props.data.id,
|
|
|
|
|
TaskID: this.props.data.TaskID,
|
|
|
|
|
},
|
|
|
|
|
onComplete: (ret) => {
|
|
|
|
|
if (ret) {
|
2025-11-21 19:27:10 +08:00
|
|
|
message.success('提交成功!');
|
2025-11-14 17:17:37 +08:00
|
|
|
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,
|
2025-11-21 19:27:10 +08:00
|
|
|
url: 'FO/FOFireJob/GetEdit',
|
2025-11-14 17:17:37 +08:00
|
|
|
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' })
|
|
|
|
|
}
|
2025-11-22 01:42:37 +08:00
|
|
|
this.onClickApprove(false);
|
2025-11-14 17:17:37 +08:00
|
|
|
}
|
2025-11-21 19:27:10 +08:00
|
|
|
|
2025-11-14 17:17:37 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-11-22 01:42:37 +08:00
|
|
|
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,
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-11-14 17:17:37 +08:00
|
|
|
onTableBtnExport() {
|
|
|
|
|
let TableWrap = document.getElementById('tableId' + this.props.data.id);
|
|
|
|
|
let Table = TableWrap.getElementsByTagName('table')[0];
|
|
|
|
|
const wb = XLSX.utils.table_to_book(Table);
|
2025-11-21 19:27:10 +08:00
|
|
|
XLSX.writeFile(wb, "动火作业工作票.xlsx")
|
2025-11-14 17:17:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const { data } = this.state;
|
2025-11-22 01:42:37 +08:00
|
|
|
const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums;
|
2025-11-14 17:17:37 +08:00
|
|
|
return <div>
|
|
|
|
|
<div style={{ padding: '10px' }}>
|
2025-11-22 01:42:37 +08:00
|
|
|
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px' }} icon="export">审批详情</Button>
|
2025-11-14 17:17:37 +08:00
|
|
|
<ReactToPrint
|
|
|
|
|
trigger={() => <Button type={'default'} icon={'printer'} style={{ marginLeft: '8px',display: data && data.FORM_STATUS === 2?"inline":"none" }}>打印</Button>}
|
|
|
|
|
content={() => this.componentRef}
|
|
|
|
|
pageStyle=".printDIV { padding:0 40px;} img{width :120px}"
|
|
|
|
|
/>
|
|
|
|
|
<Button style={{ marginLeft: '8px',display: data && data.FORM_STATUS === 2?"inline":"none" }} onClick={() => this.onTableBtnExport()} icon="export" >导出</Button>
|
2025-11-21 19:27:10 +08:00
|
|
|
<Button type="primary" style={{ marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >审阅</Button>
|
2025-11-14 17:17:37 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* */}
|
|
|
|
|
<div ref={el => (this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV">
|
|
|
|
|
|
2025-11-21 19:27:10 +08:00
|
|
|
<h1 style={{ textAlign: 'center', margin: '15px' }}>动火作业工作票</h1>
|
2025-11-14 17:17:37 +08:00
|
|
|
{
|
|
|
|
|
data ?
|
|
|
|
|
<div>
|
2025-11-22 01:42:37 +08:00
|
|
|
<Descriptions size="middle" bordered className={styles.description}>
|
2025-11-21 19:27:10 +08:00
|
|
|
<Descriptions.Item label="公司">{data.Nav_Company?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="生产单元">{data.Nav_ProductionUnit?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="发起时间">{data.CREATE_TIME}</Descriptions.Item>
|
|
|
|
|
|
|
|
|
|
<Descriptions.Item label="发起部门">{data.Nav_ApplyDepartment?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="发起人">{data.Nav_ApplyUser?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="工作票编号">{data.CODE}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="作业名称">{data.Nav_OperationStep?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="审批层级">{enums.HMOperationTaskAuditEnum.enums[data.AUDIT_LEVEL]}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="作业风险等级">{enums.SKEvaluateLevelEnum.enums[data.EVALUATE_LEVEL]}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火部门">{data.Nav_FireDepartment?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火部门负责人">{data.Nav_FireUser?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="安全生产管理人员">{data.Nav_SafeUser?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火区域">{data.Nav_Area?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火地点">{data.JOB_CONTENT}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火方式">{data.Nav_Type?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火具体事项">{data.JOB_CONTENT}</Descriptions.Item>
|
2025-12-10 17:07:08 +08:00
|
|
|
{/* <Descriptions.Item label="作业监护人">{data.Nav_MonitorUser?.NAME}</Descriptions.Item> */}
|
2025-11-21 19:27:10 +08:00
|
|
|
<Descriptions.Item label="动火计划开始时间">{data.JOB_DATE}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火计划结束时间">{data.JOB_END_DATE}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="存在的风险">{ data.Nav_Risks && data.Nav_Risks.map((item, i) => {
|
|
|
|
|
return item.RISK_NAME + ' '
|
|
|
|
|
})}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="附件">{showFiles(data.Nav_Files, config.picServerHost, this)}</Descriptions.Item>
|
2025-11-24 01:13:28 +08:00
|
|
|
</Descriptions>
|
2025-11-22 12:57:14 +08:00
|
|
|
|
2025-11-24 01:13:28 +08:00
|
|
|
|
2025-11-22 12:57:14 +08:00
|
|
|
{
|
2025-11-21 19:27:10 +08:00
|
|
|
data && data.Nav_Users?
|
|
|
|
|
<table style={{ width: '100%', textAlign: 'center', marginTop: '10px', borderTop: '1px solid #333', borderLeft: '1px solid #333' }} className={styles.PrintForm}>
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="100px" className={styles.fontBold}>序号</td>
|
|
|
|
|
<td className={styles.fontBold}>作业人员类别</td>
|
|
|
|
|
<td className={styles.fontBold}>姓名</td>
|
|
|
|
|
<td className={styles.fontBold}>证书编号</td>
|
|
|
|
|
<td className={styles.fontBold}>附件</td>
|
2025-11-22 22:16:30 +08:00
|
|
|
{/* <td className={styles.fontBold}>签名</td> */}
|
2025-11-21 19:27:10 +08:00
|
|
|
</tr>
|
|
|
|
|
{
|
|
|
|
|
data.Nav_Users && data.Nav_Users.map((item, i) => {
|
|
|
|
|
return <tr>
|
|
|
|
|
<td width="100px">
|
|
|
|
|
{i + 1}
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
{item.Nav_UserType?.NAME}
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
{item.Nav_User?.NAME}
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
{item.CERTIFICATE_CODE}
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
{showFiles(item.Nav_UserFiles, config.picServerHost, this)}
|
|
|
|
|
</td>
|
2025-11-22 22:16:30 +08:00
|
|
|
{/* <td>
|
2025-11-21 19:27:10 +08:00
|
|
|
{ item.DEAL_STATUS == 1?
|
|
|
|
|
showUserSign(item.Nav_User, config.picServerHost):null
|
|
|
|
|
}
|
2025-11-22 22:16:30 +08:00
|
|
|
</td> */}
|
2025-11-21 19:27:10 +08:00
|
|
|
</tr>
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table> : null
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
data && data.Nav_Details?
|
|
|
|
|
<table style={{ width: '100%', textAlign: 'center', marginTop: '10px', borderTop: '1px solid #333', borderLeft: '1px solid #333' }} className={styles.PrintForm}>
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="100px" className={styles.fontBold}>序号</td>
|
|
|
|
|
<td className={styles.fontBold}>作业阶段</td>
|
|
|
|
|
<td className={styles.fontBold}>作业流程及安全措施</td>
|
2025-11-25 13:17:05 +08:00
|
|
|
<td style={{display:data.STATUS == 30?'table-cell':'none'}}className={styles.fontBold}>是否确认</td>
|
|
|
|
|
<td style={{display:data.STATUS == 30?'table-cell':'none'}}className={styles.fontBold}>附件</td>
|
2025-11-21 19:27:10 +08:00
|
|
|
</tr>
|
|
|
|
|
{
|
|
|
|
|
data.Nav_Details && data.Nav_Details.map((item, i) => {
|
|
|
|
|
return <tr>
|
|
|
|
|
<td width="100px">
|
|
|
|
|
{i + 1}
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
2025-11-22 12:57:14 +08:00
|
|
|
{enums.FOJobStepEnum.enums[item.JOB_STEP]}
|
2025-11-21 19:27:10 +08:00
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
{item.CONTENT}
|
|
|
|
|
</td>
|
2025-11-25 13:17:05 +08:00
|
|
|
<td style={{display:data.STATUS == 30?'table-cell':'none'}}>
|
2025-11-22 12:57:14 +08:00
|
|
|
{item.IS_CONFIRM_NEW ? "是" : "否"}
|
|
|
|
|
{/* {enums.FOYesOrNoEnum.enums[item.IS_CONFIRM]} */}
|
2025-11-21 19:27:10 +08:00
|
|
|
</td>
|
2025-11-25 13:17:05 +08:00
|
|
|
<td style={{display:data.STATUS == 30?'table-cell':'none'}}>
|
2025-11-21 19:27:10 +08:00
|
|
|
{showFiles(item.Nav_DetailFiles, config.picServerHost, this)}
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table> : null
|
|
|
|
|
}
|
2025-11-25 13:17:05 +08:00
|
|
|
<Descriptions size="middle" bordered className={styles.description} style={{display:data.STATUS == 30?'block':'none'}}>
|
2025-11-24 01:13:28 +08:00
|
|
|
<Descriptions.Item label="动火作业现场条件验收情况">{data.COMPLETED_CONDITION}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="是否可以动火">{enums.FOYesOrNoEnum.enums[data.IS_FIRE]}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火实际开始时间">{data.ACT_DATE}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="现场条件验收附件"> {showFiles(data.Nav_FireFiles, config.picServerHost, this)}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="矿调度室人员">{data.Nav_DispatchUser?.NAME}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火部门负责人签名">{
|
|
|
|
|
|
|
|
|
|
data.USER_DEAL_STATUS == 1?
|
|
|
|
|
showUserSign(data.Nav_FireUser, config.picServerHost)
|
|
|
|
|
:null
|
|
|
|
|
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="安全管理人员签名">{
|
|
|
|
|
|
|
|
|
|
data.SAFE_DEAL_STATUS == 1?
|
|
|
|
|
showUserSign(data.Nav_SafeUser, config.picServerHost)
|
|
|
|
|
:null
|
|
|
|
|
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="矿调度人员签名">{
|
|
|
|
|
|
|
|
|
|
data.DISPATCH_DEAL_STATUS == 1?
|
|
|
|
|
showUserSign(data.Nav_DispatchUser, config.picServerHost)
|
|
|
|
|
:null
|
|
|
|
|
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
</Descriptions>
|
2025-12-10 17:07:08 +08:00
|
|
|
<Descriptions size="middle" bordered className={styles.description} style={{display:data.FIRE_STATUS > 15?'block':'none'}}>
|
2025-11-24 01:13:28 +08:00
|
|
|
<Descriptions.Item label="动火作业完工验收情况">{
|
|
|
|
|
data.COMPLETED_CONTENT
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="是否可以撤离">{
|
|
|
|
|
enums.FOYesOrNoEnum.enums[data.IS_LEAVE]
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火实际结束时间">{
|
|
|
|
|
data.ACT_END_DATE
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="离开现场时间">{
|
|
|
|
|
data.LEAVE_DATE
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="完工验收附件">{
|
|
|
|
|
showFiles(data.Nav_MonitorFiles, config.picServerHost, this)
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="动火部门负责人签字">{
|
|
|
|
|
data.USER_DEAL_FINISH_STATUS == 1?
|
|
|
|
|
showUserSign(data.Nav_FireUser, config.picServerHost)
|
|
|
|
|
:null
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label="安全生产管理人员签字">{
|
|
|
|
|
data.SAFE_DEAL_FINISH_STATUS == 1?
|
|
|
|
|
showUserSign(data.Nav_SafeUser, config.picServerHost)
|
|
|
|
|
:null
|
|
|
|
|
}</Descriptions.Item>
|
|
|
|
|
|
|
|
|
|
</Descriptions>
|
|
|
|
|
<FormPage {...this.state.tmpData} />
|
2025-11-14 17:17:37 +08:00
|
|
|
</div> : null
|
2025-11-24 01:13:28 +08:00
|
|
|
|
2025-11-14 17:17:37 +08:00
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2025-11-22 12:57:14 +08:00
|
|
|
export default connect(({ login,app }) => ({ login,app }))(FO043ShowPrint)
|