diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 8ca9fab7..48fcecb2 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; import { convertToUrlString } from "../util/url"; //工资单-工资单发放列表 @@ -248,3 +248,8 @@ export const genPdfBeforeExport = (params) => { export const salaryBillPreview = (params) => { return postFetch("/api/bs/hrmsalary/salaryBill/preview", params); }; +// 工资单查看详情导出-重构 +export const exportDetailList_reconfig = (params) => { + return postExportFetch("/api/bs/hrmsalary/salaryBill/send/exportDetailList", params); +}; + diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index b5f4f87f..f52953bb 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; //通用字典表 {enumClass:""} export const commonEnumList = (params) => { @@ -75,3 +75,7 @@ export const reportGetForm = params => { export const saveSalarySendFeedback = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveSalarySendFeedback", params); }; +// 数据分析列表导出 +export const exportDataReport = (params) => { + return postExportFetch("/api/bs/hrmsalary/report/statistics/report/exportData", params); +}; diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index d2305b86..cd4380b1 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -24,7 +24,7 @@ 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 Declare from "./pages/declare"; import DeclareDetail from "./pages/declareDetail"; import DeclareOnlineComparison from "./pages/declareOnlineComparison"; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js index 129d9cb7..2380cfae 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js @@ -5,7 +5,7 @@ * Date: 2023/9/25 */ import React, { Component } from "react"; -import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { WeaBrowser, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; import cs from "classnames"; import { Col, Row } from "antd"; import "./index.less"; @@ -13,6 +13,48 @@ import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; class EditSalaryBaseInfo extends Component { + componentWillReceiveProps(nextProps, nextContext) { + if (this.props.visible !== nextProps.visible && nextProps.visible && !_.isEmpty(nextProps.baseInfo)) { + nextProps.onChange(_.map(nextProps.baseInfo, it => { + const { fieldValue, canEdit, fieldValueObj } = it; + if (canEdit) { + const { id: value, name: valueSpan } = fieldValueObj || fieldValue; + return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } }; + } + return { ...it }; + })); + } + } + + renderBrowser = (item) => { + const { fieldType, fieldValue, fieldCode } = item; + const { id: value, name: valueSpan } = fieldValue; + let browserType = {}; + switch (fieldType) { + case "subcompanyBrowser": + browserType = { ...browserType, type: 164, title: getLabel(111, "选择分部") }; + break; + case "departmentBrowser": + browserType = { ...browserType, type: 4, title: getLabel(111, "选择部门") }; + break; + case "jobtitleBrowser": + browserType = { ...browserType, type: 24, title: getLabel(111, "选择岗位") }; + break; + case "jobcallBrowser": + browserType = { ...browserType, type: 260, title: getLabel(111, "选择职称") }; + break; + default: + break; + } + return this.props.onChange(_.map(this.props.baseInfo, it => { + if (fieldCode === it.fieldCode) { + return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } }; + } + return { ...it }; + }))}/>; + }; + render() { const { baseInfo } = this.props; return ( @@ -32,7 +74,7 @@ class EditSalaryBaseInfo extends Component { { _.map(baseInfo, (item, index) => { - const { fieldName, fieldValue } = item; + const { fieldName, fieldType, fieldValue, fieldValueObj } = item; return ( {fieldName} - {fieldValue} + + { + fieldType.indexOf("Browser") !== -1 ? + this.renderBrowser({ ...item, fieldValue: fieldValueObj || fieldValue }) : + fieldValue + } + diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js index 16cacd2c..0943bd38 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js @@ -5,7 +5,7 @@ * Date: 2023/9/25 */ import React, { Component } from "react"; -import { Button, message } from "antd"; +import { Button, message, Modal } from "antd"; import { WeaLocaleProvider, WeaSlideModal, WeaTab } from "ecCom"; import EditSalaryBaseInfo from "./baseInfo"; import PayrollItemsTable from "../../../../calculateDetail/payrollItemsTable"; @@ -87,9 +87,16 @@ class EditSalaryCalcSlide extends Component { }; save = () => { const { id: salaryAcctEmpId } = this.props; - const { issuedAndReissueItems, itemsByGroup } = this.state; + const { issuedAndReissueItems, itemsByGroup, baseInfo } = this.state; + if (_.every(baseInfo, it => !it.canEdit || (it.canEdit && !it.fieldValue))) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } const payload = { - salaryAcctEmpId, + salaryAcctEmpId, employeeInfos: baseInfo, items: [ ..._.reduce(itemsByGroup, (pre, cur) => { return [ @@ -133,7 +140,8 @@ class EditSalaryCalcSlide extends Component { top={0} width={60} height={100} measure={"%"} direction={"right"} title={this.renderTitle()} content={
- + this.setState({ baseInfo })}/> this.setState({ selectedKey: v })} datas={!_.isEmpty(issuedAndReissueItems) ? topTab : topTab.slice(0, 1)} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js index 33a90a08..9d2ddfce 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js @@ -40,7 +40,7 @@ class PayrollItemsTable extends Component { const { canEdit, dataType, pattern } = record; return dataType === "number" ? onChangeIssueReissueValue(record.salaryItemId, value, "itemsByGroup", salarySobItemGroupId)} /> : + 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..3c5e23b5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js @@ -0,0 +1,145 @@ +/* + * + * 查看工资单详情-列表 + * @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) this.setState({ updateSum: true }, () => this.getPayrollDetailList()); + } + + handleReceive = async ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.getPayrollDetailList(); + } else if (type === "turn") { + switch (id) { + case "PAGEINFO": + const { pageNum: current, size: pageSize } = params; + this.setState({ + pageInfo: { ...this.state.pageInfo, current, pageSize }, + updateSum: false + }, () => this.getPayrollDetailList()); + break; + 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(",") : [] + }; + this.setState({ loading: true }); + API.getPayrollDetailList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { dataKey, pageInfo: pageResult, datas: dataSource } = data; + const { datas } = dataKey; + const { pageNum: current, pageSize, total } = pageResult; + 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: pageInfo.total === 0 ? 90 : 156, + 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 }), "*"); + }; + handleSetCustomCols = () => { + const { payrollStore: { salaryTableStore } } = this.props; + this.setState({ updateSum: true }, () => { + salaryTableStore.setColSetVisible(true); + salaryTableStore.tableColSet(true); + }); + }; + + + render() { + const { payrollStore: { salaryTableStore } } = this.props; + const { loading, pageInfo } = this.state; + const { pageSize, total } = pageInfo; + const columnNum = total > 10 ? pageSize + 1 : total + 1; + return ( +
+ +