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/pages/payroll/payrollDetail/payrollDetail.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/payrollDetail.js index 835d6f2b..a0c9e495 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/payrollDetail.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/payrollDetail.js @@ -9,7 +9,8 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { toJS } from "mobx"; +import { WeaLoadingGlobal, WeaLocaleProvider, WeaTop } from "ecCom"; import { Button } from "antd"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SalaryMonthHelpfulTip from "./components/salaryMonthHelpfulTip"; @@ -50,14 +51,16 @@ class PayrollDetail extends Component { } handleExportAll = () => { + const { payrollStore: { salaryTableStore } } = this.props; + const columns = _.filter(toJS(salaryTableStore.columns), (item) => item.display === "true"); + WeaLoadingGlobal.start(); const salarySendId = getQueryString("id"); - const url = `${window.location.origin}/api/bs/hrmsalary/salaryBill/send/exportDetailList?salarySendId=${salarySendId}`; - window.open(url, "_blank"); + const promise = API.exportDetailList_reconfig({ salarySendId, columns: _.map(columns, it => it.dataIndex) }); }; render() { const { salarySendDetailBaseInfo, showSearchAd, conditions, isQuery, showTotalCell } = this.state; - const { taxAgentStore: { showOperateBtn }, payrollStore: { salaryTableStore } } = this.props; + const { taxAgentStore: { showOperateBtn } } = this.props; const { salaryMonth, template } = salarySendDetailBaseInfo; const dropMenuDatas = [ {