Compare commits

..

No commits in common. "85a59a75ba8119b897f51e23e0f1c73f7103e627" and "5196bd88ee039300b020a29089d89f7b0cbf4f9e" have entirely different histories.

3 changed files with 128 additions and 131 deletions

View File

@ -39,7 +39,8 @@ class PFCommonApproveView extends React.Component {
} }
}; };
componentDidMount() { componentDidMount() {
if (this.props.data?.id) { if (this.props.data?.id)
{
this.loadData(this.props.data?.id,false); this.loadData(this.props.data?.id,false);
this.setState({ this.setState({
appVisible: this.props.data.appVisible?this.props.data.appVisible:false, appVisible: this.props.data.appVisible?this.props.data.appVisible:false,
@ -52,7 +53,8 @@ class PFCommonApproveView extends React.Component {
// if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { // if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) {
// this.loadData(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) { if (NextProps.data?.id) {
this.loadData(NextProps.data?.id,true); this.loadData(NextProps.data?.id,true);
this.setState({ this.setState({
@ -236,11 +238,7 @@ class PFCommonApproveView extends React.Component {
appVisible:appVisibleTemp, appVisible:appVisibleTemp,
BtnAgreeDisplay:this.props.data.BtnAgreeDisplay?this.props.data.BtnAgreeDisplay:'inline' 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 json.Parameter22=this.props.data?.TASK_ORGID
}
this.props.dispatch({ this.props.dispatch({
type: 'app/getDataByPost', type: 'app/getDataByPost',
payload: json, payload: json,
@ -474,7 +472,8 @@ class PFCommonApproveView extends React.Component {
<td colSpan={2} rowSpan={1} className={styles.fontBold}>审批详情</td> <td colSpan={2} rowSpan={1} className={styles.fontBold}>审批详情</td>
<td colSpan={8} rowSpan={1}>{ <td colSpan={8} rowSpan={1}>{
this.state.data[0].Nav_ApproveDetails && this.state.data[0].Nav_ApproveDetails.sort(this.compare).map((item, i) => { 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/> 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.CONTEXT===undefined?"驳回":item.CONTEXT ))}<br/>
{("审核时间:"+item.NODE_APPROVE_TIME)}</td> {("审核时间:"+item.NODE_APPROVE_TIME)}</td>
@ -484,7 +483,8 @@ class PFCommonApproveView extends React.Component {
</table> </table>
} }
else if (item.NODE_APPROVE_STATUS != 0) { 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/> 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.CONTEXT===undefined?"同意":item.CONTEXT ))}<br/>
{("审核时间:"+item.NODE_APPROVE_TIME)}</td> {("审核时间:"+item.NODE_APPROVE_TIME)}</td>
@ -493,7 +493,8 @@ class PFCommonApproveView extends React.Component {
<tr><td colSpan={2} style={{border:"0"}}><hr style={{border:'1px dashed #ccc'}}></hr></td></tr> <tr><td colSpan={2} style={{border:"0"}}><hr style={{border:'1px dashed #ccc'}}></hr></td></tr>
</table> </table>
} }
else { else
{
return <table style={{border:"0",width:'100%', textAlign: 'left'}}><tr><td style={{border:"0"}}><b>{(item.NAME? item.NAME: "")}</b><br/> 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.CONTEXT===undefined?"同意":item.CONTEXT ))}<br/>
{("审核时间:"+item.NODE_APPROVE_TIME)}</td> {("审核时间:"+item.NODE_APPROVE_TIME)}</td>

View File

@ -1,6 +1,6 @@
import { Button, Descriptions, Modal, Badge, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; import { Button, Descriptions, Modal, Badge, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd';
import React from 'react'; import React from 'react';
import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, ShowDateTime, ShowPrintClose, GetFileModel, showFiles, approveView } from '../../../utils/common'; import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, initQueryFilter, ShowDateTime, ShowPrintClose, GetFileModel, showFiles } from '../../../utils/common';
import ReactToPrint from 'react-to-print'; import ReactToPrint from 'react-to-print';
import { ExportToExcel } from '@woowalker/feui' import { ExportToExcel } from '@woowalker/feui'
import XLSX from 'xlsx'; import XLSX from 'xlsx';
@ -40,8 +40,18 @@ class SE071ShowPrint extends React.Component {
let Table = TableWrap.getElementsByTagName('table1')[0]; let Table = TableWrap.getElementsByTagName('table1')[0];
const wb = XLSX.utils.table_to_book(Table); const wb = XLSX.utils.table_to_book(Table);
XLSX.writeFile(wb, this.props.record.Nav_Department.NAME + '.xlsx') 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) => { loadData = (id) => {
var isCheck = (this.props.data.tableKey != undefined && this.props.data.tableKey == '1') ? true : false var isCheck = (this.props.data.tableKey != undefined && this.props.data.tableKey == '1') ? true : false
var orgId = this.props.login ? this.props.login.OrgId : ''; var orgId = this.props.login ? this.props.login.OrgId : '';
@ -76,7 +86,7 @@ class SE071ShowPrint extends React.Component {
<div style={{ padding: '10px' }}> <div style={{ padding: '10px' }}>
<table> <table>
<tr> <tr>
<td><Button onClick={() => approveView(this)} style={{ marginRight: '8px' }} icon='export'>审批详情</Button></td> <td><Button onClick={() => this.onClickApprove(true)} style={{ marginRight: '8px' }} icon='export'>审批详情</Button></td>
<td><ReactToPrint trigger={() => <Button type={'default'} icon={'printer'} >打印</Button>} content={() => this.componentRef} /></td> <td><ReactToPrint trigger={() => <Button type={'default'} icon={'printer'} >打印</Button>} content={() => this.componentRef} /></td>
<td><ExportToExcel fileName='年度培训计划' tableId={'tableId' + this.props.data.id} /></td> <td><ExportToExcel fileName='年度培训计划' tableId={'tableId' + this.props.data.id} /></td>
</tr> </tr>

View File

@ -1970,17 +1970,3 @@ export function getArryPropShow(arry, propPath) {
} }
return arryShow; 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
});
}