Merge pull request '编制信息导出' (#53) from feature/cl into dev
Reviewed-on: http://221.226.25.34:3000/liang.cheng/trunk/pulls/53
This commit is contained in:
commit
6c5eb74743
|
|
@ -1,7 +1,9 @@
|
|||
|
||||
import {
|
||||
WeaTools
|
||||
WeaTools,
|
||||
WeaLocaleProvider
|
||||
} from 'ecCom'
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
export const getSearchList = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/staff/getTable', 'GET', params);
|
||||
|
|
@ -50,4 +52,19 @@ export const getForm = (params) => {
|
|||
|
||||
export const getHasRight = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/staff/getHasRight', 'GET', params);
|
||||
}
|
||||
|
||||
export const exportData = (planId) => {
|
||||
return new Promise(resolve => {
|
||||
fetch(`/api/bs/hrmorganization/common/staff/export?planId=${planId}`).then(res => res.blob().then(blob => {
|
||||
resolve();
|
||||
var filename=`${getLabel(547733,'编制信息档案')}.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
});
|
||||
}
|
||||
|
|
@ -131,6 +131,14 @@ export default class Staff extends React.Component {
|
|||
}
|
||||
|
||||
|
||||
exportStaff() {
|
||||
const {
|
||||
staff
|
||||
} = this.props;
|
||||
staff.exportData();
|
||||
}
|
||||
|
||||
|
||||
log = () => {
|
||||
window.setLogViewProp({
|
||||
logMoudleType: 13,
|
||||
|
|
@ -488,7 +496,7 @@ export default class Staff extends React.Component {
|
|||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, staffName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
||||
form, dialogLoading, isEdit, date, hasRight
|
||||
form, dialogLoading, isEdit, date, hasRight,exSpinning
|
||||
} = staff;
|
||||
const {importVisible} = importDialog;
|
||||
|
||||
|
|
@ -528,7 +536,7 @@ export default class Staff extends React.Component {
|
|||
onSearchChange={val => this.onSearchChange(val)}
|
||||
replaceLeft={this.replaceLeft()}
|
||||
/>
|
||||
|
||||
<Spin size="large" spinning={exSpinning} tip={getLabel(547647,'正在导出请稍候....')} className="hrm-loading-center-small"/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
|
|
|
|||
|
|
@ -1064,7 +1064,7 @@ export const i18n = {
|
|||
checkOnDetach: () => getLabel(547620, '确定启用组织管理分权吗'),
|
||||
checkOffDetach: () => getLabel(547621, '确定取消组织管理分权吗'),
|
||||
checkResume: () => getLabel(547657, '简历模板加载失败'),
|
||||
|
||||
checkStaff: () => getLabel(547734, '请选择编制方案后导出数据'),
|
||||
|
||||
authFailed: () => getLabel(2012, '对不起,您暂时没有权限!'),
|
||||
actionError: () => getLabel(132200, '操作失败!'),
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ export class StaffStore {
|
|||
@observable date = '';
|
||||
@observable hasRight = '';
|
||||
@observable operateType = ''; //1 编辑 2 变更
|
||||
@observable exSpinning = false;
|
||||
@observable companysId = 1;
|
||||
|
||||
@observable planId = '';
|
||||
|
|
@ -86,6 +87,15 @@ export class StaffStore {
|
|||
|
||||
}
|
||||
|
||||
@action("导出") async exportData() {
|
||||
if(this.planId.length == 0) {
|
||||
return message.warning(i18n.message.checkStaff())
|
||||
}
|
||||
this.exSpinning = true;
|
||||
await Api.exportData(this.planId);
|
||||
this.exSpinning = false;
|
||||
}
|
||||
|
||||
//删除
|
||||
delete() {
|
||||
let params = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue