社保福利台账核算详情页面添加补差的功能

This commit is contained in:
黎永顺 2022-12-16 15:38:39 +08:00
parent 9b6c8ed544
commit 26457c01e6
12 changed files with 283 additions and 94 deletions

View File

@ -202,6 +202,14 @@ export const getWelfareList = () => {
{}
);
};
// 补差表单字段对应的接口
export const getBalanceWelfareList = () => {
return WeaTools.callApi(
"/api/bs/hrmsalary/siaccount/getBalanceWelfareList",
"get",
{}
);
};
// 社保福利台账-导入预览
export const welfarePreview = (params) => {
@ -226,6 +234,17 @@ export const importInsuranceAcctDetail = (params) => {
body: JSON.stringify(params)
}).then((res) => res.json());
};
// 社保福利台账-补差数据导入
export const importBalanceInsuranceDetail = (params) => {
return fetch("/api/bs/hrmsalary/siaccount/welfare/importBalanceInsuranceDetail", {
method: "post",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then((res) => res.json());
};
// 社保福利台账-线下对比数据导入
export const importExcelInsuranceDetail = (params) => {
@ -251,10 +270,18 @@ export const saveRecession = (params) => {
export const recessionList = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params);
};
//查询补差列表
export const balanceList = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params);
};
//删除退差数据
export const delRecession = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params);
};
//删除补差数据
export const delBalance = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/delBalance", params);
};
//编辑社保福利缴纳数据
export const editAccount = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/editAccount", params);

View File

@ -37,7 +37,7 @@ export default class AcctResultImportModal extends React.Component {
// 获取模板
handleAccResultTemplateLink() {
const { isStandingBook, standingBookTabKey } = this.props;
const { isStandingBook, standingBookTabKey, standingBookType } = this.props;
let url = "";
if (_.isEmpty(this.state.modalParam.salaryItemIds)) {
message.warning("请选择表单字段");
@ -52,6 +52,8 @@ export default class AcctResultImportModal extends React.Component {
url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/importtemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
} else if (standingBookTabKey === "3") {
url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/supplyimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
} else if (standingBookType === "difference") {
url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/balanceimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
}
}
window.open(url, "_self");
@ -162,8 +164,10 @@ export default class AcctResultImportModal extends React.Component {
}
render() {
const billMonth = getQueryString("billMonth");
//isStandingBook: 是否是社保福利台账核算的导入标识
const { calculateStore, standingBookStore, isStandingBook, visiable } = this.props;
//standingBookType: 是否是补差的导入标识
const { calculateStore, standingBookStore, isStandingBook, visiable, standingBookType } = this.props;
const {
fetchPreviewAcctResult,
previewAcctResultColumns,
@ -176,7 +180,8 @@ export default class AcctResultImportModal extends React.Component {
previewStandingBookAcctResultColumns,
previewStandingBookAcctResultDataSource,
importStandingBookAcctResult,
importInsuranceAcctDetail
importInsuranceAcctDetail,
importBalanceInsuranceDetail
} = standingBookStore;
const { step, selectFieldVisible, modalParam } = this.state;
return (
@ -184,6 +189,7 @@ export default class AcctResultImportModal extends React.Component {
{
visiable && <ImportModal
isStandingBook={isStandingBook}
standingBookType={standingBookType}
init={() => {
this.handleImportModalInit();
}}
@ -200,7 +206,11 @@ export default class AcctResultImportModal extends React.Component {
!isStandingBook ? fetchPreviewAcctResult(params) : welfarePreview(params);
}}
importFile={(params) => {
!isStandingBook ? fetchImportAcctResult(params) : importInsuranceAcctDetail(params);
!isStandingBook ?
fetchImportAcctResult(params) :
standingBookType === "difference" ?
importBalanceInsuranceDetail({...params, billMonth}) :
importInsuranceAcctDetail(params);
}}
templateLink={() => {
this.handleAccResultTemplateLink();
@ -215,6 +225,7 @@ export default class AcctResultImportModal extends React.Component {
{
selectFieldVisible && <SelectFieldModal
isStandingBook={isStandingBook}
standingBookType={standingBookType}
id={this.props.id}
visible={selectFieldVisible}
fieldData={this.props.fieldData}

View File

@ -3,6 +3,8 @@ import { Button, Col, Row } from "antd";
import { inject, observer } from "mobx-react";
import { WeaCheckbox, WeaDialog } from "ecCom";
const APIFox = {};
@inject("calculateStore", "standingBookStore")
@observer
export default class SelectFieldModal extends React.Component {
@ -14,7 +16,11 @@ export default class SelectFieldModal extends React.Component {
}
componentWillMount() {
const { calculateStore: { getImportField }, standingBookStore: { getWelfareList }, isStandingBook } = this.props;
const {
calculateStore: { getImportField },
standingBookStore: { getWelfareList, getBalanceWelfareList },
isStandingBook, standingBookType
} = this.props;
if (!isStandingBook) {
getImportField(this.props.id).then(data => {
let fieldData = {};
@ -43,7 +49,8 @@ export default class SelectFieldModal extends React.Component {
this.fieldData = fieldData;
});
} else {
getWelfareList().then(result => {
const APIFox = standingBookType === "difference" ? getBalanceWelfareList : getWelfareList;
APIFox().then(result => {
let fieldData = {};
let formulaItems = [];
formulaItems = _.map(result, it => ({ ...it, salaryItemId: it.salaryItemName }));
@ -146,9 +153,9 @@ export default class SelectFieldModal extends React.Component {
const { isStandingBook } = this.props;
return (
<WeaDialog
title='添加表头字段'
title="添加表头字段"
visible={this.props.visible}
style={{width:800}}
style={{ width: 800 }}
onCancel={() => {
this.props.onCancel();
}}
@ -161,7 +168,7 @@ export default class SelectFieldModal extends React.Component {
<div style={{ minHeight: "20vh", maxHeight: "50vh", overflow: "hidden auto", padding: "16px 20px" }}>
{
!_.isEmpty(fieldData.formulaItems) &&
<div >
<div>
<div style={{ height: "40px", lineHeight: "40px" }}>
<WeaCheckbox content={!isStandingBook ? "公式项" : "全选"} onChange={(value) => {
this.handleTitleCheckboxChange(value, "formula");

View File

@ -47,8 +47,8 @@
}
}
//退差
.regressionWrapper {
//退差;补差
.regressionWrapper, .differenceWrapper {
height: calc(100vh - 47px);
overflow: auto;

View File

@ -0,0 +1,136 @@
/*
* Author: 黎永顺
* name: 补差
* Description:
* Date: 2022/12/16
*/
import React, { Component } from "react";
import RegTop from "./regTop";
import { message, Modal } from "antd";
import { getQueryString } from "../../../../util/url";
import RegList from "./regList";
import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
import * as API from "../../../../apis/standingBook";
import "./index.less";
import RegEditDetial from "./regEditDetial";
class MakeupDifference extends Component {
constructor(props) {
super(props);
this.state = {
selectKey: [],
fieldData: {},
returnEditPersonSlide: {
title: "",
editId: "",
visible: false
},
importDiffModal: {
visible: false
},
loading: { save: false }
};
this.diffListRef = null;
this.regTopRef = null;
}
delBalance = () => {
const { selectKey: ids } = this.state;
const billMonth = getQueryString("billMonth");
const paymentOrganization = getQueryString("paymentOrganization");
const payload = { ids, billMonth, paymentOrganization };
API.delBalance(payload).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.diffListRef.recessionList();
this.diffListRef.handleResetSelectRowKeys([]);
this.setState({ selectKey: [] });
} else {
message.error(errormsg || "删除失败");
}
});
};
handleChangeOpt = (key) => {
const { importDiffModal } = this.state;
const name = this.regTopRef.state.name;
const billMonth = getQueryString("billMonth");
const paymentOrganization = getQueryString("paymentOrganization");
switch (key) {
case "delete":
Modal.confirm({
title: "信息确认",
content: "确定删除数据吗?",
onOk: () => this.delBalance()
});
break;
case "import":
this.setState({ importDiffModal: { ...importDiffModal, visible: true } });
break;
case "export":
const url = `${window.location.origin}/api/bs/hrmsalary/welfare/balance/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
window.open(url, "_self");
break;
case "search":
this.diffListRef.recessionList(name);
break;
default:
break;
}
};
handleEdit = (record) => {
const { userName, id: editId } = record;
const { returnEditPersonSlide } = this.state;
this.setState({
returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId }
});
};
handleCloseModal = () => {
const { returnEditPersonSlide } = this.state;
this.setState({
returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
});
};
render() {
const billMonth = getQueryString("billMonth");
const { selectKey, importDiffModal, fieldData, returnEditPersonSlide } = this.state;
return (
<div className="differenceWrapper">
<RegTop
type="difference"
ref={dom => this.regTopRef = dom}
billMonth={billMonth}
onChange={this.handleChangeOpt}
selectKey={selectKey}
/>
<RegList
type="difference"
ref={dom => this.diffListRef = dom}
onChangeRowkey={(selectKey) => this.setState({ selectKey })}
onEdit={this.handleEdit}
/>
{/*编辑弹框*/}
<RegEditDetial {...returnEditPersonSlide} onCancel={this.handleCloseModal}/>
{/*导入补差*/}
{
importDiffModal.visible &&
<AcctResultImportModal
visiable={importDiffModal.visible}
fieldData={fieldData}
onAdd={fieldData => this.setState({ fieldData })}
onCancel={() => {
this.setState({ importDiffModal: { ...importDiffModal, visible: false }, fieldData: {} }, () => {
const name = this.regTopRef.state.name;
this.diffListRef.recessionList(name);
});
}}
isStandingBook
standingBookType="difference"
/>
}
</div>
);
}
}
export default MakeupDifference;

View File

@ -496,28 +496,29 @@ export default class NormalIndex extends Component {
}
};
});
if (selectedKey === "3") {
columns = [
...columns,
{
title: "操作",
dataIndex: "operate",
fixed: "right",
width: "120px",
render: (text, record) => {
return (
<div className="optWrapper">
columns = [
...columns,
{
title: "操作",
dataIndex: "operate",
fixed: "right",
width: "120px",
render: (text, record) => {
return (
<div className="optWrapper">
{
selectedKey === '3' &&
<a
href="javascript:void(0);"
className="mr10"
onClick={() => this.handleEditNormalStandingBook(record)}
>编辑</a>
</div>
);
}
}
</div>
);
}
];
}
}
];
return (
<div className="normalWapper">
{

View File

@ -30,33 +30,6 @@ class RegAddEmployee extends Component {
};
}
componentDidMount() {
this.getEmployeeListByTaxAgent();
}
getEmployeeListByTaxAgent = () => {
const { returnPersonInfo, selectPersonInfo } = this.state;
const payload = {
pageNum: 1,
pageSize: 10000,
name: null
};
API.getEmployeeListByTaxAgent(payload).then(({ status, data }) => {
if (status) {
const { list } = data;
this.setState({
returnPersonInfo: {
...returnPersonInfo,
employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username }))
},
selectPersonInfo: {
...selectPersonInfo,
employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username }))
}
});
}
});
};
handleReset = () => {
this.setState({
baseInfo: {

View File

@ -10,6 +10,11 @@ import { getQueryString } from "../../../../util/url";
import * as API from "../../../../apis/standingBook";
import "./index.less";
const APIFox = {
"regression": API.recessionList,
"difference": API.balanceList
};
class RegList extends Component {
constructor(props) {
super(props);
@ -42,6 +47,7 @@ class RegList extends Component {
this.setState({ selectedRowKeys });
};
recessionList = (userName = "") => {
const { type } = this.props;
const { loading, pageInfo } = this.state;
const billMonth = getQueryString("billMonth");
const paymentOrganization = getQueryString("paymentOrganization");
@ -54,7 +60,7 @@ class RegList extends Component {
...pageInfo
};
this.setState({ loading: { ...loading, query: true } });
API.recessionList(payload).then(({ status, data }) => {
APIFox[type](payload).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
const { pageInfo: list } = data;

View File

@ -13,7 +13,7 @@ class RegTop extends Component {
renderTopBtns = () => {
const { name } = this.state;
const { onChange, selectKey } = this.props;
const { onChange, selectKey, type: regtopType } = this.props;
const type = getQueryString("type");
let dom = [
<WeaHelpfulTip
@ -44,15 +44,18 @@ class RegTop extends Component {
];
if (!type) {
const [dom1, ...extra] = dom;
const domBtn = regtopType === "regression" ?
<Button type="primary" size="small" onClick={() => onChange("add")}>
<span className="icon-coms-Add-to-hot" title="添加"></span>
</Button> :
<Button type="primary" size="small" onClick={() => onChange("import")}>
<span className="icon-coms02-Import" title="导入"></span>
</Button>;
dom = [
dom1,
<Button type="primary" size="small" disabled={_.isEmpty(selectKey)} onClick={() => onChange("delete")}>
<span className="icon-coms-form-delete-hot" title="删除"></span>
</Button>,
<Button type="primary" size="small" onClick={() => onChange("add")}>
<span className="icon-coms-Add-to-hot" title="添加"></span>
</Button>,
...extra
</Button>, domBtn, ...extra
];
}
return dom;

View File

@ -40,7 +40,6 @@ class Regression extends Component {
API.delRecession(selectKey).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.regListRef.recessionList();
this.regListRef.handleResetSelectRowKeys([]);
this.setState({ selectKey: [] });
@ -124,12 +123,14 @@ class Regression extends Component {
return (
<div className="regressionWrapper">
<RegTop
type="regression"
ref={dom => this.regTopRef = dom}
billMonth={billMonth}
onChange={this.handleChangeOpt}
selectKey={selectKey}
/>
<RegList
type="regression"
ref={dom => this.regListRef = dom}
visible={returnPersonModal.visible}
onChangeRowkey={(selectKey) => this.setState({ selectKey })}

View File

@ -11,6 +11,7 @@ import NormalIndex from "./components/normal";
import OverViewIndex from "./components/overView";
import AbnormalListIndex from "./components/abnormalList";
import Regression from "./components/regression";
import MakeupDifference from "./components/makeupDifference";
@inject("standingBookStore")
@observer
@ -39,7 +40,7 @@ class StandingBookDetail extends Component {
getTabList({ billMonth, paymentOrganization: this.paymentOrganization }).then(({ data }) => {
const { tabList, remarks, billMonth } = data;
let newTabList = tabList.filter(item => item.id != "2");
newTabList[newTabList.length - 2] = newTabList.splice(newTabList.length - 1, 1, newTabList[newTabList.length - 2])[0]
newTabList.push(newTabList.splice(_.findIndex(newTabList, it => it.id === "4"), 1)[0]);
this.setState({
selectedKey: newTabList[0].id,
tabList: _.map(newTabList, it => ({ title: it.content, viewcondition: it.id })),
@ -74,7 +75,10 @@ class StandingBookDetail extends Component {
<OverViewIndex billMonth={billMonth} type={this.type} paymentOrganization={this.paymentOrganization}/>
}
{
selectedKey === "5" && <Regression />
selectedKey === "5" && <Regression/>
}
{
selectedKey === "6" && <MakeupDifference/>
}
</div>
);

View File

@ -1,11 +1,8 @@
import { observable, action, toJS } from "mobx";
import { action, observable } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import { removePropertyCondition } from "../util/response";
import _ from "lodash";
import * as API from "../apis/standingBook";
import { importExcelInsuranceDetail } from "../apis/standingBook";
const { TableStore } = WeaTableNew;
@ -44,7 +41,7 @@ export class StandingBookStore {
if (status) {
// 接口请求成功/失败处理
const {
pageInfo: { list, columns, total, pageNum },
pageInfo: { list, columns, total, pageNum }
} = data;
resolve({ list, columns, total, pageNum });
} else {
@ -66,7 +63,7 @@ export class StandingBookStore {
if (status) {
// 接口请求成功/失败处理
const {
pageInfo: { list, columns, total },
pageInfo: { list, columns, total }
} = data;
resolve({ list, columns, total });
} else {
@ -88,7 +85,7 @@ export class StandingBookStore {
if (status) {
// 接口请求成功/失败处理
const {
pageInfo: { list, columns, total },
pageInfo: { list, columns, total }
} = data;
resolve({ list, columns, total });
} else {
@ -131,7 +128,7 @@ export class StandingBookStore {
// 接口请求成功/失败处理
const {
dataKey: { datas },
pageInfo: { list, total },
pageInfo: { list, total }
} = data;
this.tableStore.getDatas(datas);
resolve({ list, total });
@ -229,7 +226,7 @@ export class StandingBookStore {
// 接口请求成功/失败处理
const {
dataKey: { datas },
pageInfo: { list, total },
pageInfo: { list, total }
} = data;
this.tableStore.getDatas(datas);
resolve({ list, total });
@ -302,7 +299,7 @@ export class StandingBookStore {
action((res) => {
if (res.status) {
// 接口请求成功/失败处理
let condition = removePropertyCondition(res.data.condition)
let condition = removePropertyCondition(res.data.condition);
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
@ -318,7 +315,7 @@ export class StandingBookStore {
action((res) => {
if (res.status) {
// 接口请求成功/失败处理
let condition = removePropertyCondition(res.data.condition)
let condition = removePropertyCondition(res.data.condition);
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
@ -361,57 +358,70 @@ export class StandingBookStore {
commonAccount = (params) => {
return new Promise((resolve, reject) => {
API.commonAccount(params).then(res => {
if(res.status) {
if (res.status) {
resolve();
} else {
message.error(res.errormsg || "接口调用失败!")
message.error(res.errormsg || "接口调用失败!");
reject();
}
})
})
}
});
});
};
@action("社保福利台账重新核算")
socialSecurityBenefitsRecalculate = (params) => {
return new Promise((resolve, reject) => {
API.socialSecurityBenefitsRecalculate(params).then(res => {
if(res.status) {
if (res.status) {
resolve();
} else {
reject(res.errormsg || "接口调用失败!");
}
})
})
}
});
});
};
// 获取当前管理员下的所有个税扣缴义务人
@action
getAdminTaxAgentList = () => {
return new Promise((resolve, reject) => {
API.getAdminTaxAgentList().then(res => {
if(res.status) {
if (res.status) {
resolve(res.data);
} else {
message.error(res.errormsg || "接口调用失败!")
message.error(res.errormsg || "接口调用失败!");
reject();
}
})
})
}
});
});
};
@action("社保福利台账核算导入信息表头信息列表")
getWelfareList = () => {
return new Promise((resolve, reject) => {
API.getWelfareList().then(res => {
if(res.status) {
if (res.status) {
resolve(res.data);
} else {
message.error(res.errormsg || "接口调用失败!")
message.error(res.errormsg || "接口调用失败!");
reject();
}
})
})
}
});
});
};
@action("社保福利台账补差导入信息表头信息列表")
getBalanceWelfareList = () => {
return new Promise((resolve, reject) => {
API.getBalanceWelfareList().then(res => {
if (res.status) {
resolve(res.data);
} else {
message.error(res.errormsg || "接口调用失败!");
reject();
}
});
});
};
@action
setPreviewStandingBookAcctResultDataSource = previewAcctResultDataSource => {
@ -452,6 +462,16 @@ export class StandingBookStore {
});
};
@action("社保福利台账-补差数据导入")
importBalanceInsuranceDetail = (params) => {
API.importBalanceInsuranceDetail(params).then(res => {
if (res.status) {
this.importStandingBookAcctResult = res.data;
} else {
message.error(res.errormsg || "导入失败");
}
});
};
@action("社保福利台账-核算数据导入")
importInsuranceAcctDetail = (params) => {
API.importInsuranceAcctDetail(params).then(res => {