审批流查看 添加 公共方法 给每个页面调用 使支持总部查看子页的审批流数据正常
This commit is contained in:
parent
08f404d8f9
commit
6bb8aa83c9
@ -39,8 +39,7 @@ class PFCommonApproveView extends React.Component {
|
||||
}
|
||||
};
|
||||
componentDidMount() {
|
||||
if (this.props.data?.id)
|
||||
{
|
||||
if (this.props.data?.id) {
|
||||
this.loadData(this.props.data?.id, false);
|
||||
this.setState({
|
||||
appVisible: this.props.data.appVisible ? this.props.data.appVisible : false,
|
||||
@ -53,8 +52,7 @@ class PFCommonApproveView extends React.Component {
|
||||
// if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) {
|
||||
// this.loadData(NextProps.data?.id);
|
||||
// }
|
||||
if(NextProps.data?.key && this.props.data?.key != NextProps.data?.key)
|
||||
{
|
||||
if (NextProps.data?.key && this.props.data?.key != NextProps.data?.key) {
|
||||
if (NextProps.data?.id) {
|
||||
this.loadData(NextProps.data?.id, true);
|
||||
this.setState({
|
||||
@ -238,7 +236,11 @@ class PFCommonApproveView extends React.Component {
|
||||
appVisible: appVisibleTemp,
|
||||
BtnAgreeDisplay: this.props.data.BtnAgreeDisplay ? this.props.data.BtnAgreeDisplay : 'inline'
|
||||
});
|
||||
if (this.props.data.ORG_ID_HV) {
|
||||
json.Parameter22 = this.props.data.ORG_ID_HV;
|
||||
} else {
|
||||
json.Parameter22 = this.props.data?.TASK_ORGID
|
||||
}
|
||||
this.props.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
payload: json,
|
||||
@ -472,8 +474,7 @@ class PFCommonApproveView extends React.Component {
|
||||
<td colSpan={2} rowSpan={1} className={styles.fontBold}>审批详情</td>
|
||||
<td colSpan={8} rowSpan={1}>{
|
||||
this.state.data[0].Nav_ApproveDetails && this.state.data[0].Nav_ApproveDetails.sort(this.compare).map((item, i) => {
|
||||
if(item.NODE_APPROVE_STATUS == 20)
|
||||
{
|
||||
if (item.NODE_APPROVE_STATUS == 20) {
|
||||
return <table style={{ border: "0", width: '100%', textAlign: 'left' }}><tr><td style={{ border: "0", color: "red" }}><b>{(item.NAME ? item.NAME : "")}</b><br />
|
||||
{("审批结论:" + (item.CONTEXT === undefined ? "驳回" : item.CONTEXT))}<br />
|
||||
{("审核时间:" + item.NODE_APPROVE_TIME)}</td>
|
||||
@ -483,8 +484,7 @@ class PFCommonApproveView extends React.Component {
|
||||
</table>
|
||||
}
|
||||
else if (item.NODE_APPROVE_STATUS != 0) {
|
||||
if (item.Nav_ApproveUser != null && item.Nav_ApproveUser.FILE_PATH != null)
|
||||
{
|
||||
if (item.Nav_ApproveUser != null && item.Nav_ApproveUser.FILE_PATH != null) {
|
||||
return <table style={{ border: "0", width: '100%', textAlign: 'left' }}><tr><td style={{ border: "0" }}><b>{(item.NAME ? item.NAME : "")}</b><br />
|
||||
{("审批结论:" + (item.CONTEXT === undefined ? "同意" : item.CONTEXT))}<br />
|
||||
{("审核时间:" + item.NODE_APPROVE_TIME)}</td>
|
||||
@ -493,8 +493,7 @@ class PFCommonApproveView extends React.Component {
|
||||
<tr><td colSpan={2} style={{ border: "0" }}><hr style={{ border: '1px dashed #ccc' }}></hr></td></tr>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return <table style={{ border: "0", width: '100%', textAlign: 'left' }}><tr><td style={{ border: "0" }}><b>{(item.NAME ? item.NAME : "")}</b><br />
|
||||
{("审批结论:" + (item.CONTEXT === undefined ? "同意" : item.CONTEXT))}<br />
|
||||
{("审核时间:" + item.NODE_APPROVE_TIME)}</td>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Button, Descriptions, Modal, Badge, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd';
|
||||
import React from 'react';
|
||||
import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, ShowDateTime, ShowPrintClose, GetFileModel, showFiles } from '../../../utils/common';
|
||||
import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, ShowDateTime, ShowPrintClose, GetFileModel, showFiles, approveView } from '../../../utils/common';
|
||||
import ReactToPrint from 'react-to-print';
|
||||
import { ExportToExcel } from '@woowalker/feui'
|
||||
import XLSX from 'xlsx';
|
||||
@ -40,18 +40,8 @@ class SE071ShowPrint extends React.Component {
|
||||
let Table = TableWrap.getElementsByTagName('table1')[0];
|
||||
const wb = XLSX.utils.table_to_book(Table);
|
||||
XLSX.writeFile(wb, this.props.record.Nav_Department.NAME + '.xlsx')
|
||||
|
||||
}
|
||||
|
||||
onClickApprove = (appVisible) => {
|
||||
const newtmpData = {
|
||||
data: { id: this.props.data.id, isShow: true, key: guid(), param: this.props.data.param, appVisible: appVisible, BtnAgreeDisplay: 'none' },
|
||||
formCode: 'PF123',
|
||||
}
|
||||
this.setState({
|
||||
tmpData: newtmpData,
|
||||
});
|
||||
}
|
||||
loadData = (id) => {
|
||||
var isCheck = (this.props.data.tableKey != undefined && this.props.data.tableKey == '1') ? true : false
|
||||
var orgId = this.props.login ? this.props.login.OrgId : '';
|
||||
@ -86,7 +76,7 @@ class SE071ShowPrint extends React.Component {
|
||||
<div style={{ padding: '10px' }}>
|
||||
<table>
|
||||
<tr>
|
||||
<td><Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px' }} icon='export'>审批详情</Button></td>
|
||||
<td><Button onClick={() => approveView(this)} style={{ marginRight: '8px' }} icon='export'>审批详情</Button></td>
|
||||
<td><ReactToPrint trigger={() => <Button type={'default'} icon={'printer'} >打印</Button>} content={() => this.componentRef} /></td>
|
||||
<td><ExportToExcel fileName='年度培训计划' tableId={'tableId' + this.props.data.id} /></td>
|
||||
</tr>
|
||||
|
||||
@ -1970,3 +1970,17 @@ export function getArryPropShow(arry, propPath) {
|
||||
}
|
||||
return arryShow;
|
||||
}
|
||||
|
||||
/****** 审批查看公共能方法 ******/
|
||||
export function approveView(that, appVisible) {
|
||||
if (appVisible == null || appVisible == undefined) {
|
||||
appVisible = true
|
||||
}
|
||||
const newtmpData = {
|
||||
data: { id: that.props.data.id, isShow: true, key: guid(), param: that.props.data.param, appVisible: appVisible, BtnAgreeDisplay: 'none', ORG_ID_HV: that.props.data.ORG_ID_HV },
|
||||
formCode: 'PF123',
|
||||
}
|
||||
that.setState({
|
||||
tmpData: newtmpData
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user