From 7c07f6c591b547c15e29d2963e028aef0caeae6a Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Fri, 1 Apr 2022 13:54:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/archive.js | 25 ++++++++++++ pc4mobx/hrmSalary/pages/salaryFile/index.js | 35 +++++++++++++---- .../socialSecurityBenefits/programme/index.js | 3 +- pc4mobx/hrmSalary/stores/salaryFile.js | 39 ++++++++++++++++++- 4 files changed, 92 insertions(+), 10 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/archive.js b/pc4mobx/hrmSalary/apis/archive.js index 39444557..c02e8e68 100644 --- a/pc4mobx/hrmSalary/apis/archive.js +++ b/pc4mobx/hrmSalary/apis/archive.js @@ -135,3 +135,28 @@ export const importPreview = (params) => { body: JSON.stringify(params) }).then(res => res.json()) } + +// 导入档案 +export const importSalaryArchive = (params) => { + return fetch('/api/bs/hrmsalary/salaryArchive/importSalaryArchive', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }).then(res => res.json()) +} + +// 导出档案 +export const exportSalaryArchive = (ids = "") => { + fetch('/api/bs/hrmsalary/salaryArchive/exportList?ids=' + ids).then(res => res.blob().then(blob => { + var filename=`薪资档案.xlsx` + var a = document.createElement('a'); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })) +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index 06341d88..26028179 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.js @@ -73,11 +73,30 @@ export default class SalaryFile extends React.Component { importPreview(params) } + // 导入档案 + handleImportFile(params) { + const { salaryFileStore: {importSalaryArchive}} = this.props; + params.importType = this.state.importType + importSalaryArchive(params) + } + + + // 导入完成按钮操作 + handleImportFinish() { + this.setState({modalVisiable: false, step: 0}) + } + + // 导出全部 + handleExportAll() { + const { salaryFileStore: {exportSalaryArchive}} = this.props; + exportSalaryArchive(); + } + render() { const { salaryFileStore } = this.props; const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = salaryFileStore; - const { importType } = salaryFileStore; + const { importType, previewColumns, previewDataSource } = salaryFileStore; const { selectedTab, step } = this.state; if (!hasRight && !loading) { // 无权限处理 return renderNoright(); @@ -105,7 +124,7 @@ export default class SalaryFile extends React.Component { ]; const topTab = [ - ]; + ]; const renderSearchOperationItem = () => { return
@@ -133,7 +152,7 @@ export default class SalaryFile extends React.Component { const menu2 = ( ); @@ -153,7 +172,7 @@ export default class SalaryFile extends React.Component { placement="topLeft" />