From 9101769934d724add692bb2dba380363dab8cdaa 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, 3 Jan 2023 10:08:52 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E7=BC=B4=E6=96=B0=E5=A2=9E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/standingBook.js | 8 +
.../standingBookDetail/components/index.less | 8 +-
.../standingBookDetail/components/normal.js | 96 +++---
.../components/supplementarySlide.js | 286 ++++++++++++++++++
4 files changed, 348 insertions(+), 50 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js
diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js
index dd2d4225..28235f77 100644
--- a/pc4mobx/hrmSalary/apis/standingBook.js
+++ b/pc4mobx/hrmSalary/apis/standingBook.js
@@ -286,6 +286,14 @@ export const delBalance = (params) => {
export const editAccount = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/editAccount", params);
};
+//获取指定月份的福利基数
+export const getSupplementPaymentForm = (params) => {
+ return postFetch("/api/bs/hrmsalary/siaccount/detail/getSupplementPaymentForm", params);
+};
+//获取待编辑的补缴费用相关福利项
+export const getPaymentGroup = (params) => {
+ return postFetch("/api/bs/hrmsalary/siaccount/detail/getPaymentGroup", params);
+};
//获取核算项个人和公司社保福利缴纳详情
export const getPaymentById = ({ id }) => {
return fetch(`/api/bs/hrmsalary/siaccount/getPaymentById?id=${id}`, {
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
index 14a06006..492bdaf8 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
@@ -24,7 +24,7 @@
padding: 8px 20px;
justify-content: flex-end;
- i, button {
+ i.icon-coms-Batch-delete, i.icon-coms-Add-to, button {
cursor: pointer;
margin-right: 10px;
}
@@ -107,7 +107,7 @@
}
//调差抽屉
-.adjustmentWrapper, .adjustDefSlideWrapper {
+.adjustmentWrapper, .adjustDefSlideWrapper, .supplementarySlideWrapper {
.wea-slide-modal-title {
height: initial;
line-height: initial;
@@ -131,7 +131,7 @@
}
@media (min-width: 1260px) {
- .adjustmentWrapper, .adjustDefSlideWrapper {
+ .adjustmentWrapper, .adjustDefSlideWrapper, .supplementarySlideWrapper {
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
max-width: 100% !important;
}
@@ -139,7 +139,7 @@
}
@media screen and (min-width: 1060px) and (max-width: 1260px) {
- .adjustmentWrapper, .adjustDefSlideWrapper {
+ .adjustmentWrapper, .adjustDefSlideWrapper, .supplementarySlideWrapper {
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
max-width: calc(100% - 96px) !important;
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
index c85b5dab..567fcfe8 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
@@ -8,16 +8,17 @@ import React, { Component } from "react";
import { Button, Icon, message, Modal, Spin, Tooltip } from "antd";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
-import { WeaDialog, WeaInputSearch, WeaTable } from "ecCom";
-import { calcPageNo, getSearchs } from "../../../../util";
+import { WeaInputSearch, WeaTable } from "ecCom";
+import { calcPageNo } from "../../../../util";
import { getQueryString } from "../../../../util/url";
import ProgressModal from "../../../../components/progressModal";
import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
import AdjustmentSlide from "./adjustmentSlide";
import { getCalculateProgress } from "../../../../apis/calculate";
+import RegEditDetial from "./regEditDetial";
+import SupplementarySlide from "./supplementarySlide";
import _ from "lodash";
import "./index.less";
-import RegEditDetial from "./regEditDetial";
@inject("standingBookStore")
@observer
@@ -345,20 +346,10 @@ export default class NormalIndex extends Component {
}
};
handleAdd = () => {
- const {
- siaccountCommonForm,
- querySupplementaryForm
- } = this.props.standingBookStore;
- const { billMonth, selectedKey } = this.props;
- if (selectedKey === "1") {
- siaccountCommonForm();
- } else {
- querySupplementaryForm();
- }
this.setState({
addProps: {
...this.state.addProps,
- title: "添加缴纳人员",
+ title: "添加补缴人员",
visible: true
}
});
@@ -440,7 +431,11 @@ export default class NormalIndex extends Component {
this.setState({
returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
}, () => {
- refreshList && this.getNormalList();
+ const { location } = this.props;
+ const { current } = this.state;
+ const billMonth = location.query.billMonth;
+ const paymentOrganization = location.query.paymentOrganization;
+ refreshList && this.getSupplementaryList({ billMonth, current, paymentOrganization });
});
};
@@ -567,37 +562,46 @@ export default class NormalIndex extends Component {
: }
-
- {addProps.visible &&
-
- this.setState({
- addProps: {
- ...addProps,
- title: "",
- visible: false
- }
- })}
- buttons={[
- ,
-
- ]}>
- {getSearchs(form, toJS(condition), 1)}
- }
- {/* {selectedKey === "3" && (
-
-
-
- )}
-
-
- */}
+ {
+ this.setState({
+ addProps: {
+ ...addProps,
+ visible: false
+ }
+ }, () => {
+ isRefresh && this.getSupplementaryList({
+ billMonth,
+ current: this.state.current,
+ paymentOrganization
+ });
+ });
+ }}
+ />
+ {/*{addProps.visible &&*/}
+ {/* */}
+ {/* this.setState({*/}
+ {/* addProps: {*/}
+ {/* ...addProps,*/}
+ {/* title: "",*/}
+ {/* visible: false*/}
+ {/* }*/}
+ {/* })}*/}
+ {/* buttons={[*/}
+ {/* ,*/}
+ {/* */}
+ {/* ]}>*/}
+ {/* {getSearchs(form, toJS(condition), 1)}*/}
+ {/* }*/}
{
selectedKey === "1" && this.props.type !== "detail" &&
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js
new file mode 100644
index 00000000..25c34933
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js
@@ -0,0 +1,286 @@
+/*
+ * Author: 黎永顺
+ * name: 添加补缴
+ * Description:
+ * Date: 2022/12/30
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { message, Modal } from "antd";
+import { WeaFormItem, WeaSearchGroup, WeaSelect, WeaSlideModal } from "ecCom";
+import SlideModalTitle from "../../../../components/slideModalTitle";
+import { Picker, SelectWithAll } from "./regAddEmployee";
+import { Browser } from "../../../dataAcquisition/addItems";
+import { getPaymentGroup, getSupplementPaymentForm, siaccountSupplementarySave } from "../../../../apis/standingBook";
+import "./index.less";
+
+@inject("taxAgentStore")
+@observer
+class SupplementarySlide extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false,
+ baseInfo: {
+ includes: "",
+ includeNames: "",
+ supplementType: "1",
+ projectsAll: "",
+ projects: "",
+ billMonthList: "",
+ historyMonth: ""
+ }
+ };
+ }
+
+ handleSaveSupplementSalary = () => {
+ const { billMonth, paymentOrganization, onCancel } = this.props;
+ const { baseInfo } = this.state;
+ const { supplementType, projects, projectsAll, billMonthList, includes } = baseInfo;
+ if (!projects || !billMonthList || !includes) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ const payload = {
+ supplementType,
+ projects: projectsAll.split(",").concat(projects.split(",")),
+ billMonth,
+ paymentOrganization,
+ billMonthList: billMonthList.split(","),
+ includes: includes.split(",")
+ };
+ this.setState({ loading: true });
+ siaccountSupplementarySave(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ onCancel(true);
+ this.handleResetForm();
+ } else {
+ message.error(errormsg || "接口调用失败!");
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+ handleResetForm = () => {
+ this.setState({
+ baseInfo: {
+ includes: "",
+ includeNames: "",
+ supplementType: "1",
+ projectsAll: "",
+ projects: "",
+ billMonthList: ""
+ }
+ });
+ };
+ handleChangeItem = () => {
+ const { paymentOrganization } = this.props;
+ const { baseInfo } = this.state;
+ const { supplementType, includes, projects, projectsAll, historyMonth } = baseInfo;
+ if (supplementType === "2") {
+ if (includes && (projects || projectsAll) && historyMonth) {
+ const payload = {
+ billMonth: historyMonth,
+ paymentOrganization: Number(paymentOrganization),
+ employeeId: Number(includes),
+ projects: projectsAll ? projectsAll.split(",").concat(projects.split(",")) : projects.split(",")
+ };
+ getSupplementPaymentForm(payload).then(({ status, data, errormsg }) => {
+ if (status) {
+
+ } else {
+ message.error(errormsg || "");
+ }
+ });
+ }
+ } else if (supplementType === "3") {
+ if (includes && (projects || projectsAll)) {
+ const payload = {
+ paymentOrganization: Number(paymentOrganization),
+ employeeId: Number(includes),
+ projects: projectsAll ? projectsAll.split(",").concat(projects.split(",")) : projects.split(",")
+ };
+ getPaymentGroup(payload).then((status, data) => {
+ console.log(data);
+ });
+ }
+ }
+ };
+
+ render() {
+ const { title, visible, onCancel, taxAgentStore: { showOperateBtn } } = this.props;
+ const { baseInfo, loading } = this.state;
+ const baseItems = [
+ {
+ com: Browser({
+ label: "对象",
+ viewAttr: 3,
+ value: baseInfo.includes,
+ valueSpan: baseInfo.includeNames,
+ onChange: ({ ids, names }) => {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ includes: ids,
+ includeNames: names
+ }
+ }, () => this.handleChangeItem());
+ }
+ })
+ },
+ {
+ com: Picker({
+ label: "补缴月份",
+ value: baseInfo.billMonthList,
+ onChange: (billMonthList) => {
+ this.setState({ baseInfo: { ...baseInfo, billMonthList } });
+ }
+ })
+ },
+ {
+ com: SelectWithAll({
+ label: "补缴项目",
+ options: [
+ { key: "1", showname: "社保" },
+ { key: "2", showname: "公积金" },
+ { key: "3", showname: "企业年金及其他福利" },
+ { key: "4", showname: "养老保险" },
+ { key: "5", showname: "医疗保险" }
+ ],
+ detailtype: 2,
+ valueAll: baseInfo.projectsAll,
+ value: baseInfo.projects,
+ onChangeAll: ({ selected }) => {
+ if (selected) {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ projectsAll: selected,
+ projects: "1,2,3,4,5"
+ }
+ }, () => this.handleChangeItem());
+ } else {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ projectsAll: selected,
+ projects: ""
+ }
+ }, () => this.handleChangeItem());
+ }
+ },
+ onChange: ({ selected }) => {
+ const bool1 = selected.split(",").includes("1");
+ const bool2 = selected.split(",").includes("2");
+ const bool3 = selected.split(",").includes("3");
+ const bool4 = selected.split(",").includes("4");
+ const bool5 = selected.split(",").includes("5");
+ if (bool1 && bool2 && bool3 && bool4 && bool5) {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ projectsAll: "0",
+ projects: selected
+ }
+ }, () => this.handleChangeItem());
+ } else {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ projectsAll: "",
+ projects: selected
+ }
+ }, () => this.handleChangeItem());
+ }
+ }
+ })
+ },
+ {
+ com: SelectDetailType({
+ label: "补缴金额核算方式",
+ options: [
+ { key: "1", showname: "按补缴人员当前档案基数及方案核算" },
+ { key: "2", showname: "按补缴人员的历史月份核算基数和当前档案方案核算" },
+ { key: "3", showname: "手动输入补缴金额" }
+ ],
+ detailtype: 3,
+ value: baseInfo.supplementType,
+ onChange: ({ selected: supplementType }) => {
+ this.setState({
+ baseInfo: {
+ ...baseInfo,
+ supplementType,
+ historyMonth: ""
+ }
+ }, () => this.handleChangeItem());
+ }
+ })
+ }
+ ];
+ const baseExtraItems = [
+ {
+ com: Picker({
+ label: "补缴基数参考月份",
+ value: baseInfo.historyMonth,
+ onChange: (historyMonth) => {
+ this.setState({ baseInfo: { ...baseInfo, historyMonth } }, () => this.handleChangeItem());
+ }
+ })
+ }
+ ];
+ return (
+
+ }
+ content={
+
+
+
+ }
+ onClose={() => {
+ onCancel();
+ this.handleResetForm();
+ }}
+ />
+ );
+ }
+}
+
+export default SupplementarySlide;
+
+export const SelectDetailType = payload => {
+ const { label, onChange, value, options = [], viewAttr = 3, detailtype = 1 } = payload;
+ return (
+
+ onChange({ type: label, selected, showName })}
+ style={{ width: "60%" }}
+ />
+
+ );
+};