From cefe6ee46dd996e983cfc457f5f308fe01ecce09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 6 Apr 2023 17:07:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=9B=9B=E4=B8=AA=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=85=A8=E9=83=A8=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=E7=AD=9B=E9=80=89=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E5=B8=A6=E6=9D=A1=E4=BB=B6=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/calculateDetail/index.js | 6 +++--- .../pages/dataAcquisition/cumDeduct/index.js | 4 +++- .../pages/dataAcquisition/cumSituation/index.js | 4 +++- .../pages/dataAcquisition/otherDeduct/index.js | 4 +++- .../dataAcquisition/specialAddDeduction/index.js | 4 +++- pc4mobx/hrmSalary/util/url.js | 15 +++++++++++++++ 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index 668a798e..0f857405 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -4,7 +4,7 @@ import { inject, observer } from "mobx-react"; import SalaryDetail from "./salaryDetail"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom"; -import { getQueryString } from "../../util/url"; +import { convertToUrlString, getQueryString } from "../../util/url"; import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal"; import ProgressModal from "../../components/progressModal"; @@ -172,7 +172,7 @@ export default class CalculateDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", selectedRowKeys: [], queryParams: { - salaryAcctRecordId, + salaryAcctRecordId } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -209,7 +209,7 @@ export default class CalculateDetail extends React.Component { ); } else if (e.key == "3") { window.open( - "/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + this.id + "&ids=" + `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${this.id}&ids=&${convertToUrlString(this.state.searchItemsValue)}` ); } }; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 731b6cc9..3e839bd0 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -19,6 +19,7 @@ import ImportFormCom from "./components/importFormCom"; import TableRecord from "../components/tableRecord"; import { dataCollectCondition, modalColumns } from "./columns"; import { removePropertyCondition } from "../../../util/response"; +import { convertToUrlString } from "../../../util/url"; import Layout from "../layout"; import moment from "moment"; @@ -160,9 +161,10 @@ class Index extends Component { * Date: 2023/2/20 */ handleExportAll = () => { + const { cumDeductStore: { form } } = this.props; const { declareMonth, taxAgentId } = this.state; this.setState({ - exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}` + exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}&${convertToUrlString(form.getFormParams())}` }); }; /* diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index ef5e134b..ea3e56e8 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -28,6 +28,7 @@ import { dataCollectCondition, taxOptions } from "./columns"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { situationModalColumns } from "../cumDeduct/columns"; +import { convertToUrlString } from "../../../util/url"; @inject("taxAgentStore", "cumSituationStore") @observer @@ -277,9 +278,10 @@ class Index extends Component { * Date: 2023/2/20 */ handleExportAll = () => { + const { cumSituationStore: { form } } = this.props; const { declareMonth, taxAgentId, year } = this.state; this.setState({ - exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}` + exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}&${convertToUrlString(form.getFormParams())}` }); }; /* diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index caa24c1f..aafc7674 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -29,6 +29,7 @@ import { dataCollectCondition } from "./columns"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { otherModalColumns } from "../cumDeduct/columns"; +import { convertToUrlString } from "../../../util/url"; @inject("taxAgentStore", "otherDeductStore") @observer @@ -250,9 +251,10 @@ class Index extends Component { * Date: 2023/2/20 */ handleExportAll = () => { + const { otherDeductStore: { form } } = this.props; const { declareMonth, taxAgentId } = this.state; this.setState({ - exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/otherDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}` + exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/otherDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}&${convertToUrlString(form.getFormParams())}` }); }; /* diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index 2629381c..0a33af1d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -21,6 +21,7 @@ import { condition } from "./components/condition"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { specialModalColumns } from "../cumDeduct/columns"; +import { convertToUrlString } from "../../../util/url"; @inject("taxAgentStore", "specialAddStore") @observer @@ -207,9 +208,10 @@ class Index extends Component { * Date: 2023/2/20 */ handleExportAll = () => { + const { specialAddStore: { advanceForm } } = this.props; const { taxAgentId } = this.state; this.setState({ - exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=&taxAgentId=${taxAgentId}` + exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=&taxAgentId=${taxAgentId}&${convertToUrlString(advanceForm.getFormParams())}` }); }; /* diff --git a/pc4mobx/hrmSalary/util/url.js b/pc4mobx/hrmSalary/util/url.js index 0ef96e1b..a69b4f81 100644 --- a/pc4mobx/hrmSalary/util/url.js +++ b/pc4mobx/hrmSalary/util/url.js @@ -22,3 +22,18 @@ export const getQueryString = (variable) => { } return null; }; + +export const convertToUrlString = (data) => { + const _result = []; + for (const key in data) { + const value = data[key]; + if (value.constructor === Array) { + value.forEach(function (_value) { + _result.push(key + "=" + _value); + }); + } else { + _result.push(key + "=" + value); + } + } + return _result.join("&"); +};