From 6e5eec06fe82e19f0192cf5b2e9f55be02c25040 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 22 Sep 2023 10:41:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/department.js | 13 +++++++ .../components/department/department.js | 38 +++++++++++-------- pc4mobx/organization/stores/department.js | 7 ++++ 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/pc4mobx/organization/apis/department.js b/pc4mobx/organization/apis/department.js index 3a0f813..ca1407c 100644 --- a/pc4mobx/organization/apis/department.js +++ b/pc4mobx/organization/apis/department.js @@ -45,6 +45,19 @@ export const version = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/save', 'POST', params); } + +export const exportData = (ids) => { + fetch('/api/bs/hrmorganization/common/department/export').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); + })) +} + export const selectVersions = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/getVersion', 'GET', params); } diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index 2895141..8941a94 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2023-07-26 18:46:24 + * @LastEditTime: 2023-09-21 18:55:33 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -130,7 +130,15 @@ export default class Department extends React.Component { department.setNeDialogTitle(i18n.label.newDept()); department.setNewVisible(true); department.getDeptForm(); + } + export() { + const { + department + } = this.props; + + department.exportData(); + } //联查岗位 @@ -385,33 +393,33 @@ export default class Department extends React.Component { { - _this.view(record.id) -}}>查看 + _this.view(record.id) + }}>查看 { - _this.doDel(record.id) -}}>删除 + _this.doDel(record.id) + }}>删除 { - _this.merge(record.id) -}}>合并 + _this.merge(record.id) + }}>合并 { - _this.transfer(record.id) -}}>转移 + _this.transfer(record.id) + }}>转移 { - _this.select(record.id) -}}>联查岗位 + _this.select(record.id) + }}>联查岗位 { - _this.copy(record.id) -}}>复制 + _this.copy(record.id) + }}>复制 {/* { _this.version(record) }}>另存为版本 @@ -472,8 +480,8 @@ export default class Department extends React.Component { const btn = [ (), + department.setCurrent(1); department.setPageSize(10); department.getTableInfo(); department.setPanelStatus(false) + }}>{i18n.button.search()}), (), (), ]; diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 0c0b368..b1ad814 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -386,6 +386,13 @@ export class DepartmentStore { }) } + @action("全部导出") exportData() { + Api.exportData().then(res => { + }, error => { + message.warning(error.msg); + }) + } + updateFields(val) { this.form.updateFields({