岗位剩余接口对接
This commit is contained in:
parent
24d9f3bc9e
commit
064c40d299
|
|
@ -4,8 +4,7 @@ import {
|
|||
} from 'ecCom'
|
||||
|
||||
export const getSearchList = (params) => {
|
||||
//return WeaTools.callApi('/api/bs/hrmorganization/comp/listComp', 'POST', params);
|
||||
return fetch('/api/bs/hrmorganization/comp/listComp', {
|
||||
return fetch('/api/bs/hrmorganization/job/listPage', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
|
|
@ -15,20 +14,8 @@ export const getSearchList = (params) => {
|
|||
})
|
||||
}
|
||||
|
||||
export const getDeptListByPid = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/dept/getDeptListByPid', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const deleteTableData = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/comp/deleteByIds', {
|
||||
return fetch('/api/bs/hrmorganization/job/deleteByIds', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
|
|
@ -39,11 +26,30 @@ export const deleteTableData = (params) => {
|
|||
}
|
||||
|
||||
export const getAdvanceSearchCondition = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/comp/getSearchCondition', 'GET', params);
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/job/getSearchCondition', 'GET', params);
|
||||
}
|
||||
|
||||
export const getHrmListByJobId = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/job/getHrmListByJobId', 'GET', params);
|
||||
}
|
||||
|
||||
export const getCopyForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/job/getCopyForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const add = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/comp/saveBaseComp', {
|
||||
return fetch('/api/bs/hrmorganization/job/saveBaseForm', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const copy = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/job/copyJobItem', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
|
|
@ -54,19 +60,11 @@ export const add = (params) => {
|
|||
}
|
||||
|
||||
export const editResource = (params) => {
|
||||
// return fetch('/api/bs/hrmorganization/comp/updateComp', {
|
||||
// method: 'POST',
|
||||
// mode: 'cors',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json'
|
||||
// },
|
||||
// body: JSON.stringify(params)
|
||||
// })
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/comp/updateComp', 'POST', params);
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/job/updateForm', 'POST', params);
|
||||
}
|
||||
|
||||
export const updateForbiddenTag = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/comp/updateForbiddenTagById', {
|
||||
return fetch('/api/bs/hrmorganization/job/updateForbiddenTagById', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
|
|
@ -76,16 +74,16 @@ export const updateForbiddenTag = (params) => {
|
|||
})
|
||||
}
|
||||
|
||||
export const getCompanyForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompSaveForm', 'GET', params);
|
||||
export const getJobForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/job/getSaveForm', 'GET', params);
|
||||
}
|
||||
|
||||
|
||||
export const getCompanyExtendForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompBaseForm', 'GET', params);
|
||||
export const getJobExtendForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/job/getJobBaseForm', 'GET', params);
|
||||
}
|
||||
|
||||
|
||||
export const getHasRight = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/comp/getHasRight', 'GET', params);
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/job/getHasRight', 'GET', params);
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
import {
|
||||
WeaNewScroll,
|
||||
WeaSearchGroup,
|
||||
WeaMoreButton,
|
||||
WeaTable
|
||||
} from 'ecCom'
|
||||
|
||||
import {
|
||||
Spin,
|
||||
Button,
|
||||
Pagination
|
||||
} from 'antd'
|
||||
|
||||
import {
|
||||
WeaSwitch
|
||||
} from 'comsMobx'
|
||||
|
||||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
|
||||
import '../style/common.less';
|
||||
|
||||
|
||||
export default class NewWeaTable extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const {
|
||||
dataSource,
|
||||
columns,
|
||||
rowSelection,
|
||||
loading,
|
||||
indentSize
|
||||
} = this.props
|
||||
|
||||
const pagination = {
|
||||
total: dataSource.length,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
},
|
||||
onChange(current) {
|
||||
},
|
||||
showTotal(total){
|
||||
return `共 ${total} 条`
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
loading ? <div className='hrm-new-weatable-spin'>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={loading}></Spin>
|
||||
</div> :
|
||||
<WeaTable rowKey={record => record.id}
|
||||
dataSource={dataSource} childrenColumnName="children"
|
||||
columns={columns}
|
||||
rowSelection={rowSelection}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
indentSize={indentSize}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
import {
|
||||
WeaNewScroll,
|
||||
WeaSearchGroup,
|
||||
WeaMoreButton,
|
||||
WeaDialog
|
||||
} from 'ecCom'
|
||||
|
||||
import {
|
||||
Spin,
|
||||
Button,
|
||||
Pagination
|
||||
} from 'antd'
|
||||
|
||||
import {
|
||||
WeaSwitch,
|
||||
WeaTableNew
|
||||
} from 'comsMobx'
|
||||
|
||||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
|
||||
import '../style/common.less';
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
export default class NewWeaTableDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
width: 800,
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
title,
|
||||
visible,
|
||||
onCancel,
|
||||
height,
|
||||
tableStore
|
||||
} = this.props, {
|
||||
width,
|
||||
} = this.state;
|
||||
|
||||
const buttons = [
|
||||
//(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jd6baw`} type="primary" onClick={() => save()} disabled={loading}>{i18n.button.save()}</Button>),
|
||||
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@e4f4n1`} />)
|
||||
];
|
||||
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1txk5f`}
|
||||
title={title}
|
||||
icon="icon-coms-hrm"
|
||||
iconBgcolor="#217346"
|
||||
visible={visible}
|
||||
closable={true}
|
||||
hasScroll={true}
|
||||
onCancel={() => onCancel()}
|
||||
buttons={buttons}
|
||||
style={{ width: width, height: height }}
|
||||
>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
/>
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-18 16:23:32
|
||||
* @LastEditTime: 2022-05-27 15:05:49
|
||||
* @LastEditTime: 2022-06-01 11:51:20
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
|
||||
*/
|
||||
|
|
@ -40,7 +40,7 @@ import '../../style/common.less';
|
|||
|
||||
import NewTableDialog from '../NewTableDialog';
|
||||
import NewAndEditDialog from '../NewAndEditDialog';
|
||||
import NewWeaTable from '../NewWeaTable';
|
||||
import NewWeaTable from '../NewWeaTableDialog';
|
||||
import { renderLoading } from '../../util'; // 从util文件引入公共的方法
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-26 14:05:59
|
||||
* @LastEditTime: 2022-05-30 17:08:21
|
||||
* @LastEditTime: 2022-06-01 16:18:15
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/job.js
|
||||
*/
|
||||
|
|
@ -40,9 +40,8 @@ import {
|
|||
|
||||
import '../../style/common.less';
|
||||
|
||||
import NewTableDialog from '../NewTableDialog';
|
||||
import NewAndEditDialog from '../NewAndEditDialog';
|
||||
import NewWeaTable from '../NewWeaTable';
|
||||
import NewWeaTableDialog from '../NewWeaTableDialog';
|
||||
import { renderLoading } from '../../util'; // 从util文件引入公共的方法
|
||||
|
||||
|
||||
|
|
@ -82,6 +81,7 @@ export default class Job extends React.Component {
|
|||
} = this.props;
|
||||
job.getTableInfo();
|
||||
job.getHasRight();
|
||||
job.getCopyForm();
|
||||
}
|
||||
|
||||
getTopMenuBtns() {
|
||||
|
|
@ -95,10 +95,13 @@ export default class Job extends React.Component {
|
|||
|
||||
let btns = [];
|
||||
topMenu.map((item, i) => {
|
||||
if (item.menuFun !== 'batchDelete') {
|
||||
btns.push(<Button type='primary' onClick={() => this.handleClick(item)}>{item.menuName}</Button>);
|
||||
} else {
|
||||
if (item.menuFun === 'batchDelete') {
|
||||
btns.push(<Button type='primary' onClick={() => this.handleClick(item)} disabled={selectedRowKeys.length > 0 ? false : true} >{item.menuName}</Button>);
|
||||
} else if (item.menuFun === 'copy') {
|
||||
btns.push(<Button type='primary' onClick={() => this.handleClick(item)} disabled={selectedRowKeys.length > 0 ? false : true} >{item.menuName}</Button>);
|
||||
} else {
|
||||
btns.push(<Button type='primary' onClick={() => this.handleClick(item)}>{item.menuName}</Button>);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
|
@ -125,20 +128,70 @@ export default class Job extends React.Component {
|
|||
|
||||
job.setNeDialogTitle(i18n.label.jobName());
|
||||
job.setNewVisible(true);
|
||||
job.getCompanyForm();
|
||||
job.getJobForm();
|
||||
|
||||
}
|
||||
|
||||
//联查部门
|
||||
//联查人员
|
||||
select(id) {
|
||||
const {
|
||||
job
|
||||
} = this.props;
|
||||
|
||||
job.setNeDialogTitle(i18n.label.jobName());
|
||||
job.setNeDialogTitle("联查人员");
|
||||
job.setVisible(true);
|
||||
job.setDialogLoadingStatus(true);
|
||||
job.getDeptTable(id);
|
||||
job.getHrmTable(id);
|
||||
}
|
||||
|
||||
copy() {
|
||||
const {
|
||||
job
|
||||
} = this.props;
|
||||
const {
|
||||
selectedRowKeys
|
||||
} = job;
|
||||
let keys = toJS(selectedRowKeys).toString();
|
||||
job.setIds(keys);
|
||||
confirm({
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
content: this.getCopyForm(),
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel(),
|
||||
onOk() {
|
||||
job.copy()
|
||||
},
|
||||
onCancel() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getCopyForm() {
|
||||
const {
|
||||
job
|
||||
} = this.props;
|
||||
const {
|
||||
copyCondition,
|
||||
form2,
|
||||
} = job;
|
||||
let formParams = form2.getFormParams();
|
||||
const {
|
||||
isFormInit
|
||||
} = form2;
|
||||
let arr = [];
|
||||
isFormInit && copyCondition.map(c => {
|
||||
c.items.map((field, index) => {
|
||||
arr.push(
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
|
||||
label={`${field.label}`}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
|
||||
</WeaFormItem>
|
||||
)
|
||||
})
|
||||
})
|
||||
return arr;
|
||||
}
|
||||
|
||||
batchDelete() {
|
||||
|
|
@ -210,6 +263,13 @@ export default class Job extends React.Component {
|
|||
this[key] && this[key]();
|
||||
}
|
||||
|
||||
updateForbiddenTag(checked, id) {
|
||||
const {
|
||||
job
|
||||
} = this.props;
|
||||
job.updateForbiddenTag(checked, id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
onSearchChange(val) {
|
||||
|
|
@ -220,7 +280,7 @@ export default class Job extends React.Component {
|
|||
form
|
||||
} = job;
|
||||
|
||||
job.setCompanyName(val);
|
||||
job.setJobName(val);
|
||||
!this.isEmptyObject(form.getFormParams()) && job.updateFields(val);
|
||||
}
|
||||
|
||||
|
|
@ -236,7 +296,7 @@ export default class Job extends React.Component {
|
|||
return <Switch defaultChecked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
}
|
||||
};
|
||||
if (c.dataIndex == 'compName') {
|
||||
if (c.dataIndex == 'jobName') {
|
||||
c.render = function (text, record) {
|
||||
return <a href='javascript:void(0);' onClick={() => {
|
||||
window.open(`/spa/organization/static/index.html#/main/organization/jobExtend/${record.id}`, "_blank")
|
||||
|
|
@ -253,7 +313,7 @@ export default class Job extends React.Component {
|
|||
<a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item>
|
||||
<a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查部门</a>
|
||||
<a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查人员</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
|
|
@ -504,13 +564,11 @@ export default class Job extends React.Component {
|
|||
</WeaLeftRightLayout>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
<NewTableDialog ecId={`${this && this.props && this.props.ecId || ''}_NewTableDialog@q4rrwm`}
|
||||
<NewWeaTableDialog ecId={`${this && this.props && this.props.ecId || ''}_NewTableDialog@q4rrwm`}
|
||||
title={nEdialogTitle}
|
||||
visible={visible}
|
||||
loading={dialogLoading}
|
||||
height={400}
|
||||
dataSource={deptDataSource} //联查部门数据
|
||||
columns={deptColumns}
|
||||
tableStore={tableStore}
|
||||
onCancel={() => job.setVisible(false)}
|
||||
/>
|
||||
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
||||
|
|
@ -522,7 +580,7 @@ export default class Job extends React.Component {
|
|||
loading={dialogLoading}
|
||||
isEdit={isEdit}
|
||||
height={300}
|
||||
conditionLen={4}
|
||||
conditionLen={13}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => job.setNewVisible(false)}
|
||||
enable={false} //是否开启字段联动
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-26 14:07:12
|
||||
* @LastEditTime: 2022-05-30 17:04:50
|
||||
* @LastEditTime: 2022-05-30 17:16:47
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/JobExtend.js
|
||||
*/
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
|
||||
@inject('jobExtend')
|
||||
@inject('company')
|
||||
@inject('job')
|
||||
@observer
|
||||
export default class JobExtend extends React.Component {
|
||||
|
||||
|
|
@ -29,8 +29,7 @@
|
|||
this.init();
|
||||
}
|
||||
init = () => {
|
||||
const { jobExtend,company } = this.props;
|
||||
//const {id} = company;
|
||||
const { jobExtend,job } = this.props;
|
||||
let {hash} = window.location;
|
||||
hash = hash.split("?")[0];
|
||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ export const i18n = {
|
|||
editJob: () => getLabel(386247, '编辑岗位'),
|
||||
|
||||
|
||||
|
||||
|
||||
authorizationGroup: () => getLabel(492, '权限组'),
|
||||
allAuthorization: () => getLabel(33363, '全部权限'),
|
||||
|
|
|
|||
|
|
@ -1,374 +1,419 @@
|
|||
import {
|
||||
observable,
|
||||
action
|
||||
} from 'mobx';
|
||||
import * as mobx from 'mobx';
|
||||
import * as Api from '../apis/job'; // 引入API接口文件
|
||||
import {
|
||||
WeaForm
|
||||
} from 'comsMobx';
|
||||
import {
|
||||
WeaTableNew
|
||||
} from 'comsMobx';
|
||||
import {
|
||||
Modal,
|
||||
message,
|
||||
} from 'antd'
|
||||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
const {
|
||||
TableStore
|
||||
} = WeaTableNew;
|
||||
|
||||
|
||||
export class JobStore {
|
||||
@observable topMenu = []
|
||||
@observable rightMenu = [];
|
||||
@observable dataSource = [];
|
||||
@observable columns = [];
|
||||
@observable deptDataSource = [];
|
||||
@observable deptColumns = [];
|
||||
@observable tableStore = new TableStore();
|
||||
@observable loading = true;
|
||||
@observable dialogLoading = true;
|
||||
@observable isEdit = true;
|
||||
@observable nEdialogTitle = '';
|
||||
@observable searchCondition = [];
|
||||
@observable condition = [];
|
||||
@observable isPanelShow = false; //高级搜索面板
|
||||
@observable form = new WeaForm();
|
||||
@observable form1 = new WeaForm(); //新增主表表单
|
||||
@observable jobName = '';
|
||||
@observable conditionNum = 8;
|
||||
@observable ids = ''; //选择行id
|
||||
@observable id = ''; //页面跳转参数id
|
||||
@observable searchConditionLoading = true;
|
||||
@observable visible = false;
|
||||
@observable newVisible = false; //新增弹窗
|
||||
@observable jobId = '';
|
||||
@observable selectedRowKeys = '';
|
||||
@observable date = '';
|
||||
@observable init = true; //是否首次加载
|
||||
@observable total = '';
|
||||
@observable current = 1;
|
||||
@observable pageSize = 10;
|
||||
observable,
|
||||
action
|
||||
} from 'mobx';
|
||||
import * as mobx from 'mobx';
|
||||
import * as Api from '../apis/job'; // 引入API接口文件
|
||||
import {
|
||||
WeaForm
|
||||
} from 'comsMobx';
|
||||
import {
|
||||
WeaTableNew
|
||||
} from 'comsMobx';
|
||||
import {
|
||||
Modal,
|
||||
message,
|
||||
} from 'antd'
|
||||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
|
||||
@observable defaultShowLeft = true;
|
||||
@observable companysId = 1
|
||||
|
||||
|
||||
|
||||
|
||||
@action
|
||||
getTableInfo(params) {
|
||||
this.setLoading(true);
|
||||
const toJS = mobx.toJS;
|
||||
const {
|
||||
TableStore
|
||||
} = WeaTableNew;
|
||||
|
||||
|
||||
export class JobStore {
|
||||
@observable tableStore = new TableStore();
|
||||
@observable topMenu = []
|
||||
@observable rightMenu = [];
|
||||
@observable dataSource = [];
|
||||
@observable columns = [];
|
||||
@observable deptDataSource = [];
|
||||
@observable deptColumns = [];
|
||||
@observable loading = true;
|
||||
@observable dialogLoading = true;
|
||||
@observable isEdit = true;
|
||||
@observable nEdialogTitle = '';
|
||||
@observable searchCondition = [];
|
||||
@observable condition = [];
|
||||
@observable copyCondition = [];
|
||||
@observable isPanelShow = false; //高级搜索面板
|
||||
@observable form = new WeaForm();
|
||||
@observable form1 = new WeaForm(); //新增主表表单
|
||||
@observable form2 = new WeaForm(); //复制表单
|
||||
@observable jobName = '';
|
||||
@observable conditionNum = 12;
|
||||
@observable ids = ''; //选择行id
|
||||
@observable id = ''; //页面跳转参数id
|
||||
@observable searchConditionLoading = true;
|
||||
@observable visible = false;
|
||||
@observable newVisible = false; //新增弹窗
|
||||
@observable jobId = '';
|
||||
@observable selectedRowKeys = '';
|
||||
@observable date = '';
|
||||
@observable init = true; //是否首次加载
|
||||
@observable total = '';
|
||||
@observable current = 1;
|
||||
@observable pageSize = 10;
|
||||
|
||||
@observable defaultShowLeft = true;
|
||||
@observable companysId = 1
|
||||
|
||||
|
||||
|
||||
|
||||
@action
|
||||
getTableInfo(params) {
|
||||
this.setLoading(true);
|
||||
params = {
|
||||
...params,
|
||||
current: this.current,
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
if (this.isEmptyObject(this.form.getFormParams())) {
|
||||
params = {
|
||||
...params,
|
||||
current:this.current,
|
||||
pageSize:this.pageSize
|
||||
}
|
||||
if (this.isEmptyObject(this.form.getFormParams())) {
|
||||
params = {
|
||||
...params,
|
||||
...this.form.getFormParams(),
|
||||
compName: this.jobName
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
...params,
|
||||
...this.form.getFormParams(),
|
||||
};
|
||||
}
|
||||
Api.getSearchList(params).then(response => {
|
||||
return response.json()
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns);
|
||||
this.setTotal(res.data.pageInfo.total);
|
||||
res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list);
|
||||
this.setLoading(false);
|
||||
this.setInit(false);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
@action("nodetree事件")
|
||||
doSearch (params){
|
||||
this.setInit(true);
|
||||
this.getTableInfo(params);
|
||||
}
|
||||
|
||||
@action("联查部门")
|
||||
getDeptTable(id) {
|
||||
let params = {
|
||||
parentComp:id
|
||||
}
|
||||
Api.getDeptListByPid(params).then(response => {
|
||||
return response.json()
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.list && this.setDeptDataSource(res.data.list);
|
||||
res.data.columns && this.setDeptColumns(res.data.columns);
|
||||
this.setDialogLoadingStatus(false);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
//删除
|
||||
delete() {
|
||||
let params = {
|
||||
ids: this.ids
|
||||
...params,
|
||||
...this.form.getFormParams(),
|
||||
compName: this.jobName
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
...params,
|
||||
...this.form.getFormParams(),
|
||||
};
|
||||
Api.deleteTableData(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(i18n.message.deleteSuccess());
|
||||
this.getTableInfo();
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateForbiddenTag(checked, id) {
|
||||
let params = {
|
||||
forbiddenTag: checked,
|
||||
id: id
|
||||
Api.getSearchList(params).then(response => {
|
||||
return response.json()
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns);
|
||||
this.setTotal(res.data.pageInfo.total);
|
||||
res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list);
|
||||
this.setLoading(false);
|
||||
this.setInit(false);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
Api.updateForbiddenTag(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
getSearchCondition() {
|
||||
this.setScLoadingStatus(true);
|
||||
Api.getAdvanceSearchCondition().then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setScLoadingStatus(false);
|
||||
res.data.conditions && this.setSearchCondition(res.data.conditions);
|
||||
res.data.conditions && this.form.initFormFields(res.data.conditions);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
getCompanyForm() {
|
||||
let params = {};
|
||||
this.setDialogLoadingStatus(true);
|
||||
Api.getCompanyForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setDialogLoadingStatus(false);
|
||||
res.data.condition && this.setCondition(res.data.condition);
|
||||
res.data.condition && this.form1.initFormFields(res.data.condition);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@action("nodetree事件")
|
||||
doSearch(params) {
|
||||
this.setInit(true);
|
||||
this.getTableInfo(params);
|
||||
}
|
||||
|
||||
@action("联查人员")
|
||||
getHrmTable(id) {
|
||||
let params = {
|
||||
jobId: id
|
||||
}
|
||||
this.tableStore = new TableStore();
|
||||
Api.getHrmListByJobId(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
//删除
|
||||
delete() {
|
||||
let params = {
|
||||
ids: this.ids
|
||||
};
|
||||
Api.deleteTableData(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(i18n.message.deleteSuccess());
|
||||
this.getTableInfo();
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateForbiddenTag(checked, id) {
|
||||
let params = {
|
||||
forbiddenTag: checked,
|
||||
id: id
|
||||
}
|
||||
Api.updateForbiddenTag(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg, 1);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
getSearchCondition() {
|
||||
this.setScLoadingStatus(true);
|
||||
Api.getAdvanceSearchCondition().then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setScLoadingStatus(false);
|
||||
res.data.conditions && this.setSearchCondition(res.data.conditions);
|
||||
res.data.conditions && this.form.initFormFields(res.data.conditions);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
getJobForm() {
|
||||
let params = {};
|
||||
this.setDialogLoadingStatus(true);
|
||||
Api.getJobForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setDialogLoadingStatus(false);
|
||||
res.data.condition && this.setCondition(res.data.condition);
|
||||
res.data.condition && this.form1.initFormFields(res.data.condition);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
@action("复制表单")
|
||||
getCopyForm() {
|
||||
let params = {};
|
||||
Api.getCopyForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data && this.setCopyCondition(res.data);
|
||||
res.data && this.form2.initFormFields(res.data);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
save() {
|
||||
let params = {
|
||||
...this.form1.getFormParams()
|
||||
...this.form1.getFormParams()
|
||||
};
|
||||
this.form1.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.add(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
this.setNewVisible(false);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setDate(new Date());
|
||||
}
|
||||
if (f.isValid) {
|
||||
Api.add(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
this.setNewVisible(false);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setDate(new Date());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
res.data.topMenu && this.setTopMenu(res.data.topMenu);
|
||||
|
||||
copy() {
|
||||
debugger
|
||||
let params = {
|
||||
ids: this.ids,
|
||||
...this.form2.getFormParams()
|
||||
};
|
||||
this.form2.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.copy(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
message.error(data.msg);
|
||||
}
|
||||
}, error => {
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
this.form.updateFields({
|
||||
compName: {
|
||||
value: val
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setSearchCondition(condition) {
|
||||
this.searchCondition = condition;
|
||||
}
|
||||
|
||||
setScLoadingStatus(bool) {
|
||||
this.searchConditionLoading = bool;
|
||||
}
|
||||
|
||||
setPanelStatus(bool) {
|
||||
this.isPanelShow = bool;
|
||||
bool && this.getSearchCondition();
|
||||
if (!bool) {
|
||||
this.scLoadingReset();
|
||||
})
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setDate(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
setJobName(val) {
|
||||
this.jobName = val;
|
||||
}
|
||||
|
||||
isEmptyObject(obj) {
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
setIds(ids) {
|
||||
this.ids = ids;
|
||||
}
|
||||
|
||||
setId(id) {
|
||||
this.id =id;
|
||||
}
|
||||
|
||||
scLoadingReset() {
|
||||
this.searchConditionLoading = true;
|
||||
}
|
||||
|
||||
|
||||
formReset() {
|
||||
this.form1 = new WeaForm();
|
||||
}
|
||||
|
||||
|
||||
setVisible(bool) {
|
||||
this.visible = bool;
|
||||
}
|
||||
|
||||
setDialogLoadingStatus(bool) {
|
||||
this.dialogLoading = bool;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
setSearchCondition(searchCondition) {
|
||||
this.searchCondition = searchCondition;
|
||||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
res.data.topMenu && this.setTopMenu(res.data.topMenu);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
this.form.updateFields({
|
||||
compName: {
|
||||
value: val
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setSearchCondition(condition) {
|
||||
this.searchCondition = condition;
|
||||
}
|
||||
|
||||
setScLoadingStatus(bool) {
|
||||
this.searchConditionLoading = bool;
|
||||
}
|
||||
|
||||
setPanelStatus(bool) {
|
||||
this.isPanelShow = bool;
|
||||
bool && this.getSearchCondition();
|
||||
if (!bool) {
|
||||
this.scLoadingReset();
|
||||
}
|
||||
|
||||
setJobId(jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
setJobName(val) {
|
||||
this.jobName = val;
|
||||
}
|
||||
|
||||
isEmptyObject(obj) {
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
setDate(date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
setTopMenu(topMenu) {
|
||||
this.topMenu = topMenu;
|
||||
}
|
||||
|
||||
setRightMenu(rightMenu) {
|
||||
this.rightMenu = rightMenu;
|
||||
}
|
||||
|
||||
setDataSource(dataSource) {
|
||||
this.dataSource = dataSource;
|
||||
}
|
||||
|
||||
setDeptDataSource(deptDataSource) {
|
||||
this.deptDataSource = deptDataSource;
|
||||
}
|
||||
|
||||
setColumns(columns) {
|
||||
this.columns = columns
|
||||
}
|
||||
|
||||
setDeptColumns(deptColumns) {
|
||||
this.deptColumns = deptColumns
|
||||
}
|
||||
|
||||
setSelectedRowKeys(selectedRowKeys) {
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
}
|
||||
|
||||
setLoading(bool) {
|
||||
this.loading = bool;
|
||||
}
|
||||
|
||||
setNeDialogTitle(title) {
|
||||
this.nEdialogTitle = title
|
||||
}
|
||||
|
||||
setCondition(condition) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
setNewVisible(bool) {
|
||||
this.formReset();
|
||||
this.newVisible = bool;
|
||||
}
|
||||
|
||||
setTotal(total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
setCurrent(current) {
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
setPageSize(pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
setInit(bool) {
|
||||
this.init = bool;
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
setIds(ids) {
|
||||
this.ids = ids;
|
||||
}
|
||||
|
||||
setId(id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
scLoadingReset() {
|
||||
this.searchConditionLoading = true;
|
||||
}
|
||||
|
||||
|
||||
formReset() {
|
||||
this.form1 = new WeaForm();
|
||||
}
|
||||
|
||||
|
||||
setVisible(bool) {
|
||||
this.visible = bool;
|
||||
}
|
||||
|
||||
setDialogLoadingStatus(bool) {
|
||||
this.dialogLoading = bool;
|
||||
}
|
||||
|
||||
|
||||
setSearchCondition(searchCondition) {
|
||||
this.searchCondition = searchCondition;
|
||||
}
|
||||
|
||||
setJobId(jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
setDate(date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
setTopMenu(topMenu) {
|
||||
this.topMenu = topMenu;
|
||||
}
|
||||
|
||||
setRightMenu(rightMenu) {
|
||||
this.rightMenu = rightMenu;
|
||||
}
|
||||
|
||||
setDataSource(dataSource) {
|
||||
this.dataSource = dataSource;
|
||||
}
|
||||
|
||||
setDeptDataSource(deptDataSource) {
|
||||
this.deptDataSource = deptDataSource;
|
||||
}
|
||||
|
||||
setColumns(columns) {
|
||||
this.columns = columns
|
||||
}
|
||||
|
||||
setDeptColumns(deptColumns) {
|
||||
this.deptColumns = deptColumns
|
||||
}
|
||||
|
||||
setSelectedRowKeys(selectedRowKeys) {
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
}
|
||||
|
||||
setLoading(bool) {
|
||||
this.loading = bool;
|
||||
}
|
||||
|
||||
setNeDialogTitle(title) {
|
||||
this.nEdialogTitle = title
|
||||
}
|
||||
|
||||
setCondition(condition) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
setCopyCondition(copyCondition) {
|
||||
this.copyCondition = copyCondition;
|
||||
}
|
||||
|
||||
setNewVisible(bool) {
|
||||
this.formReset();
|
||||
this.newVisible = bool;
|
||||
}
|
||||
|
||||
setTotal(total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
setCurrent(current) {
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
setPageSize(pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
setInit(bool) {
|
||||
this.init = bool;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ export class JobExtendStore {
|
|||
id: this.id,
|
||||
viewCondition:this.selectedKey
|
||||
}
|
||||
Api.getCompanyExtendForm(params).then((res) => {
|
||||
Api.getJobExtendForm(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
res.data.result.conditions && this.form.initFormFields(res.data.result.conditions);
|
||||
res.data.result.conditions && this.setConditions(res.data.result.conditions);
|
||||
|
|
|
|||
Loading…
Reference in New Issue