From 506490116f42954a6fca33b10a9a5da277d119eb 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, 27 Dec 2022 13:46:00 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E5=B7=AE=E4=BF=9D=E5=AD=98=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/standingBook.js | 4 +
.../components/adjustTable.js | 2 +-
.../components/adjustmentDefaultSlide.js | 126 ++++++++++++++++++
.../components/adjustmentSlide.js | 81 +++++++----
.../standingBookDetail/components/index.less | 6 +-
5 files changed, 190 insertions(+), 29 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js
diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js
index 9f8b28b1..dd2d4225 100644
--- a/pc4mobx/hrmSalary/apis/standingBook.js
+++ b/pc4mobx/hrmSalary/apis/standingBook.js
@@ -323,6 +323,10 @@ export const getCompensationComTotal = (params) => {
export const compensationSave = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/compensationSave", params);
};
+//社保调差默认配置保存
+export const compensationConfigSave = (params) => {
+ return postFetch("/api/bs/hrmsalary/siaccount/compensationConfigSave", params);
+};
//撤回调差数据
export const compensationBack = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/compensationBack", params);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js
index 07313d27..e88f17bf 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js
@@ -69,7 +69,7 @@ class AdjustTable extends Component {
adjustTo: it.adjustTo.toString(),
adjustToOptions: _.map(it.categoryTypeOptions, child => ({ key: child.id, showname: child.content })),
categoryTypeOptions: _.map(it.categoryTypeOptions, child => ({ key: child.id, showname: child.content })),
- targetOptions: _.map(it.targetOptions, child => ({ key: child.id, showname: child.name }))
+ targetOptions: _.map([it.targetOptions], child => ({ key: child.id, showname: child.name }))
};
}),
columns: _.map(columns, item => {
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js
new file mode 100644
index 00000000..6229ca63
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js
@@ -0,0 +1,126 @@
+/*
+ * Author: 黎永顺
+ * name: 默认调差弹框
+ * Description:
+ * Date: 2022/12/27
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { Alert, message } from "antd";
+import { WeaSlideModal, WeaTable } from "ecCom";
+import SlideModalTitle from "../../../../components/slideModalTitle";
+import { compensationConfigSave } from "../../../../apis/standingBook";
+import "./index.less";
+
+@inject("taxAgentStore")
+@observer
+class AdjustmentDefaultSlide extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false
+ };
+ }
+
+ handleSaveDefAdjustment = () => {
+ const { dataSource } = this.props;
+ const payload = _.map(dataSource, it => {
+ return {
+ paymentOrganization: it.paymentOrganization,
+ categoryType: it.categoryType,
+ welfareType: it.welfareType,
+ target: it.target,
+ adjustTo: it.adjustTo,
+ employeeId: it.employeeId
+ };
+ });
+ this.setState({ loading: true });
+ compensationConfigSave(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success("保存成功");
+ } else {
+ message.error(errormsg || "保存失败");
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+
+ render() {
+ const { visible, onCancel, taxAgentStore: { showOperateBtn }, dataSource } = this.props;
+ const { loading } = this.state;
+ const columns = [
+ {
+ dataIndex: "target", title: "调差对象",
+ render: (text, record) => {
+ return (
+ {_.map(record.targetOptions, it => it.showname).join(",")}
+ );
+ }
+ },
+ {
+ dataIndex: "welfareType", title: "统计调差福利",
+ render: (text, record) => {
+ return (
+ 社保
+ );
+ }
+ },
+ {
+ dataIndex: "categoryType", title: "统计调差福利类型(单位)",
+ render: (text, record) => {
+ return (
+ {_.map(record.categoryTypeOptions, it => it.showname).join(",")}
+ );
+ }
+ },
+ {
+ dataIndex: "adjustTo", title: "调差到(单位)",
+ render: (text, record) => {
+ return (
+ {_.find(record.adjustToOptions, it => it.key === record.adjustTo).showname}
+ );
+ }
+ }
+ ];
+ return (
+