feature/2.12.1.2404.02-薪资核算判断账套是否修改提示

This commit is contained in:
黎永顺 2024-04-26 16:53:51 +08:00
parent f1670a0380
commit 2fb3c89947
4 changed files with 125 additions and 3 deletions

View File

@ -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);
};

View File

@ -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";
@ -57,7 +57,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 (<SalaryCalcLayout {...this.props}>
<div className="salary-edit-calc-content">
<div className="salary-flex-between weapp-salary-tb-tip">
<div>
@ -92,7 +92,7 @@ class Index extends Component {
{...this.props} showTotalCell={showTotalCell}
onShowFormulaTd={this.handleShowFormulaTa}/>
</div>
);
</SalaryCalcLayout>);
}
}

View File

@ -207,3 +207,30 @@
}
}
}
.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%;
}
}
}

View File

@ -0,0 +1,86 @@
/*
* Author: 黎永顺
* name: 薪资核算-layout
* Description:
* Date: 2024/4/26
*/
import React, { Component } from "react";
import { WeaCheckbox, WeaDialog, WeaLocaleProvider } from "ecCom";
import { Button, message } 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"
};
}
componentDidMount() {
this.getCompareSobConfig();
}
getCompareSobConfig = () => {
const { fieldInformationConfirm } = this.state;
const { routeParams: { salaryAcctRecordId: id } } = this.props;
API.getCompareSobConfig({ id }).then(({ status, data }) => {
if (status) {
this.setState({
fieldInformationConfirm: { ...fieldInformationConfirm, visible: true }
});
}
});
};
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({
fieldInformationConfirm: { ...fieldInformationConfirm, visible: false }
});
} else {
message.error(errormsg);
}
});
};
render() {
const { fieldInformationConfirm, userConfirmed } = this.state;
const buttons = [
<Button type="primary" onClick={this.onOk}
disabled={userConfirmed === "0"}>{getLabel(111, "是,按最新账套设置全量核算")}</Button>,
<Button type="ghost" onClick={() => this.setState({
fieldInformationConfirm: { ...fieldInformationConfirm, visible: false }
})}>{getLabel(111, "否,忽略该提示")}</Button>
];
return (
<React.Fragment>
{this.props.children}
<WeaDialog
title={getLabel(131329, "信息确认")} visible={fieldInformationConfirm.visible} initLoadCss hasScroll
style={{ width: 380 }} className="infoConfirmDialog" buttons={buttons} onCancel={() =>
this.setState({
fieldInformationConfirm: { ...fieldInformationConfirm, visible: false }
})}>
<div className="confirm-content">
<div className="contract">
{getLabel("111", "本次核算所属薪资账套发生变更,是否需要按最新的账套设置进行核算?按照最新的账套进行核算,将覆盖当前核算数据(不清空手动输入/导入的数据),且不可恢复,请谨慎操作。")}
</div>
<div className="confirm-container">
<WeaCheckbox value={userConfirmed} content={getLabel("111", "已认真阅读,知晓风险")}
onChange={v => this.setState({ userConfirmed: v })}/>
</div>
</div>
</WeaDialog>
</React.Fragment>
);
}
}
export default SalaryCalcLayout;