From b3493270882c5c7cf98e59325c25639244e0fb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 15 Jul 2024 17:14:55 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.14.5.2406.03-=E5=B7=A5=E8=B5=84?= =?UTF-8?q?=E5=8D=95=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E5=88=97=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 4 +- .../components/advanceInputBtn/index.js | 27 ++++ .../components/advanceInputBtn/index.less | 28 ++++ .../components/salaryDetailList/index.js | 130 ++++++++++++++++++ .../salaryDetailSearchPannel/index.js | 37 +++++ .../components/salaryMonthHelpfulTip.js | 37 +++++ .../pages/payroll/payrollDetail/index.less | 72 ++++++++++ .../payroll/payrollDetail/payrollDetail.js | 106 ++++++++++++++ .../payrollDetail/payrollGrantDetail.js | 62 --------- pc4mobx/hrmSalary/stores/payroll.js | 1 + 10 files changed, 441 insertions(+), 63 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.js create mode 100644 pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.less create mode 100644 pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js create mode 100644 pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailSearchPannel/index.js create mode 100644 pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryMonthHelpfulTip.js create mode 100644 pc4mobx/hrmSalary/pages/payroll/payrollDetail/payrollDetail.js delete mode 100644 pc4mobx/hrmSalary/pages/payroll/payrollDetail/payrollGrantDetail.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index aff0d014..0d936a80 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -24,7 +24,8 @@ import Calculate from "./pages/calculate/calculate"; //重构的薪资核算页 // import Payroll from "./pages/payroll"; import Payroll from "./pages/payrollRelease"; //重构的工资单发放页面 import PayrollGrant from "./pages/payroll/payrollGrant"; -import PayrollDetail from "./pages/payroll/payrollDetail"; +import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail"; +import PayrollDetailDemo from "./pages/payroll/payrollDetail"; // import Declare from "./pages/declare"; import Declare from "./pages/declare/declare"; //重构的个税申报表 import TaxRate from "./pages/taxRate"; @@ -149,6 +150,7 @@ const Routes = ( + diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.js new file mode 100644 index 00000000..82c06533 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.js @@ -0,0 +1,27 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("payrollStore") +@observer +class Index extends Component { + render() { + const { payrollStore: { detailListConditionForm } } = this.props; + return ( +
+ detailListConditionForm.updateFields({ username: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.less new file mode 100644 index 00000000..1a3d7283 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.less @@ -0,0 +1,28 @@ +.advance-search { + display: flex; + align-items: center; + position: relative; + top: -2.5px; + + .wea-advanced-search { + top: 2px; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js new file mode 100644 index 00000000..fc64f6a8 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js @@ -0,0 +1,130 @@ +/* + * + * 查看工资单详情-列表 + * @Author: 黎永顺 + * @Date: 2024/7/15 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { WeaLocaleProvider } from "ecCom"; +import { Spin } from "antd"; +import { WeaTableNew } from "comsMobx"; +import * as API from "../../../../../apis/payroll"; +import { getQueryString } from "../../../../../util/url"; + +const getLabel = WeaLocaleProvider.getLabel; +const WeaTableComx = WeaTableNew.WeaTable; + +@inject("payrollStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, dataSource: [], visible: false, updateSum: true, payload: {}, + pageInfo: { current: 1, pageSize: 10, total: 0 } + }; + } + + componentDidMount() { + window.addEventListener("message", this.handleReceive, false); + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.isQuery !== this.props.isQuery) { + console.log("componentWillReceiveProps", nextProps.isQuery); + } + } + + handleReceive = async ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.getPayrollDetailList(); + } else if (type === "turn") { + switch (id) { + default: + break; + } + } + }; + getPayrollDetailList = () => { + const { pageInfo } = this.state; + const salarySendId = getQueryString("id"); + const { payrollStore: { detailListConditionForm: form, salaryTableStore } } = this.props; + const payload = { + salarySendId, ...pageInfo, ...form.getFormParams(), + departmentIds: form.getFormParams().departmentIds ? form.getFormParams().departmentIds.split(",") : [], + subCompanyIds: form.getFormParams().subCompanyIds ? form.getFormParams().subCompanyIds.split(",") : [] + }; + API.getPayrollDetailList(payload).then(({ status, data }) => { + if (status) { + const { dataKey, pageInfo, datas: dataSource } = data; + const { datas } = dataKey; + const { pageNum: current, pageSize, total } = pageInfo; + salaryTableStore.getDatas(datas); + this.setState({ payload, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } }); + } + }); + }; + getColumns = () => { + const { payrollStore: { salaryTableStore }, showTotalCell } = this.props; + const { dataSource, pageInfo, selectedRowKeys, payload, updateSum } = this.state; + const columns = _.filter(toJS(salaryTableStore.columns), (item) => item.display === "true"); + const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/salaryBill/send/sum" : ""; + if (!_.isEmpty(columns)) { + this.postMessageToChild({ + dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, + sumRowlistUrl, payload: { ...payload, updateSum }, + columns: _.map(columns, (it, idx) => ({ + ...it, width: it.oldWidth, fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "", + ellipsis: true + })) + }); + } + return []; + }; + postMessageToChild = (payload) => { + const i18n = { + "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), + "总计": getLabel(523, "总计") + }; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; + + + render() { + const { payrollStore: { salaryTableStore } } = this.props; + const { loading, pageInfo } = this.state; + const { pageSize, total } = pageInfo; + const columnNum = total > 10 ? pageSize + 1 : total + 1; + return ( +
+ +