diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 745b3706..9f8b28b1 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -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); diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js index 44d0a208..86b4be54 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js @@ -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 && { 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 && { 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 ( { this.props.onCancel(); }} @@ -161,7 +168,7 @@ export default class SelectFieldModal extends React.Component {
{ !_.isEmpty(fieldData.formulaItems) && -
+
{ this.handleTitleCheckboxChange(value, "formula"); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 84b963f0..e266ce39 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -47,8 +47,8 @@ } } -//退差 -.regressionWrapper { +//退差;补差 +.regressionWrapper, .differenceWrapper { height: calc(100vh - 47px); overflow: auto; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js new file mode 100644 index 00000000..0541af88 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js @@ -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 ( +
+ this.regTopRef = dom} + billMonth={billMonth} + onChange={this.handleChangeOpt} + selectKey={selectKey} + /> + this.diffListRef = dom} + onChangeRowkey={(selectKey) => this.setState({ selectKey })} + onEdit={this.handleEdit} + /> + {/*编辑弹框*/} + + {/*导入补差*/} + { + importDiffModal.visible && + this.setState({ fieldData })} + onCancel={() => { + this.setState({ importDiffModal: { ...importDiffModal, visible: false }, fieldData: {} }, () => { + const name = this.regTopRef.state.name; + this.diffListRef.recessionList(name); + }); + }} + isStandingBook + standingBookType="difference" + /> + } +
+ ); + } +} + +export default MakeupDifference; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index aab96473..e3859fa6 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -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 ( -
+ columns = [ + ...columns, + { + title: "操作", + dataIndex: "operate", + fixed: "right", + width: "120px", + render: (text, record) => { + return ( + - ); - } + } +
+ ); } - ]; - } + } + ]; return (
{ diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js index 822cc0c7..c311d035 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js @@ -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: { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js index 2bb8d60f..787cd272 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js @@ -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; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js index 96107ed0..78a837b9 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js @@ -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 = [ onChange("add")}> + + : + ; dom = [ dom1, , - , - ...extra + , domBtn, ...extra ]; } return dom; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js index 2b91f51b..33a79fb9 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js @@ -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 (
this.regTopRef = dom} billMonth={billMonth} onChange={this.handleChangeOpt} selectKey={selectKey} /> this.regListRef = dom} visible={returnPersonModal.visible} onChangeRowkey={(selectKey) => this.setState({ selectKey })} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js index 75b41a1b..a5ae1a93 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js @@ -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 { } { - selectedKey === "5" && + selectedKey === "5" && + } + { + selectedKey === "6" && }
); diff --git a/pc4mobx/hrmSalary/stores/StandingBook.js b/pc4mobx/hrmSalary/stores/StandingBook.js index 083914f8..d74c1c5c 100644 --- a/pc4mobx/hrmSalary/stores/StandingBook.js +++ b/pc4mobx/hrmSalary/stores/StandingBook.js @@ -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 => {