feature/2.12.1.2404.02-薪资核算判断账套是否修改提示
This commit is contained in:
parent
3b90b1def4
commit
eeea664a8a
|
|
@ -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 (<SalaryCalcLayout {...this.props} onConfirm={() => this.onAdSearch(false)}>
|
||||
return (<SalaryCalcLayout {...this.props} init={this.init} onConfirm={() => this.onAdSearch(false)}>
|
||||
<div className="salary-edit-calc-content">
|
||||
<div className="salary-flex-between weapp-salary-tb-tip">
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -234,3 +234,12 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loadingLayout {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
padding: 30px 50px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { Button, message, Spin } from "antd";
|
||||
import * as API from "../../../../../apis/calculate";
|
||||
import "./index.less";
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ class SalaryCalcLayout extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
fieldInformationConfirm: { visible: false, data: {} }, userConfirmed: "0"
|
||||
fieldInformationConfirm: { visible: false, data: {} }, userConfirmed: "0", show: false
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -28,12 +28,14 @@ class SalaryCalcLayout extends Component {
|
|||
const { fieldInformationConfirm } = this.state;
|
||||
const { routeParams: { salaryAcctRecordId: id } } = this.props;
|
||||
API.getCompareSobConfig({ id }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
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;
|
||||
|
|
@ -42,8 +44,12 @@ class SalaryCalcLayout extends Component {
|
|||
if (status) {
|
||||
message.success(getLabel(30700, "操作成功!"));
|
||||
this.setState({
|
||||
show: true,
|
||||
fieldInformationConfirm: { ...fieldInformationConfirm, visible: false }
|
||||
}, () => this.props.onConfirm());
|
||||
}, () => {
|
||||
this.props.init();
|
||||
this.props.onConfirm();
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
|
|
@ -51,23 +57,26 @@ class SalaryCalcLayout extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { fieldInformationConfirm, userConfirmed } = this.state;
|
||||
const { fieldInformationConfirm, userConfirmed, show } = this.state;
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={this.onOk}
|
||||
disabled={userConfirmed === "0"}>{getLabel(111, "是,更新账套设置")}</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({
|
||||
show: true,
|
||||
fieldInformationConfirm: { ...fieldInformationConfirm, visible: false }
|
||||
})}>{getLabel(111, "否,忽略该提示")}</Button>
|
||||
}, () => this.props.init())}>{getLabel(111, "否,忽略该提示")}</Button>
|
||||
];
|
||||
return (
|
||||
<React.Fragment>
|
||||
{this.props.children}
|
||||
{
|
||||
show ? this.props.children : <div className="loadingLayout"><Spin/></div>
|
||||
}
|
||||
<WeaDialog
|
||||
title={getLabel(131329, "信息确认")} visible={fieldInformationConfirm.visible} initLoadCss hasScroll
|
||||
style={{ width: 380 }} className="infoConfirmDialog" buttons={buttons} onCancel={() =>
|
||||
this.setState({
|
||||
fieldInformationConfirm: { ...fieldInformationConfirm, visible: false }
|
||||
})}>
|
||||
}, () => this.props.init())}>
|
||||
<div className="confirm-content">
|
||||
<div className="contract">
|
||||
{getLabel("111", "账套发生变更,是否需要更新账套设置?更新后核算将按照最新的账套进行核算,请谨慎操作。")}
|
||||
|
|
|
|||
|
|
@ -216,23 +216,17 @@ class Index extends Component {
|
|||
/>
|
||||
}
|
||||
{/* 薪资核算-自定义导出*/}
|
||||
<CustomCalcExportDialog
|
||||
{...customExpDialog}
|
||||
onCancel={() => {
|
||||
this.setState({
|
||||
customExpDialog: { ...customExpDialog, visible: false }
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<CustomCalcExportDialog {...customExpDialog} onCancel={() => {
|
||||
this.setState({
|
||||
customExpDialog: { ...customExpDialog, visible: false }
|
||||
});
|
||||
}}/>
|
||||
{/* 薪资核算-导入*/}
|
||||
<SalaryEditCalcImport
|
||||
{...salaryImpDialog}
|
||||
onCancel={(isFresh) => {
|
||||
this.setState({
|
||||
salaryImpDialog: { ...salaryImpDialog, visible: false }
|
||||
}, () => isFresh && this.calc.onAdSearch(false));
|
||||
}}
|
||||
/>
|
||||
<SalaryEditCalcImport {...salaryImpDialog} onCancel={(isFresh) => {
|
||||
this.setState({
|
||||
salaryImpDialog: { ...salaryImpDialog, visible: false }
|
||||
}, () => isFresh && this.calc.onAdSearch(false));
|
||||
}}/>
|
||||
</WeaReqTop>
|
||||
</div>
|
||||
</Layout>
|
||||
|
|
|
|||
Loading…
Reference in New Issue