From b61dc20db51018340dfe37ca82cd2e24a5759a39 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 3 Dec 2024 18:38:14 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.17.1.2411.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E8=96=AA=E8=B5=84=E6=98=8E=E7=BB=86=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/customTransferDialog.js | 15 ++-- .../components/salaryDetails.js | 73 ++++++++----------- .../pages/analysisOfSalaryStatistics/index.js | 20 ++--- .../hrmSalary/pages/ruleConfig/conditions.js | 20 ++--- 4 files changed, 53 insertions(+), 75 deletions(-) diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js index 7bcf1f88..25957acb 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js @@ -133,18 +133,19 @@ class CustomTransferDialog extends Component { renderTitle = () => { return (
{getLabel(111, "数据选择")} -
+
{this.props.titleOptsComs}
); }; render() { const { loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys } = this.state; - const { searchParamsKey, saveLoading, btns = [] } = this.props; - const buttons = [ - , - ...btns, - ]; + const { + searchParamsKey, saveLoading, buttons = [ + , + + ] + } = this.props; let rightActive = false, leftActive = false, rightAllActive = false; if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true; if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index 219b5e4f..26e67c3c 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -35,7 +35,7 @@ class SalaryDetails extends Component { showTotalCell: false, updateSum: true, tempDialog: { visible: false, setting: [], id: "", template: {} }, transferDialog: { visible: false, searchParamsKey: "name", saveLoading: false, - dataParams: { page: "salary_details_report", defaultSetting: "0" }, + dataParams: { page: "salary_details_report" }, completeURL: "", convertDatasource: datas => { return { listDatas: _.map(datas.setting, o => ({ id: o.id || o.column, name: o.name || o.text })), @@ -49,9 +49,7 @@ class SalaryDetails extends Component { async componentDidMount() { const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]); - this.setState({ showTotalCell: confCode === "1" }, () => { - this.props.salaryDetailShowType === "1" && this.getPageListTemplatelist(); - }); + this.setState({ showTotalCell: confCode === "1" }); window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", () => this.forceUpdate(), false); } @@ -73,8 +71,7 @@ class SalaryDetails extends Component { if (status) { this.setState({ tempPageList: _.map(data, o => ({ ...o, key: String(o.id), showname: o.name })), - templateId: !_.isEmpty(_.find(data, o => !!o.checked)) ? String(_.find(data, o => !!o.checked).id) : "", - transferDialog: { ...this.state.transferDialog, visible: false, type: "default" } + templateId: !_.isEmpty(_.find(data, o => !!o.checked)) ? String(_.find(data, o => !!o.checked).id) : "" }); } }); @@ -173,12 +170,13 @@ class SalaryDetails extends Component { } return []; }; - handleSetDefCols = (params) => this.setState({ + handleSetDefCols = (params = {}) => this.setState({ transferDialog: { - ...this.state.transferDialog, completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", visible: true, - dataParams: { ...this.state.transferDialog.dataParams, ...params } + ...this.state.transferDialog, visible: true, type: "temp", + dataParams: { ...this.state.transferDialog.dataParams, ...params }, + completeURL: "/api/bs/hrmsalary/common/pageList/template/get" } - }); + }, () => this.getPageListTemplatelist()); converCheckedCol = (data) => { return _.reduce(data.checked || [], (pre, cur) => { const item = _.find(data.setting, k => k.column === cur.column); @@ -186,14 +184,9 @@ class SalaryDetails extends Component { return pre; }, []); }; + savePageListSetting = (values) => { - const { transferDialog, tempDialog } = this.state, { type } = transferDialog; - if (type === "temp") { - this.setState({ - tempDialog: { ...tempDialog, visible: true, setting: _.map(values, o => o.id) } - }); - return; - } + const { transferDialog } = this.state; const payload = { ...transferDialog.dataParams, setting: _.map(values, o => o.id) }; @@ -211,13 +204,8 @@ class SalaryDetails extends Component { }); }; handelAddTemp = (templateId) => { - const { transferDialog, tempDialog, tempPageList } = this.state; + const { tempDialog, tempPageList } = this.state; this.setState({ - transferDialog: { - ...transferDialog, visible: true, type: "temp", - dataParams: { ...transferDialog.dataParams, id: templateId }, - completeURL: "/api/bs/hrmsalary/common/pageList/template/get" - }, tempDialog: { ...tempDialog, id: templateId, template: _.find(tempPageList, o => o.key === templateId) } }); }; @@ -226,7 +214,15 @@ class SalaryDetails extends Component { API.changePageListTemplate({ page: "salary_details_report", templateId }).then(({ status, errormsg }) => { if (status) { message.success(getLabel(111, "操作成功!")); - this.getSalaryList(); + this.setState({ + transferDialog: { + ...this.state.transferDialog, + dataParams: { ...this.state.transferDialog.dataParams, id: templateId } + } + }, () => { + this.transferRef.getData(true); + this.getSalaryList(); + }); } else { message.error(errormsg); } @@ -252,21 +248,6 @@ class SalaryDetails extends Component { const { dataParams: { defaultSetting } } = transferDialog; return (
- { - salaryDetailShowType === "1" && -
- - { - templateId && - this.handelAddTemp(templateId)}> - - - } -
- } @@ -291,10 +272,16 @@ class SalaryDetails extends Component { {/* columns={this.getColumns()}*/} {/*/>*/} {/*默认显示列,薪资模板列表*/} - {getLabel(111, "恢复默认显示列")}] : []} + this.transferRef = dom} + buttons={[ + , + + ]} + titleOptsComs={ + } onCancel={() => this.setState({ transferDialog: { ...transferDialog, completeURL: "", visible: false, type: "default" diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index 87deee95..f7c2ca7a 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, sysinfo } from "../../apis/ruleconfig"; +import { commonEnumList, reportGetForm } from "../../apis/ruleconfig"; import { dimensionGetForm } from "../../apis/statistics"; import EmployeeDetails from "./components/employeeDetails"; import SalaryDetails from "./components/salaryDetails"; @@ -50,16 +50,12 @@ class Index extends Component { title: "", visible: false, typeKey: "", id: "" }, - logDialogVisible: false, filterConditions: "[]", - salaryDetailShowType: "0" //薪资明细列表显示方式 + logDialogVisible: false, filterConditions: "[]" }; } componentDidMount() { this.initReportFormCondition(); - sysinfo().then(({ status, data }) => { - if (status) this.setState({ salaryDetailShowType: data.SALARY_DETAILS_REPORT_SHOW_TYPE }); - }); } initReportFormCondition = (payload = {}) => { @@ -281,7 +277,7 @@ class Index extends Component { const { selectedKey, modalReq, slideReq, conditions, reportConditions, reportName, keyword, year, logDialogVisible, filterConditions, - dateRange, showSearchAd, isQuery, salaryDetailShowType + dateRange, showSearchAd, isQuery } = this.state; const buttons = selectedKey === "statistics" ? [ , @@ -319,7 +315,7 @@ class Index extends Component { icon: , content: getLabel(111, "显示列定制"), onClick: () => { - this.salaryRef.wrappedInstance.handleSetDefCols({ defaultSetting: "0" }); + this.salaryRef.wrappedInstance.handleSetDefCols(); // tableStore.setColSetVisible(true); // tableStore.tableColSet(true); } @@ -331,18 +327,13 @@ class Index extends Component { { key: "salaryDetail", title: getLabel(111, "薪资明细") } ]; 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({ defaultSetting: "1" }) - }]); return ( } selectedKey={selectedKey} 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 === "statistics") || (selectedKey === "salaryDetail" && salaryDetailShowType !== "1")} - onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}> + showDropIcon={selectedKey !== "detail"} 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/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index 22135a29..51759130 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -215,16 +215,16 @@ export const conditions = [ labelcol: 8, viewAttr: 2 }, - { - conditionType: "SELECT", - domkey: ["SALARY_DETAILS_REPORT_SHOW_TYPE"], - fieldcol: 10, - label: "薪资明细显示模式", - lanId: 111, - options: [], - labelcol: 8, - viewAttr: 2 - } + // { + // conditionType: "SELECT", + // domkey: ["SALARY_DETAILS_REPORT_SHOW_TYPE"], + // fieldcol: 10, + // label: "薪资明细显示模式", + // lanId: 111, + // options: [], + // labelcol: 8, + // viewAttr: 2 + // } ], title: "薪资报表", lanId: 111,