From 65b0020ea18410887027f4070b9e8b70b0d51171 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 27 Feb 2025 09:13:44 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E9=99=95=E8=A5=BF=E4=B8=87=E4=BC=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-pages/wz/provisionReport/index.js | 39 ++++++++++++++++--- .../wz/provisionReport/index.less | 7 +++- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/custom-pages/wz/provisionReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/wz/provisionReport/index.js index 9c2d6313..b642fffd 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/wz/provisionReport/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/wz/provisionReport/index.js @@ -4,6 +4,7 @@ import { getDHSalaryReportList } from "../../../../apis/custom-apis/wz_api"; import { Button } from "antd"; import moment from "moment"; import "./index.less"; +import { convertToUrlString } from "../../../../util/url"; const getLabel = WeaLocaleProvider.getLabel; @@ -11,7 +12,7 @@ class Index extends Component { constructor(props) { super(props); this.state = { - startMonthStr: moment().format("YYYY-MM"), dataSource: [], columns: [] + startMonthStr: moment().format("YYYY-MM"), dataSource: [], columns: [], loading: false }; } @@ -20,29 +21,57 @@ class Index extends Component { } getDHSalaryReportList = () => { + this.setState({ loading: true }); getDHSalaryReportList({ startMonthStr: this.state.startMonthStr }).then(({ status, data }) => { + this.setState({ loading: false }); if (status) { const { data: dataSource, column } = data; this.setState({ - dataSource, columns: _.map(column, o => ({ dataIndex: o.column, title: o.text, width: o.width })) + dataSource, columns: _.map(column, it => { + const { column } = it; + if (column !== "rylx") { + return { dataIndex: column, title: it.text, width: it.width }; + } else { + return { + dataIndex: column, title: it.text, width: it.width, + render: (value, row, index) => { + const obj = { + children: value, + props: {} + }; + const mergeList = _.filter(dataSource, o => o.rylx === row.rylx); + if (index === 0 || dataSource[index - 1].rylx !== row.rylx) { + obj.props.rowSpan = mergeList.length; + } else { + obj.props.rowSpan = 0; + } + return obj; + } + }; + } + }) }); } }); }; + handleExportSalaryReport = () => { + window.open(`/api/bs/hrmsalary/salaryacct/dhSalaryReport/export?${convertToUrlString({ startMonthStr: this.state.startMonthStr })}`, "_blank"); + }; render() { - const { startMonthStr, dataSource, columns } = this.state; + const { startMonthStr, dataSource, columns, loading } = this.state; return (} iconBgcolor="#F14A2D" buttons={[ this.setState({ startMonthStr: val }, () => this.getDHSalaryReportList())}/>, - + ]}>
- +
); } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/wz/provisionReport/index.less b/pc4mobx/hrmSalary/pages/custom-pages/wz/provisionReport/index.less index d8e1acf7..b6ef03d9 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/wz/provisionReport/index.less +++ b/pc4mobx/hrmSalary/pages/custom-pages/wz/provisionReport/index.less @@ -3,9 +3,14 @@ width: 100%; height: 100%; background: #f6f6f6; + padding: 8px 16px 0 16px; - .wea-table { + .wea-new-table { background: #FFF; + + table td { + padding-left: 8px !important; + } } } }