diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 0abda464..f2bd582a 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -266,4 +266,13 @@ export const deleteExportTemplate = (params) => { export const getExportTemplateForm = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params); }; +//薪资核算-薪资项目改变否 +export const getCompareSobConfig = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/compareSobConfig", "GET", params); +}; +//薪资核算-更新薪资账套 +export const updateSobConfig = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/updateSobConfig", "GET", params); +}; + diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js index e3ed75a1..54081da1 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -6,12 +6,12 @@ */ import React, { Component } from "react"; import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom"; -import { Button } from "antd"; import { getColumnDesc, getSalarySobCycle } from "../../../../../apis/calculate"; import { sysConfCodeRule } from "../../../../../apis/ruleconfig"; import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel"; import EditCalcTable from "./editCalcTable"; import SalaryMonthTip from "../salaryMonthTip"; +import SalaryCalcLayout from "./salaryCalcLayout"; import cs from "classnames"; import "./index.less"; @@ -26,10 +26,6 @@ class Index extends Component { }; } - componentDidMount() { - const promise = this.init(); - } - openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); onAdSearch = (bool = true) => { this.calcTableRef.wrappedInstance.queryCalcResultList(); @@ -57,7 +53,7 @@ class Index extends Component { const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state; const { routeParams: { salaryAcctRecordId } } = this.props; const formulaObj = _.get(columnDesc, [formulaTd]) || {}; - return ( + return ( this.onAdSearch(false)}>
@@ -92,7 +88,7 @@ class Index extends Component { {...this.props} showTotalCell={showTotalCell} onShowFormulaTd={this.handleShowFormulaTa}/>
- ); + ); } } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less index 77f3e425..3d23810b 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less @@ -207,3 +207,39 @@ } } } + +.infoConfirmDialog { + .confirm-content { + width: 100%; + height: 100%; + padding: 16px; + overflow: auto; + position: relative; + display: flex; + flex-direction: column; + justify-content: space-between; + + .contract { + text-align: center; + flex-grow: 1; + flex-shrink: 1; + } + + .confirm-container { + flex-grow: 0; + flex-shrink: 0; + margin-top: 8px; + width: 100%; + + } + } +} + +.loadingLayout { + width: 100%; + height: 100%; + text-align: center; + border-radius: 4px; + padding: 30px 50px; + margin: 20px 0; +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js new file mode 100644 index 00000000..c95f07b0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js @@ -0,0 +1,96 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-layout + * Description: + * Date: 2024/4/26 + */ +import React, { Component } from "react"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message, Spin } from "antd"; +import * as API from "../../../../../apis/calculate"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class SalaryCalcLayout extends Component { + constructor(props) { + super(props); + this.state = { + fieldInformationConfirm: { visible: false, data: {} }, userConfirmed: "0", show: false + }; + } + + componentDidMount() { + this.getCompareSobConfig(); + } + + getCompareSobConfig = () => { + const { fieldInformationConfirm } = this.state; + const { routeParams: { salaryAcctRecordId: id } } = this.props; + API.getCompareSobConfig({ id }).then(({ status, data }) => { + if (status && data) { + this.setState({ + fieldInformationConfirm: { ...fieldInformationConfirm, visible: data } + }); + } else { + this.setState({ show: true }, () => this.props.init()); + } + }).catch(() => this.setState({ show: true }, () => this.props.init())); + }; + onOk = () => { + const { fieldInformationConfirm } = this.state; + const { routeParams: { salaryAcctRecordId: id } } = this.props; + API.updateSobConfig({ id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.setState({ + show: true, + fieldInformationConfirm: { ...fieldInformationConfirm, visible: false } + }, () => { + this.props.init(); + this.props.onConfirm(); + }); + } else { + message.error(errormsg); + } + }); + }; + + render() { + const { fieldInformationConfirm, userConfirmed, show } = this.state; + const buttons = [ + , + + ]; + return ( + + { + show ? this.props.children :
+ } + + this.setState({ + show: true, + fieldInformationConfirm: { ...fieldInformationConfirm, visible: false } + }, () => this.props.init())}> +
+
+ {getLabel("111", "账套发生变更,是否需要更新账套设置?更新后核算将按照最新的账套进行核算,请谨慎操作。")} +
+
+ this.setState({ userConfirmed: v })}/> +
+
+
+
+ ); + } +} + +export default SalaryCalcLayout; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index d8a8d78e..0d1c87fc 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -216,23 +216,17 @@ class Index extends Component { /> } {/* 薪资核算-自定义导出*/} - { - this.setState({ - customExpDialog: { ...customExpDialog, visible: false } - }); - }} - /> + { + this.setState({ + customExpDialog: { ...customExpDialog, visible: false } + }); + }}/> {/* 薪资核算-导入*/} - { - this.setState({ - salaryImpDialog: { ...salaryImpDialog, visible: false } - }, () => isFresh && this.calc.onAdSearch(false)); - }} - /> + { + this.setState({ + salaryImpDialog: { ...salaryImpDialog, visible: false } + }, () => isFresh && this.calc.onAdSearch(false)); + }}/>