From ebc80f8b88b81c6ce6bf4e6f8d4855383f73ec15 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 19 Sep 2025 09:25:17 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E9=A2=86=E6=82=A6=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingyue/adjustSalaryFile/content.js | 46 ++++---- .../lingyue/adjustSalaryFile/layout.js | 1 + .../adjustSalaryFile/positionReport/index.js | 102 ++++++++++++++++-- .../adjustSalaryFile/rankReport/index.js | 74 +++++++++++-- .../lingyue/salaryFile/content.js | 18 +++- .../custom-pages/lingyue/salaryFile/layout.js | 1 + .../salaryFile/positionReport/index.js | 87 ++++++++++++++- .../lingyue/salaryFile/rankReport/index.js | 61 ++++++++++- 8 files changed, 339 insertions(+), 51 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/content.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/content.js index 0e06aa00..22d731af 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/content.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/content.js @@ -10,8 +10,8 @@ import React, { Component } from "react"; import { WeaEchart, WeaLeftRightLayout, WeaLocaleProvider, WeaTable } from "ecCom"; import * as API from "../../../../apis/custom-apis/lingyue"; -import "./index.less"; import { format_with_regex } from "../../../../util"; +import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; const colorList = ["#709DF7", "#73DEB3", "#7585A2", "#F7C739", "#5FC3E3", "#AEE279", "#FF7F81"]; @@ -32,6 +32,7 @@ class Content extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.isQuery !== this.props.isQuery) this.getSalaryFileReportList(nextProps); } + componentDidUpdate(prevProps, prevState, snapshot) { if (prevState.showLeft !== this.state.showLeft) { this.refs.chartA.paint(); @@ -40,29 +41,34 @@ class Content extends Component { } getSalaryFileReportList = (props) => { - const { type, dateRange } = props || this.props; + const { type, queryParams } = props || this.props, + { dateRange, pqList, xmList, zwjsList, ...extra } = queryParams; const [startDate, endDate] = dateRange; + const payload = { + pqList: pqList ? pqList.split(",") : [], + xmList: xmList ? xmList.split(",") : [], + zwjsList: zwjsList ? zwjsList.split(",") : [], + startDate, endDate, ...extra + }; this.setState({ loading: true }); - API.getSalaryFileReportList(type, { startDate, endDate }) - .then(({ status, data: result }) => { - this.setState({ loading: false }); - if (status) { - const { data: dataSource, columns, chartsDataA, chartsDataB } = result; - this.setState({ - dataSource, - chartsDataA: _.reduce(_.keys(chartsDataA), (pre, cur) => { - return [...pre, { name: cur, value: chartsDataA[cur] }]; - }, []), - chartsDataB: _.reduce(_.keys(chartsDataB), (pre, cur) => { - return [...pre, { name: cur, value: chartsDataB[cur] }]; - }, []), - columns: _.map(columns, o => ({ title: o.text, width: o.width, dataIndex: o.column })) - }); - } - }); + API.getSalaryFileReportList(type, payload).then(({ status, data: result }) => { + this.setState({ loading: false }); + if (status) { + const { data: dataSource, columns, chartsDataA, chartsDataB } = result; + this.setState({ + dataSource, + chartsDataA: _.reduce(_.keys(chartsDataA), (pre, cur) => { + return [...pre, { name: cur, value: chartsDataA[cur] }]; + }, []), + chartsDataB: _.reduce(_.keys(chartsDataB), (pre, cur) => { + return [...pre, { name: cur, value: chartsDataB[cur] }]; + }, []), + columns: _.map(columns, o => ({ title: o.text, width: o.width, dataIndex: o.column })) + }); + } + }); }; mapPieOptions = (data, pieName) => { - return { tooltip: { show: true, diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/layout.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/layout.js index 60b140c0..d38750f1 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/layout.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/layout.js @@ -10,6 +10,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaRangePicker, WeaTop } from "ecCom"; import { Button } from "antd"; +import "../index.less" const getLabel = WeaLocaleProvider.getLabel; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/positionReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/positionReport/index.js index 95565e90..7b3cfe8b 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/positionReport/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/positionReport/index.js @@ -8,7 +8,7 @@ * @description: */ import React, { Component } from "react"; -import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; +import { WeaBrowser, WeaFormItem, WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import * as API from "../../../../../apis/custom-apis/lingyue"; import SalaryFileReportLayout from "../layout"; import SalaryFileReport from "../content"; @@ -20,27 +20,107 @@ class Index extends Component { constructor(props) { super(props); this.state = { - isQuery: false, dateRange: [ - moment(new Date()).format("YYYY-MM-DD"), - moment(new Date()).format("YYYY-MM-DD") - ] + isQuery: false, + queryParams: { + pqList: "", xmList: "", zwjsList: "", + dateRange: [ + moment(new Date()).format("YYYY-MM-DD"), + moment(new Date()).format("YYYY-MM-DD") + ] + } }; } handleExport = async () => { - const { dateRange } = this.state; - WeaLoadingGlobal.start(); + const { queryParams } = this.state; + const { dateRange, pqList, xmList, zwjsList } = queryParams; const [startDate, endDate] = dateRange; - const promise = await API.exportTxdazwjstjReport({ startDate, endDate }); + WeaLoadingGlobal.start(); + const payload = { + pqList: pqList ? pqList.split(",") : [], + xmList: xmList ? xmList.split(",") : [], + zwjsList: zwjsList ? zwjsList.split(",") : [], + startDate, endDate + }; + const promise = await API.exportTxdazwjstjReport(payload); + }; + getBrowserPatams = (type, title) => { + let custBrowserParams = {}; + type === 162 && (custBrowserParams = { + completeParams: { + type: 162, + fielddbtype: "browser.b_zwjs" + }, + conditionDataParams: { + type: 162, + fielddbtype: "browser.b_zwjs" + }, + dataParams: { + type: 162, + fielddbtype: "browser.b_zwjs" + }, + destDataParams: { + type: 162, + fielddbtype: "browser.b_zwjs" + }, + isMultCheckbox: true + }); + return { + 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: "", + title, + type, + viewAttr: 2, + ...custBrowserParams + }; }; render() { - const { isQuery, dateRange } = this.state; + const { queryParams, isQuery } = this.state; + const { dateRange, zwjsList, pqList, xmList } = queryParams; return ( this.setState({ dateRange: v, isQuery: !isQuery })}> - + onChange={v => this.setState({ + queryParams: { ...queryParams, dateRange: v }, + isQuery: !isQuery + })}> +
+ + { + this.setState({ queryParams: { ...queryParams, pqList: v }, isQuery: !isQuery }); + }} + title={getLabel(111, "片区")} {...this.getBrowserPatams(194, getLabel(111, "片区"))} /> + + + this.setState({ queryParams: { ...queryParams, xmList: v }, isQuery: !isQuery })} + title={getLabel(111, "项目")} {...this.getBrowserPatams(194, getLabel(111, "项目"))} /> + + + this.setState({ + queryParams: { ...queryParams, zwjsList: v }, + isQuery: !isQuery + })} + title={getLabel(111, "职务角色")} {...this.getBrowserPatams(162, getLabel(111, "职务角色"))} /> + +
+
); } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/rankReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/rankReport/index.js index 220b6653..47ae8f5e 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/rankReport/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/adjustSalaryFile/rankReport/index.js @@ -8,7 +8,7 @@ * @description: */ import React, { Component } from "react"; -import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; +import { WeaBrowser, WeaFormItem, WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import SalaryFileReportLayout from "../layout"; import SalaryFileReport from "../content"; import * as API from "../../../../../apis/custom-apis/lingyue"; @@ -20,27 +20,79 @@ class Index extends Component { constructor(props) { super(props); this.state = { - isQuery: false, dateRange: [ - moment(new Date()).format("YYYY-MM-DD"), - moment(new Date()).format("YYYY-MM-DD") - ] + isQuery: false, + queryParams: { + pqList: "", xmList: "", zj: "", + dateRange: [ + moment(new Date()).format("YYYY-MM-DD"), + moment(new Date()).format("YYYY-MM-DD") + ] + } }; } handleExport = async () => { - const { dateRange } = this.state; - WeaLoadingGlobal.start(); + const { queryParams } = this.state; + const { dateRange, pqList, xmList, ...extra } = queryParams; const [startDate, endDate] = dateRange; - const promise = await API.exportTxdazjtjReport({ startDate, endDate }); + WeaLoadingGlobal.start(); + const payload = { + pqList: pqList ? pqList.split(",") : [], + xmList: xmList ? xmList.split(",") : [], + startDate, endDate, ...extra + }; + const promise = await API.exportTxdazjtjReport(payload); + }; + getBrowserPatams = (type, title) => { + return { + 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: "", + title, + type, + viewAttr: 2 + }; }; render() { - const { isQuery, dateRange } = this.state; + const { queryParams, isQuery } = this.state; + const { dateRange, zj, pqList, xmList } = queryParams; return ( this.setState({ dateRange: v, isQuery: !isQuery })}> - + onChange={v => this.setState({ + queryParams: { ...queryParams, dateRange: v }, + isQuery: !isQuery + })}> +
+ + this.setState({ queryParams: { ...queryParams, pqList: v }, isQuery: !isQuery })} + title={getLabel(111, "片区")} {...this.getBrowserPatams(194, getLabel(111, "片区"))} /> + + + this.setState({ queryParams: { ...queryParams, xmList: v }, isQuery: !isQuery })} + title={getLabel(111, "项目")} {...this.getBrowserPatams(194, getLabel(111, "项目"))} /> + + + this.setState({ queryParams: { ...queryParams, zj: v } })} + onSearch={() => this.setState({ isQuery: !isQuery })}/> + +
+
); } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/content.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/content.js index 5b28dcda..5f1258d5 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/content.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/content.js @@ -27,14 +27,26 @@ class Content extends Component { this.getSalaryFileReportList(); } + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.isQuery !== this.props.isQuery) this.getSalaryFileReportList(nextProps); + } + componentDidUpdate(prevProps, prevState, snapshot) { if (prevState.showLeft !== this.state.showLeft) this.refs.chart.paint(); } - getSalaryFileReportList = () => { - const { type } = this.props; + getSalaryFileReportList = (props) => { + const { type, queryParams } = props || this.props; + const { dateRange, pqList, xmList, zwjsList, ...extra } = queryParams; + this.setState({ loading: true }); - API.getSalaryFileReportList(type).then(({ status, data: result }) => { + const payload = { + pqList: pqList ? pqList.split(",") : [], + xmList: xmList ? xmList.split(",") : [], + zwjsList: zwjsList ? zwjsList.split(",") : [], + ...extra + }; + API.getSalaryFileReportList(type, payload).then(({ status, data: result }) => { this.setState({ loading: false }); if (status) { const { data: dataSource, columns, chartsData } = result; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/layout.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/layout.js index 553d3f4d..fe93a8ed 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/layout.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/layout.js @@ -10,6 +10,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTop } from "ecCom"; import { Button } from "antd"; +import "../index.less"; const getLabel = WeaLocaleProvider.getLabel; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/positionReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/positionReport/index.js index d01c7ea1..57edaca2 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/positionReport/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/positionReport/index.js @@ -8,7 +8,7 @@ * @description: */ import React, { Component } from "react"; -import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; +import { WeaBrowser, WeaFormItem, WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import * as API from "../../../../../apis/custom-apis/lingyue"; import SalaryFileReportLayout from "../layout"; import SalaryFileReport from "../content"; @@ -16,15 +16,96 @@ import SalaryFileReport from "../content"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { + constructor(props) { + super(props); + this.state = { + isQuery: false, + queryParams: { + pqList: "", xmList: "", zwjsList: "" + } + }; + } + handleExport = async () => { + const { queryParams } = this.state; + const { pqList, xmList, zwjsList } = queryParams; WeaLoadingGlobal.start(); - const promise = await API.exportXcdazwjstjReport({}); + const payload = { + pqList: pqList ? pqList.split(",") : [], + xmList: xmList ? xmList.split(",") : [], + zwjsList: zwjsList ? zwjsList.split(",") : [] + }; + const promise = await API.exportXcdazwjstjReport(payload); + }; + getBrowserPatams = (type, title) => { + let custBrowserParams = {}; + type === 162 && (custBrowserParams = { + completeParams: { + type: 162, + fielddbtype: "browser.b_zwjs" + }, + conditionDataParams: { + type: 162, + fielddbtype: "browser.b_zwjs" + }, + dataParams: { + type: 162, + fielddbtype: "browser.b_zwjs" + }, + destDataParams: { + type: 162, + fielddbtype: "browser.b_zwjs" + }, + isMultCheckbox: true + }); + + return { + 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: "", + title, + type, + viewAttr: 2, + ...custBrowserParams + }; }; render() { + const { queryParams, isQuery } = this.state; + const { zwjsList, pqList, xmList } = queryParams; return ( - +
+ + this.setState({ queryParams: { ...queryParams, pqList: v }, isQuery: !isQuery })} + title={getLabel(111, "片区")} {...this.getBrowserPatams(194, getLabel(111, "片区"))} /> + + + this.setState({ queryParams: { ...queryParams, xmList: v }, isQuery: !isQuery })} + title={getLabel(111, "项目")} {...this.getBrowserPatams(194, getLabel(111, "项目"))} /> + + + this.setState({ queryParams: { ...queryParams, zwjsList: v }, isQuery: !isQuery })} + title={getLabel(111, "职务角色")} {...this.getBrowserPatams(162, getLabel(111, "职务角色"))} /> + +
+
); } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/rankReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/rankReport/index.js index 5adfe611..0a355c21 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/rankReport/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salaryFile/rankReport/index.js @@ -8,7 +8,7 @@ * @description: */ import React, { Component } from "react"; -import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; +import { WeaBrowser, WeaFormItem, WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import SalaryFileReportLayout from "../layout"; import SalaryFileReport from "../content"; import * as API from "../../../../../apis/custom-apis/lingyue"; @@ -16,15 +16,70 @@ import * as API from "../../../../../apis/custom-apis/lingyue"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { + constructor(props) { + super(props); + this.state = { + isQuery: false, queryParams: { pqList: "", xmList: "", zj: "" } + }; + } + handleExport = async () => { + const { queryParams } = this.state; + const { pqList, xmList, ...extra } = queryParams; WeaLoadingGlobal.start(); - const promise = await API.exportXcdazjtjReport({}); + const payload = { + pqList: pqList ? pqList.split(",") : [], + xmList: xmList ? xmList.split(",") : [], + ...extra + }; + const promise = await API.exportXcdazjtjReport(payload); + }; + getBrowserPatams = (type, title) => { + return { + 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: "", + title, + type, + viewAttr: 2 + }; }; render() { + const { queryParams, isQuery } = this.state; + const { zj, pqList, xmList } = queryParams; return ( - +
+ + this.setState({ queryParams: { ...queryParams, pqList: v }, isQuery: !isQuery })} + title={getLabel(111, "片区")} {...this.getBrowserPatams(194, getLabel(111, "片区"))} /> + + + this.setState({ queryParams: { ...queryParams, xmList: v }, isQuery: !isQuery })} + title={getLabel(111, "项目")} {...this.getBrowserPatams(194, getLabel(111, "项目"))} /> + + + this.setState({ queryParams: { ...queryParams, zj: v } })} + onSearch={() => this.setState({ isQuery: !isQuery })}/> + +
+
); }