From 03d282f0f3f1cbe07569f0d3a879f52718e93b8e 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, 9 Jan 2023 16:30:26 +0800
Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E8=B5=84=E8=B4=A6=E5=A5=97=E5=85=B3?=
=?UTF-8?q?=E8=81=94=E4=BA=BA=E5=91=98=E6=B7=BB=E5=8A=A0=E5=AF=BC=E5=85=A5?=
=?UTF-8?q?=E4=BA=BA=E5=91=98=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/apis/ledger.js | 8 ++
.../components/ledgerAssociatedPersonnel.js | 102 +++++++++++++++++-
pc4mobx/hrmSalary/pages/taxAgent/columns.js | 64 +++++++----
.../pages/taxAgent/slideTaxagentUser.js | 23 +---
4 files changed, 155 insertions(+), 42 deletions(-)
diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js
index 254c4643..6e7a3f17 100644
--- a/pc4mobx/hrmSalary/apis/ledger.js
+++ b/pc4mobx/hrmSalary/apis/ledger.js
@@ -282,3 +282,11 @@ export const getBackitemForm = params => {
export const salarysobBackitemSave = params => {
return postFetch("/api/bs/hrmsalary/salarysob/backitem/save", params);
};
+//预览人员范围导入
+export const salarysobRangePreview = params => {
+ return postFetch("/api/bs/hrmsalary/salarysob/range/preview", params);
+};
+//导入人员范围
+export const salarysobRangeImportData = params => {
+ return postFetch("/api/bs/hrmsalary/salarysob/range/importData", params);
+};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
index f77d31fa..55c61acd 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
@@ -6,7 +6,7 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
-import { message, Modal } from "antd";
+import { Button, message, Modal } from "antd";
import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom";
import PersonalScopeTable from "../../../components/PersonalScopeTable";
import PersonalScopeModal from "../../../components/PersonalScopeModal";
@@ -14,8 +14,13 @@ import {
deleteLedgerPersonRange,
getLedgerPersonRangeExclude,
getLedgerPersonRangeInclude,
+ salarysobRangeImportData,
+ salarysobRangePreview,
saveLedgerPersonRange
} from "../../../apis/ledger";
+import ImportModal from "../../../components/importModal";
+import { importEmployColumns } from "../../taxAgent/columns";
+
const APIFox = {
listInclude: getLedgerPersonRangeInclude,
@@ -34,6 +39,12 @@ class LedgerAssociatedPersonnel extends Component {
searchValue: "",
selectedKey: "listInclude",
rowKeys: [],
+ previewDataSource: [],
+ importParams: {
+ visible: false,
+ step: 0,
+ importResult: {}
+ },
personalAddModal: {
visible: false,
title: "关联人员",
@@ -82,9 +93,55 @@ class LedgerAssociatedPersonnel extends Component {
}
});
};
+ /*
+ * Author: 黎永顺
+ * Description:清空导入弹框列表数据
+ * Params:
+ * Date: 2023/1/9
+ */
+ handleInitModal = () => {
+ this.setState({
+ previewDataSource: [],
+ importParams: {
+ ...this.state.importParams,
+ importResult: {}
+ }
+ });
+ };
+ handleImportFile = (params) => {
+ const { editId: salarySobId } = this.props;
+ salarysobRangeImportData({ ...params, salarySobId }).then(({ status, data }) => {
+ if (status) {
+ data.errorData = data.errorNotice;
+ this.setState({
+ importParams: {
+ ...this.state.importParams,
+ importResult: data
+ }
+ });
+ }
+ });
+ };
+ salarysobRangePreview = (params) => {
+ salarysobRangePreview(params).then(({ status, data }) => {
+ if (status) {
+ const { preview } = data;
+ this.setState({
+ previewDataSource: preview
+ });
+ }
+ });
+ };
render() {
- const { selectedKey, searchValue, rowKeys, personalAddModal } = this.state;
+ const {
+ selectedKey,
+ searchValue,
+ rowKeys,
+ personalAddModal,
+ importParams,
+ previewDataSource
+ } = this.state;
const { taxAgentStore: { showOperateBtn }, editId, saveSalarySobId } = this.props;
const topTab = [
{
@@ -97,6 +154,14 @@ class LedgerAssociatedPersonnel extends Component {
}
];
const btns = showOperateBtn ? [
+ ,
this.setState({ selectedKey })}
/>
this.setState({ rowKeys })}
/>
+ {/*关联人员范围导入*/}
+ {importParams.visible && (
+ {
+ this.handleInitModal();
+ }}
+ isInit={false}
+ columns={importEmployColumns}
+ slideDataSource={previewDataSource}
+ step={importParams.step}
+ setStep={(step) => {
+ this.setState({ importParams: { ...this.state.importParams, step } });
+ }}
+ importResult={importParams.importResult}
+ onFinish={() => {
+ this.setState({
+ importParams: {
+ ...this.state.importParams,
+ visible: false
+ }
+ }, () => this.personalScopeTableRef.getPersonalScopeList());
+ }}
+ previewImport={(params) => this.salarysobRangePreview(params)}
+ importFile={(params) => this.handleImportFile(params)}
+ templateLink={`/api/bs/hrmsalary/salarysob/range/downloadTemplate?salarySobId=${editId}`}
+ visiable={importParams.visible}
+ onCancel={() => {
+ this.setState({ importParams: { ...this.state.importParams, visible: false } });
+ }}
+ />
+ )}
{/*新增人员范围*/}
{
taxAgentRangePreview(params).then(({ status, data }) => {
if (status) {
- const { headers, list } = data;
+ const { preview } = data;
this.setState({
- previewColumns: headers.map((item, index) => {
- return {
- key: index,
- title: item,
- dataIndex: index
- };
- }),
- previewDataSource: list.map(item => {
- let result = {};
- item.map((i, index) => {
- result[index] = i;
- });
- return result;
- })
+ previewDataSource: preview
});
}
});
@@ -121,7 +109,6 @@ export default class SlideTaxagentUser extends React.Component {
searchValue,
addTaxagentModalVisible,
importParams,
- previewColumns,
previewDataSource
} = this.state;
const {
@@ -279,7 +266,7 @@ export default class SlideTaxagentUser extends React.Component {
this.handleInitModal();
}}
isInit={false}
- columns={previewColumns}
+ columns={importEmployColumns}
slideDataSource={previewDataSource}
step={importParams.step}
setStep={(step) => {