diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index e44dfc25..013bddee 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -520,6 +520,39 @@ export const siaccountDetailCommonListSum = (params) => { body: JSON.stringify(params) }).then(res => res.json()); }; +// 社保福利台账补缴合计接口 +export const siaccountDetailSupplementaryListSum = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list/sum", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +// 社保福利台账退差合计接口 +export const siaccountDetailRecessionListSum = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/detail/recession/list/sum", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +// 社保福利台账补差合计接口 +export const siaccountDetailBalanceListSum = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/detail/balance/list/sum", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 导入薪资核算添加表头字段缓存 export const cacheImportField = (params) => { return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", { diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js index bacbe74c..f288cc35 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js @@ -109,7 +109,10 @@ export default class SelectFieldModal extends React.Component { // 添加按钮点击回调 handleAddClick = async () => { - const { status } = await this.cacheImportField(); + //薪资核算详情页面的导入表单字段缓存功能 + if (window.location.hash.indexOf("calculateDetail") !== -1) { + const { status } = await this.cacheImportField(); + } this.props.onAdd(this.fieldData); this.props.onCancel(); }; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js index 8bc29bd1..579cb872 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js @@ -154,7 +154,7 @@ class DataTables extends Component { dataSource={dataSource} pagination={pagination} loading={loading.query} - xWidth={getColumns.length * 120} + xWidth={getColumns.length * 150} />; } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js index cb2efd8f..6f542381 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js @@ -103,6 +103,15 @@ export const dataCollectCondition = [ labelcol: 8, value: "", viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["privatePension"], + fieldcol: 14, + label: "个人养老金", + labelcol: 8, + value: "", + viewAttr: 2 } ], title: "数据采集", diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 1373bb3d..9ed9d668 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -77,6 +77,9 @@ .tableWrapper { flex: 1; overflow: hidden; + .ant-spin-nested-loading, .ant-spin-container { + height: 100%; + } } .tdEllipsis { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index b3b61565..9f67ea87 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -13,7 +13,11 @@ import { getQueryString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal"; import AdjustmentSlide from "./adjustmentSlide"; -import { getCalculateProgress, siaccountDetailCommonListSum } from "../../../../apis/calculate"; +import { + getCalculateProgress, + siaccountDetailCommonListSum, + siaccountDetailSupplementaryListSum +} from "../../../../apis/calculate"; import { sysConfCodeRule } from "../../../../apis/ruleconfig"; import RegEditDetial from "./regEditDetial"; import SupplementarySlide from "./supplementarySlide"; @@ -78,9 +82,11 @@ export default class NormalIndex extends Component { if (type === "init") { const { selectedKey } = this.props; const { status, data: sysData } = await this.sysConfCodeRule(); - const { data: { sumRow: siaccountSum } } = await this.siaccountDetailCommonListSum(); + const { data: { sumRow: siaccountSum } } = selectedKey === "1" ? + await this.siaccountDetailCommonListSum() : + await this.siaccountDetailSupplementaryListSum(); this.setState({ - showSum: selectedKey === "1" && status && sysData === "1", + showSum: status && sysData === "1", siaccountSum }, () => this.postMessageToChild()); } else if (type === "turn") { @@ -109,8 +115,16 @@ export default class NormalIndex extends Component { return sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }); }; siaccountDetailCommonListSum = () => { - const { billMonth, paymentOrganization } = this.props; - return siaccountDetailCommonListSum({ billMonth, paymentOrganization }); + const { searchValue: userName } = this.state; + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); + return siaccountDetailCommonListSum({ billMonth, paymentOrganization, userName }); + }; + siaccountDetailSupplementaryListSum = () => { + const { searchValue: userName } = this.state; + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); + return siaccountDetailSupplementaryListSum({ billMonth, paymentOrganization, userName }); }; componentWillUnmount() { @@ -247,7 +261,7 @@ export default class NormalIndex extends Component { const { getNormalList } = this.props.standingBookStore; getNormalList({ ...payload }).then(({ list, columns = [], total }) => { this.setState({ - showSum: this.props.selectedKey === "1" && status && sysData === "1", + showSum: status && sysData === "1", siaccountSum, tableData: { list, total, columns } }, () => this.postMessageToChild()); @@ -255,13 +269,13 @@ export default class NormalIndex extends Component { }; getSupplementaryList = async (payload = {}) => { const { status, data: sysData } = await this.sysConfCodeRule(); - const { data: { sumRow: siaccountSum } } = await this.siaccountDetailCommonListSum(); + const { data: { sumRow: siaccountSum } } = await this.siaccountDetailSupplementaryListSum(); const { getSupplementaryList } = this.props.standingBookStore; getSupplementaryList({ ...payload }).then(({ list, columns = [], total }) => { this.setState({ - showSum: this.props.selectedKey === "1" && status && sysData === "1", + showSum: status && sysData === "1", siaccountSum, tableData: { list, columns, total } }, () => this.postMessageToChild()); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js index 50eea2cc..477de105 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js @@ -5,9 +5,11 @@ * Date: 2022/11/23 */ import React, { Component } from "react"; -import { WeaTable } from "ecCom"; +import { Spin } from "antd"; import { getQueryString } from "../../../../util/url"; import * as API from "../../../../apis/standingBook"; +import { sysConfCodeRule } from "../../../../apis/ruleconfig"; +import { siaccountDetailBalanceListSum, siaccountDetailRecessionListSum } from "../../../../apis/calculate"; import "./index.less"; const APIFox = { @@ -25,6 +27,8 @@ class RegList extends Component { loading: { query: false }, + showSum: false, + siaccountSum: {}, pageInfo: { current: 1, pageSize: 10, @@ -35,19 +39,80 @@ class RegList extends Component { componentDidMount() { this.recessionList(); + window.addEventListener("message", this.handleReceive, false); } + handleReceive = async ({ data }) => { + const { type: listType, onEdit, onChangeRowkey } = this.props; + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + const { status, data: sysData } = await this.sysConfCodeRule(); + const { data: { sumRow: siaccountSum } } = listType === "regression" ? + await this.siaccountDetailRecessionListSum() : + await this.siaccountDetailBalanceListSum(); + this.setState({ + showSum: status && sysData === "1", + siaccountSum + }, () => this.postMessageToChild()); + } else if (type === "turn") { + if (id === "PAGEINFO") { + const { pageNum: current, size: pageSize } = params; + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList()); + } else if (id === "ROWSELECT") { + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); + onChangeRowkey(selectedRowKeys); + } else if (id === "EDIT") { + onEdit(params); + } + } + }; + postMessageToChild = () => { + const childFrameObj = document.getElementById("atdTable"); + const { pageInfo, dataSource, columns, selectedRowKeys, showSum, siaccountSum } = this.state; + childFrameObj.contentWindow.postMessage(JSON.stringify({ + dataSource, columns, pageInfo, + selectedRowKeys, showSum, siaccountSum, + showOperates: !getQueryString("type") + }), "*"); + }; + sysConfCodeRule = () => { + return sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }); + }; + siaccountDetailRecessionListSum = (module = {}) => { + const paymentStatus = "3"; + const creator = Number(getQueryString("creator")); + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); + return siaccountDetailRecessionListSum({ creator, paymentStatus, billMonth, paymentOrganization, ...module }); + }; + siaccountDetailBalanceListSum = (module = {}) => { + const paymentStatus = "3"; + const creator = Number(getQueryString("creator")); + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); + return siaccountDetailBalanceListSum({ creator, paymentStatus, billMonth, paymentOrganization, ...module }); + }; + componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible) { this.recessionList(); } } + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + handleResetSelectRowKeys = (selectedRowKeys) => { this.setState({ selectedRowKeys }); }; - recessionList = (module) => { + recessionList = async (module) => { const { type } = this.props; + const { status: sysStatus, data: sysData } = await this.sysConfCodeRule(); + const { data: { sumRow: siaccountSum } } = type === "regression" ? + await this.siaccountDetailRecessionListSum({ ...module }) : + await this.siaccountDetailBalanceListSum({ ...module }); const { loading, pageInfo } = this.state; const billMonth = getQueryString("billMonth"); const paymentOrganization = getQueryString("paymentOrganization"); @@ -68,105 +133,27 @@ class RegList extends Component { this.setState({ pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, - columns: _.map(_.filter(columns, it => it.dataIndex !== "id"), items => { - if (items.dataIndex === "employeeId") { - return { - ...items, - width: 110, - title: "姓名", - render: (text, r) => { - const { userName } = r; - return ( - {userName} - ); - } - }; - } else if (items.dataIndex === "costCenter") { - return { - ...items, - width: 110, - render: (text, r) => { - const { costCenter } = r; - return ( - {costCenter.name || ""} - ); - } - }; - } - return { - ...items, - title: , - width: 120, - render: (text) => { - return {text}; - } - }; - }) - }); + columns, + showSum: sysStatus && sysData === "1", + siaccountSum + }, () => this.postMessageToChild()); } }).catch(() => { this.setState({ loading: { ...loading, query: false } }); }); }; - handleChangeRow = (selectedRowKeys) => { - const { onChangeRowkey } = this.props; - this.setState({ selectedRowKeys }); - onChangeRowkey(selectedRowKeys); - }; render() { - const { loading, pageInfo, selectedRowKeys, dataSource, columns } = this.state; - const { onEdit } = this.props; - const pagination = { - ...pageInfo, - showTotal: total => `共 ${total} 条`, - showQuickJumper: true, - showSizeChanger: true, - pageSizeOptions: ["10", "20", "50", "100"], - onShowSizeChange: (current, pageSize) => { - this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => { - this.recessionList(); - }); - }, - onChange: (current) => { - this.setState({ pageInfo: { ...pageInfo, current } }, () => { - this.recessionList(); - }); - } - }; - const rowSelection = { - selectedRowKeys, - onChange: this.handleChangeRow - }; + const { loading } = this.state; return ( - { - return ( -
- onEdit(record)} - >编辑 -
- ); - } - } - ] : [...columns]} - dataSource={dataSource} - loading={loading.query} - pagination={pagination} - rowSelection={rowSelection} - scroll={{ x: 900 }} - /> + +