From 8d58561b887be557a637fd7e26df4eed1d731c3d 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, 26 Mar 2024 17:07:21 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.12.1.2403.02-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E9=85=8D=E7=BD=AE=E9=A1=B9?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E8=96=AA=E8=B5=84=E6=98=8E=E7=BB=86=E7=9A=84?= =?UTF-8?q?=E5=BC=80=E5=8F=91=201=E3=80=81=E8=A1=A5=E7=AE=97=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AE=8C=E6=88=90=202=E3=80=81=E8=96=AA?= =?UTF-8?q?=E9=85=AC=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E6=8A=A5=E8=A1=A8=E7=9A=84=E9=A1=B5=E9=9D=A2=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/index.js | 5 +- pc4mobx/hrmSalary/apis/statistics.js | 14 +- .../components/advanceInputBtn/index.js | 33 ++++ .../components/advanceInputBtn/index.less | 29 ++++ .../components/conditions.js | 88 +++++++++++ .../components/salaryDetails.js | 148 ++++++++++++++++++ .../components/searchPannel/index.js | 77 +++++++++ .../pages/analysisOfSalaryStatistics/index.js | 75 +++++++-- .../analysisOfSalaryStatistics/index.less | 58 ++++++- .../pages/reportView/components/condition.js | 13 ++ .../statisticalMicroSettingsSlide.js | 16 +- .../pages/supplementaryCalc/index.less | 7 + pc4mobx/hrmSalary/stores/attendanceStore.js | 5 +- 13 files changed, 545 insertions(+), 23 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/advanceInputBtn/index.js create mode 100644 pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/advanceInputBtn/index.less create mode 100644 pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js create mode 100644 pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/searchPannel/index.js diff --git a/pc4mobx/hrmSalary/apis/index.js b/pc4mobx/hrmSalary/apis/index.js index 4cb3b93c..92514839 100644 --- a/pc4mobx/hrmSalary/apis/index.js +++ b/pc4mobx/hrmSalary/apis/index.js @@ -39,4 +39,7 @@ export const getDetailChanges = params => { export const getSalarysobListAll = params => { return postFetch("/api/bs/hrmsalary/salarysob/listAll", params); }; - +//补算 +export const supplementAcctRecord = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/supplementAcctRecord", params); +}; diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js index 3b70ee59..76056002 100644 --- a/pc4mobx/hrmSalary/apis/statistics.js +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; //薪酬统计维度下拉列表 export const dimensionGetForm = (params) => { @@ -122,3 +122,15 @@ export const getExpandFieldSettings = (params) => { export const statisticsReportDuplicate = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/report/duplicate", "GET", params); }; +//薪酬统计报表-薪资明细列表 +export const getSalaryList = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/employee/salaryList", params); +}; +//薪酬统计报表-薪资明细列表总计行 +export const getSalaryListSum = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/employee/salaryListSum", params); +}; +// 薪酬统计报表-薪资明细导出 +export const exportSalaryList = (params) => { + return postExportFetch("/api/bs/hrmsalary/report/statistics/employee/exportSalaryList", params); +}; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/advanceInputBtn/index.js new file mode 100644 index 00000000..86a5f416 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/advanceInputBtn/index.js @@ -0,0 +1,33 @@ +/* + * Author: 黎永顺 + * name:薪酬统计报表-高级搜索 + * Description: + * Date: 2024/3/26 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("attendanceStore") +@observer +class Index extends Component { + render() { + const { attendanceStore: { salaryDetailSearchForm } } = this.props; + return ( +
+ salaryDetailSearchForm.updateFields({ keyword: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/advanceInputBtn/index.less new file mode 100644 index 00000000..9081d39f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/advanceInputBtn/index.less @@ -0,0 +1,29 @@ +.achrive-advance-search { + display: flex; + align-items: center; + position: relative; + top: -1.5px; + + .wea-advanced-search { + top: 2px; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + top: 1px; + } +} diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js index 080dd0e4..6a19614c 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js @@ -1,3 +1,4 @@ +import React from "react"; import { WeaLocaleProvider } from "ecCom"; const { getLabel } = WeaLocaleProvider; @@ -131,3 +132,90 @@ export const extensionCondition = [ defaultshow: true } ]; +export const salaryDetailSearchConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["keyword"], + fieldcol: 16, + label: getLabel(111, "姓名/工号"), + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["taxAgentIds"], + fieldcol: 16, + label: getLabel(537996, "个税扣缴义务人"), + labelcol: 8, + options: [], + multiple: true, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "164", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["subcompanyIds"], + fieldcol: 16, + label: getLabel(33553, "分部"), + labelcol: 8, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57", + viewAttr: 2 + }, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 16, + label: getLabel(27511, "部门"), + labelcol: 8, + viewAttr: 2 + } + ], + defaultshow: true, + title: getLabel(1361, "基本信息"), + col: 2 + } +]; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js new file mode 100644 index 00000000..e83e95ca --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -0,0 +1,148 @@ +/* + * Author: 黎永顺 + * name:薪资明细列表 + * Description: + * Date: 2024/3/26 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; +import { WeaTableNew } from "comsMobx"; +import { message, Spin } from "antd"; +import * as API from "../../../apis/statistics"; +import { getIframeParentHeight } from "../../../util"; +import { sysConfCodeRule } from "../../../apis/ruleconfig"; +import "../index.less"; + +const WeaTableComx = WeaTableNew.WeaTable; +const { getLabel } = WeaLocaleProvider; + +@inject("attendanceStore") +@observer +class SalaryDetails extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, dataSource: [], columns: [], selectedRowKeys: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, + countResult: {}, showTotalCell: false + }; + } + + componentDidMount() { + this.getSalaryList(this.props); + window.addEventListener("message", this.handleReceive, false); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.isQuery !== this.props.isQuery) this.getSalaryList(nextProps); + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + this.setState(({ selectedRowKeys: [] })); + } + + handleReceive = ({ data }) => { + const { type, payload: { id, params } = {} } = data; + const { pageInfo } = this.state; + if (type === "init") { + this.getColumns(); + } else if (type === "turn") { + if (id === "PAGEINFO") { + const { pageNum: current, size: pageSize } = params; + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getSalaryList(this.props)); + } else if (id === "CHECKBOX") { + const { selectedRowKeys: checkBox } = params; + this.setState({ selectedRowKeys: checkBox }); + } + } + }; + postMessageToChild = (payload) => { + const i18n = { + "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), + "总计": getLabel(523, "总计") + }; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; + getSalaryList = (props) => { + const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props; + const [startDateStr, endDateStr] = dateRange; + const { taxAgentIds, subcompanyIds, departmentIds, ...extra } = salaryDetailSearchForm.getFormParams(); + const { pageInfo } = this.state; + const payload = { + taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [], + departmentIds: departmentIds ? departmentIds.split(",") : [], + subcompanyIds: subcompanyIds ? subcompanyIds.split(",") : [], + ...extra, ...pageInfo, startDateStr, endDateStr + }; + this.setState({ loading: true }); + API.getSalaryList(payload).then(async ({ status, data }) => { + const [{ data: sumData }, { data: confCode }] = await Promise.all([API.getSalaryListSum(payload), sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]); + this.setState({ loading: false }); + if (status) { + const { dataKey, pageInfo: pageparams } = data; + const { list: dataSource, pageNum: current, total, pageSize } = pageparams; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload, + countResult: sumData.sumRow, showTotalCell: confCode === "1" + }, () => tableStore.getDatas(dataKey.datas)); + } + }).catch(() => this.setState({ loading: false })); + }; + handleExportSalaryList = (key) => { + let { selectedRowKeys, payload } = this.state; + if (key === "SELECTED" && selectedRowKeys.length === 0) { + message.warning(getLabel(543345, "请选择需要导出的数据!")); + return; + } + WeaLoadingGlobal.start(); + const promise = API.exportSalaryList({ ...payload, ids: selectedRowKeys }); + }; + getColumns = () => { + const { attendanceStore: { tableStore } } = this.props; + const { dataSource, pageInfo, selectedRowKeys, countResult, showTotalCell } = this.state; + const columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); + if (!_.isEmpty(columns)) { + this.postMessageToChild({ + dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, + sumRow: countResult, + columns: _.map(columns, (it, idx) => ({ + ...it, + width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.oldWidth, + fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "", + ellipsis: true + })) + }); + } + return []; + }; + + render() { + const { loading, dataSource } = this.state; + const { attendanceStore: { tableStore } } = this.props; + return ( +
+ +