Merge branch 'hotfix/2.15.1.2407.01' into release/2.15.1.2407.01

This commit is contained in:
黎永顺 2024-08-22 15:44:34 +08:00
commit 69fd955592
5 changed files with 71 additions and 15 deletions

View File

@ -52,6 +52,7 @@ import ExternalPersonManage from "./pages/externalPersonManage";
import AdjustSalaryManage from "./pages/adjustSalaryManage";
import TopologyMap from "./pages/topologyMap";
import SupplementaryCalc from "./pages/supplementaryCalc";
import Layout from "./layout";
import stores from "./stores";
import "./style/index";
@ -114,7 +115,7 @@ const DataAcquisition = (props) => props.children;
// supplementaryCalc 补算
const Routes = (
<Route key="hrmSalary" path="hrmSalary" onEnter={getLocaleLabel} component={Home}>
<Route key="hrmSalary" path="hrmSalary" onEnter={getLocaleLabel} component={Layout}>
<Route key="historicalPayroll" path="historicalPayroll" component={HistoricalPayroll}/>
<Route key="salaryAdjustmentRecords" path="salaryAdjustmentRecords" component={SalaryAdjustmentRecords}/>
<Route key="mySalaryMobile" path="mySalaryMobile" component={MySalaryMobile}/>
@ -124,8 +125,8 @@ const Routes = (
<Route key="programme" path="programme" component={Programme}/>
<Route key="archives" path="archives" component={Archives}/>
<Route key="standingBook" path="standingBook" component={StandingBook}/>
<Route key="standingBookDetail" path="standingBookDetail" component={StandingBookDetail} />
<Route key="sbofflineComparison" path="sbofflineComparison" component={StandingBookOfflineComparison} />
<Route key="standingBookDetail" path="standingBookDetail" component={StandingBookDetail}/>
<Route key="sbofflineComparison" path="sbofflineComparison" component={StandingBookOfflineComparison}/>
</Route>
<Route key="salaryItem" path="salaryItem" component={SalaryItem}/>
<Route key="salaryFile" path="salaryFile" component={SalaryFiles}/>
@ -152,7 +153,7 @@ const Routes = (
<Route key="templatePreview" path="templatePreview" component={TemplatePreview}/>
<Route key="payrollinfo" path="payrollinfo" component={PayrollTemplatePreview}/>
<Route key="declare" path="declare" component={Declare}/>
<Route key="generateDeclarationDetail" path="generateDeclarationDetail" component={GenerateDeclarationDetail} />
<Route key="generateDeclarationDetail" path="generateDeclarationDetail" component={GenerateDeclarationDetail}/>
<Route key="taxRate" path="taxRate" component={TaxRate}/>
<Route key="taxAgent" path="taxAgent" component={TaxAgent}/>
<Route key="mobilepayroll" path="mobilepayroll" component={MobilePayroll}/>

View File

@ -0,0 +1,53 @@
/*
* 薪酬管理-
* layout组件
* @Author: 黎永顺
* @Date: 2024/8/15
* @Wechat:
* @Email: 971387674@qq.com
* @description:
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTools } from "ecCom";
import stores from "./stores";
const { ls } = WeaTools;
const { getLabel } = WeaLocaleProvider;
class Layout extends Component {
constructor(props) {
super(props);
this.state = {};
}
componentWillReceiveProps(nextProps, nextContext) {
if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) {
if (window.location.hash.indexOf("payroll") !== -1) {
window.localStorage.removeItem("template-basedata");
window.localStorage.removeItem("salary-showset");
}
}
}
componentDidMount() {
if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) {
const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css";
const link = document.createElement("link");
link.setAttribute("rel", "stylesheet");
link.setAttribute("type", "text/css");
link.setAttribute("href", src);
let header = document.getElementById("container");
header.appendChild(link);
top.$(".ant-message").remove();
window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission();
}
}
render() {
return (
<WeaLocaleProvider>{this.props.children}</WeaLocaleProvider>
);
}
}
export default Layout;

View File

@ -104,14 +104,14 @@ class EditSalaryCalcSlide extends Component {
..._.map(cur.salaryItems, it => {
return {
salaryItemId: it.salaryItemId,
resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, it.pattern || 2) : it.resultValue
resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, !_.isNil(it.pattern) ? it.pattern : 2) : it.resultValue
};
})
];
}, []),
...issuedAndReissueItems.map(item => ({
salaryItemId: item.salaryItemId,
resultValue: (item.dataType === "number" && !!item.resultValue) ? toDecimal_n(item.resultValue, item.pattern || 2) : item.resultValue
resultValue: (item.dataType === "number" && !!item.resultValue) ? toDecimal_n(item.resultValue, !_.isNil(item.pattern) ? item.pattern : 2) : item.resultValue
}))
]
};

View File

@ -413,9 +413,9 @@ const StatisticalScopePicker = (props) => {
value={startDate} disabled={disabled}
disabledDate={(current) => {
if (!current || !endDate) return false;
const start = moment(startDate || endDate).subtract(11, "months").format("YYYY-MM");
const end = moment(startDate).add(12, "months").format("YYYY-MM");
return current.getTime() < new Date(start).getTime() || current.getTime() > new Date(endDate || end).getTime();
const tooEarly = moment(current.getTime()).isBefore(moment(endDate).subtract(12, "month"));
const tooLate = moment(current.getTime()).isAfter(moment(endDate));
return !!tooEarly || !!tooLate;
}}
format="YYYY-MM"
onChange={(val) => onChange([val, endDate], timeType)}
@ -426,10 +426,9 @@ const StatisticalScopePicker = (props) => {
value={endDate} disabled={disabled}
disabledDate={(current) => {
if (!current || !startDate) return false;
const start = moment(endDate).subtract(12, "months").format("YYYY-MM");
const end = moment(endDate || startDate).add(12, "months").format("YYYY-MM");
return current.getTime() > new Date(end).getTime() || current.getTime() < new Date(startDate || start).getTime();
const tooEarly = moment(current.getTime()).isAfter(moment(startDate).add(12, "month"));
const tooLate = moment(current.getTime()).isBefore(moment(startDate));
return !!tooEarly || !!tooLate;
}}
format="YYYY-MM"
viewAttr={viewAttr}

View File

@ -16,7 +16,7 @@ import {
} from "../../apis/archive";
import { inject, observer } from "mobx-react";
import { adjCondition } from "./columns";
import { getDomkes, getSearchs } from "../../util";
import { getDomkes, getSearchs, toDecimal_n } from "../../util";
import moment from "moment";
const { getLabel } = WeaLocaleProvider;
@ -149,7 +149,10 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component {
let payload = {
...adjForm.getFormParams(), salaryArchiveId,
effectiveTime: moment(new Date(adjForm.getFormParams().effectiveTime)).format("YYYY-MM-DD"),
salaryArchiveItems: _.map(list, o => ({ salaryItemId: o.salaryItem, adjustValue: o.adjustAfter }))
salaryArchiveItems: _.map(list, o => ({
salaryItemId: o.salaryItem,
adjustValue: o.dataType === "number" ? toDecimal_n(o.adjustAfter, o.pattern) : o.adjustAfter
}))
};
if (salaryArchiveItemId) {
payload = { ...payload, canOperator, salaryArchiveItemId };