diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index f49bf4ac..6b3826c2 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -5,6 +5,7 @@ * Date: 2024/3/26 */ import React, { Component } from "react"; +import { toJS } from "mobx"; import { inject, observer } from "mobx-react"; import { WeaTableNew } from "comsMobx"; import { WeaLoadingGlobal, WeaLocaleProvider, WeaSelect } from "ecCom"; @@ -131,28 +132,34 @@ class SalaryDetails extends Component { }).catch(() => this.setState({ loading: false })); }; handleExportSalaryList = (key) => { - let { selectedRowKeys, payload, columns } = this.state; + const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props; + let { selectedRowKeys, payload, columns: tempCols } = this.state; + const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); + const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols; if (key === "SELECTED" && selectedRowKeys.length === 0) { message.warning(getLabel(543345, "请选择需要导出的数据!")); return; } WeaLoadingGlobal.start(); const promise = API.exportSalaryList({ - ...payload, ids: key === "SELECTED" ? selectedRowKeys : [], columns: _.map(columns, o => o.column) + ...payload, ids: key === "SELECTED" ? selectedRowKeys : [], columns: _.map(columns, o => o.column || o.dataIndex) }); }; getColumns = () => { + const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props; const { - columns, dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum, transferDialog + columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum, transferDialog } = this.state; + const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : ""; + const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols; if (!_.isEmpty(columns) && !transferDialog.visible && !transferDialog.cancel) { this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRowlistUrl, payload: { ...payload, updateSum }, columns: _.map(columns, (it, idx) => ({ - dataIndex: it.column, title: it.text, calcDetail: true, - width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.width, + dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true, + width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : (it.width || it.oldWidth), fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "", ellipsis: true })) @@ -219,11 +226,15 @@ class SalaryDetails extends Component { render() { const { loading, dataSource, transferDialog, tempDialog, tempPageList, templateId } = this.state; - const { attendanceStore: { tableStore }, dateRange, showSearchAd } = this.props; + const { attendanceStore: { tableStore }, dateRange, showSearchAd, salaryDetailShowType } = this.props; return (
- + { + salaryDetailShowType === "1" && + + } this.setState({ transferDialog: { ...this.state.transferDialog, cancel: true } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index cb624a06..3b68a2b3 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react"; import { WeaDatePicker, WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom"; import { Button, Dropdown, Menu } from "antd"; import { condition, reportCondition } from "./components/conditions"; -import { commonEnumList, reportGetForm } from "../../apis/ruleconfig"; +import { commonEnumList, reportGetForm, sysinfo } from "../../apis/ruleconfig"; import { dimensionGetForm } from "../../apis/statistics"; import EmployeeDetails from "./components/employeeDetails"; import SalaryDetails from "./components/salaryDetails"; @@ -50,12 +50,16 @@ class Index extends Component { title: "", visible: false, typeKey: "", id: "" }, - logDialogVisible: false, filterConditions: "[]" + logDialogVisible: false, filterConditions: "[]", + salaryDetailShowType: "0" //薪资明细列表显示方式 }; } componentDidMount() { this.initReportFormCondition(); + sysinfo().then(({ status, data }) => { + if (status) this.setState({ salaryDetailShowType: data.SALARY_DETAILS_REPORT_SHOW_TYPE }); + }); } initReportFormCondition = (payload = {}) => { @@ -277,7 +281,7 @@ class Index extends Component { const { selectedKey, modalReq, slideReq, conditions, reportConditions, reportName, keyword, year, logDialogVisible, filterConditions, - dateRange, showSearchAd, isQuery + dateRange, showSearchAd, isQuery, salaryDetailShowType } = this.state; const buttons = selectedKey === "statistics" ? [ , @@ -336,8 +340,8 @@ class Index extends Component { iconBgcolor="#F14A2D" tabDatas={tabs} className="xc_tj_fx_wrapper" buttons={(!statisticsReportBtn && selectedKey === "statistics") ? buttons.slice(-1) : buttons} buttonSpace={10} onChange={selectedKey => this.setState({ selectedKey }, () => this.state.selectedKey === "statistics" && this.initReportFormCondition())} - showDropIcon={selectedKey !== "detail"} onDropMenuClick={this.onDropMenuClick} - dropMenuDatas={dropMenuDatas}> + showDropIcon={(selectedKey === "statistics") || (selectedKey === "salaryDetail" && salaryDetailShowType !== "1")} + onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}> { selectedKey === "statistics" ? this.onDropMenuClick(type, targetid)} /> : this.salaryRef = dom} dateRange={dateRange} isQuery={isQuery} + salaryDetailShowType={salaryDetailShowType} showSearchAd={showSearchAd} handleOpenAdvanceSearch={this.handleOpenAdvanceSearch} handleAdvanceSearch={this.handleAdvanceSearch} onAdSearch={this.onAdSearch} onCancel={() => this.setState({ showSearchAd: false })} diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less index 1243b949..a2fa2079 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less @@ -5,6 +5,10 @@ width: 220px; } + .ant-btn-group { + margin-right: 10px; + } + .employeeYearWrapper { display: flex; align-items: center; diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index bb22f65e..6bc04d8c 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -196,6 +196,16 @@ export const conditions = [ options: [], labelcol: 8, viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["SALARY_DETAILS_REPORT_SHOW_TYPE"], + fieldcol: 10, + label: "薪资明细显示模式", + lanId: 111, + options: [], + labelcol: 8, + viewAttr: 2 } ], title: "薪资报表", diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js index 8c56b847..8504f501 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js @@ -51,6 +51,13 @@ class RuleConfig extends Component { { key: "1", showname: getLabel(111, "实时组织信息"), selected: false } ] }; + } else if (getKey(o) === "SALARY_DETAILS_REPORT_SHOW_TYPE") { + return { + ...o, options: [ + { key: "0", showname: getLabel(111, "定制列"), selected: true }, + { key: "1", showname: getLabel(111, "模板"), selected: false } + ] + }; } else if (getKey(o) === "OPEN_APPLICATION_ENCRYPT") { return { ...o, viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 }; } else if (getKey(o) === "taxDeclarationFunction") { @@ -78,7 +85,7 @@ class RuleConfig extends Component { form.updateFields({ [item]: { value: sysinfo["salaryAcctEmployeeRule"] || "" } }); } else if (item === "taxDeclarationFunction") { form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "1") } }); - } else if (item === "REPORT_ORGANIZATIN_TYPE") { + } else if (item === "REPORT_ORGANIZATIN_TYPE" || item === "SALARY_DETAILS_REPORT_SHOW_TYPE") { form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "0") } }); } else if (item === "taxAgentShowStatus" || item === "salaryShowStatus" || item === "adjustShowStatus") { form.updateFields({ [item]: { value: sysinfo[item] || "1" } }); @@ -128,6 +135,7 @@ class RuleConfig extends Component { case "salaryShowStatus": case "adjustShowStatus": case "REPORT_ORGANIZATIN_TYPE": + case "SALARY_DETAILS_REPORT_SHOW_TYPE": if (!this.handleDebounce) { this.handleDebounce = _.debounce(() => { const confTitle = { @@ -138,7 +146,8 @@ class RuleConfig extends Component { taxAgentShowStatus: getLabel(111, "显示【个税扣缴义务人】信息"), salaryShowStatus: getLabel(111, "显示工资单页签"), adjustShowStatus: getLabel(111, "显示调薪记录页签"), - REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息") + REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息"), + SALARY_DETAILS_REPORT_SHOW_TYPE: getLabel(111, "薪资明细显示模式") }; this.unifiedSettings(key, confTitle[key]); this.handleDebounce = null;