This commit is contained in:
wjn 2024-02-02 10:46:16 +08:00
commit b9bd5c168c
42 changed files with 0 additions and 9635 deletions

View File

@ -1,191 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE005ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PECorrectivePreventive/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="发起时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"150px"}} className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>生产单元</td>
<td className={stylesStep.fontBold}>模块名称</td>
<td className={stylesStep.fontBold}>纠正内容</td>
<td className={stylesStep.fontBold}>不符合性质</td>
<td className={stylesStep.fontBold}>整改期限</td>
<td className={stylesStep.fontBold}>责任部门</td>
<td className={stylesStep.fontBold}>评估人员</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{
item.Nav_ProductionUnit?.NAME
}
</td>
<td>
{
item.Nav_StandardName?.NAME
}
</td>
<td>
{item.CONTENTS}
</td>
<td>
{enums.PEConformityPropertyEnum.enums[item?.CONFORM_PROPERTY]}
</td>
<td>
{moment(item.RECTIFICATION_TIME).format('YYYY-MM-DD')}
</td>
<td>
{
item.Nav_Department?.NAME
}
</td>
<td>
{
item.Nav_User?.NAME
}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE005ShowPrint)

View File

@ -1,215 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE007ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventiveProcess/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PECorrectivePreventiveProcess/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="发起时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"150px"}} className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>生产单元</td>
<td className={stylesStep.fontBold}>模块名称</td>
<td className={stylesStep.fontBold}>需纠正内容</td>
<td className={stylesStep.fontBold}>整改期限</td>
<td className={stylesStep.fontBold}>原因分析</td>
<td className={stylesStep.fontBold}>纠正与预防措施</td>
<td className={stylesStep.fontBold}>落实情况</td>
<td className={stylesStep.fontBold}>未落实说明</td>
<td className={stylesStep.fontBold}>落实人员</td>
<td className={stylesStep.fontBold}>纠正时间</td>
<td className={stylesStep.fontBold}>附件</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{
item.Nav_ProductionUnit?.NAME
}
</td>
<td>
{
item.Nav_StandardName?.NAME
}
</td>
<td>
{item.CONTENTS}
</td>
<td>
{moment(item.RECTIFICATION_TIME).format('YYYY-MM-DD')}
</td>
<td>
{
item.REASON
}
</td>
<td>
{
item.CORRECTIVE_PREVENTIVE
}
</td>
<td>
{enums.PESituationEnum.enums[item?.SITUATION]}
</td>
<td>
{
item.NOT_CARRY_OUT
}
</td>
<td>
{
item.Nav_User?.NAME
}
</td>
<td>
{item.CORRECT_TIME?moment(item.CORRECT_TIME).format('YYYY-MM-DD'):null}
</td>
<td>
{
item.Nav_Files && item.Nav_Files.map((t, i) => {
return <a width={'20%'} title={t.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + t.Nav_ImgFile.Nav_File.FILE_PATH} >{t.Nav_ImgFile.FILE_NAME}<br></br> </a>
})
}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE007ShowPrint)

View File

@ -1,224 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE009ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventiveProcess/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PECorrectivePreventiveEvaluation/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="发起时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"150px"}} className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>需纠正内容</td>
<td className={stylesStep.fontBold}>纠正与预防措施</td>
<td className={stylesStep.fontBold}>落实情况</td>
<td className={stylesStep.fontBold}>未落实说明</td>
<td className={stylesStep.fontBold}>评估结果</td>
<td className={stylesStep.fontBold}>附件</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.CONTENTS}
</td>
<td>
{
item.CORRECTIVE_PREVENTIVE
}
</td>
<td>
{enums.PESituationEnum.enums[item?.SITUATION]}
</td>
<td>
{
item.NOT_CARRY_OUT
}
</td>
<td>
{enums.PEEvaluateResultEnum.enums[item?.EVALUATE_RESULT]}
</td>
<td>
{
item.Nav_Files && item.Nav_Files.map((t, i) => {
return <a width={'20%'} title={t.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + t.Nav_ImgFile.Nav_File.FILE_PATH} >{t.Nav_ImgFile.FILE_NAME}<br></br> </a>
})
}
</td>
</tr>
})
}
</table>:null
}
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="措施考虑因素">{
data.Nav_MeasureConsider && data.Nav_MeasureConsider.map((item, i) => {
if (i == (data.Nav_MeasureConsider.length - 1)) {
return item.Nav_Consider.NAME
} else {
return item.Nav_Consider.NAME + ','
}
})
}</Descriptions.Item>
<Descriptions.Item label="综合评审意见">{data.COMMENTS}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label='评估人员'>
<div>{
data.Nav_Details && data.Nav_Details.map((item, i) => {
if (item.DEAL_STATUS == 1) {
if (item.Nav_User != null && item.Nav_User.Nav_UserSignFiles[0] != null)
return <img style={{ margin: "0 0 0 15px",width:'150px' }} alt={item.Nav_User?.NAME} src={config.picServerHost + item.Nav_User.Nav_UserSignFiles[0].Nav_ImgFile.Nav_File.FILE_PATH} />
else
return <img style={{ margin: "0 0 0 15px",width:'150px' }} title={item.Nav_User?.NAME} />
}
})
}</div>
</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE009ShowPrint)

View File

@ -1,191 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE019ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PESafetyMonitorPlan/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PESafetyMonitorPlan/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="发起时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="年度">{data.YEAR}</Descriptions.Item>
<Descriptions.Item label="监测程序">{data.MONITOR_PROGRAM}</Descriptions.Item>
<Descriptions.Item label="监测范围位置">{data.MONITOR_RANGE}</Descriptions.Item>
<Descriptions.Item label="资源配备">{data.RESOURCES}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"150px"}} className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>监测项目</td>
<td className={stylesStep.fontBold}>监测内容</td>
<td className={stylesStep.fontBold}>监测标准</td>
<td className={stylesStep.fontBold}>监测频率</td>
<td className={stylesStep.fontBold}>监测方法与技术</td>
<td className={stylesStep.fontBold}>监测部门</td>
<td className={stylesStep.fontBold}>负责人员</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Project?.NAME}
</td>
<td>
{item.CONTENTS}
</td>
<td>
{
item.STANDARD
}
</td>
<td>
{enums.PTAssessmentCycleEnums.enums[item?.ASSESSMENT_CYCLE]}
</td>
<td>
{
item.METHOD
}
</td>
<td>
{item.Nav_Department?.NAME}
</td>
<td>
{item.Nav_User?.NAME}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE019ShowPrint)

View File

@ -1,223 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE021ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PESafetyMonitorRecord/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PESafetyMonitorRecord/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</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="监测时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="监测部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="记录人">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="监测人员">{
data.Nav_MonitorUser && data.Nav_MonitorUser.map((item, i) => {
if (i == (data.Nav_MonitorUser.length - 1)) {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'> {item.Nav_User?.NAME}</label>
else
return item.Nav_User.NAME
} else {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'>{item.Nav_User?.NAME + ','}</label>
else
return item.Nav_User.NAME + ','
}
})
}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"150px"}} className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>监测项目</td>
<td className={stylesStep.fontBold}>监测内容</td>
<td className={stylesStep.fontBold}>监测标准</td>
<td className={stylesStep.fontBold}>监测方法与技术</td>
<td className={stylesStep.fontBold}>监测实况</td>
<td className={stylesStep.fontBold}>结果论述</td>
<td className={stylesStep.fontBold}>附件</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Project?.NAME}
</td>
<td>
{item.CONTENTS}
</td>
<td>
{
item.STANDARD
}
</td>
<td>
{
item.METHOD
}
</td>
<td>
{item.MONITOR_LIVE}
</td>
<td>
{enums.PTResultDiscussEnums.enums[item?.RESULT_DISCUSS]}
</td>
<td>
{
item.Nav_Files && item.Nav_Files.map((t, i) => {
return <a width={'20%'} title={t.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + t.Nav_ImgFile.Nav_File.FILE_PATH} >{t.Nav_ImgFile.FILE_NAME} <br></br></a>
})
}
</td>
</tr>
})
}
</table>:null
}
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="监测人员签字">{
data.Nav_MonitorUser && data.Nav_MonitorUser.map((item, i) => {
if (item.DEAL_STATUS == 1) {
if (item.Nav_User != null && item.Nav_User.Nav_UserSignFiles[0] != null)
return <img style={{ margin: "0 0 0 15px",width:'200px' }} alt={item.Nav_User.NAME} src={config.picServerHost + item.Nav_User.Nav_UserSignFiles[0].Nav_ImgFile.Nav_File.FILE_PATH} />
else
return <img style={{ margin: "0 0 0 15px" ,width:'200px'}} title={item.Nav_User.NAME} />
}
})
}</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE021ShowPrint)

View File

@ -1,217 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE022ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PESafetyMonitorPlan/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PESafetyMonitorPlan/GetRecordEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="发起时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="年度">{data.YEAR}</Descriptions.Item>
<Descriptions.Item label="监测程序">{data.MONITOR_PROGRAM}</Descriptions.Item>
<Descriptions.Item label="监测范围位置">{data.MONITOR_RANGE}</Descriptions.Item>
<Descriptions.Item label="资源配备">{data.RESOURCES}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"150px"}} className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>监测项目</td>
<td className={stylesStep.fontBold}>监测内容</td>
<td className={stylesStep.fontBold}>监测标准</td>
<td className={stylesStep.fontBold}>监测频率</td>
<td className={stylesStep.fontBold}>监测方法与技术</td>
<td className={stylesStep.fontBold}>监测部门</td>
<td className={stylesStep.fontBold}>负责人员</td>
<td className={stylesStep.fontBold}>监测实况</td>
<td className={stylesStep.fontBold}>结果论述</td>
<td className={stylesStep.fontBold}>监测人员</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Project?.NAME}
</td>
<td>
{item.CONTENTS}
</td>
<td>
{
item.STANDARD
}
</td>
<td>
{enums.PTAssessmentCycleEnums.enums[item?.ASSESSMENT_CYCLE]}
</td>
<td>
{
item.METHOD
}
</td>
<td>
{item.Nav_Department?.NAME}
</td>
<td>
{item.Nav_User?.NAME}
</td>
<td>
{item.MONITOR_LIVE}
</td>
<td>
{enums.PTResultDiscussEnums.enums[item?.RESULT_DISCUSS]}
</td>
<td>
{
item.Nav_MonitorUser && item.Nav_MonitorUser.map((item2, i) => {
if (i == (item.Nav_MonitorUser.length - 1)) {
if (item2.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'> {item2.Nav_User?.NAME}</label>
else
return item2.Nav_User.NAME
} else {
if (item2.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'>{item2.Nav_User?.NAME + ' '}</label>
else
return item2.Nav_User.NAME + ' '
}
})
}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE022ShowPrint)

View File

@ -1,184 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE027ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PESafetyMonitorRecord/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PESafetyEvaluationPlan/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</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.YEAR}</Descriptions.Item>
<Descriptions.Item label="生产单元">{data?.Nav_ProductionUnit?.NAME} </Descriptions.Item>
{/* {enums.PTProductionUnitEnum.enums[data?.PRODUCTION_UNIT]} */}
<Descriptions.Item label="评价开始时间">{moment(data.START_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="评价结束时间">{moment(data.END_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"150px"}} className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>评价要素</td>
<td className={stylesStep.fontBold}>评价人员</td>
<td className={stylesStep.fontBold}>评价方法</td>
<td className={stylesStep.fontBold}>评价技术</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_StandardName?.NAME}
</td>
<td>
{
item.Nav_EvaluationUser && item.Nav_EvaluationUser.map((item2, i) => {
return <label>{item2.Nav_User?.NAME + ' '}</label>
})
}
</td>
<td>
{
item.Nav_EvaluationMethod && item.Nav_EvaluationMethod.map((item2, i) => {
return <tr><label> {item2.Nav_Method?.NAME}</label></tr>
})
}
</td>
<td>
{
item.EVALUATION_TECHNOLOGY
}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE027ShowPrint)

View File

@ -1,252 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE029ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PESafetyEvaluationRecord/IdentityUpdateNew',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PESafetyEvaluationRecord/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</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="评价开始时间">{moment(data.Nav_EvaluationPlan?.START_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="评价结束时间">{moment(data.Nav_EvaluationPlan?.END_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="评价人员">{
data.Nav_IngoreUser && data.Nav_IngoreUser.map((item, i) => {
if (i == (data.Nav_IngoreUser.length - 1)) {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'> {item.Nav_User?.NAME}</label>
else
return item.Nav_User.NAME
} else {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'>{item.Nav_User?.NAME + ','}</label>
else
return item.Nav_User.NAME + ','
}
})
}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"50px"}} className={stylesStep.fontBold}>序号</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>生产单元</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>一级类目</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>二级类目</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>三级类目</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>考评项目</td>
<td className={stylesStep.fontBold}>考评内容</td>
<td style={{width:"150px"}}className={stylesStep.fontBold}>评分办法</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>标准分</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>实得分</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>评价结论</td>
<td style={{width:"150px"}}className={stylesStep.fontBold}>不符合说明</td>
<td style={{width:"150px"}} className={stylesStep.fontBold}>评价方法</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_ProductionUnit?.NAME}
</td>
<td>
{item.Nav_Primary?.NAME}
</td>
<td>
{item.Nav_Second?.NAME}
</td>
<td>
{item.Nav_Three?.NAME}
</td>
<td>
{enums.PEEvaluationItemEnum.enums[item?.EVALUATION_ITEM]}
</td>
<td>
{
item.CONTENTS
}
</td>
<td>
{item.DESCRIPTION}
</td>
<td>
{
item.STANDARDIZED_SCORE
}
</td>
<td>
{item.RESULT_SCORE}
</td>
<td>
{enums.PEEvaluationResultEnum.enums[item?.EVALUATION_RESULT]}
</td>
<td>
{item.NON_CONFORMANCE}
</td>
<td>
{
item.Nav_EvaluationMethod && item.Nav_EvaluationMethod.map((item2, i) => {
return <tr><label> {item2.Nav_Method?.NAME}</label></tr>
})
}
</td>
</tr>
})
}
</table>:null
}
{
data && data.STAND_TOTAL && data.RESULT_TOTAL ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="标准分汇总">{data.STAND_TOTAL}</Descriptions.Item>
<Descriptions.Item label="实得分汇总">{data.RESULT_TOTAL}</Descriptions.Item>
<Descriptions.Item label="标准化得分">{data.STAND_TOTAL===0?0:(data.RESULT_TOTAL/data.STAND_TOTAL*100).toFixed(2)}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="评价人员签字">{
data.Nav_IngoreUser && data.Nav_IngoreUser.map((item, i) => {
if (item.DEAL_STATUS == 1) {
if (item.Nav_User != null && item.Nav_User.Nav_UserSignFiles[0] != null)
return <img style={{ margin: "0 0 0 15px",width:'200px' }} alt={item.Nav_User.NAME} src={config.picServerHost + item.Nav_User.Nav_UserSignFiles[0].Nav_ImgFile.Nav_File.FILE_PATH} />
else
return <img style={{ margin: "0 0 0 15px" ,width:'200px'}} title={item.Nav_User.NAME} />
}
})
}</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE029ShowPrint)

View File

@ -1,418 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE029ShowPrintNew extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
searchTodayVisible: false, //弹窗显示
tmpData: [],
searchColumns :[
{
title: '序号',
dataIndex: 'ROW_NO',
key: 'ROW_NO',
},
{
title: '生产单元',
dataIndex: 'Nav_ProductionUnit.NAME',
key: 'Nav_ProductionUnit.NAME',
},
{
title: '一级类目',
dataIndex: 'Nav_Primary.NAME',
key: 'Nav_Primary.NAME'
},
{
title: '二级类目',
dataIndex: 'Nav_Second.NAME',
key: 'Nav_Second.NAME'
},
{
title: '三级类目',
dataIndex: 'Nav_Three.NAME',
key: 'Nav_Three.NAME',
},
{
title: '考评项目',
dataIndex: 'EVALUATION_ITEM',
key: 'EVALUATION_ITEM',
render: (text, record) => (
<span>{this.props.app.enums.PEEvaluationItemEnum.enums[record?.EVALUATION_ITEM]}</span>
)
},
{
width: "350px",
title: '考评内容',
dataIndex: 'CONTENTS',
key: 'CONTENTS',
},
{
title: '扣分分值',
dataIndex: 'NON_STANDARDIZED_SCORE',
key: 'NON_STANDARDIZED_SCORE',
},
{
title: '不符合说明',
dataIndex: 'NON_CONFORMANCE',
key: 'NON_CONFORMANCE',
},
// {
// title: '标准分',
// dataIndex: 'STANDARDIZED_SCORE',
// key: 'STANDARDIZED_SCORE',
// },
// {
// title: '实得分',
// dataIndex: 'RESULT_SCORE',
// key: 'RESULT_SCORE',
// },
// {
// title: '评价结论',
// dataIndex: 'EVALUATION_RESULT',
// key: 'EVALUATION_RESULT',
// render: (text, record) => (
// <span>{this.props.app.enums.PEEvaluationResultEnum.enums[record?.EVALUATION_RESULT]}</span>
// )
// },
{
title: '评价方法',
dataIndex: 'Nav_EvaluationMethod',
key: 'Nav_EvaluationMethod',
render: (text, record) => (
<span>{
record.Nav_EvaluationMethod && record.Nav_EvaluationMethod?.map((item, i) => {
return <tr><label> {item.Nav_Method?.NAME}</label></tr>
})
}</span>
)
},]
};
};
componentDidMount() {
if (this.props.data?.id)
this.loadData(this.props.data?.id);
else
this.loadData(null);
}
componentWillReceiveProps(NextProps) {
if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) {
this.loadData(NextProps.data?.id);
}
}
loadList = () => {
let that=this;
let json = initFilter(that.props.login.OrgId);
// extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PESafetyEvaluationRecord/FullGet',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnAgree() {
this.props.dispatch({
type: 'app/getDataByPost',
url: 'PE/PESafetyMonitorRecord/IdentityUpdateNew',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PESafetyEvaluationRecord/FullGet',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
showModal = () => {
if(this.state.data && this.state.data?.Nav_Details)
{
let temp=this.state.data?.Nav_Details?.filter(t=>t.NON_CONFORMANCE != "" && t.NON_CONFORMANCE!=null);
let tmpData = temp.map((item, i) => {
item['ROW_NO'] = i + 1;
return item;
});
let aa={"CONTENTS":"合计扣分:","NON_STANDARDIZED_SCORE":this.state.data.NON_STANDARDIZED_SCORE}
tmpData.push(aa)
this.setState({
searchTodayVisible: true, //弹窗显示
tmpData:tmpData
});
}
else
{
message.error("请先等待数据加载");
}
}
closeModal = () => {
let newtmpData = { ...this.state.tmpData }
this.setState({
searchTodayVisible: false,
tmpData: [],//newtmpData
})
}
onTableBtnExport() {
// const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</Button> */}
</div>
<div ref={el => (this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id}>
<h1 style={{ textAlign: 'center', margin: '15px' }}>安全标准化内部评价记录表</h1>
<Button type="primary" style={{marginBottom:'8px' }} onClick={() => this.showModal()} icon="file" >不符合说明</Button>
<Modal
visible={this.state.searchTodayVisible}
title={"不符合项说明"}
onCancel={this.closeModal}
footer={null}
width={1000}
style={{ width: '100%', height: '100%' }}
>
<div>
{/* <FormPage {...this.state.tmpData} /> */}
<Table
dataSource={this.state.tmpData}
columns={this.state.searchColumns}
pagination={false}
loading={false}
size="small"
className={stylesStep.PrintForm1}
/>
</div>
</Modal>
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="评价开始时间">{data.Nav_EvaluationPlan?.START_TIME}</Descriptions.Item>
<Descriptions.Item label="评价结束时间">{data.Nav_EvaluationPlan?.END_TIME}</Descriptions.Item>
<Descriptions.Item label="评价人员">{
data.Nav_IngoreUser && data.Nav_IngoreUser.map((item, i) => {
if (i == (data.Nav_IngoreUser.length - 1)) {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'> {item.Nav_User?.NAME}</label>
else
return item.Nav_User.NAME
} else {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'>{item.Nav_User?.NAME + ','}</label>
else
return item.Nav_User.NAME + ','
}
})
}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"50px"}} className={stylesStep.fontBold}>序号</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>生产单元</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>一级类目</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>二级类目</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>三级类目</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>考评项目</td>
<td className={stylesStep.fontBold}>考评内容</td>
<td style={{width:"150px"}}className={stylesStep.fontBold}>评分办法</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>标准分</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>实得分</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>评价结论</td>
<td style={{width:"150px"}}className={stylesStep.fontBold}>不符合说明</td>
<td style={{width:"150px"}} className={stylesStep.fontBold}>评价方法</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_ProductionUnit?.NAME}
</td>
<td>
{item.Nav_Primary?.NAME}
</td>
<td>
{item.Nav_Second?.NAME}
</td>
<td>
{item.Nav_Three?.NAME}
</td>
<td>
{enums.PEEvaluationItemEnum.enums[item?.EVALUATION_ITEM]}
</td>
<td>
{
item.CONTENTS
}
</td>
<td>
{item.DESCRIPTION}
</td>
<td>
{
item.STANDARDIZED_SCORE
}
</td>
<td>
{item.RESULT_SCORE}
</td>
<td>
{enums.PEEvaluationResultEnum.enums[item?.EVALUATION_RESULT]}
</td>
<td>
{
item.NON_CONFORMANCE
}
</td>
<td>
{
item.Nav_EvaluationMethod && item.Nav_EvaluationMethod.map((item2, i) => {
return <tr><label> {item2.Nav_Method?.NAME}</label></tr>
})
}
</td>
</tr>
})
}
</table>:null
}
{
data && data.STAND_TOTAL && data.RESULT_TOTAL ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="标准分汇总">{data.STAND_TOTAL}</Descriptions.Item>
<Descriptions.Item label="实得分汇总">{data.RESULT_TOTAL}</Descriptions.Item>
<Descriptions.Item label="标准化得分">{data.STAND_TOTAL===0?0:(data.RESULT_TOTAL/data.STAND_TOTAL*100).toFixed(2)}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="评价人员签字">{
data.Nav_IngoreUser && data.Nav_IngoreUser.map((item, i) => {
if (item.DEAL_STATUS == 1) {
if (item.Nav_User != null && item.Nav_User.Nav_UserSignFiles[0] != null)
return <img style={{ margin: "0 0 0 15px",width:'200px' }} alt={item.Nav_User.NAME} src={config.picServerHost + item.Nav_User.Nav_UserSignFiles[0].Nav_ImgFile.Nav_File.FILE_PATH} />
else
return <img style={{ margin: "0 0 0 15px" ,width:'200px'}} title={item.Nav_User.NAME} />
}
})
}</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE029ShowPrintNew)

View File

@ -1,383 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PE030ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
searchTodayVisible: false, //弹窗显示
tmpData: [],
searchColumns :[
{
title: '序号',
dataIndex: 'ROW_NO',
key: 'ROW_NO',
},
{
title: '生产单元',
dataIndex: 'Nav_ProductionUnit.NAME',
key: 'Nav_ProductionUnit.NAME',
},
{
title: '一级类目',
dataIndex: 'Nav_Primary.NAME',
key: 'Nav_Primary.NAME'
},
{
title: '二级类目',
dataIndex: 'Nav_Second.NAME',
key: 'Nav_Second.NAME'
},
{
title: '三级类目',
dataIndex: 'Nav_Three.NAME',
key: 'Nav_Three.NAME',
},
{
title: '考评项目',
dataIndex: 'EVALUATION_ITEM',
key: 'EVALUATION_ITEM',
render: (text, record) => (
<span>{this.props.app.enums.PEEvaluationItemEnum.enums[record?.EVALUATION_ITEM]}</span>
)
},
{
width: "350px",
title: '考评内容',
dataIndex: 'CONTENTS',
key: 'CONTENTS',
},
{
title: '扣分分值',
dataIndex: 'NON_STANDARDIZED_SCORE',
key: 'NON_STANDARDIZED_SCORE',
},
{
title: '不符合说明',
dataIndex: 'NON_CONFORMANCE',
key: 'NON_CONFORMANCE',
},
// {
// title: '标准分',
// dataIndex: 'STANDARDIZED_SCORE',
// key: 'STANDARDIZED_SCORE',
// },
// {
// title: '实得分',
// dataIndex: 'RESULT_SCORE',
// key: 'RESULT_SCORE',
// },
// {
// title: '评价结论',
// dataIndex: 'EVALUATION_RESULT',
// key: 'EVALUATION_RESULT',
// render: (text, record) => (
// <span>{this.props.app.enums.PEEvaluationResultEnum.enums[record?.EVALUATION_RESULT]}</span>
// )
// },
{
title: '评价方法',
dataIndex: 'Nav_EvaluationMethod',
key: 'Nav_EvaluationMethod',
render: (text, record) => (
<span>{
record.Nav_EvaluationMethod && record.Nav_EvaluationMethod?.map((item, i) => {
return <tr><label> {item.Nav_Method?.NAME}</label></tr>
})
}</span>
)
},]
};
};
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: 'PE/PESafetyEvaluationRecord/IdentityUpdateNew',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, null);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PE/PESafetyEvaluationRecord/FullGet',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
showModal = () => {
if(this.state.data && this.state.data?.Nav_Details)
{
let temp=this.state.data?.Nav_Details?.filter(t=>t.NON_CONFORMANCE != "" && t.NON_CONFORMANCE!=null);
let tmpData = temp.map((item, i) => {
item['ROW_NO'] = i + 1;
return item;
});
let aa={"CONTENTS":"合计扣分:","NON_STANDARDIZED_SCORE":this.state.data.NON_STANDARDIZED_SCORE}
tmpData.push(aa)
this.setState({
searchTodayVisible: true, //弹窗显示
tmpData:tmpData
});
}
else
{
message.error("请先等待数据加载");
}
}
closeModal = () => {
let newtmpData = { ...this.state.tmpData }
this.setState({
searchTodayVisible: false,
tmpData: [],//newtmpData
})
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</Button> */}
</div>
<div ref={el => (this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id}>
<h1 style={{ textAlign: 'center', margin: '15px' }}>安全标准化自评表</h1>
<Button type="primary" style={{marginBottom:'8px' }} onClick={() => this.showModal()} icon="file" >不符合说明</Button>
<Modal
visible={this.state.searchTodayVisible}
title={"不符合项说明"}
onCancel={this.closeModal}
footer={null}
width={1000}
style={{ width: '100%', height: '100%' }}
>
<div>
{/* <FormPage {...this.state.tmpData} /> */}
<Table
dataSource={this.state.tmpData}
columns={this.state.searchColumns}
pagination={false}
loading={false}
size="small"
className={stylesStep.PrintForm1}
/>
</div>
</Modal>
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="评价开始时间">{data.Nav_EvaluationPlan?.START_TIME}</Descriptions.Item>
<Descriptions.Item label="评价结束时间">{data.Nav_EvaluationPlan?.END_TIME}</Descriptions.Item>
<Descriptions.Item label="评价人员">{
data.Nav_IngoreUser && data.Nav_IngoreUser.map((item, i) => {
if (i == (data.Nav_IngoreUser.length - 1)) {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'> {item.Nav_User?.NAME}</label>
else
return item.Nav_User.NAME
} else {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'>{item.Nav_User?.NAME + ','}</label>
else
return item.Nav_User.NAME + ','
}
})
}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"50px"}} className={stylesStep.fontBold}>序号</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>生产单元</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>一级类目</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>二级类目</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>三级类目</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>考评项目</td>
<td className={stylesStep.fontBold}>考评内容</td>
<td style={{width:"150px"}}className={stylesStep.fontBold}>评分办法</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>标准分</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>实得分</td>
<td style={{width:"50px"}}className={stylesStep.fontBold}>评价结论</td>
<td style={{width:"150px"}}className={stylesStep.fontBold}>不符合说明</td>
<td style={{width:"150px"}} className={stylesStep.fontBold}>评价方法</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_ProductionUnit?.NAME}
</td>
<td>
{item.Nav_Primary?.NAME}
</td>
<td>
{item.Nav_Second?.NAME}
</td>
<td>
{item.Nav_Three?.NAME}
</td>
<td>
{enums.PEEvaluationItemEnum.enums[item?.EVALUATION_ITEM]}
</td>
<td>
{
item.CONTENTS
}
</td>
<td>
{item.DESCRIPTION}
</td>
<td>
{
item.STANDARDIZED_SCORE
}
</td>
<td>
{item.RESULT_SCORE}
</td>
<td>
{enums.PEEvaluationResultEnum.enums[item?.EVALUATION_RESULT]}
</td>
<td>
{
item.NON_CONFORMANCE
}
</td>
<td>
{
item.Nav_EvaluationMethod && item.Nav_EvaluationMethod.map((item2, i) => {
return <tr><label> {item2.Nav_Method?.NAME}</label></tr>
})
}
</td>
</tr>
})
}
</table>:null
}
{
data && data.STAND_TOTAL && data.RESULT_TOTAL ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="标准分汇总">{data.STAND_TOTAL}</Descriptions.Item>
<Descriptions.Item label="实得分汇总">{data.RESULT_TOTAL}</Descriptions.Item>
<Descriptions.Item label="标准化得分">{data.STAND_TOTAL===0?0:(data.RESULT_TOTAL/data.STAND_TOTAL*100).toFixed(2)}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label="评价人员签字">{
data.Nav_IngoreUser && data.Nav_IngoreUser.map((item, i) => {
if (item.DEAL_STATUS == 1) {
if (item.Nav_User != null && item.Nav_User.Nav_UserSignFiles[0] != null)
return <img style={{ margin: "0 0 0 15px",width:'200px' }} alt={item.Nav_User.NAME} src={config.picServerHost + item.Nav_User.Nav_UserSignFiles[0].Nav_ImgFile.Nav_File.FILE_PATH} />
else
return <img style={{ margin: "0 0 0 15px" ,width:'200px'}} title={item.Nav_User.NAME} />
}
})
}</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PE030ShowPrint)

View File

@ -1,154 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR003ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/PRDesignDocumentReview/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="发起时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="设计文件名称">{data.NAME}</Descriptions.Item>
<Descriptions.Item label="设计潜在风险">{data.POTENTIAL_RISK}</Descriptions.Item>
<Descriptions.Item label="设计层级">{enums.PRDesignLevelEnum.enums[data.DESIGN_LEVEL]}</Descriptions.Item>
<Descriptions.Item label='审核要求表'>
<div>{
data.Nav_Requirements && data.Nav_Requirements.map((item, i) => {
return <tr><label> {item.Nav_Requirement?.NAME}</label></tr>
})
}</div></Descriptions.Item>
<Descriptions.Item label='设计文件'>
<div>{
data.Nav_Files && data.Nav_Files.map((item, i) => {
return <tr><a title={item.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + item.Nav_ImgFile.Nav_File.FILE_PATH} >{item.Nav_ImgFile.FILE_NAME} </a></tr>
})
}</div></Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR003ShowPrint)

View File

@ -1,148 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR007ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_User');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/LandslideRollstoneMonitor/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="记录时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="记录人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="监测情况">{enums.PRMonitorStatusEnum.enums[data.MONITOR_STATUS]}</Descriptions.Item>
<Descriptions.Item label="发生地点">{data.PLACE}</Descriptions.Item>
<Descriptions.Item label="情况描述">{data.DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label="是否处理">{enums.DisableStatusEnum.enums[data.IS_DEAL]}</Descriptions.Item>
<Descriptions.Item label="是否需要外部协助">{enums.DisableStatusEnum.enums[data.IS_HELP]}</Descriptions.Item>
<Descriptions.Item label="未处理原因及建议">{data.REASON}</Descriptions.Item>
<Descriptions.Item label="处理措施">{data.MEASURES}</Descriptions.Item>
<Descriptions.Item label="处理措施是否可靠">{enums.DisableStatusEnum.enums[data.IS_RELIABLE]}</Descriptions.Item>
<Descriptions.Item label="验收意见">{data.OPINION}</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR007ShowPrint)

View File

@ -1,147 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR009ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_User');
extendInclude(json, 'Nav_Department');
extendInclude(json, 'Nav_Monitor');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/ExternalAssistanceApplication/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="申请时间">{moment(data.CREATE_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="申请部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="申请人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="申请原因">{data.REASON}</Descriptions.Item>
<Descriptions.Item label="情况描述">{data.DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label="外部协作单位名称">{data.UNIT}</Descriptions.Item>
<Descriptions.Item label="联系人">{data.NAME}</Descriptions.Item>
<Descriptions.Item label="联系方式">{data.PHONE}</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR009ShowPrint)

View File

@ -1,160 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR011ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Acceptances');
extendInclude(json, 'Nav_Acceptances.Nav_ImgFile');
extendInclude(json, 'Nav_Acceptances.Nav_ImgFile.Nav_File');
extendInclude(json, 'Nav_Files');
extendInclude(json, 'Nav_Files.Nav_ImgFile');
extendInclude(json, 'Nav_Files.Nav_ImgFile.Nav_File');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/ExternalAcceptanceRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="处理开始时间">{moment(data.START_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="处理结束时间">{moment(data.END_TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="外部协作单位">{data.UNIT}</Descriptions.Item>
<Descriptions.Item label="情况描述">{data.DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label="整改记录">{data.RECTIFICATION_RECORD}</Descriptions.Item>
<Descriptions.Item label="处理措施是否可靠">{enums.DisableStatusEnum.enums[data.IS_RELIABLE]}</Descriptions.Item>
<Descriptions.Item label='验收记录'>
<div>{
data.Nav_Acceptances && data.Nav_Acceptances.map((item, i) => {
return <tr><a title={item.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + item.Nav_ImgFile.Nav_File.FILE_PATH} >{item.Nav_ImgFile.FILE_NAME} </a></tr>
})
}</div></Descriptions.Item>
<Descriptions.Item label='附件'>
<div>{
data.Nav_Files && data.Nav_Files.map((item, i) => {
return <tr><a title={item.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + item.Nav_ImgFile.Nav_File.FILE_PATH} >{item.Nav_ImgFile.FILE_NAME} </a></tr>
})
}</div></Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR011ShowPrint)

View File

@ -1,151 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR013ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Department');
extendInclude(json, 'Nav_User');
extendInclude(json, 'Nav_Files');
extendInclude(json, 'Nav_Files.Nav_ImgFile');
extendInclude(json, 'Nav_Files.Nav_ImgFile.Nav_File');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/MapProcessRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="日期">{moment(data.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="测绘人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="测绘部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="采掘带开采情况">{data.DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label='测绘记录上传'>
<div>{
data.Nav_Files && data.Nav_Files.map((item, i) => {
return <tr><a title={item.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + item.Nav_ImgFile.Nav_File.FILE_PATH} >{item.Nav_ImgFile.FILE_NAME} </a></tr>
})
}</div></Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR013ShowPrint)

View File

@ -1,195 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR015ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Users');
extendInclude(json, 'Nav_Users.Nav_User');
extendInclude(json, 'Nav_Details');
extendInclude(json, 'Nav_Files');
extendInclude(json, 'Nav_Files.Nav_ImgFile');
extendInclude(json, 'Nav_Files.Nav_ImgFile.Nav_File');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/SurveyRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="测量时间">{moment(data.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="测量地点">{data.PLACE}</Descriptions.Item>
<Descriptions.Item label='测量人员'>
<div>{
data.Nav_Users && data.Nav_Users.map((item, i) => {
return <tr><label> {item.Nav_User?.NAME}</label></tr>
})
}</div></Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px'className={stylesStep.fontBold}>测量类型</td>
<td width='150px' className={stylesStep.fontBold}>测量参数</td>
<td width='150px' className={stylesStep.fontBold}>设计/规范值</td>
<td width='150px' className={stylesStep.fontBold}>测量/计算值</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.TYPE}
</td>
<td>
{item.PARAMETER}
</td>
<td>
{item.VALUE}
</td>
<td>
{item.ACTUAL_VALUE}
</td>
</tr>
})
}
</table>:null
}
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label='附件'>
<div>{
data.Nav_Files && data.Nav_Files.map((item, i) => {
return <tr><a title={item.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + item.Nav_ImgFile.Nav_File.FILE_PATH} >{item.Nav_ImgFile.FILE_NAME} </a></tr>
})
}</div></Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR015ShowPrint)

View File

@ -1,165 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR019ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_OperationStep');
extendInclude(json, 'Nav_User');
extendInclude(json, 'Nav_Users.Nav_User');
extendInclude(json, 'Nav_Files');
extendInclude(json, 'Nav_Files.Nav_ImgFile');
extendInclude(json, 'Nav_Files.Nav_ImgFile.Nav_File');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/ProductionOperationRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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.Nav_OperationStep ? data.Nav_OperationStep.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="作业时间">{moment(data.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="作业地点">{data.PLACE}</Descriptions.Item>
<Descriptions.Item label="记录人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label='作业人员'>
<div>{
data.Nav_Users && data.Nav_Users.map((item, i) => {
if (i == (data.Nav_Users.length - 1)) {
return item.Nav_User?.NAME
}
else
{
return item.Nav_User?.NAME + ' '
}
})
}</div></Descriptions.Item>
<Descriptions.Item label="作业工程量描述">{data.DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label='附件'>
<div>{
data.Nav_Files && data.Nav_Files.map((item, i) => {
return <tr><a title={item.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + item.Nav_ImgFile.Nav_File.FILE_PATH} >{item.Nav_ImgFile.FILE_NAME} </a></tr>
})
}</div></Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR019ShowPrint)

View File

@ -1,186 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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 { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR023ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Department');
extendInclude(json, 'Nav_User');
extendInclude(json, 'Nav_Types');
extendInclude(json, 'Nav_Types.Nav_Type');
extendInclude(json, 'Nav_Tasks');
extendInclude(json, 'Nav_Tasks.Nav_Task');
extendInclude(json, 'Nav_Tasks.Nav_User');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/ChangeIdentifyEvaluation/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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={styles.description}>
<Descriptions.Item label="编号">{data.CODE}</Descriptions.Item>
<Descriptions.Item label="发起时间">{moment(data.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label='变化类型'>
<div>{
data.Nav_Types && data.Nav_Types.map((item, i) => {
if (i == (data.Nav_Types.length - 1)) {
return item.Nav_Type?.NAME
}
else
{
return item.Nav_Type?.NAME + ' '
}
})
}</div></Descriptions.Item>
<Descriptions.Item label="变化描述">{data.DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label="变化带来的风险">{data.RISK}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={styles.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={styles.fontBold}>序号</td>
<td className={styles.fontBold}>变化后执行任务</td>
<td className={styles.fontBold}>落实人员</td>
</tr>
{
data.Nav_Tasks && data.Nav_Tasks.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Task.NAME}
</td>
<td>
{item.Nav_User.NAME}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR023ShowPrint)

View File

@ -1,178 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR026ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/PRChangeTaskImplement/GetUserEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label='变化类型'>
<div>{
data.Nav_Types && data.Nav_Types.map((item, i) => {
if (i == (data.Nav_Types.length - 1)) {
return item.Nav_Type?.NAME
}
else
{
return item.Nav_Type?.NAME + ' '
}
})
}</div></Descriptions.Item>
<Descriptions.Item label="变化描述">{data.DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label='变化后执行任务'>
<div>{
data.Nav_Task?.NAME
}</div></Descriptions.Item>
<Descriptions.Item label="执行状况">{enums.PRPerformStatusEnum.enums[data.PERFORM_STATUS]}</Descriptions.Item>
<Descriptions.Item label='执行人员'>
<div>{
data.Nav_Users && data.Nav_Users.map((item, i) => {
if (i == (data.Nav_Users.length - 1)) {
return item.Nav_User?.NAME
}
else
{
return item.Nav_User?.NAME + ' '
}
})
}</div></Descriptions.Item>
<Descriptions.Item label="执行情况">{data.PERFORM_DESCRIPTION}</Descriptions.Item>
<Descriptions.Item label="未执行原因">{data.REASON}</Descriptions.Item>
<Descriptions.Item label='附件'>
<div>{
data.Nav_Files && data.Nav_Files.map((item, i) => {
return <tr><a title={item.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + item.Nav_ImgFile.Nav_File.FILE_PATH} >{item.Nav_ImgFile.FILE_NAME} </a></tr>
})
}</div></Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR026ShowPrint)

View File

@ -1,177 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR028ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/PRChangeAcceptance/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label='变化类型'>
<div>{
data.Nav_Types && data.Nav_Types.map((item, i) => {
if (i == (data.Nav_Types.length - 1)) {
return item.Nav_Type?.NAME
}
else
{
return item.Nav_Type?.NAME + ' '
}
})
}</div></Descriptions.Item>
<Descriptions.Item label="变化描述">{data.DESCRIPTION}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>变化后验收内容</td>
<td className={stylesStep.fontBold}>验收意见</td>
</tr>
{
data.Nav_Tasks && data.Nav_Tasks.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Task.NAME}
</td>
<td>
{enums.PRAcceptanceOpinionEnum.enums[item.ACCEPTANCE_OPINION]}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR028ShowPrint)

View File

@ -1,224 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR046ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PR/PRDrugOutboundRecord/IdentityUpdate',
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 that=this;
let json = initFilter(this.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_User');
extendInclude(json, 'Nav_Department');
extendInclude(json, 'Nav_Details');
extendInclude(json, 'Nav_Details.Nav_Drug');
extendInclude(json, 'Nav_Details.Nav_Type');
extendInclude(json, 'Nav_Details.Nav_Specify');
extendInclude(json, 'Nav_Details.Nav_Place');
extendInclude(json, 'Nav_Details.Nav_Users.Nav_User');
extendInclude(json, 'Nav_Details.Nav_Accepts.Nav_User');
extendIgnoreDataRule(json)
this.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/DrugOutboundRecord/Get',
onComplete: (ret) => {
if (ret) {
if(this.props.data && this.props.data.loadDataDeal)
{
this.props.data.loadDataDeal(1);
}
ret.Nav_Details.forEach(item=>{
item.Nav_Users.sort((x, y) => (x.ROW_NO > y.ROW_NO ? 1 : -1));
item.Nav_Accepts.sort((x, y) => (x.ROW_NO > y.ROW_NO ? 1 : -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);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</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="申请日期">{moment(data.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="申请部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="申请人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px'className={stylesStep.fontBold}>药品名称</td>
<td width='150px' className={stylesStep.fontBold}>规格</td>
<td width='150px' className={stylesStep.fontBold}>出库数量</td>
<td width='150px' className={stylesStep.fontBold}>单位</td>
<td width='150px' className={stylesStep.fontBold}>搬运时间</td>
<td width='150px' className={stylesStep.fontBold}>搬运人员</td>
<td width='150px' className={stylesStep.fontBold}>搬运部门</td>
<td width='150px' className={stylesStep.fontBold}>送达地点</td>
<td width='150px' className={stylesStep.fontBold}>接收人员</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Drug.NAME}
</td>
<td>
{item.Nav_Specify.NAME}
</td>
<td>
{item.QTY}
</td>
<td>
{item.UNIT}
</td>
<td>
{moment(item.CARRY_TIME).format('YYYY-MM-DD')}
</td>
<td>
{
item?.Nav_Users && item?.Nav_Users?.map((item2, i) => {
if (i == (item?.Nav_Users.length - 1)) {
return item2?.Nav_User?.NAME
}
else
{
return item2?.Nav_User?.NAME + ' '
}
})
}
</td>
<td>
{item.DEPARTMENT}
</td>
<td>
{item.Nav_Place.NAME}
</td>
<td>
{
item?.Nav_Accepts && item?.Nav_Accepts?.map((item2, i) => {
if (i == (item?.Nav_Accepts.length - 1)) {
return item2?.Nav_User?.NAME
}
else
{
return item2?.Nav_User?.NAME + ' '
}
})
}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR046ShowPrint)

View File

@ -1,301 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR048ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PR/PRDrugCarryRecord/IdentityUpdateNew',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Confirms');
extendInclude(json, 'Nav_Confirms.Nav_Type');
extendInclude(json, 'Nav_Details');
extendInclude(json, 'Nav_Details.Nav_Drug');
extendInclude(json, 'Nav_Details.Nav_Type');
extendInclude(json, 'Nav_Details.Nav_Specify');
extendInclude(json, 'Nav_Details.Nav_Place');
extendInclude(json, 'Nav_Details.Nav_Users');
extendInclude(json, 'Nav_Details.Nav_Users.Nav_User.Nav_UserSignFiles.Nav_ImgFile.Nav_File');
extendInclude(json, 'Nav_Details.Nav_Accepts');
extendInclude(json, 'Nav_Details.Nav_Accepts.Nav_User.Nav_UserSignFiles.Nav_ImgFile.Nav_File');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/DrugCarryRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
ret.Nav_Details.forEach(item=>{
item.Nav_Users.sort((x, y) => (x.ROW_NO > y.ROW_NO ? 1 : -1));
item.Nav_Accepts.sort((x, y) => (x.ROW_NO > y.ROW_NO ? 1 : -1));
})
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</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 ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px'className={stylesStep.fontBold}>药品名称</td>
<td width='150px' className={stylesStep.fontBold}>规格</td>
<td width='150px' className={stylesStep.fontBold}>搬运数量</td>
<td width='150px' className={stylesStep.fontBold}>单位</td>
<td width='150px' className={stylesStep.fontBold}>搬运时间</td>
<td width='150px' className={stylesStep.fontBold}>搬运人员</td>
<td width='150px' className={stylesStep.fontBold}>搬运部门</td>
<td width='150px' className={stylesStep.fontBold}>送达地点</td>
<td width='150px' className={stylesStep.fontBold}>接收人员</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Drug.NAME}
</td>
<td>
{item.Nav_Specify.NAME}
</td>
<td>
{item.QTY}
</td>
<td>
{item.UNIT}
</td>
<td>
{moment(item.CARRY_TIME).format('YYYY-MM-DD')}
</td>
<td>
{
item.Nav_Users && item.Nav_Users.map((item2, i) => {
if (i == (item.Nav_Users.length - 1)) {
if (item2.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'> {item2.Nav_User.NAME}</label>
else
return item2.Nav_User.NAME
} else {
if (item2.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'>{item2.Nav_User.NAME + ' '}</label>
else
return item2.Nav_User.NAME + ' '
}
})
}
</td>
<td>
{item.DEPARTMENT}
</td>
<td>
{item.Nav_Place.NAME}
</td>
<td>
{
item.Nav_Accepts && item.Nav_Accepts.map((item2, i) => {
if (i == (item.Nav_Accepts.length - 1)) {
// if (item2.DEAL_STATUS == 0)
// return <label style={{ color: 'red' }} title='未签到'> {item2.Nav_User.NAME}</label>
// else
return item2.Nav_User?.NAME
}
else
{
// if (item2.DEAL_STATUS == 0)
// return <label style={{ color: 'red' }} title='未签到'>{item2.Nav_User.NAME + ' '}</label>
// else
return item2.Nav_User.NAME + ' '
}
})
}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px'className={stylesStep.fontBold}>药品类型</td>
<td className={stylesStep.fontBold}>搬运安全确认项目</td>
<td width='150px' className={stylesStep.fontBold}>是否确认</td>
</tr>
{
data.Nav_Confirms && data.Nav_Confirms.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Type.NAME}
</td>
<td>
{item.NAME}
</td>
<td>
{item.IS_CONFIRM == true?"是":"否"}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px'className={stylesStep.fontBold}>药品名称</td>
<td className={stylesStep.fontBold}>搬运人员签名</td>
{/* <td className={stylesStep.fontBold}>接收人员签名</td> */}
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Drug.NAME}
</td>
<td>
{
item.Nav_Users.map((item2, i) => {
if (item2.DEAL_STATUS === 1) {
if (item2.Nav_User !== null && item2.Nav_User.Nav_UserSignFiles[0] !== null)
return <img style={{ margin: "0 0 0 15px",width:'150px' }} alt={item2.Nav_User?.NAME} src={config.picServerHost + item2.Nav_User.Nav_UserSignFiles[0]?.Nav_ImgFile.Nav_File.FILE_PATH} />
else
return <img style={{ margin: "0 0 0 15px",width:'150px' }} title={item2.Nav_User?.NAME} />
}
})
}
</td>
{/* <td>
{
item.Nav_Accepts.map((item2, i) => {
if (item2.DEAL_STATUS === 1) {
if (item2.Nav_User !== null && item2.Nav_User.Nav_UserSignFiles[0] !== null)
return <img style={{ margin: "0 0 0 15px",width:'150px' }} alt={item2.Nav_User?.NAME} src={config.picServerHost + item2.Nav_User.Nav_UserSignFiles[0]?.Nav_ImgFile.Nav_File.FILE_PATH} />
else
return <img style={{ margin: "0 0 0 15px",width:'150px' }} title={item2.Nav_User?.NAME} />
}
})
}
</td> */}
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR048ShowPrint)

View File

@ -1,206 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR050ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PR/PRDrugUseRecord/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Department');
extendInclude(json, 'Nav_Users.Nav_User.Nav_UserSignFiles.Nav_ImgFile.Nav_File');
extendInclude(json, 'Nav_Drug');
extendInclude(json, 'Nav_Type');
extendInclude(json, 'Nav_Specify');
extendInclude(json, 'Nav_Confirms');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/DrugUseRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</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="使用时间">{moment(data.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="使用部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="使用人员">{
data.Nav_Users && data.Nav_Users.map((item, i) => {
if (i == (data.Nav_Users.length - 1)) {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'> {item.Nav_User?.NAME}</label>
else
return item.Nav_User.NAME
} else {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'>{item.Nav_User?.NAME + ' '}</label>
else
return item.Nav_User.NAME + ' '
}
})
}</Descriptions.Item>
<Descriptions.Item label="药品(剂)名称">{data.Nav_Drug ? data.Nav_Drug.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="规格">{data.Nav_Specify ? data.Nav_Specify.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="使用数量">{data.QTY}</Descriptions.Item>
<Descriptions.Item label="单位">{data.UNIT}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>使用安全确认项目</td>
<td width='150px' className={stylesStep.fontBold}>是否确认</td>
</tr>
{
data.Nav_Confirms && data.Nav_Confirms.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NAME}
</td>
<td>
{item.IS_CONFIRM == true?"是":"否"}
</td>
</tr>
})
}
</table>:null
}
{
data ?
<div>
<Descriptions size="middle" bordered className={stylesStep.description}>
<Descriptions.Item label='使用人员签名'>
<div>{
data.Nav_Users && data.Nav_Users.map((item, i) => {
if (item.DEAL_STATUS == 1) {
if (item.Nav_User != null && item.Nav_User.Nav_UserSignFiles[0] != null)
return <img style={{ margin: "0 0 0 15px",width:'150px' }} alt={item.Nav_User?.NAME} src={config.picServerHost + item.Nav_User.Nav_UserSignFiles[0].Nav_ImgFile.Nav_File.FILE_PATH} />
else
return <img style={{ margin: "0 0 0 15px",width:'150px' }} title={item.Nav_User?.NAME} />
}
})
}</div>
</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR050ShowPrint)

View File

@ -1,168 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR052ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/PRDrugUseRecordPrint/GetUserEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="使用时间">{moment(data.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
<Descriptions.Item label="使用部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="使用人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="药品名称">{data.Nav_Drug ? data.Nav_Drug.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="药剂类型">{data.Nav_Type ? data.Nav_Type.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="规格">{data.Nav_Specify ? data.Nav_Specify.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="使用数量">{data.QTY}</Descriptions.Item>
<Descriptions.Item label="单位">{data.UNIT}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>使用安全确认项目</td>
<td width='150px' className={stylesStep.fontBold}>是否确认</td>
</tr>
{
data.Nav_Confirms && data.Nav_Confirms.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NAME}
</td>
<td>
{item.IS_CONFIRM == true?"是":"否"}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR052ShowPrint)

View File

@ -1,182 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR056ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Details');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/ExperimentalOperationRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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="实验样品">{data.SAMPLE}</Descriptions.Item>
<Descriptions.Item label="实验目的">{data.PURPOSE}</Descriptions.Item>
<Descriptions.Item label="实验要求">{data.REQUIREMENTS}</Descriptions.Item>
<Descriptions.Item label="实验时间">{moment(data.TIME).format('YYYY-MM-DD')}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>产品编号</td>
<td width='150px' className={stylesStep.fontBold}>产品名称</td>
<td width='150px' className={stylesStep.fontBold}>重量</td>
<td width='150px' className={stylesStep.fontBold}>产率</td>
<td width='150px' className={stylesStep.fontBold}>品位</td>
<td width='150px' className={stylesStep.fontBold}>金属量</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.CODE}
</td>
<td>
{item.NAME}
</td>
<td>
{item.WEIGHT}
</td>
<td>
{item.RATE}
</td>
<td>
{item.GRADE}
</td>
<td>
{item.METAL}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR056ShowPrint)

View File

@ -1,269 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR058ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Pres');
extendInclude(json, 'Nav_Dets');
extendInclude(json, 'Nav_Ores');
extendInclude(json, 'Nav_Sams');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/LaboratoryOperationRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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 ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>系列</td>
<td width='150px' className={stylesStep.fontBold}>原矿/精原%</td>
<td width='150px' className={stylesStep.fontBold}>粗精/湿精%</td>
<td width='150px' className={stylesStep.fontBold}>尾矿%</td>
<td width='150px' className={stylesStep.fontBold}>回收率%</td>
<td width='150px' className={stylesStep.fontBold}>富集比</td>
</tr>
{
data.Nav_Pres && data.Nav_Pres.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.UNDRESS_ORE}
</td>
<td>
{item.COARSE_FINE}
</td>
<td>
{item.TAILING}
</td>
<td>
{item.RECOVERY_RATE}
</td>
<td>
{item.ENRICHMENT}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>系列</td>
<td width='150px' className={stylesStep.fontBold}>原矿/精原%</td>
<td width='150px' className={stylesStep.fontBold}>粗精/湿精%</td>
<td width='150px' className={stylesStep.fontBold}>尾矿%</td>
<td width='150px' className={stylesStep.fontBold}>回收率%</td>
<td width='150px' className={stylesStep.fontBold}>富集比</td>
</tr>
{
data.Nav_Dets && data.Nav_Dets.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.UNDRESS_ORE}
</td>
<td>
{item.COARSE_FINE}
</td>
<td>
{item.TAILING}
</td>
<td>
{item.RECOVERY_RATE}
</td>
<td>
{item.ENRICHMENT}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>PH</td>
<td className={stylesStep.fontBold}>浓度</td>
<td className={stylesStep.fontBold}>细度</td>
</tr>
{
data.Nav_Ores && data.Nav_Ores.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.PH}
</td>
<td>
{item.STRINGNESS}
</td>
<td>
{item.FINENESS}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>批号</td>
<td className={stylesStep.fontBold}>WO3%</td>
<td className={stylesStep.fontBold}>H2O%</td>
</tr>
{
data.Nav_Sams && data.Nav_Sams.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.BATCH_NO}
</td>
<td>
{item.WO3}
</td>
<td>
{item.H2O}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR058ShowPrint)

View File

@ -1,298 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR060ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Deals');
extendInclude(json, 'Nav_Drugs');
extendInclude(json, 'Nav_Machs');
extendInclude(json, 'Nav_Inves');
extendInclude(json, 'Nav_Tungs');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/DutyOperationRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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 ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>系列</td>
<td width='150px' className={stylesStep.fontBold}>运行时间</td>
<td width='150px' className={stylesStep.fontBold}>矿量</td>
</tr>
{
data.Nav_Deals && data.Nav_Deals.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.HOUR}
</td>
<td>
{item.COUNT}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>药剂名称</td>
<td width='150px' className={stylesStep.fontBold}>用量</td>
<td width='150px' className={stylesStep.fontBold}>单耗</td>
</tr>
{
data.Nav_Drugs && data.Nav_Drugs.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.QTY}
</td>
<td>
{item.ACERAGE}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>本班压力</td>
<td className={stylesStep.fontBold}>本班放浆桶数</td>
<td className={stylesStep.fontBold}>本班加温数</td>
</tr>
{
data.Nav_Machs && data.Nav_Machs.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.PRESS}
</td>
<td>
{item.QTY}
</td>
<td>
{item.HEAT_QTY}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>接班库存量</td>
<td className={stylesStep.fontBold}>本班入库量</td>
<td className={stylesStep.fontBold}>本班使用量</td>
<td className={stylesStep.fontBold}>交班库存量</td>
<td className={stylesStep.fontBold}>交班时高水池水位</td>
</tr>
{
data.Nav_Inves && data.Nav_Inves.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.ACCEPT_QTY}
</td>
<td>
{item.INPUT_QTY}
</td>
<td>
{item.USE_QTY}
</td>
<td>
{item.SEND_QTY}
</td>
<td>
{item.HEIGHT}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>系列</td>
<td width='150px' className={stylesStep.fontBold}>原矿品位%</td>
<td width='150px' className={stylesStep.fontBold}>精矿品位%</td>
<td width='150px' className={stylesStep.fontBold}>尾矿品位%</td>
<td width='150px' className={stylesStep.fontBold}>回收率%</td>
<td width='150px' className={stylesStep.fontBold}>富集比</td>
<td className={stylesStep.fontBold}>备注</td>
</tr>
{
data.Nav_Tungs && data.Nav_Tungs.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.UNDRESS_ORE}
</td>
<td>
{item.COARSE_FINE}
</td>
<td>
{item.TAILING}
</td>
<td>
{item.RECOVERY_RATE}
</td>
<td>
{item.ENRICHMENT}
</td>
<td>
{item.REMARK}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR060ShowPrint)

View File

@ -1,329 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR062ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Seris');
extendInclude(json, 'Nav_Drugs');
extendInclude(json, 'Nav_Meas');
extendInclude(json, 'Nav_Targs');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/TungpreOperationRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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 ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>系列</td>
<td width='150px' className={stylesStep.fontBold}>时间</td>
<td width='150px' className={stylesStep.fontBold}>浓度</td>
<td width='150px' className={stylesStep.fontBold}>细度</td>
<td width='150px' className={stylesStep.fontBold}>含量</td>
<td width='150px' className={stylesStep.fontBold}>纯碱标定开启度</td>
<td width='150px' className={stylesStep.fontBold}>纯碱标定流量</td>
<td width='150px' className={stylesStep.fontBold}>抑制剂标定开启度</td>
<td width='150px' className={stylesStep.fontBold}>抑制剂标定流量</td>
<td width='150px' className={stylesStep.fontBold}>皂化标定开启度</td>
<td width='150px' className={stylesStep.fontBold}>皂化标定粗选流量</td>
<td width='150px' className={stylesStep.fontBold}>皂化标定扫选1流量</td>
<td width='150px' className={stylesStep.fontBold}>泡沫层值粗选</td>
<td width='150px' className={stylesStep.fontBold}>泡沫层值扫选1</td>
<td width='150px' className={stylesStep.fontBold}>泡沫层值扫选2</td>
<td width='150px' className={stylesStep.fontBold}>泵频率粗选</td>
<td width='150px' className={stylesStep.fontBold}>泵频率扫选1</td>
<td width='150px' className={stylesStep.fontBold}>泵频率扫选2</td>
<td width='150px' className={stylesStep.fontBold}>气压粗选</td>
<td width='150px' className={stylesStep.fontBold}>气压扫选1</td>
<td width='150px' className={stylesStep.fontBold}>气压扫选2</td>
</tr>
{
data.Nav_Seris && data.Nav_Seris.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.TIME}
</td>
<td>
{item.STRONG}
</td>
<td>
{item.DETAIL}
</td>
<td>
{item.RATE}
</td>
<td>
{item.SODA_START}
</td>
<td>
{item.SODA_TRAFFIC}
</td>
<td>
{item.INHI_START}
</td>
<td>
{item.INHI_TRAFFIC}
</td>
<td>
{item.SAPO_START}
</td>
<td>
{item.SAPO_TRAFFIC}
</td>
<td>
{item.SAPO_SCAVENG}
</td>
<td>
{item.BUBBLE_ROUGH}
</td>
<td>
{item.BUBBLE_SCAVENG1}
</td>
<td>
{item.BUBBLE_SCAVENG2}
</td>
<td>
{item.PUMP_ROUGH}
</td>
<td>
{item.PUMP_SCAVENG1}
</td>
<td>
{item.PUMP_SCAVENG2}
</td>
<td>
{item.AIRPRESS_ROUGH}
</td>
<td>
{item.AIRPRESS_SCAVENG1}
</td>
<td>
{item.AIRPRESS_SCAVENG2}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>药剂名称</td>
<td className={stylesStep.fontBold}>用量</td>
<td className={stylesStep.fontBold}>单耗</td>
</tr>
{
data.Nav_Drugs && data.Nav_Drugs.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.QTY}
</td>
<td>
{item.ACERAGE}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>时间</td>
<td className={stylesStep.fontBold}>温度</td>
</tr>
{
data.Nav_Meas && data.Nav_Meas.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.TIME}
</td>
<td>
{item.TEMP}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>系列</td>
<td width='150px' className={stylesStep.fontBold}>原矿品位%</td>
<td width='150px' className={stylesStep.fontBold}>精矿品位%</td>
<td width='150px' className={stylesStep.fontBold}>尾矿品位%</td>
<td width='150px' className={stylesStep.fontBold}>理论收率%</td>
<td width='150px' className={stylesStep.fontBold}>富集比</td>
<td className={stylesStep.fontBold}>备注</td>
</tr>
{
data.Nav_Targs && data.Nav_Targs.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.UNDRESS_ORE}
</td>
<td>
{item.COARSE_FINE}
</td>
<td>
{item.TAILING}
</td>
<td>
{item.RECOVERY_RATE}
</td>
<td>
{item.ENRICHMENT}
</td>
<td>
{item.REMARK}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR062ShowPrint)

View File

@ -1,277 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR064ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Seris');
extendInclude(json, 'Nav_Drugs');
extendInclude(json, 'Nav_Airs');
extendInclude(json, 'Nav_Deals');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/ControlroomOperationRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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 ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>系列</td>
<td width='150px' className={stylesStep.fontBold}>时间</td>
<td width='150px' className={stylesStep.fontBold}>纯碱标定开启度</td>
<td width='150px' className={stylesStep.fontBold}>纯碱标定流量</td>
<td width='150px' className={stylesStep.fontBold}>抑制剂标定开启度</td>
<td width='150px' className={stylesStep.fontBold}>抑制剂标定流量</td>
<td width='150px' className={stylesStep.fontBold}>皂化标定开启度</td>
<td width='150px' className={stylesStep.fontBold}>皂化标定粗选流量</td>
<td width='150px' className={stylesStep.fontBold}>皂化标定扫选1流量</td>
<td width='150px' className={stylesStep.fontBold}>泡沫层值粗选</td>
<td width='150px' className={stylesStep.fontBold}>泡沫层值扫选1</td>
<td width='150px' className={stylesStep.fontBold}>泡沫层值扫选2</td>
</tr>
{
data.Nav_Seris && data.Nav_Seris.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.TIME}
</td>
<td>
{item.SODA_START}
</td>
<td>
{item.SODA_TRAFFIC}
</td>
<td>
{item.INHI_START}
</td>
<td>
{item.INHI_TRAFFIC}
</td>
<td>
{item.SAPO_START}
</td>
<td>
{item.SAPO_TRAFFIC}
</td>
<td>
{item.SAPO_SCAVENG}
</td>
<td>
{item.BUBBLE_ROUGH}
</td>
<td>
{item.BUBBLE_SCAVENG1}
</td>
<td>
{item.BUBBLE_SCAVENG2}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>药剂名称</td>
<td width='150px' className={stylesStep.fontBold}>用量</td>
<td width='150px' className={stylesStep.fontBold}>单耗</td>
</tr>
{
data.Nav_Drugs && data.Nav_Drugs.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.QTY}
</td>
<td>
{item.ACERAGE}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>时间</td>
<td width='150px' className={stylesStep.fontBold}>压力兆帕</td>
</tr>
{
data.Nav_Airs && data.Nav_Airs.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.TIME}
</td>
<td>
{item.PRESS}
</td>
</tr>
})
}
</table>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>系列</td>
<td width='150px' className={stylesStep.fontBold}>运行时间</td>
<td width='150px' className={stylesStep.fontBold}>矿量</td>
</tr>
{
data.Nav_Deals && data.Nav_Deals.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NO}
</td>
<td>
{item.HOUR}
</td>
<td>
{item.COUNT}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR064ShowPrint)

View File

@ -1,154 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR066ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Details');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/SandpumpOperationRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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 ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>事项</td>
<td className={stylesStep.fontBold}>时间及工作情况描述</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NAME}
</td>
<td>
{item.DESCRIPTION}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR066ShowPrint)

View File

@ -1,154 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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';
import { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PR068ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PE/PECorrectivePreventive/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Details');
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PR/ThousandpumpOperationRecord/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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 ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td width='150px' textAlign='center' className={stylesStep.fontBold}>序号</td>
<td width='150px' className={stylesStep.fontBold}>事项</td>
<td className={stylesStep.fontBold}>时间及工作情况描述</td>
</tr>
{
data.Nav_Details && data.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NAME}
</td>
<td>
{item.DESCRIPTION}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PR068ShowPrint)

View File

@ -1,155 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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 { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PT013ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PT/PTIndicatorFormulationDepartment/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
// extendInclude(json, 'Nav_User')
// extendInclude(json, 'Nav_User.Nav_Person')
// extendInclude(json, 'Nav_User.Nav_Person.Nav_Post')
// extendInclude(json, 'Nav_Department')
// extendInclude(json, 'Nav_Department.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_Department')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_DetailContent')
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PT/PTSafetyPolicySurvey/GetCollectEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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={styles.description}>
<Descriptions.Item label="发起时间">{data.CREATE_TIME}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="年度">{data.YEAR}</Descriptions.Item>
<Descriptions.Item label="征集截至时间">{data.COMPLETE_DATE}</Descriptions.Item>
<Descriptions.Item label="征集要求">{
data.Nav_Collects && data.Nav_Collects.map((item, i) => {
return <tr><label> {item.Nav_Collect?.NAME}</label></tr>
})
}</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PT013ShowPrint)

View File

@ -1,259 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table,Progress } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } from "../../../utils/common";
import ReactToPrint from "react-to-print";
import config from "../../../config";
import XLSX from 'xlsx';
import { connect } from 'dva';
import moment from 'moment';
import { message } from "antd/lib/index";
import FormPage from '../../FormPage'
import stylesStep from '../HI/StepForm.css';
class PT014ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
display:'none',
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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() {
const { data } = this.props
const json = initFilter(this.props.login.OrgId)
extendRule(json, 'ID', 1, data.id)
extendRule(json, 'TASK_ID', 1, data.TaskID)
this.props.dispatch({
type: 'app/getDataByPost',
url: 'PT/PTSafetyPolicySurvey/IdentityUpdate',
payload: json,
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
// extendInclude(json, 'Nav_User')
// extendInclude(json, 'Nav_User.Nav_Person')
// extendInclude(json, 'Nav_User.Nav_Person.Nav_Post')
// extendInclude(json, 'Nav_Department')
// extendInclude(json, 'Nav_Department.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_Department')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_DetailContent')
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PT/PTSafetyPolicySurvey/GetCollectEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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,
});
}
onClickCollect =(id,guidId,otherSuggestions) =>{
const json = initFilter(this.props.login.OrgId, guidId,'',0,1,otherSuggestions)
extendRule(json, 'ID', 1, id)
// extendRule(json, 'OTHER_SUGGESTIONS', 1, otherSuggestions)
this.props.dispatch({
type: 'app/getDataByPost',
url: 'PT/PTSafetyPolicySurvey/GetCollectEdit',
payload: json,
onComplete: (ret) => {
if (ret) {
this.setState({
data: ret,
display:'block'
})
}
}
})
}
render() {
const { data } = this.state;
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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.CREATE_TIME}</Descriptions.Item>
<Descriptions.Item label="发起部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="发起人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="年度">{data.YEAR}</Descriptions.Item>
<Descriptions.Item label="征集截至时间">{data.COMPLETE_DATE}</Descriptions.Item>
<Descriptions.Item label="征集要求">{
data.Nav_Collects && data.Nav_Collects.map((item, i) => {
return <tr><label> {item.Nav_Collect?.NAME}</label></tr>
})
}</Descriptions.Item>
<Descriptions.Item label="意向方针">{data.Nav_Guidelines?.NAME}</Descriptions.Item>
<Descriptions.Item label="满意度"> <Progress percent={data.RATE } status="active" /></Descriptions.Item>
<Descriptions.Item label="征集人数">{data.ALL_USER_COUNT}</Descriptions.Item>
<Descriptions.Item label="参与人数">{data.USER_COUNT}</Descriptions.Item>
<Descriptions.Item label="参与率">{data.USER_RATE}%</Descriptions.Item>
</Descriptions>
</div>:null
}
{/* {
data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"150px"}} className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>意向方针</td>
<td className={stylesStep.fontBold}>满意度</td>
</tr>
{
data.IntentionalGuids && data.IntentionalGuids.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{
item.GUIDELINES_NAME
}
</td>
<td>
<Progress percent={item.RATE } status="active" onClick={() => this.onClickCollect(this.state.data.ID,item.GUIDELINES_ID,item.GUIDELINES_NAME)} />
</td>
</tr>
})
}
</table>:null
} */}
{/* display:this.state.display */}
<table style={{tableLayout:'fixed',width:'100%'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"150px"}}className={stylesStep.fontBold}>序号</td>
{/* <td width='10%' className={stylesStep.fontBold}>意向方针</td> */}
<td width='10%' className={stylesStep.fontBold}>填写人</td>
<td width='10%' className={stylesStep.fontBold}>填写人部门</td>
<td width='10%' className={stylesStep.fontBold}>填写时间</td>
<td width='10%' className={stylesStep.fontBold}>是否满意</td>
<td className={stylesStep.fontBold}>其他意见</td>
</tr>
{
data?.Nav_Feedbacks && data.Nav_Feedbacks?.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
{/* <td>
{
item.Nav_Guidelines?.NAME
}
</td> */}
<td>
{
item.Nav_User?.NAME
}
</td>
<td>
{
item.Nav_Department?.NAME
}
</td>
<td>
{
item.CREATE_TIME
}
</td>
<td>
{
item.IS_AGREE==1?"是":"否"
}
</td>
<td>
{
item.OTHER_SUGGESTIONS
}
</td>
</tr>
})
}
</table>
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PT014ShowPrint)

View File

@ -1,480 +0,0 @@
import React from 'react'
import { connect } from 'dva'
import { Button, Row, Col, Form, Input, Select, Transfer, message, Upload, Icon, Modal, DatePicker,Progress } from 'antd'
import {
extend,
extendRule,
initFilter,
getOnlyPropertyData,
extendIgnoreDataRule,
extendInclude,
setDataFieldValue,
getPropertyData,
guid
} from '../../../utils/common'
import moment from 'moment'
import DropDownPagination from '../../common/DropDownPaginationEx'
import config from '../../../config'
import classNames from 'classnames'
import stylesStep from '../HI/StepForm.css';
import styles from '../../../baseComponents/Component.css'
import storage from '../../../utils/storage'
import FormPage from '../../FormPage';
import MultiSelectPagination from "../../common/MultiSelectPagination";
import FoTeamActivity from '../FO/FoTeamActivity'
const Option = Select.Option
const { TextArea } = Input
class PT014ShowPrintOld extends React.Component {
constructor(props) {
super(props)
this.state = {
data: {
// PASSWORD: 'E10ADC3949BA59ABBE56E057F20F883E', // 默认密码为123456
},
btns: [],
display:'none',
BtnAgreeDisplay: 'none',
}
};
componentDidMount() {
this.props.form.resetFields()
this.loadData()
};
componentWillReceiveProps(NextProps) {
if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) {
this.props.form.resetFields()
this.loadData(NextProps.data?.id);
}
}
loadData = () => {
const { data, formId, login} = this.props
const { id } = data || {}
if (id) {
let that=this;
const json = initFilter(that.props.login.OrgId)
extendRule(json, 'ID', 1, id)
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
url: 'PT/PTSafetyPolicySurvey/GetCollectEdit',
payload: json,
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
that.setState({
data: ret,
})
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
})
}
else {
this.props.form.resetFields()
this.setState({
data: {
...this.state.data,
ORG_ID: this.props.login.OrgId,
ID: guid(),
},
})
const { form, } = this.props
const { setFieldsValue } = form
if (this.props.login.OrgCode) {
setFieldsValue({
CODE: (this.props.login.OrgCode),
})
}
}
// if (formId) {
// const btnJson = initFilter(this.props.login.OrgId, '', 'NUM', 0)
// extendRule(btnJson, 'PAGE_CUSTOM_FORM_ID', 1, formId)
// this.props.dispatch({
// type: 'FMUserEdit/getBtnList',
// payload: btnJson,
// onComplete: (ret) => {
// if (ret) {
// this.setState({
// btns: ret,
// })
// }
// }
// })
// }
};
handleOk = () => {
const { form, dispatch, data } = this.props
const { validateFieldsAndScroll } = form
validateFieldsAndScroll((errors, values) => {
if (errors) return
const json = initFilter(this.props.login.OrgId)
extendRule(json, 'ID', 1, data.id)
extendRule(json, 'TASK_ID', 1, data.TaskID)
dispatch({
type: 'app/getDataByPost',
url: 'PT/PTSafetyPolicySurvey/IdentityUpdate',
payload: json,
onComplete: (ret) => {
if (ret) {
if (ret) {
this.setState({ BtnAgreeDisplay: 'none' })
this.BtnClose();
}
message.success('执行成功')
}
}
})
})
};
BtnClose = () => {
if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function')
this.props.data.onCancel();
}
onClickCollect =(id,guidId) =>{
const json = initFilter(this.props.login.OrgId, guidId)
extendRule(json, 'ID', 1, id)
this.props.dispatch({
type: 'app/getDataByPost',
url: 'PT/PTSafetyPolicySurvey/GetCollectEdit',
payload: json,
onComplete: (ret) => {
if (ret) {
this.setState({
data: ret,
display:'block'
})
}
}
})
}
render() {
const { form } = this.props
const { getFieldDecorator } = form
const formItemLayout = {
labelCol: { span: 8 },
wrapperCol: { span: 18 },
}
const onSelectDepartment = ({ data, record }) => {
if (data && data.length > 0) {
this.setState({
data: {
...this.state.data,
DEPARTMENT_ID: data[0],
Nav_Department: { NAME: record.NAME }
}
})
}
else {
this.setState({
data: {
...this.state.data,
Nav_Department: { NAME: null },
DEPARTMENT_ID: null,
}
})
};
}
const onSelectUser = ({ data, record }) => {
if (data && data.length > 0) {
this.setState({
data: {
...this.state.data,
USER_ID: data[0],
Nav_User: { NAME: record.NAME }
}
})
}
else {
this.setState({
data: {
...this.state.data,
Nav_User: { NAME: null },
USER_ID: null,
}
})
};
}
const onSelectCollect = (value) => {
var tmpData = { ...this.state.data }
setDataFieldValue(tmpData, 'Nav_Collects', value)
this.setState({
data: tmpData,
});
}
// const onSelectCollect = ({ data, record }) => {
// if (data && data.length > 0) {
// this.setState({
// data: {
// ...this.state.data,
// COLLECT_ID: data[0],
// Nav_Collect: { NAME: record.NAME }
// }
// })
// }
// else {
// this.setState({
// data: {
// ...this.state.data,
// Nav_Collect: { NAME: null },
// COLLECT_ID: null,
// }
// })
// };
// }
const onChange = (field, value,) => {
const data = { ...this.state.data };
data[field] = value;
this.setState({
data: data,
});
}
return (
<Form style={{ padding: 12, overflow: 'hidden' }}>
<div className={styles.topBar}>
<div className={classNames(styles.topBarLeftBtns, styles.antBtns_mr8)}>
<Button type='primary' style={{ display: this.state.BtnAgreeDisplay }} onClick={() => this.handleOk()}>已阅</Button>
</div>
</div>
<Row gutter={32}>
<Col span={16}>
<Row>
<Col span={8}>
<Form.Item
label={'发起时间'}
{...formItemLayout}
>
{getFieldDecorator('CREATE_TIME', {
validateTrigger: 'onBlur',
initialValue: this.state.data.CREATE_TIME,
rules: [{ message: '请输入发起时间' }],
})(<Input disabled={true} maxLength={30} placeholder={'请输入发起时间'} />)}
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label={'年度'}
{...formItemLayout}
>
{getFieldDecorator('YEAR', {
validateTrigger: 'onBlur',
initialValue: this.state.data.YEAR,
rules: [{ message: '请输入年度' }],
})(<Input disabled={true} maxLength={30} placeholder={'请输入年度'} />)}
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label={'发起部门'}
{...formItemLayout}
>
{getFieldDecorator('Nav_Department.NAME', {
validateTrigger: 'onBlur',
initialValue: this.state.data.Nav_Department?.NAME,
rules: [{ message: '请输入发起部门' }],
})(<Input disabled={true} maxLength={30} placeholder={'请输入发起部门'} />)}
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label={'发起人员'}
{...formItemLayout}
>
{getFieldDecorator('Nav_User.NAME', {
validateTrigger: 'onBlur',
initialValue: this.state.data.Nav_User?.NAME,
rules: [{ message: '请输入发起人员' }],
})(<Input disabled={true} maxLength={30} placeholder={'请输入发起人员'} />)}
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label={'征集截至时间'}
{...formItemLayout}
>
<DatePicker
value={moment(this.state.data.COMPLETE_DATE)}
placeholder={'请输入征集截至时间'}
onChange={(value, dateString) => { onChange('COMPLETE_DATE', dateString, 0) }}
/>
</Form.Item>
</Col>
{/* <Col span={8}>
<Form.Item
label={'征集截至时间'}
{...formItemLayout}
>
{getFieldDecorator('COMPLETE_DATE', {
validateTrigger: 'onBlur',
initialValue: this.state.data.COMPLETE_DATE,
rules: [{ message: '请输入征集截至时间' }],
})(<Input disabled={true} maxLength={30} placeholder={'请输入征集截至时间'} />)}
</Form.Item>
</Col> */}
{/* <Col span={8}>
<Form.Item
label={'征集要求'}
{...formItemLayout}
>
{getFieldDecorator('Nav_Collect.NAME', {
validateTrigger: 'onBlur',
initialValue: this.state.data.Nav_Collect?.NAME,
rules: [{ message: '请输入征集要求' }],
})(<Input disabled={true} maxLength={30} placeholder={'请输入征集要求'} />)}
</Form.Item>
</Col> */}
<Col span={8}>
<Form.Item
label={'征集要求'}
{...formItemLayout}
>
<MultiSelectPagination api={'PT/CollectRequirements/OrderPaged'}
data={
{
navField: 'ID,NAME',
saveField: 'COLLECT_ID,Nav_Collect.NAME',
labelField: "Nav_Collect.NAME",
showField: "NAME",
filterField: "NAME",
idField: "SAFETY_POLICY_ID",
selectLabelField: "NAME",//不配置则默认取labelField如果labelField也不配置默认取NAME字段
}
}
colConfig={{ field: "Nav_Collects" }}
record={this.state.data} onChange={onSelectCollect} onFilter={({ params }) => {
params.OrderType = 1
params.OrgId = this.state.data ? this.state.data.ORG_ID : this.props.login.OrgId
}} />
</Form.Item>
</Col>
</Row>
</Col>
</Row>
{/* <Row>
{
this.state.data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"100px"}} className={stylesStep.fontBold}>序号</td>
<td className={stylesStep.fontBold}>发布范围</td>
</tr>
{
this.state.data?.Nav_Ranges && this.state.data?.Nav_Ranges.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_Department?.NAME}
</td>
</tr>
})
}
</table>:null
}
</Row> */}
<Row>
{
this.state.data ? <table style={{ width: '100%', textAlign: 'left'}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"100px"}} className={stylesStep.fontBold}>序号</td>
<td style={{width:"100px"}} className={stylesStep.fontBold}>意向方针</td>
<td className={stylesStep.fontBold}>比例</td>
</tr>
{
this.state.data.IntentionalGuids && this.state.data.IntentionalGuids.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{
item.GUIDELINES_NAME
}
</td>
<td>
<Progress percent={item.RATE } status="active" onClick={() => this.onClickCollect(this.state.data.ID,item.GUIDELINES_ID)} />
</td>
</tr>
})
}
</table>:null
}
</Row>
<br></br>
<Row>
<table style={{tableLayout:'fixed',width:'100%', display:this.state.display}} className={stylesStep.PrintForm1}>
<tr>
<td style={{width:"100px"}}className={stylesStep.fontBold}>序号</td>
<td width='10%' className={stylesStep.fontBold}>填写人</td>
<td width='10%' className={stylesStep.fontBold}>填写人部门</td>
<td width='10%' className={stylesStep.fontBold}>意向方针</td>
<td className={stylesStep.fontBold}>其他意见</td>
<td width='10%'className={stylesStep.fontBold}>填写时间</td>
</tr>
{
this.state.data.Nav_Feedbacks && this.state.data.Nav_Feedbacks.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{
item.Nav_User?.NAME
}
</td>
<td>
{
item.Nav_Department?.NAME
}
</td>
<td>
{
item.Nav_Guidelines?.NAME
}
</td>
<td>
{
item.OTHER_SUGGESTIONS
}
</td>
<td>
{
item.CREATE_TIME
}
</td>
</tr>
})
}
</table>
</Row>
</Form>
)
}
}
export default connect(({ login, FMBase, custom }) => ({ login, FMBase, custom }))(Form.create()(PT014ShowPrintOld))

View File

@ -1,215 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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 { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PT017ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'HM/HMJobtaskIdentify/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_User')
extendInclude(json, 'Nav_Department')
extendInclude(json, 'Nav_Formulates')
extendInclude(json, 'Nav_Formulates.Nav_Formulate')
extendInclude(json, 'Nav_PlanResources')
extendInclude(json, 'Nav_PlanResources.Nav_Resources')
extendInclude(json, 'Nav_Files')
extendInclude(json, 'Nav_Files.Nav_ImgFile')
extendInclude(json, 'Nav_Files.Nav_ImgFile.Nav_File')
extendInclude(json, 'Nav_PlanFiles')
extendInclude(json, 'Nav_PlanFiles.Nav_ImgFile')
extendInclude(json, 'Nav_PlanFiles.Nav_ImgFile.Nav_File')
extendInclude(json, 'Nav_Goals')
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PT/IndicatorFormulation/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: '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")
}
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;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</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={styles.description}>
<Descriptions.Item label="文件名称">{data.NAME}</Descriptions.Item>
<Descriptions.Item label="年度">{data.YEAR}</Descriptions.Item>
{/* .substring(0, 10) */}
<Descriptions.Item label="制定时间">{data.SET_TIME}</Descriptions.Item>
<Descriptions.Item label="制定人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="制定部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="制定要求">
{
data.Nav_Formulates && data.Nav_Formulates.map((item, i) => {
return <tr><label> {item.Nav_Formulate?.NAME}</label></tr>
})
}
</Descriptions.Item>
<Descriptions.Item label="是否体现安全管理的要求">{data.IS_DEMAND == true?"是":"否"}</Descriptions.Item>
<Descriptions.Item label="只有伤亡指标">{data.IS_TARGET == true?"是":"否"}</Descriptions.Item>
<Descriptions.Item label="年度安全生产目标与指标附件">
{
data.Nav_Files && data.Nav_Files.map((item, i) => {
return <a title={item.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + item.Nav_ImgFile.Nav_File.FILE_PATH} >{item.Nav_ImgFile.FILE_NAME} </a>
})
}</Descriptions.Item>
<Descriptions.Item label="是否制定实施计划">{data.IS_PLAN == true?"是":"否"}</Descriptions.Item>
<Descriptions.Item label="制定实施计划考虑资源">
{
data.Nav_PlanResources && data.Nav_PlanResources.map((item, i) => {
return <tr><label> {item.Nav_Resources?.NAME}</label></tr>
})
}
</Descriptions.Item>
<Descriptions.Item label="实施计划附件">
{
data.Nav_PlanFiles && data.Nav_PlanFiles.map((item, i) => {
return <a title={item.Nav_ImgFile.FILE_NAME} target='_blank' href={config.picServerHost + item.Nav_ImgFile.Nav_File.FILE_PATH} >{item.Nav_ImgFile.FILE_NAME} </a>
})
}</Descriptions.Item>
{/* <Descriptions.Item label="">{data.REASON}</Descriptions.Item>
<Descriptions.Item label="修订概要">{data.PROFILE}</Descriptions.Item>
<Descriptions.Item label="修订版本号">{data.VERSION==0?"":data.VERSION}</Descriptions.Item> */}
</Descriptions>
</div>:null
}
{/* {
data ?
<div>
<Descriptions size="middle" bordered>
<Descriptions.Item label="修订原因">{data.REASON}</Descriptions.Item>
<Descriptions.Item label="修订概要">{data.PROFILE}</Descriptions.Item>
<Descriptions.Item label="修订版本号">{data.VERSION==0?"":data.VERSION}</Descriptions.Item>
</Descriptions>
</div>:null
} */}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={styles.PrintForm1}>
<tr>
<td width='150px' className={styles.fontBold}>序号</td>
<td className={styles.fontBold}>安全生产目标与指标</td>
</tr>
{
data.Nav_Goals && data.Nav_Goals.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NAME}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login }) => ({ login }))(PT017ShowPrint)

View File

@ -1,230 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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 { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
import { IFComponent } from '@woowalker/feui';
class PT020ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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() {
let url='PT/PTIndicatorFormulationDepartment/IdentityUpdate'
if(this.props.login.OrgId === 'd9871ba8-0eec-9e4a-bb87-7d5a540d8913')//b043b28b-bbc3-c452-6052-4fba1457abfa
{
url='PT/PTIndicatorFormulationDepartment/IdentityUpdateYL'
}
this.props.dispatch({
type: 'app/getDataByPost',
url: url,
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
// extendInclude(json, 'Nav_User')
// extendInclude(json, 'Nav_User.Nav_Person')
// extendInclude(json, 'Nav_User.Nav_Person.Nav_Post')
// extendInclude(json, 'Nav_Department')
// extendInclude(json, 'Nav_Department.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_Department')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_DetailContent')
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PT/PTIndicatorFormulationDepartment/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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={styles.description}>
<Descriptions.Item label="制定时间">{data.SET_TIME}</Descriptions.Item>
<Descriptions.Item label="制定部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="制定人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="年度">{data.YEAR}</Descriptions.Item>
</Descriptions>
</div>:null
}
{/* {
data ?
<div>
<Descriptions size="middle" bordered>
<Descriptions.Item label="修订原因">{data.REASON}</Descriptions.Item>
<Descriptions.Item label="修订概要">{data.PROFILE}</Descriptions.Item>
<Descriptions.Item label="修订版本号">{data.VERSION==0?"":data.VERSION}</Descriptions.Item>
</Descriptions>
</div>:null
} */}
{
data && data.DEPARTMENT_TYPE!==2 && data.Nav_DepartmentDetail.length > 0 ? <table style={{ width: '100%', textAlign: 'left'}} className={styles.PrintForm1}>
<tr>
<td width='150px' className={styles.fontBold}>序号</td>
<td width='20%' className={styles.fontBold}>部门名称</td>
<td width='20%' className={styles.fontBold}>部门负责人</td>
<td className={styles.fontBold}>安全生产目标与指标</td>
</tr>
{
data?.Nav_DepartmentDetail && data?.Nav_DepartmentDetail.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item?.Nav_Department.NAME}
</td>
<td>
{item?.Nav_Department?.Nav_User?.NAME}
</td>
<td>
{
item?.Nav_DetailContent && item?.Nav_DetailContent.map((item2, i) => {
return <tr><label> {item2.NAME}</label></tr>
})
}
</td>
</tr>
})
}
</table>:null
}
{
data && data.Nav_TeamDetail.length > 0 ? <table style={{ width: '100%', textAlign: 'left'}} className={styles.PrintForm1}>
<tr>
<td width='150px' className={styles.fontBold}>序号</td>
<td width='20%' className={styles.fontBold}>岗位</td>
<td width='20%' className={styles.fontBold}>人员</td>
<td className={styles.fontBold}>安全生产目标与指标</td>
</tr>
{
data.Nav_TeamDetail && data.Nav_TeamDetail.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.Nav_User.Nav_Person.Nav_Post?.NAME}
</td>
<td>
{item.Nav_User.NAME }
</td>
<td>
{
item.Nav_DetailContent && item.Nav_DetailContent.map((item2, i) => {
return <tr><label> {item2.NAME}</label></tr>
})
}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PT020ShowPrint)

View File

@ -1,224 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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 { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
class PT024ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
tmpData: {},
};
};
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: 'PT/PTAssessmentPlanAudit/IdentityUpdate',
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 that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
// extendInclude(json, 'Nav_User')
// extendInclude(json, 'Nav_User.Nav_Person')
// extendInclude(json, 'Nav_User.Nav_Person.Nav_Post')
// extendInclude(json, 'Nav_Department')
// extendInclude(json, 'Nav_Department.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_Department')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_DetailContent')
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PT/PTAssessmentPlanAudit/GetEdit',
onComplete: (ret) => {
if (ret) {
// if(ret.DEPARTMENT_TYPE !== 3)
// {
// ret.Nav_Details=ret.Nav_Details.filter(t=>t.DEPARTMENT_ID ===this.props.login.departmentId)
// }
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >已阅</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={styles.description}>
<Descriptions.Item label="制定时间">{data.SET_TIME}</Descriptions.Item>
<Descriptions.Item label="制定部门">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="制定人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item>
<Descriptions.Item label="考核年度">{data?.YEAR}</Descriptions.Item>
<Descriptions.Item label="方案名称">{data?.NAME}</Descriptions.Item>
<Descriptions.Item label="考核层级">{enums.FMDepartmentType.enums[data?.DEPARTMENT_TYPE]}</Descriptions.Item>
</Descriptions>
</div>:null
}
{/* {
data ?
<div>
<Descriptions size="middle" bordered>
<Descriptions.Item label="修订原因">{data.REASON}</Descriptions.Item>
<Descriptions.Item label="修订概要">{data.PROFILE}</Descriptions.Item>
<Descriptions.Item label="修订版本号">{data.VERSION==0?"":data.VERSION}</Descriptions.Item>
</Descriptions>
</div>:null
} */}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={styles.PrintForm1}>
<tr>
<td width='150px' className={styles.fontBold}>序号</td>
<td className={styles.fontBold}>部门名称</td>
<td className={styles.fontBold}>被考核人员</td>
<td className={styles.fontBold}>考核年度</td>
<td className={styles.fontBold}>考核周期</td>
<td className={styles.fontBold}>安全生产指标考核项目</td>
<td className={styles.fontBold}>分数</td>
<td className={styles.fontBold}>考核认定评分办法</td>
</tr>
{
data?.Nav_Details && data?.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item?.Nav_Department?.NAME}
</td>
<td>
{item?.Nav_User?.NAME}
</td>
<td>
{item?.YEAR}
</td>
<td>
{enums.PTAssessmentCycleEnums.enums[item?.ASSESSMENT_CYCLE]}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr>{item2?.NAME}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.SCORE}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.METHOD}</tr>
})
}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PT024ShowPrint)

View File

@ -1,205 +0,0 @@
import React from 'react';
import { connect } from 'dva';
import { Button, Icon, Upload, Form } from 'antd';
import config from "../../../config.js";
import storage from '../../../utils/storage';
import XLSX from 'xlsx';
import { initFilter, extendRule, downLoad, extendInclude, setDataFieldValue, guid, initQueryFilter, showFiles, showApprove, showUserSign, showUsersSign } from "../../../utils/common";
class PT027Import extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
Msg: '',
isMsgShow: false,
url: props.data.url,
fileName: props.data.fileName,
isOk: true
}
}
getRequestHeaders = () => {
// 请求参数
const addHeader = 'Bearer ' + storage('lacal').getItem('accessToken').val
const userId = storage('lacal').getItem('userid').val
const user = storage('lacal').getItem('loginUserVerify').val
const RootOrgId = storage('lacal').getItem('RootOrgId').val
const orgId = storage('lacal').getItem('webOrgId').val
const Tenant = storage('lacal').getItem('Tenant').val
const headers = {
// 'Content-Type': type === 'post' ? 'application/json' : 'application/x-www-form-urlencoded',
Authorization: addHeader,
userid: userId,
username: user ? user.username : '',
RootOrgId,
orgId,
Tenant: Tenant
}
return headers
}
fillImportData = (ret) => {
if (!ret) {
this.setState({
data: [],
selectedRowKeys: [],
messages: '',
})
return;
}
if (ret.ErrorMessage) {
this.setState({
messages: ('错误:' + ret.ErrorMessage)
});
}
let messages = '';
if (ret.Data && ret.Data.MessageList && ret.Data.MessageList.length) {
var tmps = [];
ret.Data.MessageList.forEach((n, i) => {
tmps.push(n);
});
messages = tmps.join('\n');
}
const selectedRowKeys = [];
if (ret.Data && ret.Data.Data) {
ret.Data.Data.forEach((n, i) => {
selectedRowKeys.push(n.ID);
});
}
this.setState({
data: (ret.Data && ret.Data.Data ? ret.Data.Data : []),
selectedRowKeys,
messages
});
}
onTableBtnExport() {
let json = initFilter(this.props.login.OrgId);
this.props.dispatch({
type: 'app/getDataByPost',
url: 'PT/PTAssessmentPlanAudit/GetAssessmentData',
payload: json,
onlyData: false,
onComplete: (ret) => {
if (!ret || ret.Data.length == 0) {
message.warning("没有数据无需导出!");
return;
}
else{
//excel的表头
const tHeader = ["层级", "被考核部门","被考核岗位","被考核人员","考核人员","安全生产指标考核项目","考核周期","分数","考核认定评分办法"];
// 字段和table表格中对应
const fitlerVal = ["departType", "departName","postName","userName","chargeName","targetItem","type","score","method"];
const res = ret.Data.map((v) => fitlerVal.map((j) => v[j]));
const jsonWorkSheet = XLSX.utils.json_to_sheet(res,tHeader);
jsonWorkSheet.A1.v='层级';
jsonWorkSheet.B1.v='被考核部门';
jsonWorkSheet.C1.v='被考核岗位';
jsonWorkSheet.D1.v='被考核人员';
jsonWorkSheet.E1.v='考核人员';
jsonWorkSheet.F1.v='安全生产指标考核项目';
jsonWorkSheet.G1.v='考核周期';
jsonWorkSheet.H1.v='分数';
jsonWorkSheet.I1.v='考核认定评分办法';
const sheetName = "目标与指标监测数据库";
const workBook = {
SheetNames: [sheetName],
Sheets: {
[sheetName]: jsonWorkSheet,
}
};
return XLSX.writeFile(workBook, "目标与指标监测数据库.xlsx");
}
}
})
}
//渲染页面
render() {
const { data, Msg, isMsgShow, url, urlDown, isOk, fileName } = this.state;
const that = this;
const uploadProps = {
name: 'file',
action: config.serviceHost(url),
data: { OrgId: this.props.login.OrgId },//, ImportConfigCode: configCode, delFlag: delFlag
fileList: this.state.updateLoadFileList,
accept: '.xls,.xlsx',
headers: this.getRequestHeaders(),
onChange(info) {
var Msg = ''
var isOk = true
if (info.file.status === 'done') {
if (info.file.response.IsSuccessful) {
Msg = "【" + info.file.name + '】' + info.file.response.Data.Data
// message.info(`${info.file.name} 导入并保存成功`);
} else {
//失败
Msg = info.file.response.ErrorMessage
isOk = false
// message.error(`${info.file.response.ErrorMessage} `);
}
} else if (info.file.status === 'error') {
isOk = false
if (info.file.response && info.file.response.ErrorMessage) {
Msg = "【" + info.file.name + '】导入错误,详情:' + info.file.response.ErrorMessage
// message.error(`${info.file.name} 导入错误,详情:${info.file.response.ErrorMessage}`);
}
else {
Msg = "【" + info.file.name + '】导入错误'
// message.error(`${info.file.name} 导入错误`);
}
}
that.setState({
updateLoadFileList: info.fileList,
data: info,
Msg: '导入说明:' + Msg,
isMsgShow: true,
isOk: isOk
});
},
};
return <div>
<div style={{ padding: '10px' }}>
<Form>
<table>
<tr >
<td>
<Button onClick={() => this.onTableBtnExport()}>
<Icon type="vertical-align-bottom" /> 下载模板 {/* <a href={config.serviceHost(urlDown)}>下载模板</a> */}
</Button>
</td>
<td>
<Upload style={{ marginLeft: '30px' }} {...uploadProps}>
<Button>
<Icon type="upload" /> 数据导入
</Button>
</Upload>
</td>
</tr>
{
isMsgShow ? (
isOk ? <tr >
<td colSpan={2}>
{Msg}
</td>
</tr>
:
<tr style={{ color: 'red' }}>
<td colSpan={2}>
{Msg}
</td>
</tr>
)
: null
}
</table>
</Form>
</div>
</div>
}
}
export default connect(({ login, app }) => ({ login, app }))(PT027Import)

View File

@ -1,427 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude, extendIgnoreDataRule,setDataFieldValue, guid, initQueryFilter } 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 { message } from "antd/lib/index";
import FormPage from '../../../components/FormPage'
import { T } from 'antd/lib/upload/utils';
class PT029ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
BtnChargeAgreeDisplay:'none',
tmpData: {},
isExsit:0,
};
};
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: 'PT/PTMonitorAssessment/IdentityUpdate',
payload: {
ID: this.props.data.id,
TaskID: this.props.data.TaskID,
},
onComplete: (ret) => {
if (ret) {
message.success('确认成功!');
this.setState({ BtnAgreeDisplay: 'none' })
this.BtnClose();
}
}
})
}
onTableBtnChargeAgree() {
this.props.dispatch({
type: 'app/getDataByPost',
url: 'PT/PTMonitorAssessment/ChargeAgree',
payload: {
ID: this.props.data.id,
TaskID: this.props.data.TaskID,
},
onComplete: (ret) => {
if (ret) {
message.success('已阅成功!');
this.setState({ BtnChargeAgreeDisplay: 'none' })
this.BtnClose();
}
}
})
}
BtnClose = () => {
if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function')
this.props.data.onCancel();
}
loadData = (dataId) => {
let that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendIgnoreDataRule(json)
// extendInclude(json, 'Nav_User')
// extendInclude(json, 'Nav_User.Nav_Person')
// extendInclude(json, 'Nav_User.Nav_Person.Nav_Post')
// extendInclude(json, 'Nav_Department')
// extendInclude(json, 'Nav_Department.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_Department')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_DetailContent')
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PT/PTMonitorAssessment/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
let isExsit=ret?.Nav_Details.filter(t=>t.USER_ID!=null && t.USER_ID == this.props.login.userId).length;
that.setState({ data: ret,isExsit: isExsit});
if (ret.STATUS === 10) {
that.setState({ BtnAgreeDisplay: 'inline', BtnChargeAgreeDisplay: 'none' })
}
if(ret.STATUS === 20)
{
that.setState({ BtnAgreeDisplay: 'none',BtnChargeAgreeDisplay: 'none' })
}
if(ret.STATUS === 30)
{
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none',BtnChargeAgreeDisplay: 'none' })
}
else
{
that.setState({ BtnAgreeDisplay: 'none',BtnChargeAgreeDisplay: 'inline' })
}
}
// if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
// that.setState({ BtnAgreeDisplay: 'none' })
// }else{
// that.setState({ BtnAgreeDisplay: 'inline' })
// }
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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 ,isExsit} = this.state;
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnChargeAgreeDisplay }} onClick={() => this.onTableBtnChargeAgree()} icon="check" >已阅</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={styles.description}>
<Descriptions.Item label="监测时间">{data.SET_TIME}</Descriptions.Item>
<Descriptions.Item label="监测组织">{data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
{/* <Descriptions.Item label="监测人员">{data.Nav_User ? data.Nav_User.NAME : ''}</Descriptions.Item> */}
<Descriptions.Item label="监测人员">{
data.Nav_MonitorUser && data.Nav_MonitorUser.map((item, i) => {
if (i == (data.Nav_MonitorUser.length - 1)) {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'> {item.Nav_User?.NAME}</label>
else
return item.Nav_User.NAME
} else {
if (item.DEAL_STATUS == 0)
return <label style={{ color: 'red' }} title='未签到'>{item.Nav_User?.NAME + ','}</label>
else
return item.Nav_User.NAME + ','
}
})
}</Descriptions.Item>
<Descriptions.Item label="监测年度">{data?.YEAR}</Descriptions.Item>
{/* <Descriptions.Item label="监测周期">{data?.NAME}</Descriptions.Item> */}
<Descriptions.Item label="监测周期">{enums.PTAssessmentCycleEnums.enums[data?.ASSESSMENT_CYCLE]}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={styles.PrintForm1}>
<tr>
<td width='150px' className={styles.fontBold}>序号</td>
<td className={styles.fontBold}>部门名称</td>
<td className={styles.fontBold}>被考核人员</td>
<td className={styles.fontBold}>岗位</td>
<td className={styles.fontBold}>安全生产指标考核项目</td>
<td className={styles.fontBold}>分数</td>
<td className={styles.fontBold}>考核认定评分办法</td>
<td className={styles.fontBold}>考核检查情况</td>
<td className={styles.fontBold}>改进措施</td>
<td className={styles.fontBold}>得分</td>
</tr>
{
data?.Nav_Details && data?.Nav_Details.map((item,i)=>{
if(data.STATUS === 30 && data.Nav_Department.USER_ID!=this.props.login.userId )
{
if(isExsit>0)
{
if(item.USER_ID ===this.props.login.userId)
{
return <tr>
<td>
{i+1}
</td>
<td>
{item?.Nav_Department?.NAME}
</td>
<td>
{item?.Nav_User?.NAME}
</td>
<td>
{/* {item.Nav_User.Nav_Person.Nav_Post.NAME} */}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2?.NAME}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr>{item2.SCORE}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.METHOD}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.CONTENT}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.MEASURES}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.RESULT_SCORE}</tr>
})
}
</td>
</tr>
}
}
else
{
return <tr>
<td>
{i+1}
</td>
<td>
{item?.Nav_Department?.NAME}
</td>
<td>
{item?.Nav_User?.NAME}
</td>
<td>
{/* {item.Nav_User.Nav_Person.Nav_Post.NAME} */}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2?.NAME}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr>{item2.SCORE}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.METHOD}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.CONTENT}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.MEASURES}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.RESULT_SCORE}</tr>
})
}
</td>
</tr>
}
}
else
{
return <tr>
<td>
{i+1}
</td>
<td>
{item?.Nav_Department?.NAME}
</td>
<td>
{item?.Nav_User?.NAME}
</td>
<td>
{/* {item.Nav_User.Nav_Person.Nav_Post.NAME} */}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2?.NAME}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr>{item2.SCORE}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.METHOD}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.CONTENT}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.MEASURES}</tr>
})
}
</td>
<td>
{
item?.Nav_Contents && item?.Nav_Contents.map((item2, i) => {
return <tr> {item2.RESULT_SCORE}</tr>
})
}
</td>
</tr>
}
})
}
</table>:null
}
{
data ?
<div>
<Descriptions size="middle" bordered className={styles.description}>
<Descriptions.Item label="监测人员签名">
<div>{
data.Nav_MonitorUser && data.Nav_MonitorUser.map((item, i) => {
if (item.DEAL_STATUS == 1) {
if (item.Nav_User != null && item.Nav_User.Nav_UserSignFiles[0] != null)
return <img style={{ margin: "0 0 0 15px",width:'150px' }} alt={item.Nav_User?.NAME} src={config.picServerHost + item.Nav_User.Nav_UserSignFiles[0].Nav_ImgFile.Nav_File.FILE_PATH} />
else
return <img style={{ margin: "0 0 0 15px",width:'150px' }} title={item.Nav_User?.NAME} />
}
})
}</div>
</Descriptions.Item>
</Descriptions>
</div>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PT029ShowPrint)

View File

@ -1,292 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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 { message } from "antd/lib/index";
import FormPage from '../../FormPage'
class PT036ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
BtnChargeAgreeDisplay:'none',
tmpData: {},
isModalVisible6: false,
detailContens:[]
};
};
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: 'PT/PTAnnualMonotorSummary/IdentityUpdate',
payload: {
ID: this.props.data.id,
TaskID: this.props.data.TaskID,
},
onComplete: (ret) => {
if (ret) {
message.success('确认成功!');
this.setState({ BtnAgreeDisplay: 'none' })
this.BtnClose();
}
}
})
}
onTableBtnChargeAgree() {
this.props.dispatch({
type: 'app/getDataByPost',
url: 'PT/PTMonitorAssessment/ChargeAgree',
payload: {
ID: this.props.data.id,
TaskID: this.props.data.TaskID,
},
onComplete: (ret) => {
if (ret) {
message.success('已阅成功!');
this.setState({ BtnChargeAgreeDisplay: 'none' })
this.BtnClose();
}
}
})
}
BtnClose = () => {
if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function')
this.props.data.onCancel();
}
loadData = (dataId) => {
let that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_Details')
extendIgnoreDataRule(json)
// extendInclude(json, 'Nav_Details.Nav_User')
// extendInclude(json, 'Nav_Details.Nav_User.Nav_Person')
// extendInclude(json, 'Nav_Details.Nav_User.Nav_Person.Nav_Post')
// extendInclude(json, 'Nav_Details.Nav_Department')
// extendInclude(json, 'Nav_Details.Nav_Contents')
// extendInclude(json, 'Nav_Department.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_Department')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_User')
// extendInclude(json, 'Nav_DepartmentDetail.Nav_DetailContent')
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PT/PTAnnualMonotorSummary/GetEdit',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
// if (ret.STATUS === 20) {
// that.setState({ BtnAgreeDisplay: 'inline' })
// }else{
// that.setState({ BtnAgreeDisplay: 'none' })
// }
// if(ret.STATUS === 30)
// {
// that.setState({ BtnChargeAgreeDisplay: 'inline' })
// }
// else
// {
// that.setState({ BtnChargeAgreeDisplay: 'none' })
// }
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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,
});
}
closModal = () => {
this.setState({
isModalVisible: false,
});
};
showModal = (id,quarter) => {
let temp=this.state.data.Nav_Details.filter(t=>t.ID === id);
this.setState({
isModalVisible: true,
detailContens:temp[0]?.Nav_Contents.filter(t=>t.QUARTER_TYPE === quarter)
});
};
render() {
const { data } = this.state;
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
// let aaa = Math.random();
return <div>
<div style={{ padding: '10px' }}>
<Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px'}} icon="export">审批详情</Button>
<ReactToPrint
trigger={() => <Button style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }} type={'default'} icon={'printer'} >打印</Button>}
content={() => this.componentRef}
/>
<Button onClick={() => this.onTableBtnExport()} icon="export" style={{ marginLeft: '8px', display: data && data.IS_PUBLISH === 5?"inline":"none" }}>导出</Button>
<Button type="primary" style={{marginLeft: '8px', display: this.state.BtnAgreeDisplay }} onClick={() => this.onTableBtnAgree()} icon="check" >确认</Button>
{/* <Button type="primary" style={{marginLeft: '8px', display: this.state.BtnChargeAgreeDisplay }} onClick={() => this.onTableBtnChargeAgree()} icon="check" >已阅</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={styles.description}>
<Descriptions.Item label="年度">{data.YEAR}</Descriptions.Item>
<Descriptions.Item label="汇总时间">{data.SET_TIME}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={styles.PrintForm1}>
<tr>
<td width='150px' className={styles.fontBold}>序号</td>
<td className={styles.fontBold}>部门名称</td>
<td className={styles.fontBold}>被考核人员</td>
<td className={styles.fontBold}>岗位</td>
<td className={styles.fontBold}>第一季度得分</td>
<td className={styles.fontBold}>第二季度得分</td>
<td className={styles.fontBold}>第三季度得分</td>
<td className={styles.fontBold}>第四季度得分</td>
<td className={styles.fontBold}>年度平均分</td>
</tr>
{
data?.Nav_Details && data?.Nav_Details.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item?.Nav_Department?.NAME}
</td>
<td>
{item?.Nav_User?.NAME}
</td>
<td>
{item?.Nav_User?.Nav_Person?.Nav_Post?.NAME}
</td>
<td>
<a onClick={()=>this.showModal(item.ID,10)}>{item?.FIRST_SCORE}</a>
</td>
<td>
<a onClick={()=>this.showModal(item.ID,20)}>{item?.SECOND_SCORE}</a>
</td>
<td>
<a onClick={()=>this.showModal(item.ID,30)}>{item?.THIRD_SCORE}</a>
</td>
<td>
<a onClick={()=>this.showModal(item.ID,40)}>{item?.FOURTH_SCORE}</a>
</td>
<td>
{item?.YEAR_SCORE}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
<div style={{ display: 'inline-block' }}>
<Modal title="" visible={this.state.isModalVisible}
closeModal={this.closModal}
onCancel={this.closModal}
onOk={this.closModal}
footer={null}
style={{ width: '100%', height: '100%', top: "300px" }}
>
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={styles.PrintForm1}>
<tr>
<td className={styles.fontBold}>序号</td>
<td className={styles.fontBold}>安全生产指标考核项目</td>
<td className={styles.fontBold}>分数</td>
<td className={styles.fontBold}>考核认定评分办法</td>
<td className={styles.fontBold}>考核检查情况</td>
<td className={styles.fontBold}>改进措施</td>
<td className={styles.fontBold}>得分</td>
</tr>
{
this.state.detailContens && this.state.detailContens.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item?.NAME}
</td>
<td>
{item.SCORE}
</td>
<td>
{item.METHOD}
</td>
<td>
{item.CONTENT}
</td>
<td>
{item.MEASURES}
</td>
<td>
{item.RESULT_SCORE}
</td>
</tr>
})
}
</table>:null
}
</Modal>
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PT036ShowPrint)

View File

@ -1,220 +0,0 @@
import { Button, Descriptions,Popconfirm, Row, Col, Form,Modal, Input, Select, Table } from 'antd';
import React from 'react';
import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter } 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 { message } from "antd/lib/index";
import FormPage from '../../FormPage'
class PT040ShowPrint extends React.Component {
constructor(props) {
super(props);
this.state = {
data: null,
BtnAgreeDisplay: 'none',
BtnChargeAgreeDisplay:'none',
tmpData: {},
isModalVisible6: false,
detailContens:[]
};
};
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: 'PT/PTAnnualMonotorSummary/IdentityUpdate',
payload: {
ID: this.props.data.id,
TaskID: this.props.data.TaskID,
},
onComplete: (ret) => {
if (ret) {
message.success('确认成功!');
this.setState({ BtnAgreeDisplay: 'none' })
this.BtnClose();
}
}
})
}
onTableBtnChargeAgree() {
this.props.dispatch({
type: 'app/getDataByPost',
url: 'PT/PTMonitorAssessment/ChargeAgree',
payload: {
ID: this.props.data.id,
TaskID: this.props.data.TaskID,
},
onComplete: (ret) => {
if (ret) {
message.success('已阅成功!');
this.setState({ BtnChargeAgreeDisplay: 'none' })
this.BtnClose();
}
}
})
}
BtnClose = () => {
if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function')
this.props.data.onCancel();
}
loadData = (dataId) => {
let that=this;
let json = initFilter(that.props.login.OrgId);
extendRule(json, 'ID', 1, dataId);
extendInclude(json, 'Nav_MonitorAssessment')
extendInclude(json, 'Nav_Contents')
extendInclude(json, 'Nav_Department')
extendInclude(json, 'Nav_User')
extendIgnoreDataRule(json)
that.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PT/MonitorAssessmentDetail/Get',
onComplete: (ret) => {
if (ret) {
if(that.props.data && that.props.data.loadDataDeal)
{
that.props.data.loadDataDeal(1);
}
that.setState({ data: ret });
// if (ret.STATUS === 20) {
// that.setState({ BtnAgreeDisplay: 'inline' })
// }else{
// that.setState({ BtnAgreeDisplay: 'none' })
// }
// if(ret.STATUS === 30)
// {
// that.setState({ BtnChargeAgreeDisplay: 'inline' })
// }
// else
// {
// that.setState({ BtnChargeAgreeDisplay: 'none' })
// }
if (that.props.data.tableKey==="2" ||that.props.data.tableKey===undefined) {
that.setState({ BtnAgreeDisplay: 'none' })
}else{
that.setState({ BtnAgreeDisplay: 'inline' })
}
this.onClickApprove(false);
//归档才显示打印和导出按钮
// if(ret.PRE_MEETING_STATUS==5){
// this.setState({ isFinished: 'inline' })
// }
}
else
{ message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');}
}
});
}
onTableBtnExport() {
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
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,
});
}
closModal = () => {
this.setState({
isModalVisible: false,
});
};
showModal = (id,quarter) => {
let temp=this.state.data.Nav_Details.filter(t=>t.ID === id);
this.setState({
isModalVisible: true,
detailContens:temp[0]?.Nav_Contents.filter(t=>t.QUARTER_TYPE === quarter)
});
};
render() {
const { data } = this.state;
const enums=this.props.data.enums ? this.props.data.enums :this.props.app.enums ;
// let aaa = Math.random();
return <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={styles.description}>
<Descriptions.Item label="年度">{data.Nav_MonitorAssessment.YEAR}</Descriptions.Item>
<Descriptions.Item label="监测时间">{data.Nav_MonitorAssessment.SET_TIME}</Descriptions.Item>
<Descriptions.Item label="监测周期">{enums.PTAssessmentCycleEnums.enums[data.Nav_MonitorAssessment.ASSESSMENT_CYCLE]}</Descriptions.Item>
<Descriptions.Item label="考核部门">{data.Nav_Department?.NAME}</Descriptions.Item>
<Descriptions.Item label="考核人员">{data.Nav_User?.NAME}</Descriptions.Item>
</Descriptions>
</div>:null
}
{
data ? <table style={{ width: '100%', textAlign: 'left'}} className={styles.PrintForm1}>
<tr>
<td width='150px' className={styles.fontBold}>序号</td>
<td className={styles.fontBold}>安全生产指标考核项目</td>
<td className={styles.fontBold}>分数</td>
<td className={styles.fontBold}>考核认定评分办法</td>
<td className={styles.fontBold}>考核检查情况</td>
<td className={styles.fontBold}>改进措施</td>
<td className={styles.fontBold}>得分</td>
</tr>
{
data?.Nav_Contents && data?.Nav_Contents.map((item,i)=>{
return <tr>
<td>
{i+1}
</td>
<td>
{item.NAME}
</td>
<td>
{item.SCORE}
</td>
<td>
{item.METHOD}
</td>
<td>
{item.CONTENT}
</td>
<td>
{item.MEASURES}
</td>
<td>
{item.RESULT_SCORE}
</td>
</tr>
})
}
</table>:null
}
<FormPage {...this.state.tmpData} />
</div>
</div>
}
}
export default connect(({ login,app }) => ({ login,app }))(PT040ShowPrint)

View File

@ -1133,10 +1133,6 @@ const SC022Import = Loadable({
loader: () => import('../components/CustomPages/SC/SC022Import'),
loading: () => <div />
})
const PT027Import = Loadable({
loader: () => import('../components/CustomPages/PT/PT027Import'),
loading: () => <div />
})
const SC030ShowPrint = Loadable({
loader: () => import('../components/CustomPages/SC/SC030ShowPrint'),
loading: () => <div />
@ -1245,14 +1241,6 @@ const OG020Edit = Loadable({
loader: () => import('../components/CustomPages/OG/OG020Edit'),
loading: () => <div />
})
const PT014ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PT/PT014ShowPrint'),
loading: () => <div />
})
const PT017ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PT/PT017ShowPrint'),
loading: () => <div />
})
const TI008ShowPrint = Loadable({
loader: () => import('../components/CustomPages/TI/TI008ShowPrint'),
loading: () => <div />
@ -1342,74 +1330,6 @@ const AE018ShowPrint = Loadable({
loading: () => <div />
})
const PT020ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PT/PT020ShowPrint'),
loading: () => <div />
})
const PT024ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PT/PT024ShowPrint'),
loading: () => <div />
})
const PT029ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PT/PT029ShowPrint'),
loading: () => <div />
})
const PT013ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PT/PT013ShowPrint'),
loading: () => <div />
})
const PT036ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PT/PT036ShowPrint'),
loading: () => <div />
})
const PT040ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PT/PT040ShowPrint'),
loading: () => <div />
})
const PE005ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PE/PE005ShowPrint'),
loading: () => <div />
})
const PE007ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PE/PE007ShowPrint'),
loading: () => <div />
})
const PE009ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PE/PE009ShowPrint'),
loading: () => <div />
})
const PE019ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PE/PE019ShowPrint'),
loading: () => <div />
})
const PE021ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PE/PE021ShowPrint'),
loading: () => <div />
})
const PE022ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PE/PE022ShowPrint'),
loading: () => <div />
})
const PE027ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PE/PE027ShowPrint'),
loading: () => <div />
})
const PE029ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PE/PE029ShowPrint'),
loading: () => <div />
})
const PE029ShowPrintNew = Loadable({
loader: () => import('../components/CustomPages/PE/PE029ShowPrintNew'),
loading: () => <div />
})
const PE030ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PE/PE030ShowPrint'),
loading: () => <div />
})
const SC046ShowPrint = Loadable({
loader: () => import('../components/CustomPages/SC/SC046ShowPrint'),
loading: () => <div />
@ -1418,10 +1338,6 @@ const SC052ShowPrint = Loadable({
loader: () => import('../components/CustomPages/SC/SC052ShowPrint'),
loading: () => <div />
})
const PR003ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR003ShowPrint'),
loading: () => <div />
})
const CM018ShowPrint = Loadable({
loader: () => import('../components/CustomPages/CM/CM018ShowPrint'),
loading: () => <div />
@ -1466,88 +1382,6 @@ const CM036ShowPrint = Loadable({
loader: () => import('../components/CustomPages/CM/CM036ShowPrint'),
loading: () => <div />
})
const PR007ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR007ShowPrint'),
loading: () => <div />
})
const PR009ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR009ShowPrint'),
loading: () => <div />
})
const PR011ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR011ShowPrint'),
loading: () => <div />
})
const PR013ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR013ShowPrint'),
loading: () => <div />
})
const PR015ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR015ShowPrint'),
loading: () => <div />
})
const PR019ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR019ShowPrint'),
loading: () => <div />
})
const PR023ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR023ShowPrint'),
loading: () => <div />
})
const PR026ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR026ShowPrint'),
loading: () => <div />
})
const PR028ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR028ShowPrint'),
loading: () => <div />
})
const PR046ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR046ShowPrint'),
loading: () => <div />
})
const PR048ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR048ShowPrint'),
loading: () => <div />
})
const PR050ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR050ShowPrint'),
loading: () => <div />
})
const PR052ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR052ShowPrint'),
loading: () => <div />
})
const PR056ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR056ShowPrint'),
loading: () => <div />
})
const PR058ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR058ShowPrint'),
loading: () => <div />
})
const PR060ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR060ShowPrint'),
loading: () => <div />
})
const PR062ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR062ShowPrint'),
loading: () => <div />
})
const PR064ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR064ShowPrint'),
loading: () => <div />
})
const PR066ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR066ShowPrint'),
loading: () => <div />
})
const PR068ShowPrint = Loadable({
loader: () => import('../components/CustomPages/PR/PR068ShowPrint'),
loading: () => <div />
})
const DM019ShowPrint = Loadable({
loader: () => import('../components/CustomPages/DM/DM019ShowPrint'),
loading: () => <div />
@ -1987,7 +1821,6 @@ export default function (componentName, formId, formParam, data, formCode, formD
BS026ShowPrint: <BS026ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SC028ShowPrint: <SC028ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SC022Import: <SC022Import formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PT027Import: <PT027Import formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SC030ShowPrint: <SC030ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SC030View: <SC030View formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SC030ShowPrintPer: <SC030ShowPrintPer formId={formId} formParam={formParam} data={data} formCode={formCode} />,
@ -2053,8 +1886,6 @@ export default function (componentName, formId, formParam, data, formCode, formD
OG018Check: <OG018Check formId={formId} formParam={formParam} data={data} formCode={formCode} />,
OG020Edit: <OG020Edit formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PT014ShowPrint: <PT014ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PT017ShowPrint: <PT017ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
TI008ShowPrint: <TI008ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
TI008ShowPrints: <TI008ShowPrints formId={formId} formParam={formParam} data={data} formCode={formCode} />,
TI010ShowPrint: <TI010ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
@ -2069,20 +1900,6 @@ export default function (componentName, formId, formParam, data, formCode, formD
AE019ShowPrint: <AE019ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
AE018ShowPrint: <AE018ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PT020ShowPrint: <PT020ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PT024ShowPrint: <PT024ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PT029ShowPrint: <PT029ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PT013ShowPrint: <PT013ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PT036ShowPrint: <PT036ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PT040ShowPrint: <PT040ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE005ShowPrint: <PE005ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE007ShowPrint: <PE007ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE009ShowPrint: <PE009ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE019ShowPrint: <PE019ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE021ShowPrint: <PE021ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE022ShowPrint: <PE022ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE027ShowPrint: <PE027ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
OH003ShowPrint: <OH003ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
OH005ShowPrint: <OH005ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
OH006ShowPrint: <OH006ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
@ -2093,12 +1910,8 @@ export default function (componentName, formId, formParam, data, formCode, formD
OH028ShowPrint: <OH028ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
OH034ShowPrint: <OH034ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE029ShowPrint: <PE029ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE029ShowPrintNew: <PE029ShowPrintNew formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PE030ShowPrint: <PE030ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SC046ShowPrint: <SC046ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
SC052ShowPrint: <SC052ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR003ShowPrint: <PR003ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
CM018ShowPrint: <CM018ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
CM023ShowPrint: <CM023ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
@ -2112,26 +1925,6 @@ export default function (componentName, formId, formParam, data, formCode, formD
CM036Edit: <CM036Edit formId={formId} formParam={formParam} data={data} formCode={formCode} />,
CM036ShowPrint: <CM036ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR007ShowPrint: <PR007ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR009ShowPrint: <PR009ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR011ShowPrint: <PR011ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR013ShowPrint: <PR013ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR015ShowPrint: <PR015ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR019ShowPrint: <PR019ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR023ShowPrint: <PR023ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR026ShowPrint: <PR026ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR028ShowPrint: <PR028ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR046ShowPrint: <PR046ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR048ShowPrint: <PR048ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR050ShowPrint: <PR050ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR052ShowPrint: <PR052ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR056ShowPrint: <PR056ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR058ShowPrint: <PR058ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR060ShowPrint: <PR060ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR062ShowPrint: <PR062ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR064ShowPrint: <PR064ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR066ShowPrint: <PR066ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
PR068ShowPrint: <PR068ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
DM019ShowPrint: <DM019ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
DM021ShowPrint: <DM021ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,
DM012ShowPrint: <DM012ShowPrint formId={formId} formParam={formParam} data={data} formCode={formCode} />,