From 5009cd59557d52a2bd4e90f55e6c1cf395be14b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 15 Aug 2024 15:43:52 +0800 Subject: [PATCH 1/5] hotfix/2.15.1.2407.01 --- .../pages/salaryFile/salaryArchiveEditAdjLogRecord.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js b/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js index a46b7129..6975ee63 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js @@ -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 }; From 3d5561981323e402f39ff40db3f7d14d9b9a7d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 15 Aug 2024 17:43:03 +0800 Subject: [PATCH 2/5] hotfix/2.15.1.2407.01 --- pc4mobx/hrmSalary/index.js | 9 ++++--- pc4mobx/hrmSalary/layout.js | 53 +++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 pc4mobx/hrmSalary/layout.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index fff7a3d1..8c605118 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -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 = ( - + @@ -124,8 +125,8 @@ const Routes = ( - - + + @@ -152,7 +153,7 @@ const Routes = ( - + diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js new file mode 100644 index 00000000..f1ad9a67 --- /dev/null +++ b/pc4mobx/hrmSalary/layout.js @@ -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 ( + {this.props.children} + ); + } +} + +export default Layout; From a3f40f506dd37e710b146a5df9c88a68bd520888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 19 Aug 2024 16:28:53 +0800 Subject: [PATCH 3/5] hotfix/2.15.1.2407.01 --- .../doCalc/components/salaryEditCalc/editSalaryCalcSlide.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js index 0943bd38..235bac13 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js @@ -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 })) ] }; From 96f6135aba7e1d24e4d8cb6f143adb27d460413a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 19 Aug 2024 17:32:49 +0800 Subject: [PATCH 4/5] hotfix/2.15.1.2407.01 --- .../reportView/components/statisticalMicroSettingsSlide.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 50be41e5..66a38aeb 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -412,6 +412,8 @@ const StatisticalScopePicker = (props) => { { + console.log(current, moment(current).format("YYYY-MM")) + console.log(startDate, endDate) 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"); From 63eb3730251f7e3468d40b7daf583131ccdf1f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 09:23:41 +0800 Subject: [PATCH 5/5] hotfix/2.15.1.2407.01 --- .../components/statisticalMicroSettingsSlide.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 66a38aeb..e82f2eaa 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -412,12 +412,10 @@ const StatisticalScopePicker = (props) => { { - console.log(current, moment(current).format("YYYY-MM")) - console.log(startDate, endDate) 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)} @@ -428,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}