diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index d68e965d..5f2b86ee 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -86,6 +86,14 @@ export const getTaxAgentRangeListExclude = (params) => { export const getTaxAgentRangeForm = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/range/getForm", params); }; +//预览个税扣缴义务人中人员范围 +export const taxAgentRangePreview = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/preview", params); +}; +//导入个税扣缴义务人中人员范围 +export const taxAgentRangeImportData = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/importData", params); +}; //个税扣缴义务人下拉列表 export const getTaxAgentSelectList = (params) => { diff --git a/pc4mobx/hrmSalary/pages/taxAgent/editModal.js b/pc4mobx/hrmSalary/pages/taxAgent/editModal.js index 3b46493e..478776d9 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/editModal.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/editModal.js @@ -65,6 +65,7 @@ export default class EditModal extends React.Component { labelCol={{ span: `${field.labelcol}` }} error={devolutionStatus === 1 ? form.getError(field) : formDecentralization.getError(field)} tipPosition="bottom" + underline wrapperCol={{ span: `${field.fieldcol}` }}> (this.tagAgentRef = dom)} + {...this.props} dataSource={dataSource} columns={columns} pageObj={pageObj} diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index 7dfc9ad1..cda37b1a 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -2,6 +2,8 @@ import React from "react"; import { Button, message } from "antd"; import { WeaInputSearch, WeaTable } from "ecCom"; import AddTaxAgentModal from "./addTaxAgentModal"; +import ImportModal from "../../components/importModal"; +import { taxAgentRangeImportData, taxAgentRangePreview } from "../../apis/taxAgent"; export default class SlideTaxagentUser extends React.Component { constructor(props) { @@ -10,7 +12,14 @@ export default class SlideTaxagentUser extends React.Component { addTaxagentModalVisible: false, includeType: 1, selectedRowKeys: [], - searchValue: "" + searchValue: "", + previewColumns: [], + previewDataSource: [], + importParams: { + visible: false, + step: 0, + importResult: {} + } }; } @@ -56,13 +65,64 @@ export default class SlideTaxagentUser extends React.Component { this.addTaxRef.handleReset(); }); }; + handleInitModal = () => { + // 清空导入弹框列表数据 + this.setState({ + previewDataSource: [], + importParams: { + ...this.state.importParams, + importResult: {} + } + }); + }; + // 导入档案 + handleImportFile = (params) => { + const { taxAgentId } = this.props; + taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, data }) => { + if (status) { + data.errorData = data.errorNotice; + this.setState({ + importParams: { + ...this.state.importParams, + importResult: data + } + }); + } + }); + }; + salaryArchivePreview = (params) => { + taxAgentRangePreview(params).then(({ status, data }) => { + if (status) { + const { headers, list } = 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; + }) + }); + } + }); + }; render() { const { includeType, selectedRowKeys, searchValue, - addTaxagentModalVisible + addTaxagentModalVisible, + importParams, + previewColumns, + previewDataSource } = this.state; const { submitLoading, @@ -75,7 +135,9 @@ export default class SlideTaxagentUser extends React.Component { targetTypeList, onTaxAgentSave, hideIconInTax, - showSalaryItemBtn + showSalaryItemBtn, + onTaxAngetSearch, + taxAgentId } = this.props; const rowSelection = { @@ -149,19 +211,30 @@ export default class SlideTaxagentUser extends React.Component { float: "left" }}> { - (hideIconInTax || showSalaryItemBtn) && - - - + (hideIconInTax || showSalaryItemBtn) &&
+ { + includeType == "1" && + + } +
+ + +
+
} + {importParams.visible && ( + { + this.handleInitModal(); + }} + isInit={false} + columns={previewColumns} + 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 + } + }, () => { + onTaxAngetSearch({ + tab: includeType, + targetName: searchValue + }); + }); + }} + previewImport={(params) => this.salaryArchivePreview(params)} + importFile={(params) => this.handleImportFile(params)} + templateLink={`/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${taxAgentId}`} + visiable={importParams.visible} + onCancel={() => { + this.setState({ importParams: { ...this.state.importParams, visible: false } }); + }} + /> + )} ); }