Merge pull request 'feature/cl' (#26) from feature/cl into dev
Reviewed-on: http://221.226.25.34:3000/liang.cheng/trunk/pulls/26
This commit is contained in:
commit
68c07ee8b9
|
|
@ -4,7 +4,6 @@ import {
|
|||
} from 'ecCom'
|
||||
|
||||
export const getSearchList = (params) => {
|
||||
//return WeaTools.callApi('/api/bs/hrmorganization/comp/listComp', 'POST', params);
|
||||
return fetch('/api/bs/hrmorganization/comp/listComp', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
|
|
@ -43,25 +42,14 @@ export const getAdvanceSearchCondition = (params) => {
|
|||
}
|
||||
|
||||
export const add = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/comp/saveBaseComp', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/comp/saveBaseComp', 'POST', params);
|
||||
}
|
||||
|
||||
export const version = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/version/subcompanyfielddefined/save', 'POST', 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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,19 +41,16 @@ export const getMergeForm = (params) => {
|
|||
return WeaTools.callApi('/api/bs/hrmorganization/dept/getMergeForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const version = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/save', 'POST', params);
|
||||
}
|
||||
|
||||
export const getTransferForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/dept/getMoveForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const add = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/dept/saveBaseForm', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/dept/saveBaseForm', 'POST', params);
|
||||
}
|
||||
|
||||
export const copy = (params) => {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ export const getResourceExtendForm = (params) => {
|
|||
return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getBaseForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const version = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/save', 'POST', params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const exportResource = (ids) => {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,10 @@ export default class NewAndEditDialog extends React.Component {
|
|||
tipPosition="bottom"
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@7vxyfr@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} onChange={this.onChange} />}
|
||||
{field.domkey[0] == 'subcompanycode' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'departmentcode' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'job_no' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'work_code' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
</WeaFormItem>)
|
||||
})
|
||||
})
|
||||
|
|
@ -65,12 +69,6 @@ export default class NewAndEditDialog extends React.Component {
|
|||
if (moduleName == 'staffScheme' && data.planYear) {
|
||||
bindChangeEnvent(data.planYear.value);
|
||||
}
|
||||
if (moduleName == 'department' && data.parent_comp) {
|
||||
bindChangeEnvent(data.parent_comp.value);
|
||||
}
|
||||
if (moduleName == 'job' && (data.sequence_id || data.grade_id)) {
|
||||
bindChangeEnvent(data);
|
||||
}
|
||||
if (moduleName == 'staff' && data.planId) {
|
||||
bindChangeEnvent(data);
|
||||
}
|
||||
|
|
@ -105,8 +103,8 @@ export default class NewAndEditDialog extends React.Component {
|
|||
>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@5r6c5a@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} onChange={this.onChange}
|
||||
onBlur={this.onBlur} />
|
||||
{field.domkey[0] == 'comp_no' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'dept_no' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'subcompanycode' && field.viewAttr != 1 && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'departmentcode' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'job_no' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'work_code' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ export default class AttachToNumberField extends PureComponent {
|
|||
canNew: false
|
||||
};
|
||||
this.typeMap = {
|
||||
comp_no: "SUBCOMPANY",
|
||||
dept_no: "DEPARTMENT",
|
||||
subcompanycode: "SUBCOMPANY",
|
||||
departmentcode: "DEPARTMENT",
|
||||
job_no: "JOBTITLES",
|
||||
work_code: "USER"
|
||||
};
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class ColumnSetting extends Component {
|
|||
render() {
|
||||
const { columnSetting } = this.props;
|
||||
const { selectedKey, authorized } = columnSetting;
|
||||
if (!authorized) {
|
||||
if (authorized === false) {
|
||||
return renderNoright();
|
||||
}
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-18 14:52:39
|
||||
* @LastEditTime: 2022-10-12 18:01:56
|
||||
* @LastEditTime: 2022-12-09 11:08:06
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js
|
||||
*/
|
||||
|
|
@ -9,7 +9,7 @@ import { Button, Modal, message, Row, Col, Spin } from 'antd';
|
|||
import isEmpty from 'lodash/isEmpty'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import forEach from 'lodash/forEach'
|
||||
import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab,WeaTop } from 'ecCom'
|
||||
import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop,WeaSlideModal } from 'ecCom'
|
||||
import { WeaSwitch } from 'comsMobx';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import * as mobx from 'mobx';
|
||||
|
|
@ -30,9 +30,9 @@ export default class CompanyExtend extends React.Component {
|
|||
this.init();
|
||||
}
|
||||
init = () => {
|
||||
const { companyExtend,company } = this.props;
|
||||
const { companyExtend, company } = this.props;
|
||||
//const {id} = company;
|
||||
let {hash} = window.location;
|
||||
let { hash } = window.location;
|
||||
hash = hash.split("?")[0];
|
||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||
companyExtend.init();
|
||||
|
|
@ -42,14 +42,14 @@ export default class CompanyExtend extends React.Component {
|
|||
|
||||
getTabChildren = () => {
|
||||
const { companyExtend } = this.props;
|
||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = companyExtend;
|
||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = companyExtend;
|
||||
let tabChildren = [];
|
||||
tableInfo = toJS(tableInfo);
|
||||
tableInfo && tableInfo.map((t, i) => {
|
||||
if (detailSelectedKey == i) {
|
||||
tabChildren.push(
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
||||
ref={(ref)=>companyExtend.setPersonalEditTables(ref)}
|
||||
ref={(ref) => companyExtend.setPersonalEditTables(ref)}
|
||||
showTitle={isEditor}
|
||||
// title={'列表信息'}
|
||||
//addFirstRow={isEditor}
|
||||
|
|
@ -128,7 +128,7 @@ export default class CompanyExtend extends React.Component {
|
|||
labelCol={{ span: `${field.labelcol}` }}
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
||||
{field.domkey[0] == 'comp_no' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'comp_no' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true} />}
|
||||
</WeaFormItem>),
|
||||
colSpan: 1
|
||||
});
|
||||
|
|
@ -179,6 +179,13 @@ export default class CompanyExtend extends React.Component {
|
|||
onClick: key => {
|
||||
this.editCard();
|
||||
}
|
||||
}, {
|
||||
icon: <i className='icon-coms-common' />,
|
||||
content: i18n.button.version(),
|
||||
key: 'view',
|
||||
onClick: key => {
|
||||
this.editCard();
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -193,6 +200,7 @@ export default class CompanyExtend extends React.Component {
|
|||
const save = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pkes6y`} type="primary" onClick={this.saveEditCard} >{i18n.button.save()}</Button>;
|
||||
const back = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pl1fw8`} type="primary" onClick={this.backCard} >{i18n.button.back()}</Button>;
|
||||
const edit = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vkeda5`} type="primary" onClick={this.editCard} >{i18n.button.modify()}</Button>;
|
||||
const view = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vkeda5`} type="primary" onClick={this.view} >{i18n.button.version()}</Button>;
|
||||
const btns = [];
|
||||
try {
|
||||
if (isEditor) {
|
||||
|
|
@ -203,6 +211,7 @@ export default class CompanyExtend extends React.Component {
|
|||
} else {
|
||||
if (buttons.hasEdit) {
|
||||
btns.push(edit);
|
||||
btns.push(view);
|
||||
}
|
||||
}
|
||||
} catch (e) { }
|
||||
|
|
@ -223,66 +232,88 @@ export default class CompanyExtend extends React.Component {
|
|||
this.init();
|
||||
}
|
||||
|
||||
view = () => {
|
||||
const { companyExtend } = this.props;
|
||||
companyExtend.open = true;
|
||||
}
|
||||
|
||||
onClose = () => {
|
||||
const { companyExtend } = this.props;
|
||||
companyExtend.open = false;
|
||||
}
|
||||
|
||||
changeData(key) {
|
||||
const {
|
||||
companyExtend
|
||||
} = this.props;
|
||||
companyExtend.changeData(key);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { companyExtend } = this.props;
|
||||
const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey,isEditor } = companyExtend;
|
||||
const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey, isEditor, open } = companyExtend;
|
||||
|
||||
try {
|
||||
return (
|
||||
<div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||
datas={this.getRightMenu()}
|
||||
//try {
|
||||
return (
|
||||
<div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||
datas={this.getRightMenu()}
|
||||
>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||
loading={true}
|
||||
title={isEditor ? i18n.label.updateCompany() : i18n.label.viewCompany()}
|
||||
icon={<i className='icon-coms-hrm' />}
|
||||
iconBgcolor='#217346'
|
||||
buttons={this.getTopButtons()}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getRightMenu()}
|
||||
>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||
loading={true}
|
||||
title={isEditor ? i18n.label.updateCompany() : i18n.label.viewCompany()}
|
||||
icon={<i className='icon-coms-hrm' />}
|
||||
iconBgcolor='#217346'
|
||||
buttons={this.getTopButtons()}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getRightMenu()}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
keyParam="viewCondition" //主键
|
||||
selectedKey={selectedKey}
|
||||
onChange={this.changeData.bind(this)}
|
||||
/>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}>
|
||||
{this.getSearchs()}
|
||||
{
|
||||
!isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`}
|
||||
type='card'
|
||||
keyParam='key'
|
||||
datas={toJS(tabInfo)}
|
||||
selectedKey={detailSelectedKey}
|
||||
onChange={v => {
|
||||
companyExtend.updateDetailSelectedKey(v);
|
||||
}}
|
||||
/>
|
||||
{this.getTabChildren()}
|
||||
</div>
|
||||
}
|
||||
</Spin>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
keyParam="viewCondition" //主键
|
||||
selectedKey={selectedKey}
|
||||
onChange={this.changeData.bind(this)}
|
||||
/>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}>
|
||||
{this.getSearchs()}
|
||||
{
|
||||
!isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`}
|
||||
type='card'
|
||||
keyParam='key'
|
||||
datas={toJS(tabInfo)}
|
||||
selectedKey={detailSelectedKey}
|
||||
onChange={v => {
|
||||
companyExtend.updateDetailSelectedKey(v);
|
||||
}}
|
||||
/>
|
||||
{this.getTabChildren()}
|
||||
</div>
|
||||
}
|
||||
</Spin>
|
||||
|
||||
|
||||
</WeaTop>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
catch (e) {
|
||||
return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}>
|
||||
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
||||
</WeaAlertPage>
|
||||
}
|
||||
</WeaRightMenu>
|
||||
|
||||
<WeaSlideModal visible={open}
|
||||
top={6}
|
||||
width={40}
|
||||
height={94}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
onClose={this.onClose}
|
||||
onAnimationEnd={() => console.log('onAnimationEnd')}/>
|
||||
|
||||
</div>
|
||||
)
|
||||
//}
|
||||
// catch (e) {
|
||||
// return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}>
|
||||
// <div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
||||
// </WeaAlertPage>
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-18 16:23:32
|
||||
* @LastEditTime: 2022-11-08 18:39:26
|
||||
* @LastEditTime: 2022-12-09 11:36:44
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
|
||||
*/
|
||||
|
|
@ -174,6 +174,24 @@ export default class Company extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
version(record) {
|
||||
const {
|
||||
company
|
||||
} = this.props;
|
||||
confirm({
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
content: `确认将{${record.subCompanyDesc}}存为新版本?`,
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel(),
|
||||
onOk() {
|
||||
company.version(record);
|
||||
},
|
||||
onCancel() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getTransferForm() {
|
||||
const {
|
||||
company
|
||||
|
|
@ -316,12 +334,12 @@ export default class Company extends React.Component {
|
|||
// }
|
||||
// });
|
||||
columns.forEach((c, index) => {
|
||||
if (c.dataIndex == 'forbiddenTag') {
|
||||
if (c.dataIndex == 'canceled') {
|
||||
c.render = function (text, record) {
|
||||
return <Switch checked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
return <Switch checked={record.canceled == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
}
|
||||
};
|
||||
if (c.dataIndex == 'compName') {
|
||||
if (c.dataIndex == 'subCompanyDesc') {
|
||||
c.className = "wea-table-indent"
|
||||
c.render = function (text, record) {
|
||||
return <a onClick={() => {
|
||||
|
|
@ -348,6 +366,9 @@ export default class Company extends React.Component {
|
|||
<Menu.Item key="4">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.transfer(record.id) }}>转移</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="5">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.version(record) }}>另存为版本</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
return <Dropdown overlay={menu}>
|
||||
|
|
@ -594,7 +615,7 @@ export default class Company extends React.Component {
|
|||
isFormInit={form1.isFormInit}
|
||||
loading={dialogLoading}
|
||||
isEdit={isEdit}
|
||||
height={400}
|
||||
height={340}
|
||||
conditionLen={2}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => company.setNewVisible(false)}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-06-02 09:19:37
|
||||
* @LastEditTime: 2022-11-08 18:40:46
|
||||
* @LastEditTime: 2022-12-09 11:47:53
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js
|
||||
*/
|
||||
|
|
@ -338,6 +338,25 @@ export default class Department extends React.Component {
|
|||
!this.isEmptyObject(form.getFormParams()) && department.updateFields(val);
|
||||
}
|
||||
|
||||
version(record) {
|
||||
const {
|
||||
department
|
||||
} = this.props;
|
||||
confirm({
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
content: `确认将{${record.departmentMark}}存为新版本?`,
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel(),
|
||||
onOk() {
|
||||
department.version(record);
|
||||
},
|
||||
onCancel() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
reRenderColumns(columns) {
|
||||
const {
|
||||
|
|
@ -345,12 +364,12 @@ export default class Department extends React.Component {
|
|||
} = this.props;
|
||||
let _this = this;
|
||||
columns.forEach((c, index) => {
|
||||
if (c.dataIndex == 'forbiddenTag') {
|
||||
if (c.dataIndex == 'canceled') {
|
||||
c.render = function (text, record) {
|
||||
return <Switch checked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
return <Switch checked={record.canceled == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
}
|
||||
};
|
||||
if (c.dataIndex == 'deptName') {
|
||||
if (c.dataIndex == 'departmentMark') {
|
||||
c.className = "wea-table-indent"
|
||||
c.render = function (text, record) {
|
||||
return <a href='javascript:void(0);' onClick={() => {
|
||||
|
|
@ -382,6 +401,9 @@ export default class Department extends React.Component {
|
|||
<Menu.Item key="5">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.copy(record.id) }}>复制</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="6">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.version(record) }}>另存为版本</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
return <Dropdown overlay={menu}>
|
||||
|
|
@ -513,7 +535,8 @@ export default class Department extends React.Component {
|
|||
let tree = (
|
||||
<WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@dhi1ro`}
|
||||
ref='WeaOrgTree'
|
||||
dataUrl={"/api/bs/hrmorganization/dept/getSearchTree"}
|
||||
// dataUrl={"/api/bs/hrmorganization/dept/getSearchTree"}
|
||||
dataUrl={"/api/hrm/base/getHrmSearchTree"}
|
||||
loading
|
||||
needSearch
|
||||
noCache={true}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-26 14:05:59
|
||||
* @LastEditTime: 2022-10-26 15:49:00
|
||||
* @LastEditTime: 2022-12-08 15:04:50
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js
|
||||
*/
|
||||
|
|
@ -343,18 +343,18 @@ export default class Job extends React.Component {
|
|||
<Menu.Item key="0">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.view(record.id) }}>查看</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="1" disabled={record.isUsed === 0 ? false : true} style={record.isUsed === 0 ? {display:'block'} : {display:'none'}}>
|
||||
<Menu.Item key="1">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="2">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查人员</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="3">
|
||||
{/* <Menu.Item key="3">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.merge(record.id) }}>合并</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="4">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.copy(record.id) }}>复制</a>
|
||||
</Menu.Item>
|
||||
</Menu.Item> */}
|
||||
</Menu>
|
||||
)
|
||||
return <Dropdown overlay={menu}>
|
||||
|
|
@ -481,7 +481,8 @@ export default class Job extends React.Component {
|
|||
let tree = (
|
||||
<WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@dhi1ro`}
|
||||
ref='WeaOrgTree'
|
||||
dataUrl={"/api/bs/hrmorganization/job/getSearchTree"}
|
||||
// dataUrl={"/api/bs/hrmorganization/job/getSearchTree"}
|
||||
dataUrl={"/api/hrm/base/getHrmSearchTree"}
|
||||
loading
|
||||
needSearch
|
||||
noCache={true}
|
||||
|
|
@ -665,7 +666,6 @@ export default class Job extends React.Component {
|
|||
onCancel={() => job.setNewVisible(false)}
|
||||
saveAndSetting = {() => this.handleSaveAndSetting()}
|
||||
moduleName={"job"}
|
||||
bindChangeEnvent={val => job.updateConditions(val)}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -104,13 +104,13 @@ export default class newImport extends React.Component {
|
|||
case 1:
|
||||
newImport.importType = 'department';
|
||||
break;
|
||||
// case 2:
|
||||
// newImport.importType = 'jobtitle';
|
||||
// break;
|
||||
case 2:
|
||||
newImport.importType = 'jobtitle';
|
||||
break;
|
||||
case 3:
|
||||
newImport.importType = 'resource';
|
||||
break;
|
||||
case 4:
|
||||
case 3:
|
||||
newImport.importType = 'joblevel';
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,10 +224,11 @@ export default class Resource extends React.Component {
|
|||
resource
|
||||
} = this.props;
|
||||
|
||||
resource.setNeDialogTitle(i18n.label.newPeople());
|
||||
resource.setIsNew(true);
|
||||
resource.setVisible(true);
|
||||
resource.getForm();
|
||||
// resource.setNeDialogTitle(i18n.label.newPeople());
|
||||
// resource.setIsNew(true);
|
||||
// resource.setVisible(true);
|
||||
// resource.getForm();
|
||||
window.open("/spa/hrm/index_mobx.html#/main/hrm/add","_blank")
|
||||
}
|
||||
|
||||
import() {
|
||||
|
|
@ -318,7 +319,7 @@ export default class Resource extends React.Component {
|
|||
reRenderColumns(columns) {
|
||||
let _this = this;
|
||||
columns.forEach((c, index) => {
|
||||
if (c.dataIndex == 'last_name') {
|
||||
if (c.dataIndex == 'lastname') {
|
||||
c.render = function (text, record) {
|
||||
return <a href='javascript:void(0);' onClick={() => {
|
||||
window.open(`/spa/organization/static/index.html#/main/organization/resourceCard/${record.id}`);
|
||||
|
|
@ -334,12 +335,31 @@ export default class Resource extends React.Component {
|
|||
index
|
||||
} = operate;
|
||||
(index == '0') && this.view(record.randomFieldId);
|
||||
(index == '1') && this.version(record);
|
||||
}
|
||||
|
||||
view(id) {
|
||||
window.open(`/spa/organization/static/index.html#/main/organization/resourceCard/${id}`);
|
||||
}
|
||||
|
||||
version(record) {
|
||||
const {
|
||||
resource
|
||||
} = this.props;
|
||||
confirm({
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
content: `确认将{${record.lastname}}存为新版本?`,
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel(),
|
||||
onOk() {
|
||||
resource.version(record);
|
||||
},
|
||||
onCancel() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
handleSave() {
|
||||
const {
|
||||
resource
|
||||
|
|
|
|||
|
|
@ -873,6 +873,7 @@ export const i18n = {
|
|||
createType: () => getLabel(30131, '新建类型'),
|
||||
editTypeInfo: () => getLabel(32732, '编辑类型'),
|
||||
nextStep:() => getLabel(30131, '下一步'),
|
||||
version:() => getLabel(30131, '查看历史版本'),
|
||||
|
||||
batchOpen: () => getLabel(534249, '批量解锁'),
|
||||
collect: () => getLabel(28111, '收藏'),
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ export class ColumnSetting {
|
|||
columns: [],
|
||||
loading: true,
|
||||
selectedData: {}, //selectedData受控
|
||||
authorized: false
|
||||
};
|
||||
@observable tabThreeRelatedData = {
|
||||
datas: [], //datas受控
|
||||
|
|
@ -109,11 +108,6 @@ export class ColumnSetting {
|
|||
} = rs;
|
||||
|
||||
if (api_status) {
|
||||
if (!columns || !datas) {
|
||||
this.tabTwoRelatedData.authorized = false;
|
||||
return;
|
||||
}
|
||||
this.tabTwoRelatedData.authorized = true;
|
||||
columns.map((c, index) => {
|
||||
if (c.key === "itemurl") {
|
||||
c.title = <span>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export class CompanyStore {
|
|||
@observable form = new WeaForm();
|
||||
@observable form1 = new WeaForm(); //新增主表表单
|
||||
@observable companyName = '';
|
||||
@observable conditionNum = 8;
|
||||
@observable conditionNum = 4;
|
||||
@observable ids = ''; //选择行id
|
||||
@observable id = ''; //页面跳转参数id
|
||||
@observable searchConditionLoading = true;
|
||||
|
|
@ -63,10 +63,9 @@ export class CompanyStore {
|
|||
@observable transferCondition = [];
|
||||
|
||||
|
||||
|
||||
|
||||
@action
|
||||
getTableInfo() {
|
||||
|
||||
@action("列表树") getTableInfo() {
|
||||
this.setLoading(true);
|
||||
let params = {
|
||||
current: this.current,
|
||||
|
|
@ -76,7 +75,7 @@ export class CompanyStore {
|
|||
if (this.isEmptyObject(this.form.getFormParams())) {
|
||||
params = {
|
||||
...params,
|
||||
compName: this.companyName
|
||||
subCompanyDesc: this.companyName
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
|
|
@ -102,8 +101,7 @@ export class CompanyStore {
|
|||
})
|
||||
}
|
||||
|
||||
@action("联查部门")
|
||||
getDeptTable(id) {
|
||||
@action("联查部门") getDeptTable(id) {
|
||||
let params = {
|
||||
parentComp: id
|
||||
}
|
||||
|
|
@ -122,8 +120,8 @@ export class CompanyStore {
|
|||
})
|
||||
}
|
||||
|
||||
//删除
|
||||
@action delete() {
|
||||
|
||||
@action("删除") delete() {
|
||||
let params = {
|
||||
ids: this.ids
|
||||
};
|
||||
|
|
@ -144,7 +142,7 @@ export class CompanyStore {
|
|||
|
||||
updateForbiddenTag(checked, id) {
|
||||
let params = {
|
||||
forbiddenTag: checked,
|
||||
canceled: checked,
|
||||
id: id
|
||||
}
|
||||
Api.updateForbiddenTag(params).then(response => {
|
||||
|
|
@ -178,7 +176,10 @@ export class CompanyStore {
|
|||
|
||||
|
||||
getCompanyForm() {
|
||||
let params = {};
|
||||
let params = {
|
||||
addType: 'normal',
|
||||
viewattr: 2
|
||||
};
|
||||
this.setDialogLoadingStatus(true);
|
||||
Api.getCompanyForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
|
|
@ -232,9 +233,7 @@ export class CompanyStore {
|
|||
};
|
||||
this.form1.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.add(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
Api.add(params).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
|
|
@ -253,8 +252,7 @@ export class CompanyStore {
|
|||
});
|
||||
}
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
@action getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
|
|
@ -267,9 +265,21 @@ export class CompanyStore {
|
|||
})
|
||||
}
|
||||
|
||||
@action("另存为版本") version(record) {
|
||||
Api.version(record).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success(res.msg);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
this.form.updateFields({
|
||||
compName: {
|
||||
subCompanyDesc: {
|
||||
value: val
|
||||
}
|
||||
});
|
||||
|
|
@ -422,6 +432,6 @@ export class CompanyStore {
|
|||
this.transferCondition = transferCondition;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -23,7 +23,9 @@ export class CompanyExtendStore {
|
|||
@observable id = ''; //分部id
|
||||
@observable date = '';
|
||||
@observable personalEditTables;
|
||||
@observable tabkey = '0'
|
||||
@observable tabkey = '0';
|
||||
|
||||
@observable open = false;
|
||||
|
||||
|
||||
@observable selectedRowKeys = [];
|
||||
|
|
@ -38,8 +40,7 @@ export class CompanyExtendStore {
|
|||
}
|
||||
|
||||
|
||||
@action
|
||||
edit = () => {
|
||||
@action edit = () => {
|
||||
this.isEditor = true;
|
||||
this.getData();
|
||||
this.getTabInfo();
|
||||
|
|
@ -130,7 +131,7 @@ export class CompanyExtendStore {
|
|||
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);
|
||||
this.tableInfo = this.handleTable(res.data.result.tables);
|
||||
//this.tableInfo = this.handleTable(res.data.result.tables);
|
||||
this.getTabInfo();
|
||||
res.data.result.buttons && this.setButtons(res.data.result.buttons);
|
||||
res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export class DepartmentStore {
|
|||
@observable form1 = new WeaForm(); //新增主表表单
|
||||
@observable form2 = new WeaForm(); //复制表单
|
||||
@observable departmentName = '';
|
||||
@observable conditionNum = 8;
|
||||
@observable conditionNum = 4;
|
||||
@observable ids = ''; //选择行id
|
||||
@observable id = ''; //页面跳转参数id
|
||||
@observable searchConditionLoading = true;
|
||||
|
|
@ -73,8 +73,7 @@ export class DepartmentStore {
|
|||
saveAndSetting = false;
|
||||
|
||||
|
||||
@action
|
||||
getTableInfo() {
|
||||
@action getTableInfo() {
|
||||
this.setLoading(true);
|
||||
let params = {
|
||||
...this.selectTreeNodeInfo,
|
||||
|
|
@ -111,8 +110,7 @@ export class DepartmentStore {
|
|||
})
|
||||
}
|
||||
|
||||
@action("nodetree事件")
|
||||
doSearch(params) {
|
||||
@action("nodetree事件") doSearch(params) {
|
||||
this.selectTreeNodeInfo = params;
|
||||
this.setCurrent(1);
|
||||
this.setPageSize(10);
|
||||
|
|
@ -120,8 +118,7 @@ export class DepartmentStore {
|
|||
this.getTableInfo();
|
||||
}
|
||||
|
||||
@action("联查岗位")
|
||||
getPostionTable(id) {
|
||||
@action("联查岗位") getPostionTable(id) {
|
||||
let params = {
|
||||
parentDept: id
|
||||
}
|
||||
|
|
@ -194,7 +191,12 @@ export class DepartmentStore {
|
|||
|
||||
getDeptForm() {
|
||||
this.setDialogLoadingStatus(true);
|
||||
Api.getDeptForm(this.selectTreeNodeInfo).then(res => {
|
||||
let params = {
|
||||
...this.selectTreeNodeInfo,
|
||||
addType:'normal',
|
||||
viewattr:'2'
|
||||
}
|
||||
Api.getDeptForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setDialogLoadingStatus(false);
|
||||
res.data.condition && this.setCondition(res.data.condition);
|
||||
|
|
@ -264,9 +266,7 @@ export class DepartmentStore {
|
|||
};
|
||||
this.form1.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.add(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
Api.add(params).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
|
|
@ -285,7 +285,7 @@ export class DepartmentStore {
|
|||
});
|
||||
}
|
||||
|
||||
merge() {
|
||||
@action("合并") merge() {
|
||||
let params = {
|
||||
id: this.ids,
|
||||
...this.form1.getFormParams()
|
||||
|
|
@ -312,7 +312,7 @@ export class DepartmentStore {
|
|||
});
|
||||
}
|
||||
|
||||
transfer() {
|
||||
@action("转移") transfer() {
|
||||
let params = {
|
||||
id: this.ids,
|
||||
...this.form1.getFormParams()
|
||||
|
|
@ -339,7 +339,7 @@ export class DepartmentStore {
|
|||
});
|
||||
}
|
||||
|
||||
copy() {
|
||||
@action("复制") copy() {
|
||||
let params = {
|
||||
ids: this.ids,
|
||||
...this.form2.getFormParams()
|
||||
|
|
@ -374,28 +374,19 @@ export class DepartmentStore {
|
|||
})
|
||||
}
|
||||
|
||||
key = '';
|
||||
updateConditions(val) {
|
||||
this.form1.updateFields({
|
||||
parent_dept: {
|
||||
value: ''
|
||||
@action("另存为版本") version(record) {
|
||||
Api.version(record).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success(res.msg);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
});
|
||||
const label = "上级部门"
|
||||
let index = findIndex(this.condition[0].items, { label });
|
||||
let currenttime = Date.now();
|
||||
let key = `parentComp_${currenttime}`;
|
||||
const lastKey = this.key;
|
||||
Reflect.deleteProperty(this.condition[0].items[index].browserConditionParam.dataParams, lastKey)
|
||||
this.key = key;
|
||||
this.condition[0].items[index].browserConditionParam.dataParams = {
|
||||
[key]: val,
|
||||
...this.condition[0].items[index].browserConditionParam.dataParams,
|
||||
currenttime: currenttime
|
||||
}
|
||||
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
updateFields(val) {
|
||||
this.form.updateFields({
|
||||
departmentName: {
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ export class DepartmentExtendStore {
|
|||
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);
|
||||
this.tableInfo = this.handleTable(res.data.result.tables);
|
||||
//this.tableInfo = this.handleTable(res.data.result.tables);
|
||||
this.getTabInfo();
|
||||
res.data.result.buttons && this.setButtons(res.data.result.buttons);
|
||||
res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo);
|
||||
|
|
@ -142,10 +142,6 @@ export class DepartmentExtendStore {
|
|||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
handleTable = (datas) => {
|
||||
|
|
|
|||
|
|
@ -71,12 +71,11 @@ export class JobStore {
|
|||
@action initData() {
|
||||
this.getTableInfo();
|
||||
this.getHasRight();
|
||||
this.getCopyForm();
|
||||
this.getMergeForm();
|
||||
// this.getCopyForm();
|
||||
// this.getMergeForm();
|
||||
}
|
||||
|
||||
@action
|
||||
getTableInfo() {
|
||||
@action getTableInfo() {
|
||||
this.setLoading(true);
|
||||
let params = {
|
||||
...this.selectTreeNodeInfo,
|
||||
|
|
@ -113,8 +112,7 @@ export class JobStore {
|
|||
})
|
||||
}
|
||||
|
||||
@action("leftTree事件")
|
||||
doSearch(params) {
|
||||
@action("leftTree事件") doSearch(params) {
|
||||
this.selectTreeNodeInfo = params;
|
||||
this.setCurrent(1);
|
||||
this.setPageSize(10);
|
||||
|
|
@ -122,8 +120,7 @@ export class JobStore {
|
|||
this.getTableInfo();
|
||||
}
|
||||
|
||||
@action("联查人员")
|
||||
getHrmTable(id) {
|
||||
@action("联查人员") getHrmTable(id) {
|
||||
let params = {
|
||||
jobId: id
|
||||
}
|
||||
|
|
@ -139,8 +136,7 @@ export class JobStore {
|
|||
})
|
||||
}
|
||||
|
||||
//删除
|
||||
delete() {
|
||||
@action("删除") delete() {
|
||||
let params = {
|
||||
ids: this.ids
|
||||
};
|
||||
|
|
@ -209,8 +205,7 @@ export class JobStore {
|
|||
})
|
||||
}
|
||||
|
||||
@action("复制表单")
|
||||
getCopyForm() {
|
||||
@action("复制表单") getCopyForm() {
|
||||
let params = {};
|
||||
Api.getCopyForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
|
|
@ -223,8 +218,7 @@ export class JobStore {
|
|||
})
|
||||
}
|
||||
|
||||
@action("合并表单")
|
||||
getMergeForm() {
|
||||
@action("合并表单") getMergeForm() {
|
||||
Api.getMergeForm().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data && this.setMergeCondition(res.data);
|
||||
|
|
@ -303,123 +297,7 @@ export class JobStore {
|
|||
})
|
||||
}
|
||||
|
||||
updateConditions(data) {
|
||||
if (data.sequence_id) {
|
||||
if (data.sequence_id.valueObj.length > 0) {
|
||||
const params = {
|
||||
"sequenceId":data.sequence_id.value
|
||||
}
|
||||
Api.getSchemeInfo(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
let label = "等级方案";
|
||||
const index = findIndex(this.condition[1].items, { label });
|
||||
const schemeId = res.data.id;
|
||||
this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: res.data.name, id: schemeId }];
|
||||
//清空职级并限制范围
|
||||
label = "职级"
|
||||
const index1 = findIndex(this.condition[1].items, { label });
|
||||
let currenttime = 1657247378274
|
||||
let key = `scheme_id_${currenttime}`;
|
||||
// Object.defineProperty(this.condition[1].items[index1].browserConditionParam.completeParams, [key], {
|
||||
// value: schemeId,
|
||||
// })
|
||||
this.condition[1].items[index1].browserConditionParam.completeParams = {
|
||||
...this.condition[1].items[index1].browserConditionParam.completeParams,
|
||||
[key]: schemeId,
|
||||
currenttime: currenttime
|
||||
}
|
||||
this.condition[1].items[index1].browserConditionParam.conditionDataParams = {
|
||||
...this.condition[1].items[index1].browserConditionParam.conditionDataParams,
|
||||
[key]: schemeId,
|
||||
currenttime: currenttime
|
||||
}
|
||||
this.condition[1].items[index1].browserConditionParam.dataParams = {
|
||||
...this.condition[1].items[index1].browserConditionParam.dataParams,
|
||||
[key]: schemeId,
|
||||
currenttime: currenttime
|
||||
}
|
||||
this.condition[1].items[index1].browserConditionParam.destDataParams = {
|
||||
...this.condition[1].items[index1].browserConditionParam.destDataParams,
|
||||
[key]: schemeId,
|
||||
currenttime: currenttime
|
||||
}
|
||||
this.form1.updateFields({
|
||||
scheme_id: {
|
||||
value: ''
|
||||
},
|
||||
level_id: {
|
||||
value: ''
|
||||
},
|
||||
grade_id: {
|
||||
value: ''
|
||||
}
|
||||
});
|
||||
this.setCondition(this.condition);
|
||||
this.form1.initFormFields(this.condition);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
});
|
||||
|
||||
}
|
||||
} else if (data.grade_id) {
|
||||
//清空职等并限制范围
|
||||
let label = "职等"
|
||||
const index2 = findIndex(this.condition[1].items, { label });
|
||||
let currenttime = 1657247378274;
|
||||
let key1 = `level_id_${currenttime}`;
|
||||
let key2 = `scheme_id_${currenttime}`;
|
||||
let params = {
|
||||
id: data.grade_id.value
|
||||
};
|
||||
Api.getLevelId(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
const levelId = res.data;
|
||||
this.condition[1].items[index2].browserConditionParam.completeParams = {
|
||||
...this.condition[1].items[index2].browserConditionParam.completeParams,
|
||||
[key1]: levelId,
|
||||
[key2]: "''",
|
||||
currenttime: currenttime
|
||||
}
|
||||
this.condition[1].items[index2].browserConditionParam.conditionDataParams = {
|
||||
...this.condition[1].items[index2].browserConditionParam.conditionDataParams,
|
||||
[key1]: levelId,
|
||||
[key2]: "''",
|
||||
currenttime: currenttime
|
||||
}
|
||||
this.condition[1].items[index2].browserConditionParam.dataParams = {
|
||||
...this.condition[1].items[index2].browserConditionParam.dataParams,
|
||||
[key1]: levelId,
|
||||
[key2]: "''",
|
||||
currenttime: currenttime
|
||||
}
|
||||
this.condition[1].items[index2].browserConditionParam.destDataParams = {
|
||||
...this.condition[1].items[index2].browserConditionParam.destDataParams,
|
||||
[key]: levelId,
|
||||
[key2]: "''",
|
||||
currenttime: currenttime
|
||||
}
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
this.form1.updateFields({
|
||||
level_id: {
|
||||
value: ''
|
||||
}
|
||||
});
|
||||
this.setCondition(this.condition);
|
||||
this.form1.initFormFields(this.condition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
@action getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
|
|
|
|||
|
|
@ -130,25 +130,8 @@ export class JobExtendStore {
|
|||
}
|
||||
Api.getJobExtendForm(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
//默认职级职等范围
|
||||
let conditions = res.data.result.conditions;
|
||||
if (this.isEditor == true && this.selectedKey == '0') {
|
||||
let currenttime = 1657247378274;
|
||||
let key0 = `scheme_id_${currenttime}`;
|
||||
let key1 = `level_id_${currenttime}`;
|
||||
let key2 = `scheme_id_${currenttime}`;
|
||||
let label = "职级"
|
||||
const index1 = findIndex(conditions[1].items, { label });
|
||||
label = "职等"
|
||||
const index2 = findIndex(conditions[1].items, { label });
|
||||
let schemeId = conditions[1].items[1].browserConditionParam.replaceDatas.length > 0 && conditions[1].items[1].browserConditionParam.replaceDatas[0].id;
|
||||
let levelIds = res.data.levelIds;
|
||||
this.rangeLimit(key0, schemeId, index1, currenttime, conditions);
|
||||
this.rangeLimitLevel(key1, key2, index2, levelIds, currenttime, conditions)
|
||||
}
|
||||
|
||||
res.data.result.conditions && this.form.initFormFields(conditions);
|
||||
res.data.result.conditions && this.setCondition(conditions);
|
||||
res.data.result.conditions && this.form.initFormFields(res.data.result.conditions);
|
||||
res.data.result.conditions && this.setCondition(res.data.result.conditions);
|
||||
this.tableInfo = this.handleTable(res.data.result.tables);
|
||||
this.getTabInfo();
|
||||
res.data.result.buttons && this.setButtons(res.data.result.buttons);
|
||||
|
|
@ -189,143 +172,6 @@ export class JobExtendStore {
|
|||
}
|
||||
|
||||
|
||||
updateConditions(data) {
|
||||
if (data.sequence_id) {
|
||||
if (data.sequence_id.valueObj.length > 0) {
|
||||
let label = "岗位序列";
|
||||
const item = findIndex(this.condition[1].items, { label });
|
||||
this.condition[1].items[item].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].sequence_names || data.sequence_id.valueObj[0].name, id: data.sequence_id.value }];
|
||||
this.condition[1].items[2].browserConditionParam.replaceDatas = [{ name: "", id: "" }];
|
||||
this.condition[1].items[3].browserConditionParam.replaceDatas = [{ name: "", id: "" }];
|
||||
|
||||
const params = {
|
||||
"sequenceId": data.sequence_id.value
|
||||
}
|
||||
Api.getSchemeInfo(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
label = "等级方案"
|
||||
const index = findIndex(this.condition[1].items, { label });
|
||||
const schemeId = res.data.id;
|
||||
this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: res.data.name, id: schemeId }];
|
||||
//清空职级并限制范围
|
||||
label = "职级"
|
||||
const index1 = findIndex(this.condition[1].items, { label });
|
||||
let currenttime = 1657247378274;
|
||||
let key = `scheme_id_${currenttime}`;
|
||||
let condition = this.rangeLimit(key, schemeId, index1, currenttime, this.condition);
|
||||
this.form.updateFields({
|
||||
scheme_id: {
|
||||
value: schemeId
|
||||
},
|
||||
level_id: {
|
||||
value: ''
|
||||
},
|
||||
grade_id: {
|
||||
value: ''
|
||||
}
|
||||
});
|
||||
this.setCondition(condition);
|
||||
this.form.initFormFields(condition);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
} else if (data.grade_id) {
|
||||
let condition = this.condition;
|
||||
//清空职等并限制范围
|
||||
let label = "职等"
|
||||
const index2 = findIndex(this.condition[1].items, { label });
|
||||
this.condition[1].items[index2].browserConditionParam.replaceDatas = [{ name: "", id: "" }];
|
||||
label = "职级";
|
||||
const item = findIndex(this.condition[1].items, { label });
|
||||
let grade_names = data.grade_id.valueSpan ? data.grade_id.valueSpan.replace(/<.*?>/g, '') : "";
|
||||
let value = data.grade_id.value;
|
||||
this.condition[1].items[item].browserConditionParam.replaceDatas = [{ name: grade_names, id: value }];
|
||||
let currenttime = 1657247378274;
|
||||
let key1 = `level_id_${currenttime}`;
|
||||
let key2 = `scheme_id_${currenttime}`;
|
||||
let params = {
|
||||
id: data.grade_id.value
|
||||
};
|
||||
Api.getLevelId(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
const levelId = res.data;
|
||||
condition = this.rangeLimitLevel(key1, key2, index2, levelId, currenttime, this.condition);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
this.form.updateFields({
|
||||
level_id: {
|
||||
value: ''
|
||||
}
|
||||
});
|
||||
this.setCondition(condition);
|
||||
this.form.initFormFields(condition);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
rangeLimit(key, value, index, currenttime, condition) {
|
||||
condition[1].items[index].browserConditionParam.completeParams = {
|
||||
...condition[1].items[index].browserConditionParam.completeParams,
|
||||
[key]: value,
|
||||
currenttime: currenttime
|
||||
}
|
||||
condition[1].items[index].browserConditionParam.conditionDataParams = {
|
||||
...condition[1].items[index].browserConditionParam.conditionDataParams,
|
||||
[key]: value,
|
||||
currenttime: currenttime
|
||||
}
|
||||
condition[1].items[index].browserConditionParam.dataParams = {
|
||||
...condition[1].items[index].browserConditionParam.dataParams,
|
||||
[key]: value,
|
||||
currenttime: currenttime
|
||||
}
|
||||
condition[1].items[index].browserConditionParam.destDataParams = {
|
||||
...condition[1].items[index].browserConditionParam.destDataParams,
|
||||
[key]: value,
|
||||
currenttime: currenttime
|
||||
}
|
||||
return condition;
|
||||
}
|
||||
|
||||
rangeLimitLevel(key1, key2, index, value, currenttime, condition) {
|
||||
condition[1].items[index].browserConditionParam.completeParams = {
|
||||
...condition[1].items[index].browserConditionParam.completeParams,
|
||||
[key1]: value,
|
||||
[key2]: "''",
|
||||
currenttime: currenttime
|
||||
}
|
||||
condition[1].items[index].browserConditionParam.conditionDataParams = {
|
||||
...condition[1].items[index].browserConditionParam.conditionDataParams,
|
||||
[key1]: value,
|
||||
[key2]: "''",
|
||||
currenttime: currenttime
|
||||
}
|
||||
condition[1].items[index].browserConditionParam.dataParams = {
|
||||
...condition[1].items[index].browserConditionParam.dataParams,
|
||||
[key1]: value,
|
||||
[key2]: "''",
|
||||
currenttime: currenttime
|
||||
}
|
||||
condition[1].items[index].browserConditionParam.destDataParams = {
|
||||
...condition[1].items[index].browserConditionParam.destDataParams,
|
||||
[key]: value,
|
||||
[key2]: "''",
|
||||
currenttime: currenttime
|
||||
}
|
||||
|
||||
return condition;
|
||||
|
||||
}
|
||||
|
||||
setLoading(val) {
|
||||
this.loading = val;
|
||||
|
|
|
|||
|
|
@ -71,14 +71,14 @@ export class NewImportStore {
|
|||
"linkName": "部门导入",
|
||||
"url": "/spa/organization/static/index.html#/main/organization/department"
|
||||
},
|
||||
{
|
||||
"subTitle": "岗位设置",
|
||||
"bgColor": "#49B2FE",
|
||||
"icon": "icon-coms-hrm",
|
||||
"title": "岗位",
|
||||
"linkName": "岗位体系导入",
|
||||
"url": "/spa/organization/static/index.html#/main/organization/job"
|
||||
},
|
||||
// {
|
||||
// "subTitle": "岗位设置",
|
||||
// "bgColor": "#49B2FE",
|
||||
// "icon": "icon-coms-hrm",
|
||||
// "title": "岗位",
|
||||
// "linkName": "岗位体系导入",
|
||||
// "url": "/spa/organization/static/index.html#/main/organization/job"
|
||||
// },
|
||||
{
|
||||
"subTitle": "组织维护",
|
||||
"bgColor": "#51A39A",
|
||||
|
|
|
|||
|
|
@ -167,6 +167,18 @@ const {
|
|||
this.tableStore.selectedRowKeys = [];
|
||||
}
|
||||
|
||||
@action("另存为版本") version(record) {
|
||||
Api.version(record).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success(res.msg);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
this.form2.updateFields({
|
||||
lastName: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue