feature/2.12.1.2403.02-社保档案保存修改

This commit is contained in:
黎永顺 2024-05-17 10:51:56 +08:00
parent 1deceeb3e8
commit 8f8f6c5ed1
2 changed files with 35 additions and 22 deletions

View File

@ -6,7 +6,7 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
import { WeaDialog, WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
import * as API from "../../../../../apis/welfareArchive";
import { getTaxAgentSelectList } from "../../../../../apis/taxAgent";
import { sysinfo } from "../../../../../apis/ruleconfig";
@ -23,7 +23,7 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, conditions: [], formData: {}
loading: false, conditions: [], formData: {}, errorDialog: { visible: false, errorMsg: "" }
};
}
@ -207,14 +207,8 @@ class Index extends Component {
message.success(getLabel(30700, "操作成功!"));
this.props.onClose(true);
} else {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: <div>
<div>{socialErrorMsg + fundErrorMsg + otherErrorMsg}</div>
<div>{getLabel(111, "是否自动将方案的上下限调整为设置值?")}</div>
</div>,
onOk: () => this.save(true),
onCancel: () => this.props.onClose()
!changeData && this.setState({
errorDialog: { visible: true, errorMsg: socialErrorMsg + fundErrorMsg + otherErrorMsg }
});
}
};
@ -257,18 +251,19 @@ class Index extends Component {
};
handleExtraChange = (key, value) => this.setState({ formData: { ...this.state.formData, [key]: value } });
handleSameChange = (baseItems, value) => {
if (!value) return;
let newFormDatas = {}, hasCompromise = false;
baseItems.forEach((formLabel) => {
const { min, max } = formLabel;
// const { min, max } = formLabel;
newFormDatas[getKey(formLabel)] = toDecimal_n(value, 2) || "";
if (min !== "0.000" && value !== "" && Number(value) < Number(min)) {
hasCompromise = true;
newFormDatas[getKey(formLabel)] = toDecimal_n(Number(min), 2);
}
if (max !== "0.000" && value !== "" && Number(value) > Number(max)) {
hasCompromise = true;
newFormDatas[getKey(formLabel)] = toDecimal_n(Number(max), 2);
}
// if (min !== "0.000" && value !== "" && Number(value) < Number(min)) {
// hasCompromise = true;
// newFormDatas[getKey(formLabel)] = toDecimal_n(Number(min), 2);
// }
// if (max !== "0.000" && value !== "" && Number(value) > Number(max)) {
// hasCompromise = true;
// newFormDatas[getKey(formLabel)] = toDecimal_n(Number(max), 2);
// }
});
if (hasCompromise) {
message.warning(getLabel("111", "超出所选缴纳方案设置的基数上下限范围,将自动按基数上下限填充。"));
@ -311,7 +306,7 @@ class Index extends Component {
render() {
const { archivesStore: { welfareProfileForm }, showOperateBtn } = this.props;
const { conditions, formData } = this.state;
const { conditions, formData, errorDialog } = this.state;
return (
<WeaSlideModal
className="salary-welfare-archive-edit-layout" {...this.props}
@ -324,6 +319,24 @@ class Index extends Component {
this.handleSameChange, formData, this.props, showOperateBtn
)
}
<WeaDialog title={getLabel(111, "信息确认")} visible={errorDialog.visible}
style={{ width: 480, height: 200 }} hasScroll
buttons={[
<Button type="primary" onClick={() => {
this.setState({ errorDialog: { ...errorDialog, visible: false } }, () => {
const promise = this.save(true);
message.success(getLabel(30700, "操作成功!"));
this.props.onClose(true);
});
}}>{getLabel(111, "确认")}</Button>
]}
onCancel={() => this.setState({ errorDialog: { ...errorDialog, visible: false } })}
bottomLeft={getLabel(111, "点击【确认】自动将不满足条件的基数值设置为对应的上限或下限值")}
>
<div style={{ padding: 16 }}>
<div dangerouslySetInnerHTML={{ __html: (errorDialog.errorMsg).replace(/\n/g, "</br>") }}/>
</div>
</WeaDialog>
</div>}
/>
);

View File

@ -815,8 +815,8 @@ const BenefitBaseComponent = (props) => {
com: <WeaFormItem label={child.label} labelCol={{ span: 10 }} wrapperCol={{ span: 14 }}>
<WeaInputNumber
value={value[getKey(child)] || (child.min !== "0.000" ? child.min : 0)} precision={2}
min={(child.min !== "0.000" && value.welBaseAutoAdjust) ? parseFloat(child.min) : -999999999999999}
max={(child.max !== "0.000" && value.welBaseAutoAdjust) ? parseFloat(child.max) : 999999999999999}
// min={(child.min !== "0.000" && value.welBaseAutoAdjust) ? parseFloat(child.min) : -999999999999999}
// max={(child.max !== "0.000" && value.welBaseAutoAdjust) ? parseFloat(child.max) : 999999999999999}
onChange={v => onChange(getKey(child), v)}
viewAttr={(runStatuses === "4,5" || !showOperateBtn) ? 1 : 2}
/>