diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 0990c113..1aaf8045 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -51,6 +51,7 @@ import WatermarkPreview from "./pages/payroll/watermarkPreview"; import ExternalPersonManage from "./pages/externalPersonManage"; import AdjustSalaryManage from "./pages/adjustSalaryManage"; import TopologyMap from "./pages/topologyMap"; +import SupplementaryCalc from "./pages/supplementaryCalc"; import stores from "./stores"; import "./style/index"; @@ -110,6 +111,7 @@ const DataAcquisition = (props) => props.children; // reportView 薪酬报表查看 // externalPersonManage 非系统人员管理 // adjustSalaryManage 档案管理 +// supplementaryCalc 补算 const Routes = ( + ); diff --git a/pc4mobx/hrmSalary/pages/supplementaryCalc/index.js b/pc4mobx/hrmSalary/pages/supplementaryCalc/index.js new file mode 100644 index 00000000..558c2c38 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/supplementaryCalc/index.js @@ -0,0 +1,190 @@ +/* + * Author: 黎永顺 + * name: 补算 + * Description: + * Date: 2024/3/26 + */ +import React, { Component } from "react"; +import { Button, message } from "antd"; +import { WeaBrowser, WeaError, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaSelect, WeaTop } from "ecCom"; +import { supplementAcctRecord } from "../../apis"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + type: "sob", salaryItemIds: "", salarySobIds: "", + salaryAcctRecordIds: "", loading: false + }; + } + + handleChangeItems = (key, value) => { + this.setState({ [key]: value }); + }; + handleSubmit = () => { + const { salaryItemIds, salarySobIds, salaryAcctRecordIds, type } = this.state; + if (!salaryItemIds && !salarySobIds && type === "sob") { + this.refs.salaryItemError.showError(); + this.refs.salarySobError.showError(); + return; + } + if (!salaryItemIds && !salaryAcctRecordIds && type === "record") { + this.refs.salaryItemError.showError(); + this.refs.salaryPigeonholeError.showError(); + return; + } + if (!salaryItemIds) { + this.refs.salaryItemError.showError(); + return; + } + if (!salaryAcctRecordIds && type === "record") { + this.refs.salaryPigeonholeError.showError(); + return; + } + if (!salarySobIds && type === "sob") { + this.refs.salarySobError.showError(); + return; + } + this.setState({ loading: true }); + supplementAcctRecord({ + type, + salaryAcctRecordIds: salaryAcctRecordIds ? salaryAcctRecordIds.split(",") : [], + salarySobIds: salarySobIds ? salarySobIds.split(",") : [], + salaryItemIds: salaryItemIds ? salaryItemIds.split(",") : [] + }).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "补算成功")); + } else { + message.error(errormsg || getLabel(111, "补算失败")); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { type, salaryItemIds, salarySobIds, salaryAcctRecordIds, loading } = this.state; + return ( + } + buttons={[ + + ]} + > +
+ + + + this.setState({ type }, () => { + this.setState({ salarySobIds: "", salaryAcctRecordIds: "", salaryItemIds: "" }); + })} + /> + + + { + type === "sob" ? + + + this.handleChangeItems("salarySobIds", salarySobIds)} + /> + + : + + + this.handleChangeItems("salaryAcctRecordIds", salaryAcctRecordIds)} + /> + + + } + + + this.handleChangeItems("salaryItemIds", salaryItemIds)} + /> + + + +
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/supplementaryCalc/index.less b/pc4mobx/hrmSalary/pages/supplementaryCalc/index.less new file mode 100644 index 00000000..e69de29b