From b54a561ba48bc2fd591e0438f2714060fd66c4cb 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, 26 Sep 2023 11:03:19 +0800
Subject: [PATCH] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/salaryEditCalc/baseInfo.js | 59 +++++++
.../salaryEditCalc/editCalcTable.js | 19 ++-
.../salaryEditCalc/editSalaryCalcSlide.js | 160 ++++++++++++++++++
.../components/salaryEditCalc/index.less | 98 +++++++++++
.../pages/calculate/doCalc/index.less | 4 +
5 files changed, 338 insertions(+), 2 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
new file mode 100644
index 00000000..3539ec72
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
@@ -0,0 +1,59 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资基本信息
+ * Description:
+ * Date: 2023/9/25
+ */
+import React, { Component } from "react";
+import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
+import cs from "classnames";
+import { Col, Row } from "antd";
+import "./index.less";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class EditSalaryBaseInfo extends Component {
+ render() {
+ const { baseInfo } = this.props;
+ return (
+
+ {getLabel(82743, "基础信息")}
+
+
+ }
+ >
+
+ {
+ _.map(baseInfo, (item, index) => {
+ const { fieldName, fieldValue } = item;
+ return (
+
+
+
+ {fieldName}
+
+
+ {fieldValue}
+
+
+
+ );
+ })
+ }
+
+
+ );
+ }
+}
+
+export default EditSalaryBaseInfo;
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
index 07b25888..05479c3f 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
@@ -10,6 +10,7 @@ import { message, Modal, Spin } from "antd";
import { inject, observer } from "mobx-react";
import { acctResultList, updateLockStatus } from "../../../../../apis/calculate";
import ProgressModal from "../../../../../components/progressModal";
+import EditSalaryCalcSlide from "./editSalaryCalcSlide";
const getLabel = WeaLocaleProvider.getLabel;
@@ -20,7 +21,8 @@ class EditCalcTable extends Component {
super(props);
this.state = {
loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
- selectedRowKeys: [], progressVisible: false, progress: 0
+ selectedRowKeys: [], progressVisible: false, progress: 0,
+ salaryCalcSlide: { visible: false, id: "" }
};
this.timerLock = null;
}
@@ -51,6 +53,12 @@ class EditCalcTable extends Component {
const { salaryItemId, lockType: lockStatus } = params;
this.updateLockStatus({ lockStatus, salaryItemId });
break;
+ case "EDIT":
+ const { id: salaryCalcId } = params;
+ this.setState({
+ salaryCalcSlide: { visible: true, id: salaryCalcId }
+ });
+ break;
default:
break;
}
@@ -152,7 +160,7 @@ class EditCalcTable extends Component {
};
render() {
- const { loading, progressVisible, progress } = this.state;
+ const { loading, progressVisible, progress, salaryCalcSlide } = this.state;
return (
@@ -162,6 +170,13 @@ class EditCalcTable extends Component {
// src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable"
id="atdTable"
/>
+ this.setState({
+ salaryCalcSlide: {
+ visible: false,
+ id: ""
+ }
+ }, () => isFresh === "true" && this.queryCalcResultList())}/>
{
progressVisible &&
{
+ acctresultDetail({ id }).then(({ status, data }) => {
+ if (status) {
+ const { employeeInfos, issuedAndReissueItems, itemsByGroup } = data;
+ this.setState({
+ baseInfo: employeeInfos, issuedAndReissueItems, itemsByGroup
+ });
+ }
+ });
+ };
+ renderTitle = () => {
+ const { loading } = this.state;
+ return
+
+
+
{getLabel(543559, "编辑薪资")}
+
+
+
+
+
;
+ };
+ handleItemValueChange = (field, value, isInput, groupId) => {
+ const { issuedAndReissueItems, itemsByGroup } = this.state;
+ if (isInput === "itemsByGroup") {
+ this.setState({
+ itemsByGroup: itemsByGroup.map(item => {
+ if (item.salarySobItemGroupId === groupId) {
+ return {
+ ...item,
+ salaryItems: _.map(item.salaryItems, it => {
+ if (it.salaryItemId === field) {
+ return { ...it, resultValue: value };
+ }
+ return { ...it };
+ })
+ };
+ }
+ return { ...item };
+ })
+ });
+ } else if (isInput === "issuedAndReissueItems") {
+ this.setState({
+ issuedAndReissueItems: issuedAndReissueItems.map(item => {
+ item = { ...item };
+ if (item.salaryItemName === field) {
+ item.resultValue = value;
+ }
+ return item;
+ })
+ });
+ }
+ };
+ save = () => {
+ const { id: salaryAcctEmpId } = this.props;
+ const { issuedAndReissueItems, itemsByGroup } = this.state;
+ const payload = {
+ salaryAcctEmpId,
+ items: [
+ ..._.reduce(itemsByGroup, (pre, cur) => {
+ return [
+ ...pre,
+ ..._.map(cur.salaryItems, it => {
+ return {
+ salaryItemId: it.salaryItemId,
+ resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, 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
+ }))
+ ]
+ };
+ this.setState({ loading: true });
+ saveAcctResult(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success(getLabel(30700, "操作成功!"));
+ this.props.onClose("true");
+ } else {
+ message.error(errormsg);
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+
+ render() {
+ const { baseInfo, selectedKey, itemsByGroup, issuedAndReissueItems } = this.state;
+ const topTab = [
+ { title: getLabel(542704, "正常工资薪金所得"), viewcondition: "0" },
+ { title: getLabel(542651, "已发补发"), viewcondition: "1" }
+ ];
+ return (
+
+
+
+ this.setState({ selectedKey: v })}
+ datas={!_.isEmpty(issuedAndReissueItems) ? topTab : topTab.slice(0, 1)}
+ />
+ {
+ selectedKey === "0" && _.map(itemsByGroup, item => {
+ return ;
+ })
+ }
+ {
+ selectedKey === "1" &&
+
+ }
+ }
+ />
+
+ );
+ }
+}
+
+export default EditSalaryCalcSlide;
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
index 62b7cc07..c0bce5e7 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
@@ -54,3 +54,101 @@
}
}
}
+
+.salary-calculate-esf-layout {
+
+ .titleDialog {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 46px 0 16px;
+
+ .titleCol {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ }
+
+ .titleLeftBox {
+ .titleIcon {
+ color: #fff;
+ margin: 0;
+ width: 40px;
+ height: 40px;
+ line-height: 40px;
+ font-size: 22px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #F14A2D;
+ border-radius: 50%;
+ }
+
+ .title {
+ font-size: 14px;
+ color: #333;
+ padding-left: 6px;
+ }
+ }
+
+ .titleRightBox {
+ justify-content: flex-end;
+ }
+ }
+
+ .wea-slide-modal-title {
+ border-bottom: 1px solid #e5e5e5 !important;
+ }
+
+ .wea-slide-modal-content {
+ height: 100%;
+
+ .salary-calculate-esf-area {
+ background: #f6f6f6;
+ height: 100%;
+ overflow-y: auto;
+ padding: 16px;
+
+ .esf-base-info-form, .wea-title, .wea-content {
+ padding: 0;
+ }
+
+ .esf-form-content {
+ background: #fff;
+ border: 1px solid #e5e5e5;
+ border-top: none;
+ border-bottom: none;
+
+ .esf-form-item {
+ border-bottom: 1px solid #e5e5e5;
+ }
+
+ .esf-form-last-item {
+ border-right: none !important;
+ }
+
+ .esf-form-odd-item {
+ border-right: 1px solid #e5e5e5;
+ }
+
+ .label {
+ color: #666;
+ }
+
+ .label, .value {
+ display: inline-block;
+ line-height: 24px;
+ padding: 8px 16px;
+ }
+ }
+
+ .wea-new-table {
+ background: #FFF;
+ }
+
+ .wea-search-group {
+ padding: 0;
+ }
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less
index 3923efea..b64a4dad 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less
@@ -5,6 +5,10 @@
height: 100%;
background: #f6f6f6;
+ .wea-new-top-req {
+ z-index: 0 !important;
+ }
+
.wea-new-top-req-wapper .wea-new-top-req-title > div:last-child {
right: 16px;
}