Merge branch 'release/2.14.2.2405.02' into release/2.14.2.2405.02-个税

This commit is contained in:
黎永顺 2024-05-27 16:54:36 +08:00
commit b9562831ff
13 changed files with 231 additions and 54 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

@ -26,7 +26,7 @@ class SalaryDetails extends Component {
this.state = {
loading: false, dataSource: [], columns: [], selectedRowKeys: [],
pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {},
showTotalCell: false
showTotalCell: false, updateSum: true
};
}
@ -54,10 +54,13 @@ class SalaryDetails extends Component {
} else if (type === "turn") {
if (id === "PAGEINFO") {
const { pageNum: current, size: pageSize } = params;
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getSalaryList(this.props));
this.setState({
pageInfo: { ...pageInfo, current, pageSize },
updateSum: true
}, () => this.getSalaryList(this.props));
} else if (id === "CHECKBOX") {
const { selectedRowKeys: checkBox } = params;
this.setState({ selectedRowKeys: checkBox });
this.setState({ selectedRowKeys: checkBox, updateSum: false });
}
}
};
@ -106,13 +109,13 @@ class SalaryDetails extends Component {
};
getColumns = () => {
const { attendanceStore: { tableStore } } = this.props;
const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload } = this.state;
const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum } = this.state;
const columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : "";
if (!_.isEmpty(columns)) {
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, payload,
sumRowlistUrl,
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154,
sumRowlistUrl, payload: { ...payload, updateSum },
columns: _.map(columns, (it, idx) => ({
...it,
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.oldWidth,

View File

@ -42,8 +42,8 @@ class Index extends Component {
keyword: "",
year: moment().format("YYYY"),
dateRange: [
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
moment(new Date()).endOf("year").format("YYYY-MM")
moment(new Date()).subtract(6, "months").format("YYYY-MM"),
moment(new Date()).format("YYYY-MM")
],
showSearchAd: false,
isQuery: false,

View File

@ -16,8 +16,7 @@ class SalaryCalcOcImport extends Component {
super(props);
this.state = {
importDialog: {
visible: false, title: "", nextloading: false, importResult: {}, imageId: "",
link: "/api/bs/hrmsalary/salaryacct/comparisonresult/importtemplate/export?salaryAcctRecordId=",
visible: false, title: "", nextloading: false, importResult: {}, imageId: "", link: "",
previewUrl: "/api/bs/hrmsalary/salaryacct/comparisonresult/preview",
extraPreview: { salaryAcctRecordId: "" }
}
@ -30,7 +29,7 @@ class SalaryCalcOcImport extends Component {
this.setState({
importDialog: {
...this.state.importDialog,
link: `${importDialog.link}${nextProps.salaryAcctRecordId}`,
link: `/api/bs/hrmsalary/salaryacct/comparisonresult/importtemplate/export?salaryAcctRecordId=${nextProps.salaryAcctRecordId}`,
visible: nextProps.visible, importResult: {},
title: nextProps.title, imageId: "",
extraPreview: { salaryAcctRecordId: nextProps.salaryAcctRecordId }

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";
@ -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 (<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>
@ -92,7 +88,7 @@ class Index extends Component {
{...this.props} showTotalCell={showTotalCell}
onShowFormulaTd={this.handleShowFormulaTa}/>
</div>
);
</SalaryCalcLayout>);
}
}

View File

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

View File

@ -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 = [
<Button type="primary" onClick={this.onOk}
disabled={userConfirmed === "0"}>{getLabel(111, "是,更新账套设置")}</Button>,
<Button type="ghost" onClick={() => this.setState({
show: true,
fieldInformationConfirm: { ...fieldInformationConfirm, visible: false }
}, () => this.props.init())}>{getLabel(111, "否,忽略该提示")}</Button>
];
return (
<React.Fragment>
{
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({
show: true,
fieldInformationConfirm: { ...fieldInformationConfirm, visible: false }
}, () => this.props.init())}>
<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;

View File

@ -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>

View File

@ -128,6 +128,13 @@ export const salaryItemFields = [
viewAttr: 2,
tip: ""
},
// {
// key: "defaultValue",
// label: "默认值",
// type: "INPUT",
// viewAttr: 2,
// tip: ""
// },
{
key: "formulaContent",
label: "公式",

View File

@ -84,6 +84,13 @@ class SalaryItemForm extends Component {
...item,
viewAttr: (useInEmployeeSalary.toString() === "0" && ((isLedger && record.canEdit) || (editable && record.canEdit) || isAdd)) ? 2 : 1
};
case "defaultValue":
return {
...item,
type: dataType === "number" ? "INPUTNUMBER" : "INPUT",
display: valueType && valueType.toString() === "1",
viewAttr: (isLedger && record.canEdit) || (editable && record.canEdit) || isAdd ? 2 : 1
};
case "formulaContent":
return {
...item,
@ -111,6 +118,10 @@ class SalaryItemForm extends Component {
return { ...item, display: v === "1", viewAttr: 3 };
} else if (key === "dataType" && (item.key === "roundingMode" || item.key === "pattern")) {
return { ...item, display: v === "number" };
} else if (key === "dataType" && (item.key === "defaultValue")) {
return { ...item, type: v === "number" ? "INPUTNUMBER" : "INPUT" };
} else if (key === "valueType" && item.key === "defaultValue") {
return { ...item, display: v === "1" };
} else if (key === "valueType" && (item.key === "originSqlContent" || item.key === "originFormulaContent")) {
return {
...item,

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: "" }
};
}
@ -180,7 +180,7 @@ class Index extends Component {
welfareType, validate: welfareData[`${underTakeType}SchemeId`] ? !!welfareData[`${underTakeType}StartTime`] : true
};
};
save = async () => {
save = async (changeData = false) => {
const socailPayload = this.covertPayload("SOCIAL_SECURITY", "social", getConditionDomkeys(this.props.socialBase.items), getConditionDomkeys(this.props.socialBase.comItems || [])),
fundPayload = this.covertPayload("ACCUMULATION_FUND", "fund", getConditionDomkeys(this.props.fundBase.items), getConditionDomkeys(this.props.fundBase.comItems || [])),
otherPayload = this.covertPayload("OTHER", "other", getConditionDomkeys(this.props.otherBase.items), getConditionDomkeys(this.props.otherBase.comItems || []));
@ -198,13 +198,18 @@ class Index extends Component {
}, {
status: otherStatus,
errormsg: otherErrorMsg = "!"
}] = await Promise.all([API.save(socailPayload), API.save(fundPayload), API.save(otherPayload)]);
}] = await Promise.all([
API.save({ ...socailPayload, changeData }),
API.save({ ...fundPayload, changeData }),
API.save({ ...otherPayload, changeData })]);
this.setState({ loading: false });
if (socialStatus && fundStatus && otherStatus) {
message.success(getLabel(30700, "操作成功!"));
this.props.onClose(true);
} else {
message.error(socialErrorMsg + fundErrorMsg + otherErrorMsg);
!changeData && this.setState({
errorDialog: { visible: true, errorMsg: socialErrorMsg + fundErrorMsg + otherErrorMsg }
});
}
};
updateFormData = (baseData) => this.setState({ formData: { ...this.state.formData, ...baseData } });
@ -246,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", "超出所选缴纳方案设置的基数上下限范围,将自动按基数上下限填充。"));
@ -278,7 +284,7 @@ class Index extends Component {
<div className="titleCol titleRightBox">
{
runStatuses !== "4,5" && showOperateBtn &&
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
<Button type="primary" onClick={() => this.save()} loading={loading}>{getLabel(537558, "保存")}</Button>
}
</div>
</div>;
@ -300,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}
@ -313,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}
/>

View File

@ -34,7 +34,8 @@ export class SalaryItemStore {
dataType: "number",
description: "",
sharedType: "0",
taxAgentIds: ""
taxAgentIds: "",
defaultValue: ""
};
@observable tableDataSource = []; // 主列表
@ -75,7 +76,8 @@ export class SalaryItemStore {
dataType: "number",
description: "",
sharedType: "0",
taxAgentIds: ""
taxAgentIds: "",
defaultValue: ""
};
@action