补缴新增
This commit is contained in:
parent
ded592b1eb
commit
9101769934
|
|
@ -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}`, {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
</Tooltip>
|
||||
</span>
|
||||
: <span/>}
|
||||
|
||||
{addProps.visible &&
|
||||
<WeaDialog
|
||||
{...addProps}
|
||||
onCancel={() =>
|
||||
this.setState({
|
||||
addProps: {
|
||||
...addProps,
|
||||
title: "",
|
||||
visible: false
|
||||
}
|
||||
})}
|
||||
buttons={[
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={this.handleSave}
|
||||
loading={saveLoading}>
|
||||
保存
|
||||
</Button>,
|
||||
<Button onClick={() => form.resetForm()}>重置</Button>
|
||||
]}>
|
||||
{getSearchs(form, toJS(condition), 1)}
|
||||
</WeaDialog>}
|
||||
{/* {selectedKey === "3" && (
|
||||
<Tooltip title="导入">
|
||||
<i className="icon-coms02-Import" />
|
||||
</Tooltip>
|
||||
)}
|
||||
<Tooltip title="导出全部">
|
||||
<i className="icon-coms02-coms2-export" />
|
||||
</Tooltip> */}
|
||||
<SupplementarySlide
|
||||
{...addProps}
|
||||
billMonth={billMonth} paymentOrganization={paymentOrganization}
|
||||
onCancel={(isRefresh) => {
|
||||
this.setState({
|
||||
addProps: {
|
||||
...addProps,
|
||||
visible: false
|
||||
}
|
||||
}, () => {
|
||||
isRefresh && this.getSupplementaryList({
|
||||
billMonth,
|
||||
current: this.state.current,
|
||||
paymentOrganization
|
||||
});
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/*{addProps.visible &&*/}
|
||||
{/* <WeaDialog*/}
|
||||
{/* {...addProps}*/}
|
||||
{/* onCancel={() =>*/}
|
||||
{/* this.setState({*/}
|
||||
{/* addProps: {*/}
|
||||
{/* ...addProps,*/}
|
||||
{/* title: "",*/}
|
||||
{/* visible: false*/}
|
||||
{/* }*/}
|
||||
{/* })}*/}
|
||||
{/* buttons={[*/}
|
||||
{/* <Button*/}
|
||||
{/* type="primary"*/}
|
||||
{/* onClick={this.handleSave}*/}
|
||||
{/* loading={saveLoading}>*/}
|
||||
{/* 保存*/}
|
||||
{/* </Button>,*/}
|
||||
{/* <Button onClick={() => form.resetForm()}>重置</Button>*/}
|
||||
{/* ]}>*/}
|
||||
{/* {getSearchs(form, toJS(condition), 1)}*/}
|
||||
{/* </WeaDialog>}*/}
|
||||
{
|
||||
selectedKey === "1" && this.props.type !== "detail" &&
|
||||
<React.Fragment>
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<WeaSlideModal
|
||||
className="supplementarySlideWrapper"
|
||||
visible={visible}
|
||||
top={0}
|
||||
width={45}
|
||||
height={100}
|
||||
direction="right"
|
||||
measure="%"
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={title}
|
||||
tabs={[]}
|
||||
loading={loading}
|
||||
showOperateBtn={showOperateBtn}
|
||||
editable={true}
|
||||
onSave={this.handleSaveSupplementSalary}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<div>
|
||||
<WeaSearchGroup
|
||||
title="基础信息"
|
||||
items={baseInfo.supplementType === "2" ? [...baseItems, ...baseExtraItems] : baseItems}
|
||||
showGroup col={1}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
onClose={() => {
|
||||
onCancel();
|
||||
this.handleResetForm();
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SupplementarySlide;
|
||||
|
||||
export const SelectDetailType = payload => {
|
||||
const { label, onChange, value, options = [], viewAttr = 3, detailtype = 1 } = payload;
|
||||
return (
|
||||
<WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaSelect
|
||||
options={options}
|
||||
viewAttr={viewAttr}
|
||||
detailtype={detailtype}
|
||||
value={value}
|
||||
onChange={(selected, showName) => onChange({ type: label, selected, showName })}
|
||||
style={{ width: "60%" }}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
);
|
||||
};
|
||||
Loading…
Reference in New Issue