From 410a4c4ca721b7800698ffe50ca9f64377b3f726 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 6 Dec 2024 16:23:48 +0800 Subject: [PATCH] =?UTF-8?q?custom-=E7=BE=8E=E9=94=A6=E8=83=BD=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/calculate/calcView/index.js | 20 ++++++++++++++----- .../hrmSalary/pages/calculate/doCalc/index.js | 6 +++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/calcView/index.js b/pc4mobx/hrmSalary/pages/calculate/calcView/index.js index 6728c9a1..e606f4d0 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calcView/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/calcView/index.js @@ -7,12 +7,12 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTop } from "ecCom"; -import { Dropdown, Menu, message } from "antd"; +import { Button, Dropdown, Menu, message } from "antd"; import Layout from "../doCalc/layout"; import SalaryEditCalc from "../doCalc/components/salaryEditCalc"; import AdvanceInputBtn from "../doCalc/components/advanceInputBtn"; import { convertToUrlString } from "../../../util/url"; -import { getExportField } from "../../../apis/calculate"; +import { getApprovalInfoByRecordId, getExportField } from "../../../apis/calculate"; import CustomCalcExportDialog from "../doCalc/components/customCalcExportDialog"; import "./index.less"; @@ -24,13 +24,18 @@ class Index extends Component { constructor(props) { super(props); this.state = { - showChildren: false, + showChildren: false, approvalInfo: {}, customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] } }; this.calc = null; } - init = () => this.setState({ showChildren: true }); + init = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => { + if (status) this.setState({ approvalInfo, showChildren: true }); + }); + }; handleMenuClick = ({ key }) => { const { calculateStore: { ECSearchForm }, routeParams: { salaryAcctRecordId } } = this.props; @@ -69,7 +74,9 @@ class Index extends Component { }; render() { - const { showChildren, customExpDialog } = this.state; + const { routeParams: { salaryAcctRecordId } } = this.props; + const { showChildren, customExpDialog, approvalInfo } = this.state; + const { isOpenApproval, approvalWorkflowUrl } = approvalInfo; const btns = [ this.handleMenuClick({ key: "exportAll" })} @@ -81,6 +88,9 @@ class Index extends Component { onAdvanceSearch={() => this.calc.onAdSearch(false)} /> ]; + isOpenApproval && btns.unshift(); return ( } iconBgcolor="#F14A2D" diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 602e48b5..40d3c3aa 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -180,9 +180,9 @@ class Index extends Component { onAdvanceSearch={() => this.calc.onAdSearch(false)}/> ]; !canEdit && reqBtns.splice(0, 1); - isOpenApproval && reqBtns.unshift(); + // isOpenApproval && reqBtns.unshift(); accountExceptInfo && reqBtns.unshift( this.downloadTxtfile(accountExceptInfo)}/>);