花名册功能
This commit is contained in:
parent
9560631638
commit
a88de27c35
|
|
@ -14,4 +14,16 @@ export const getPersonnelResume = (params) => {
|
|||
|
||||
export const getAdvanceSearchCondition = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/personnelresume/personnelScreening', 'GET', params);
|
||||
}
|
||||
|
||||
export const downloadPerResume = (type) => {
|
||||
fetch(`/api/bs/hrmorganization/personnelresume/downloadPerResume?type=${type}`).then(res => res.blob().then(blob => {
|
||||
var filename= type == 0 ? `人员简历合并导出.docx` : `全部简历.zip`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
|
|
@ -193,6 +193,7 @@ export default class PersonnelResume extends React.Component {
|
|||
this[item.menuFun] && this[item.menuFun]();
|
||||
}
|
||||
|
||||
//模板修改
|
||||
handleChange(value) {
|
||||
|
||||
}
|
||||
|
|
@ -268,6 +269,22 @@ export default class PersonnelResume extends React.Component {
|
|||
})
|
||||
}
|
||||
|
||||
//合并导出
|
||||
MergeExport() {
|
||||
const {
|
||||
personnelResume
|
||||
} = this.props;
|
||||
personnelResume.downloadPerResume(0);
|
||||
}
|
||||
|
||||
//全部导出
|
||||
AllExport() {
|
||||
const {
|
||||
personnelResume
|
||||
} = this.props;
|
||||
personnelResume.downloadPerResume(1);
|
||||
}
|
||||
|
||||
isEmptyObject(obj) {
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
|
|
@ -413,7 +430,7 @@ export default class PersonnelResume extends React.Component {
|
|||
form={form}
|
||||
isFormInit={form.isFormInit}
|
||||
loading={dialogLoading}
|
||||
height={200}
|
||||
height={120}
|
||||
conditionLen={1}
|
||||
search={() => this.onSelect()}
|
||||
onCancel={() => personnelResume.show = ! show}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
import {
|
||||
observer
|
||||
} from 'mobx-react';
|
||||
import {
|
||||
WeaDialog,
|
||||
} from 'ecCom';
|
||||
|
||||
@observer
|
||||
export default class SearchCustomDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
DIALOG,
|
||||
dialog
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<WeaDialog
|
||||
{...DIALOG}
|
||||
{...dialog}
|
||||
>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -11,7 +11,8 @@ import {
|
|||
WeaRightMenu,
|
||||
WeaLeftRightLayout,
|
||||
WeaOrgTree,
|
||||
WeaDropdown
|
||||
WeaDropdown,
|
||||
WeaSelect
|
||||
} from 'ecCom'
|
||||
import {
|
||||
Row,
|
||||
|
|
@ -21,6 +22,7 @@ import {
|
|||
Button,
|
||||
message,
|
||||
Switch,
|
||||
Select,
|
||||
Menu, Dropdown, Icon
|
||||
} from 'antd'
|
||||
import {
|
||||
|
|
@ -36,6 +38,7 @@ import '../../style/common.less';
|
|||
import NewAndEditDialog from '../NewAndEditDialog';
|
||||
import { renderNoright } from '../../util';
|
||||
import DatasImport from '../import/datasImport';
|
||||
import SearchCustomDialog from './SearchCustomDialog';
|
||||
|
||||
|
||||
|
||||
|
|
@ -74,14 +77,14 @@ export default class Resource extends React.Component {
|
|||
resource
|
||||
} = this.props;
|
||||
resource.getHasRight();
|
||||
let {hash} = window.location;
|
||||
let { hash } = window.location;
|
||||
hash = hash.split("?")[1].split("&");
|
||||
if(hash.length >= 2) {
|
||||
if (hash.length >= 2) {
|
||||
let params = {};
|
||||
let arr = hash[0].split("=");
|
||||
let arr = hash[0].split("=");
|
||||
params[arr[0]] = arr[1];
|
||||
resource.doSearch(params);
|
||||
}else {
|
||||
} else {
|
||||
resource.getTableInfo();
|
||||
}
|
||||
}
|
||||
|
|
@ -189,11 +192,11 @@ export default class Resource extends React.Component {
|
|||
if (key == "1") {
|
||||
resource.export();
|
||||
}
|
||||
if(key == "2") {
|
||||
if (key == "2") {
|
||||
tableStore.selectedRowKeys.length > 0 ? resource.export() : message.error("请选择需要导出的数据")
|
||||
}
|
||||
}}
|
||||
menuOnClick={(key, e) => key == '1' ? tableStore.selectedRowKeys = []: ''}
|
||||
menuOnClick={(key, e) => key == '1' ? tableStore.selectedRowKeys = [] : ''}
|
||||
/>)
|
||||
|
||||
return btns;
|
||||
|
|
@ -228,7 +231,7 @@ export default class Resource extends React.Component {
|
|||
// resource.setIsNew(true);
|
||||
// resource.setVisible(true);
|
||||
// resource.getForm();
|
||||
window.open("/spa/hrm/index_mobx.html#/main/hrm/add","_blank")
|
||||
window.open("/spa/hrm/index_mobx.html#/main/hrm/add", "_blank")
|
||||
}
|
||||
|
||||
import() {
|
||||
|
|
@ -286,7 +289,9 @@ export default class Resource extends React.Component {
|
|||
|
||||
const btn = [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { resource.getTableInfo(); resource.setPanelStatus(false) }}>{i18n.button.search()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} onClick={() => form2.reset()}>{i18n.button.reset()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} type="primary" onClick={() => resource.openSearchDialog()}>{i18n.button.saveTemplate()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju7`} type="primary" onClick={() => resource.openSearchDialog()}>{i18n.button.conditionSet()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju8`} onClick={() => form2.reset()}>{i18n.button.reset()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5u9mfz`} onClick={() => resource.setPanelStatus(false)}>{i18n.button.cancel()}</Button>),
|
||||
];
|
||||
|
||||
|
|
@ -372,7 +377,8 @@ export default class Resource extends React.Component {
|
|||
!isNew && resource.edit();
|
||||
}
|
||||
|
||||
handleSaveAndSetting() {
|
||||
//高级搜索模板修改
|
||||
handleTemplateChange() {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -392,6 +398,32 @@ export default class Resource extends React.Component {
|
|||
isFormInit
|
||||
} = form2;
|
||||
|
||||
const options002 = [
|
||||
{
|
||||
key: "1",
|
||||
selected: true,
|
||||
showname: "简单模板"
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
selected: false,
|
||||
showname: "复杂模板"
|
||||
}
|
||||
];
|
||||
arr.push(<Row style={{ marginTop: 20 }}>
|
||||
<Col offset={1} span={2}><span style={{"lineHeight":"30px","color":"red"}}>选择过滤模板</span></Col>
|
||||
<Col span={6} offset={1}>
|
||||
<WeaSelect
|
||||
style={{width:"100%"}}
|
||||
options={options002}
|
||||
onChange={v => {
|
||||
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col offset={1} span={2}><Button onClick={() => console.log(11)}>删除模板</Button></Col>
|
||||
</Row>)
|
||||
|
||||
isFormInit && searchCondition.map(c => {
|
||||
c.items.map((field, index) => {
|
||||
arr.push(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} span={(index % 2 == 0) ? 10 : 11} offset={1}>
|
||||
|
|
@ -439,7 +471,7 @@ export default class Resource extends React.Component {
|
|||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, lastName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
||||
form, dialogLoading, isEdit, date, hasRight, defaultShowLeft
|
||||
form, dialogLoading, isEdit, date, hasRight, defaultShowLeft,SEARCHDIALOG,searchDialog
|
||||
} = resource;
|
||||
|
||||
if (hasRight === false) {
|
||||
|
|
@ -499,9 +531,12 @@ export default class Resource extends React.Component {
|
|||
conditionLen={2}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => resource.setVisible(false)}
|
||||
// saveAndSetting={() => this.handleSaveAndSetting()}
|
||||
/>
|
||||
<DatasImport ecId={`${this && this.props && this.props.ecId || ''}_DatasImport@q4rrwm`} />
|
||||
<SearchCustomDialog ecId={`${this && this.props && this.props.ecId || ''}_SearchCustomDialog@q4rrwm`}
|
||||
DIALOG={SEARCHDIALOG}
|
||||
dialog={searchDialog}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -875,6 +875,8 @@ export const i18n = {
|
|||
editTypeInfo: () => getLabel(32732, '编辑类型'),
|
||||
nextStep:() => getLabel(30131, '下一步'),
|
||||
version:() => getLabel(30131, '查看历史版本'),
|
||||
saveTemplate:() => getLabel(30131, '存为模板'),
|
||||
conditionSet:() => getLabel(30131, '常用条件定制'),
|
||||
|
||||
batchOpen: () => getLabel(534249, '批量解锁'),
|
||||
collect: () => getLabel(28111, '收藏'),
|
||||
|
|
|
|||
|
|
@ -305,6 +305,10 @@ export class PersonnelResumeStore {
|
|||
})
|
||||
}
|
||||
|
||||
@action("合并导出和全部导出") downloadPerResume(type) {
|
||||
Api.downloadPerResume(type);
|
||||
}
|
||||
|
||||
|
||||
setCondition(condition) {
|
||||
this.condition = condition;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import {
|
|||
import {
|
||||
Modal,
|
||||
message,
|
||||
Button
|
||||
} from 'antd'
|
||||
import {
|
||||
i18n
|
||||
|
|
@ -53,7 +54,7 @@ const {
|
|||
@observable selectTreeNodeInfo;
|
||||
|
||||
|
||||
@action getTableInfo() {
|
||||
@action("列表") getTableInfo() {
|
||||
let params;
|
||||
this.tableStore = new TableStore();
|
||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||
|
|
@ -83,7 +84,7 @@ const {
|
|||
this.getTableInfo();
|
||||
}
|
||||
|
||||
save() {
|
||||
@action("保存") save() {
|
||||
let params = {
|
||||
...this.form.getFormParams()
|
||||
};
|
||||
|
|
@ -109,7 +110,7 @@ const {
|
|||
});
|
||||
}
|
||||
|
||||
getForm() {
|
||||
@action("新增表单") getForm() {
|
||||
let params = this.isNew ? {} : {
|
||||
id: this.userId
|
||||
}
|
||||
|
|
@ -129,7 +130,7 @@ const {
|
|||
|
||||
}
|
||||
|
||||
getSearchCondition() {
|
||||
@action("高级搜索表单") getSearchCondition() {
|
||||
this.setScLoadingStatus(false);
|
||||
Api.getAdvanceSearchCondition().then(res => {
|
||||
if (res.code === 200) {
|
||||
|
|
@ -145,7 +146,7 @@ const {
|
|||
}
|
||||
|
||||
|
||||
@action getHasRight() {
|
||||
@action("顶部按钮") getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setHasRight(res.data.hasRight);
|
||||
|
|
@ -159,7 +160,7 @@ const {
|
|||
})
|
||||
}
|
||||
|
||||
@action export(){
|
||||
@action("导出") export(){
|
||||
const params = {
|
||||
...this.form.getFormParams()
|
||||
}
|
||||
|
|
@ -177,7 +178,46 @@ const {
|
|||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** ================================================================= */
|
||||
@observable searchDialog = {
|
||||
visible: false,
|
||||
title: '常用条件定制',
|
||||
}
|
||||
|
||||
SEARCHDIALOG = {
|
||||
hasScroll: false,
|
||||
icon: 'icon-coms-hrm',
|
||||
iconBgcolor: '#217346',
|
||||
onCancel: () => this.closeSearchDialog(),
|
||||
style: {
|
||||
width: 700,
|
||||
height: 450
|
||||
},
|
||||
moreBtn: {
|
||||
datas: []
|
||||
},
|
||||
buttons: [<Button type='primary' onClick={()=>this.saveHrmSearchUserDefine()}>保存</Button>],
|
||||
}
|
||||
|
||||
@action("常用条件定制保存") saveHrmSearchUserDefine = () => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@action openSearchDialog = () => {
|
||||
this.searchDialog.visible = true;
|
||||
}
|
||||
|
||||
@action closeSearchDialog = () => {
|
||||
this.searchDialog.visible = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
updateFields(val) {
|
||||
this.form2.updateFields({
|
||||
|
|
|
|||
Loading…
Reference in New Issue