企业信息登记表查看页
This commit is contained in:
parent
16d3e068bd
commit
228837cead
137
src/components/CustomPages/FO/FO055ShowPrint.js
Normal file
137
src/components/CustomPages/FO/FO055ShowPrint.js
Normal file
@ -0,0 +1,137 @@
|
||||
import { message } from "antd/lib/index";
|
||||
import { Button, Descriptions, Popconfirm, Row, Col, Form, Input, Select,Modal, Table } from 'antd';
|
||||
import React from 'react';
|
||||
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter, showFiles, GetFileModel, showUserSign, approveView } from "../../../utils/common";
|
||||
import ReactToPrint from "react-to-print";
|
||||
import styles from '../HI/StepForm.css';
|
||||
import config from "../../../config";
|
||||
import XLSX from 'xlsx';
|
||||
import { connect } from 'dva';
|
||||
import moment from 'moment';
|
||||
import FormPage from '../../../components/FormPage'
|
||||
class FO055ShowPrint 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);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
loadData = (dataId) => {
|
||||
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: 'FO/FOEnterpriseInformationRegistration/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' })
|
||||
}
|
||||
approveView(this, 'inline', 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")
|
||||
}
|
||||
|
||||
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' }}>
|
||||
<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} className="printDIV">
|
||||
|
||||
<h1 style={{ textAlign: 'center', margin: '15px' }}>企业信息登记表</h1>
|
||||
{
|
||||
data ?
|
||||
<div>
|
||||
<Descriptions size="middle" bordered className={styles.description}>
|
||||
<Descriptions.Item label="公司名称">{data.COMPANY_NAME}</Descriptions.Item>
|
||||
<Descriptions.Item label="统一社会信用代码">{data.IDENTIFY_CODE}</Descriptions.Item>
|
||||
<Descriptions.Item label="法定代表人">{data.USER_NAME}</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item label="营业开始时间">{data.WORK_DATE?moment(data?.WORK_DATE).format('YYYY-MM-DD'):null}</Descriptions.Item>
|
||||
<Descriptions.Item label="营业结束时间">{data.WORK_END_DATE?moment(data.WORK_END_DATE).format('YYYY-MM-DD'):null}</Descriptions.Item>
|
||||
<Descriptions.Item label="矿山名称">{data.NAME}</Descriptions.Item>
|
||||
<Descriptions.Item label="开采矿种">{data.TYPE}</Descriptions.Item>
|
||||
<Descriptions.Item label="开采方式">{enums.FOMethodEnum.enums[data.METHOD]}</Descriptions.Item>
|
||||
<Descriptions.Item label="生产单元">{ data.Nav_ProUnits && data.Nav_ProUnits.map((item, i) => {
|
||||
return item.Nav_ProUnit?.NAME + ' '
|
||||
})}</Descriptions.Item>
|
||||
<Descriptions.Item label="生产规模(万吨/年)">{data.MODE}</Descriptions.Item>
|
||||
<Descriptions.Item label="矿区面积(平方公里)">{data.AREA}</Descriptions.Item>
|
||||
<Descriptions.Item label="采矿许可证号">{data.ALLOW_NO}</Descriptions.Item>
|
||||
<Descriptions.Item label="许可证有效开始时间">{data.ALLOW_DATE?moment(data.ALLOW_DATE).format('YYYY-MM-DD'):null}</Descriptions.Item>
|
||||
<Descriptions.Item label="许可证有效结束时间">{data.ALLOW_END_DATE?moment(data.ALLOW_END_DATE).format('YYYY-MM-DD'):null}</Descriptions.Item>
|
||||
<Descriptions.Item label="安全生产许可证号">{data.NSAFE_ALLOW_NO}</Descriptions.Item>
|
||||
<Descriptions.Item label="安全生产许可证有效开始时间">{data.SAFE_ALLOW_DATE?moment(data.SAFE_ALLOW_DATE).format('YYYY-MM-DD'):null}</Descriptions.Item>
|
||||
<Descriptions.Item label="安全生产许可证有效结束时间">{data.SAFE_ALLOW_END_DATE?moment(data.SAFE_ALLOW_END_DATE).format('YYYY-MM-DD'):null}</Descriptions.Item>
|
||||
<Descriptions.Item label="公司简介">{data.COMPANY_DESCRIPTION}</Descriptions.Item>
|
||||
<Descriptions.Item label="营业执照附件">{showFiles(data.Nav_WorkFiles, config.picServerHost, this)}</Descriptions.Item>
|
||||
<Descriptions.Item label="采矿证附件">{showFiles(data.Nav_AllowFiles, config.picServerHost, this)}</Descriptions.Item>
|
||||
<Descriptions.Item label="安全生产许可证附件">{showFiles(data.Nav_SafeFiles, config.picServerHost, this)}</Descriptions.Item>
|
||||
<Descriptions.Item label="其他附件">{showFiles(data.Nav_Files, config.picServerHost, this)}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<FormPage {...this.state.tmpData} />
|
||||
</div> : null
|
||||
|
||||
}
|
||||
</div>
|
||||
{
|
||||
GetFileModel(Modal, FormPage, this, this.state.fileForm.visible)
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
export default connect(({ login, app }) => ({ login, app }))(FO055ShowPrint)
|
||||
@ -112,7 +112,7 @@ const FO037ShowPrint = createLoadableComponent(() => import('../components/Custo
|
||||
const FO041ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO041ShowPrint'));
|
||||
const FO043ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO043ShowPrint'));
|
||||
const FO045ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO045ShowPrint'));
|
||||
|
||||
const FO055ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO055ShowPrint'));
|
||||
const PreMeetingTask = createLoadableComponent(() => import('../components/CustomPages/Mobile/PreMeetingTask'));
|
||||
const PreOperSchTask = createLoadableComponent(() => import('../components/CustomPages/Mobile/PreOperSchTask'));
|
||||
const PF132ShowPrint = createLoadableComponent(() => import('../components/CustomPages/PF/PF132ShowPrint'));
|
||||
@ -359,7 +359,7 @@ export default function (componentName, formId, formParam, data, formCode, formD
|
||||
FO041ShowPrint: <FO041ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
FO043ShowPrint: <FO043ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
FO045ShowPrint: <FO045ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
|
||||
FO055ShowPrint: <FO055ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
HM104ShowPrint: <HM104ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
HM087ShowPrint: <HM087ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
HM109ShowPrint: <HM109ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user