From dda961cacf667197e0a766320c95131f3406bc9e Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 25 Nov 2024 17:51:49 +0800 Subject: [PATCH] release/2.17.1.2411.01 --- .../components/salaryDetails.js | 46 ++++++++++--------- .../pages/analysisOfSalaryStatistics/index.js | 7 +-- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index a45cee0f..b982d9fe 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -5,7 +5,6 @@ * 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"; @@ -34,7 +33,8 @@ class SalaryDetails extends Component { pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "", showTotalCell: false, updateSum: true, tempDialog: { visible: false, setting: [], id: "", template: {} }, transferDialog: { - visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, saveLoading: false, + visible: false, searchParamsKey: "name", saveLoading: false, + dataParams: { page: "salary_details_report", defaultSetting: "0" }, completeURL: "", convertDatasource: datas => { return { listDatas: _.map(datas.setting, o => ({ id: o.id || o.column, name: o.name || o.text })), @@ -127,7 +127,9 @@ class SalaryDetails extends Component { const { list: dataSource, pageNum: current, total, pageSize } = pageparams; this.setState({ columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload - }, () => tableStore.getDatas(dataKey.datas)); + }, () => { + // tableStore.getDatas(dataKey.datas) + }); } }).catch(() => this.setState({ loading: false })); }; @@ -137,10 +139,11 @@ class SalaryDetails extends Component { }); }; handleExportSalaryList = (key) => { - const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props; + // 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; + // const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); + // const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols; + const columns = _.filter(tempCols, o => o.column !== "acctTimes"); if (key === "SELECTED" && selectedRowKeys.length === 0) { message.warning(getLabel(543345, "请选择需要导出的数据!")); return; @@ -151,12 +154,13 @@ class SalaryDetails extends Component { }); }; getColumns = () => { - const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props; + // const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props; const { - columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRow, transferDialog + columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRow } = 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; + // const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); + // const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols; + const columns = _.filter(tempCols, o => o.column !== "acctTimes"); if (!_.isEmpty(columns)) { this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRow, @@ -170,16 +174,15 @@ class SalaryDetails extends Component { } return []; }; - handleSetDefCols = () => this.setState({ + handleSetDefCols = (params) => this.setState({ transferDialog: { ...this.state.transferDialog, completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", visible: true, - dataParams: { page: "salary_details_report" } + dataParams: { ...this.state.transferDialog.dataParams, ...params } } }); converCheckedCol = (data) => { - const { salaryDetailShowType } = this.props; return _.reduce(data.checked || [], (pre, cur) => { - const item = _.find(data.setting, k => (salaryDetailShowType !== "1" && k.id === cur) || (salaryDetailShowType === "1" && k.column === cur.column)); + const item = _.find(data.setting, k => k.column === cur.column); if (!_.isEmpty(item)) return [...pre, { ...item, id: item.id || item.column, name: item.name || item.text }]; return pre; }, []); @@ -193,8 +196,7 @@ class SalaryDetails extends Component { return; } const payload = { - page: "salary_details_report", - setting: _.map(values, o => o.id) + ...transferDialog.dataParams, setting: _.map(values, o => o.id) }; this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: true } }); API.savePageListSetting(payload).then(({ status, errormsg }) => { @@ -270,12 +272,12 @@ class SalaryDetails extends Component { id="atdTable" /> - + {/**/} {/*默认显示列,薪资模板列表*/} this.setState({ diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index 3b68a2b3..87deee95 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -319,8 +319,9 @@ class Index extends Component { icon: , content: getLabel(111, "显示列定制"), onClick: () => { - tableStore.setColSetVisible(true); - tableStore.tableColSet(true); + this.salaryRef.wrappedInstance.handleSetDefCols({ defaultSetting: "0" }); + // tableStore.setColSetVisible(true); + // tableStore.tableColSet(true); } } ]; @@ -332,7 +333,7 @@ class Index extends Component { dropMenuDatas = selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1); (PageAndOptAuth.isChief && selectedKey === "salaryDetail") && (dropMenuDatas = [...dropMenuDatas, { key: "DEF_COLUMN", icon: , content: getLabel(111, "默认显示列"), - onClick: () => this.salaryRef.wrappedInstance.handleSetDefCols() + onClick: () => this.salaryRef.wrappedInstance.handleSetDefCols({ defaultSetting: "1" }) }]); return (