diff --git a/src/components/CustomPages/PF/PFCommonApproveView.js b/src/components/CustomPages/PF/PFCommonApproveView.js index 39ea5af..0b13eff 100644 --- a/src/components/CustomPages/PF/PFCommonApproveView.js +++ b/src/components/CustomPages/PF/PFCommonApproveView.js @@ -1,5 +1,5 @@ import { message } from "antd/lib/index"; -import { Layout,Descriptions, Tabs, Steps, Button, Popconfirm, Row, Col, Form, Input, Select, Table, Drawer ,Icon} from 'antd'; +import { Layout, Descriptions, Tabs, Steps, Button, Popconfirm, Row, Col, Form, Input, Select, Table, Drawer, Icon } from 'antd'; import React from 'react'; import { PlusOutlined } from '@ant-design/icons'; import ReactToPrint from "react-to-print"; @@ -34,17 +34,16 @@ class PFCommonApproveView extends React.Component { visible: false, userData: [], selectUserId: '', - appVisible:false, - BtnAgreeDisplay:'none' + appVisible: false, + BtnAgreeDisplay: 'none' } }; componentDidMount() { - if (this.props.data?.id) - { - this.loadData(this.props.data?.id,false); + if (this.props.data?.id) { + this.loadData(this.props.data?.id, false); this.setState({ - appVisible: this.props.data.appVisible?this.props.data.appVisible:false, - BtnAgreeDisplay:this.props.data.BtnAgreeDisplay?this.props.data.BtnAgreeDisplay:'none', + appVisible: this.props.data.appVisible ? this.props.data.appVisible : false, + BtnAgreeDisplay: this.props.data.BtnAgreeDisplay ? this.props.data.BtnAgreeDisplay : 'none', }) } } @@ -53,13 +52,12 @@ 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.loadData(NextProps.data?.id, true); this.setState({ - appVisible: NextProps.data.appVisible?NextProps.data.appVisible:false, - BtnAgreeDisplay:NextProps.data.BtnAgreeDisplay?NextProps.data.BtnAgreeDisplay:'none', + appVisible: NextProps.data.appVisible ? NextProps.data.appVisible : false, + BtnAgreeDisplay: NextProps.data.BtnAgreeDisplay ? NextProps.data.BtnAgreeDisplay : 'none', }) } } @@ -145,11 +143,11 @@ class PFCommonApproveView extends React.Component { }); } - loadDataOld(dataid,appVisibleTemp) { + loadDataOld(dataid, appVisibleTemp) { const json = initFilter(this.props.login.OrgId, this.props.data.id, '', 0, 1, this.props.data.PARAM ?? null, this.props.data.PARAM2); this.setState({ - appVisible:appVisibleTemp, - BtnAgreeDisplay:this.props.data.BtnAgreeDisplay?this.props.data.BtnAgreeDisplay:'inline' + appVisible: appVisibleTemp, + BtnAgreeDisplay: this.props.data.BtnAgreeDisplay ? this.props.data.BtnAgreeDisplay : 'inline' }); this.props.dispatch({ type: 'app/getDataByPost', @@ -167,7 +165,7 @@ class PFCommonApproveView extends React.Component { payload: jsonApp, onlyData: false, onComplete: (re) => { - + if (re && re.IsSuccessful && re.Data && re.Data.Nav_ApproveDetails.length > 0) { const newtmpData = { data: { @@ -232,13 +230,17 @@ class PFCommonApproveView extends React.Component { } }); } - loadData(dataid,appVisibleTemp) { + loadData(dataid, appVisibleTemp) { const json = initFilter(this.props.login.OrgId, this.props.data.id, '', 0, 1, this.props.data.PARAM ?? null, this.props.data.PARAM2); this.setState({ - appVisible:appVisibleTemp, - BtnAgreeDisplay:this.props.data.BtnAgreeDisplay?this.props.data.BtnAgreeDisplay:'inline' + appVisible: appVisibleTemp, + BtnAgreeDisplay: this.props.data.BtnAgreeDisplay ? this.props.data.BtnAgreeDisplay : 'inline' }); - json.Parameter22=this.props.data?.TASK_ORGID + 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, @@ -309,14 +311,14 @@ class PFCommonApproveView extends React.Component { }); } - showAppDrawer= () => { + showAppDrawer = () => { this.setState({ appVisible: true, }); } onClose = () => { this.setState({ - appVisible:false, + appVisible: false, }); }; render() { @@ -338,13 +340,13 @@ class PFCommonApproveView extends React.Component { // - {/* */} - {/* { + {/* { this.state.data && this.state.data.Nav_ApproveDetails? {this.state.data?.Nav_ApproveDetails?.map((n) => { let status = 'wait'; let result = ''; @@ -373,34 +375,34 @@ class PFCommonApproveView extends React.Component { })} :"暂无审批详情" } */} - { - this.state.data && this.state.data[0] ? - this.state.data.map((m,i)=>{ - - return - { - m.Nav_ApproveDetails?.sort(this.compare).map((n) => { - let status = 'wait'; let result = ''; - if (n.NODE_APPROVE_STATUS == 10) { - status = 'finish';result='同意'; - } else if (n.NODE_APPROVE_STATUS == 20) { - status = 'error';result='驳回'; - } - if (n.IS_CURRENT) { - status = 'process'; - } - return {"审批人:"+n.Nav_ApproveUser?.NAME}
{"审批时间:"+(n.NODE_APPROVE_TIME == "0001-01-01 00:00:00" ? '' : n.NODE_APPROVE_TIME)} -
{"审批结论:"+result} -
{"审批意见:"+(n.CONTEXT ==undefined?'': n.CONTEXT)} - } status={status} icon={status=='process'?:null} /> - // description={n.Nav_ApproveUser?.NAME + (n.NODE_APPROVE_TIME == "0001-01-01 00:00:00" ? '' : n.NODE_APPROVE_TIME)} - })} -
-
- }) :"暂无审批详情" - - } - {/*
*/} + { + this.state.data && this.state.data[0] ? + this.state.data.map((m, i) => { + + return + { + m.Nav_ApproveDetails?.sort(this.compare).map((n) => { + let status = 'wait'; let result = ''; + if (n.NODE_APPROVE_STATUS == 10) { + status = 'finish'; result = '同意'; + } else if (n.NODE_APPROVE_STATUS == 20) { + status = 'error'; result = '驳回'; + } + if (n.IS_CURRENT) { + status = 'process'; + } + return {"审批人:" + n.Nav_ApproveUser?.NAME}
{"审批时间:" + (n.NODE_APPROVE_TIME == "0001-01-01 00:00:00" ? '' : n.NODE_APPROVE_TIME)} +
{"审批结论:" + result} +
{"审批意见:" + (n.CONTEXT == undefined ? '' : n.CONTEXT)} + } status={status} icon={status == 'process' ? : null} /> + // description={n.Nav_ApproveUser?.NAME + (n.NODE_APPROVE_TIME == "0001-01-01 00:00:00" ? '' : n.NODE_APPROVE_TIME)} + })} +
+
+ }) : "暂无审批详情" + + } + {/* */}
{/* @@ -429,7 +431,7 @@ class PFCommonApproveView extends React.Component { })} */} - {/* { + {/* { this.state.data && this.state.data[0]?
@@ -463,54 +465,51 @@ class PFCommonApproveView extends React.Component {
:null } */} - { - this.state.data && this.state.data[0]? -
- - - - - - - -
审批详情{ - this.state.data[0].Nav_ApproveDetails && this.state.data[0].Nav_ApproveDetails.sort(this.compare).map((item, i) => { - if(item.NODE_APPROVE_STATUS == 20) - { - return - - -
{(item.NAME? item.NAME: "")}
- {("审批结论:"+(item.CONTEXT===undefined?"驳回":item.CONTEXT ))}
- {("审核时间:"+item.NODE_APPROVE_TIME)}

-

- } - else if (item.NODE_APPROVE_STATUS != 0) { - if (item.Nav_ApproveUser != null && item.Nav_ApproveUser.FILE_PATH != null) - { - return - - -
{(item.NAME? item.NAME: "")}
- {("审批结论:"+(item.CONTEXT===undefined?"同意":item.CONTEXT ))}
- {("审核时间:"+item.NODE_APPROVE_TIME)}

{item.Nav_ApproveUser.NAME} -

- } - else - { - return - - -
{(item.NAME? item.NAME: "")}
- {("审批结论:"+(item.CONTEXT===undefined?"同意":item.CONTEXT ))}
- {("审核时间:"+item.NODE_APPROVE_TIME)}

-

- } - } - }) - }
-
:null - } + { + this.state.data && this.state.data[0] ? +
+ + + + + + + +
审批详情{ + this.state.data[0].Nav_ApproveDetails && this.state.data[0].Nav_ApproveDetails.sort(this.compare).map((item, i) => { + if (item.NODE_APPROVE_STATUS == 20) { + return + + +
{(item.NAME ? item.NAME : "")}
+ {("审批结论:" + (item.CONTEXT === undefined ? "驳回" : item.CONTEXT))}
+ {("审核时间:" + item.NODE_APPROVE_TIME)}

+

+ } + else if (item.NODE_APPROVE_STATUS != 0) { + if (item.Nav_ApproveUser != null && item.Nav_ApproveUser.FILE_PATH != null) { + return + + +
{(item.NAME ? item.NAME : "")}
+ {("审批结论:" + (item.CONTEXT === undefined ? "同意" : item.CONTEXT))}
+ {("审核时间:" + item.NODE_APPROVE_TIME)}

{item.Nav_ApproveUser.NAME} +

+ } + else { + return + + +
{(item.NAME ? item.NAME : "")}
+ {("审批结论:" + (item.CONTEXT === undefined ? "同意" : item.CONTEXT))}
+ {("审核时间:" + item.NODE_APPROVE_TIME)}

+

+ } + } + }) + }
+
: null + }
) diff --git a/src/components/CustomPages/SE/SE071ShowPrint.js b/src/components/CustomPages/SE/SE071ShowPrint.js index 08b0775..361339a 100644 --- a/src/components/CustomPages/SE/SE071ShowPrint.js +++ b/src/components/CustomPages/SE/SE071ShowPrint.js @@ -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 {
- + diff --git a/src/utils/common.js b/src/utils/common.js index 6e573ac..d52a25d 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -1537,19 +1537,19 @@ function fileOnClick(file, callBack) { //适应 组件 对附件的显示 export function getFileShow(FILE_PATH, FILE_NAME) { - const result = [] - if (!FILE_NAME) { - var listPath = FILE_PATH.split('/') - FILE_NAME = listPath[listPath.length - 1] - } - result.push({ - Nav_ImgFile: { - FILE_PATH: FILE_PATH, - FILE_NAME: FILE_NAME, - FILE_TYPE:'' - } - }) - return result; + const result = [] + if (!FILE_NAME) { + var listPath = FILE_PATH.split('/') + FILE_NAME = listPath[listPath.length - 1] + } + result.push({ + Nav_ImgFile: { + FILE_PATH: FILE_PATH, + FILE_NAME: FILE_NAME, + FILE_TYPE: '' + } + }) + return result; } //显示附件 @@ -1969,4 +1969,18 @@ 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 + }); } \ No newline at end of file
} content={() => this.componentRef} />