查看页

This commit is contained in:
何美荣 2026-04-03 17:14:47 +08:00
parent 0c880725bc
commit 49be1aa091
3 changed files with 157 additions and 0 deletions

View File

@ -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 <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px' }} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button type={'default'} icon={'printer'} style={{ marginLeft: '8px', display: data && data.STATUS === 30 ? "inline" : "none" }}>打印</Button>}
content={() => this.componentRef}
pageStyle=".printDIV { padding:0 40px;} img{width :120px}"
/>
<Button style={{ marginLeft: '8px', display: data && data.STATUS === 30 ? "inline" : "none" }} onClick={() => this.onTableBtnExport()} icon="export" >导出</Button>
</div>
<div ref={el => (this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id}>
<h1 style={{ textAlign: 'center', margin: '15px' }}>重大事故隐患治理销号表</h1>
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="表单编号">{data.CODE}</Descriptions.Item>
<Descriptions.Item label="发起时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_ApplyDepartment ? data.Nav_ApplyDepartment.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人">{data.Nav_ApplyUser ? data.Nav_ApplyUser.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="整改记录单编号">{data.Nav_RectifyRecord?data.Nav_RectifyRecord?.CODE:''}</Descriptions.Item>
<Descriptions.Item label="重大事故隐患名称">{data.HIDDEN_DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label="重大事故隐患形成原因分析">{data.HIDDEN_REASON}</Descriptions.Item>
<Descriptions.Item label="实地复查负责人">{data.Nav_ChargeUser ? data.Nav_ChargeUser.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="复查人员">{
data?.Nav_Users && data?.Nav_Users.map((item2, i) => {
return <a>{(i > 0 ? "," : "") + item2.Nav_User.NAME}</a>
})
}</Descriptions.Item>
<Descriptions.Item label="复查情况描述">{data.REVIEW_DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label="附件">{
showFileImg(data?.Nav_Files, config.picServerHost, this)
}</Descriptions.Item>
<Descriptions.Item label="复查结论">{enums.SKReviewResultEnum.enums[data.REVIEW_RESULT]}</Descriptions.Item>
<Descriptions.Item label="监管部门">{data.Nav_MonitorDepart ? data.Nav_MonitorDepart.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="监管部门意见">{data.MONITOR_OPINION}</Descriptions.Item>
</Descriptions>
</div> : null
}
<FormPage {...this.state.tmpData} />
</div>
{
GetFileModel(Modal, FormPage, this, this.state.fileForm.visible)
}
</div>
}
}
export default connect(({ login, app }) => ({ login, app }))(SK080ShowPrint)

17
src/files/edit/SK080.js Normal file
View File

@ -0,0 +1,17 @@
import { message } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
import moment from 'moment';
import FormPage from '../../components/FormPage';
import ListPage from '../../components/Table/ListPage';
import ShowModal from '../../components/common/ShowModal';
import { Button, Row, Col, Form, Input, Select, Upload, Icon, Modal, Spin,Table } from 'antd';
/**
* @return {string}
*/
// 编辑
export default {
onBeforeSaveHandleRecord(params) {
params.record.TaskID = params.data.TaskID //TaskID传递消息表ID
params.record.PUBLISH = params.customParams;
},
}

View File

@ -264,6 +264,7 @@ const SK039ShowPrint = createLoadableComponent(() => import('../components/Custo
const SK041ShowPrint = createLoadableComponent(() => import('../components/CustomPages/SK/SK041ShowPrint'));
const SK043ShowPrint = createLoadableComponent(() => import('../components/CustomPages/SK/SK043ShowPrint'));
const SK045ShowPrint = createLoadableComponent(() => import('../components/CustomPages/SK/SK045ShowPrint'));
const SK080ShowPrint = createLoadableComponent(() => import('../components/CustomPages/SK/SK080ShowPrint'));
const BI00FullScreen = createLoadableComponent(() => import('../components/CustomPages/BI/BI00FullScreen'));
const BI064FormRunAnalysis = createLoadableComponent(() => import('../components/CustomPages/BI/BI064FormRunAnalysis'));
@ -515,6 +516,7 @@ export default function (componentName, formId, formParam, data, formCode, formD
SK041ShowPrint: <SK041ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SK043ShowPrint: <SK043ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SK045ShowPrint: <SK045ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SK080ShowPrint: <SK080ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
BI00FullScreen: <BI00FullScreen formId={formId} formParam={formParam} data={data} formCode={formCode} />,
BI064FormRunAnalysis: (
<BI064FormRunAnalysis formId={formId} formParam={formParam} data={data} formCode={formCode} />