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:
liang.cheng 2022-12-09 14:51:10 +08:00
commit 68c07ee8b9
22 changed files with 289 additions and 478 deletions

View File

@ -4,7 +4,6 @@ import {
} from 'ecCom' } from 'ecCom'
export const getSearchList = (params) => { 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/comp/listComp', {
method: 'POST', method: 'POST',
mode: 'cors', mode: 'cors',
@ -43,25 +42,14 @@ export const getAdvanceSearchCondition = (params) => {
} }
export const add = (params) => { export const add = (params) => {
return fetch('/api/bs/hrmorganization/comp/saveBaseComp', { return WeaTools.callApi('/api/bs/hrmorganization/comp/saveBaseComp', 'POST', params);
method: 'POST', }
mode: 'cors',
headers: { export const version = (params) => {
'Content-Type': 'application/json' return WeaTools.callApi('/api/bs/hrmorganization/version/subcompanyfielddefined/save', 'POST', params);
},
body: JSON.stringify(params)
})
} }
export const editResource = (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/comp/updateComp', 'POST', params);
} }

View File

@ -41,19 +41,16 @@ export const getMergeForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getMergeForm', 'GET', 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) => { export const getTransferForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getMoveForm', 'GET', params); return WeaTools.callApi('/api/bs/hrmorganization/dept/getMoveForm', 'GET', params);
} }
export const add = (params) => { export const add = (params) => {
return fetch('/api/bs/hrmorganization/dept/saveBaseForm', { return WeaTools.callApi('/api/bs/hrmorganization/dept/saveBaseForm', 'POST', params);
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
} }
export const copy = (params) => { export const copy = (params) => {

View File

@ -39,6 +39,10 @@ export const getResourceExtendForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getBaseForm', 'GET', 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) => { export const exportResource = (ids) => {

View File

@ -48,6 +48,10 @@ export default class NewAndEditDialog extends React.Component {
tipPosition="bottom" tipPosition="bottom"
wrapperCol={{ span: `${field.fieldcol}` }}> 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} />} {<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>) </WeaFormItem>)
}) })
}) })
@ -65,12 +69,6 @@ export default class NewAndEditDialog extends React.Component {
if (moduleName == 'staffScheme' && data.planYear) { if (moduleName == 'staffScheme' && data.planYear) {
bindChangeEnvent(data.planYear.value); 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) { if (moduleName == 'staff' && data.planId) {
bindChangeEnvent(data); 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} <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@5r6c5a@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} onChange={this.onChange}
onBlur={this.onBlur} /> onBlur={this.onBlur} />
{field.domkey[0] == 'comp_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] == 'dept_no' && 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] == '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}/>} {field.domkey[0] == 'work_code' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}

View File

@ -29,8 +29,8 @@ export default class AttachToNumberField extends PureComponent {
canNew: false canNew: false
}; };
this.typeMap = { this.typeMap = {
comp_no: "SUBCOMPANY", subcompanycode: "SUBCOMPANY",
dept_no: "DEPARTMENT", departmentcode: "DEPARTMENT",
job_no: "JOBTITLES", job_no: "JOBTITLES",
work_code: "USER" work_code: "USER"
}; };

View File

@ -58,7 +58,7 @@ class ColumnSetting extends Component {
render() { render() {
const { columnSetting } = this.props; const { columnSetting } = this.props;
const { selectedKey, authorized } = columnSetting; const { selectedKey, authorized } = columnSetting;
if (!authorized) { if (authorized === false) {
return renderNoright(); return renderNoright();
} }
return ( return (

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-05-18 14:52:39 * @Date: 2022-05-18 14:52:39
* @LastEditTime: 2022-10-12 18:01:56 * @LastEditTime: 2022-12-09 11:08:06
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js * @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 isEmpty from 'lodash/isEmpty'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
import forEach from 'lodash/forEach' 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 { WeaSwitch } from 'comsMobx';
import { inject, observer } from 'mobx-react'; import { inject, observer } from 'mobx-react';
import * as mobx from 'mobx'; import * as mobx from 'mobx';
@ -30,9 +30,9 @@ export default class CompanyExtend extends React.Component {
this.init(); this.init();
} }
init = () => { init = () => {
const { companyExtend,company } = this.props; const { companyExtend, company } = this.props;
//const {id} = company; //const {id} = company;
let {hash} = window.location; let { hash } = window.location;
hash = hash.split("?")[0]; hash = hash.split("?")[0];
let id = hash.match("[^/]+(?=/$|$)")[0]; let id = hash.match("[^/]+(?=/$|$)")[0];
companyExtend.init(); companyExtend.init();
@ -42,14 +42,14 @@ export default class CompanyExtend extends React.Component {
getTabChildren = () => { getTabChildren = () => {
const { companyExtend } = this.props; const { companyExtend } = this.props;
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = companyExtend; let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = companyExtend;
let tabChildren = []; let tabChildren = [];
tableInfo = toJS(tableInfo); tableInfo = toJS(tableInfo);
tableInfo && tableInfo.map((t, i) => { tableInfo && tableInfo.map((t, i) => {
if (detailSelectedKey == i) { if (detailSelectedKey == i) {
tabChildren.push( tabChildren.push(
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`} <WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
ref={(ref)=>companyExtend.setPersonalEditTables(ref)} ref={(ref) => companyExtend.setPersonalEditTables(ref)}
showTitle={isEditor} showTitle={isEditor}
// title={'列表信息'} // title={'列表信息'}
//addFirstRow={isEditor} //addFirstRow={isEditor}
@ -128,7 +128,7 @@ export default class CompanyExtend extends React.Component {
labelCol={{ span: `${field.labelcol}` }} labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{ span: `${field.fieldcol}` }}> wrapperCol={{ span: `${field.fieldcol}` }}>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} /> <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>), </WeaFormItem>),
colSpan: 1 colSpan: 1
}); });
@ -179,6 +179,13 @@ export default class CompanyExtend extends React.Component {
onClick: key => { onClick: key => {
this.editCard(); 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 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 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 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 = []; const btns = [];
try { try {
if (isEditor) { if (isEditor) {
@ -203,6 +211,7 @@ export default class CompanyExtend extends React.Component {
} else { } else {
if (buttons.hasEdit) { if (buttons.hasEdit) {
btns.push(edit); btns.push(edit);
btns.push(view);
} }
} }
} catch (e) { } } catch (e) { }
@ -223,66 +232,88 @@ export default class CompanyExtend extends React.Component {
this.init(); this.init();
} }
view = () => {
const { companyExtend } = this.props;
companyExtend.open = true;
}
onClose = () => {
const { companyExtend } = this.props;
companyExtend.open = false;
}
changeData(key) { changeData(key) {
const { const {
companyExtend companyExtend
} = this.props; } = this.props;
companyExtend.changeData(key); companyExtend.changeData(key);
} }
render() { render() {
const { companyExtend } = this.props; 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 { //try {
return ( return (
<div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}> <div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`} <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
datas={this.getRightMenu()} 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`} <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
loading={true} datas={topTab}
title={isEditor ? i18n.label.updateCompany() : i18n.label.viewCompany()} keyParam="viewCondition" //主键
icon={<i className='icon-coms-hrm' />} selectedKey={selectedKey}
iconBgcolor='#217346' onChange={this.changeData.bind(this)}
buttons={this.getTopButtons()} />
showDropIcon={true} <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}>
dropMenuDatas={this.getRightMenu()} {this.getSearchs()}
> {
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`} !isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'>
datas={topTab} <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`}
keyParam="viewCondition" //主键 type='card'
selectedKey={selectedKey} keyParam='key'
onChange={this.changeData.bind(this)} datas={toJS(tabInfo)}
/> selectedKey={detailSelectedKey}
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}> onChange={v => {
{this.getSearchs()} companyExtend.updateDetailSelectedKey(v);
{ }}
!isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'> />
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`} {this.getTabChildren()}
type='card' </div>
keyParam='key' }
datas={toJS(tabInfo)} </Spin>
selectedKey={detailSelectedKey}
onChange={v => {
companyExtend.updateDetailSelectedKey(v); </WeaTop>
}}
/>
{this.getTabChildren()}
</div>
}
</Spin>
</WeaTop>
</WeaRightMenu>
</div> </WeaRightMenu>
)
} <WeaSlideModal visible={open}
catch (e) { top={6}
return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}> width={40}
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div> height={94}
</WeaAlertPage> 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>
// }
} }
} }

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-05-18 16:23:32 * @Date: 2022-05-18 16:23:32
* @LastEditTime: 2022-11-08 18:39:26 * @LastEditTime: 2022-12-09 11:36:44
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js * @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() { getTransferForm() {
const { const {
company company
@ -316,12 +334,12 @@ export default class Company extends React.Component {
// } // }
// }); // });
columns.forEach((c, index) => { columns.forEach((c, index) => {
if (c.dataIndex == 'forbiddenTag') { if (c.dataIndex == 'canceled') {
c.render = function (text, record) { 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.className = "wea-table-indent"
c.render = function (text, record) { c.render = function (text, record) {
return <a onClick={() => { return <a onClick={() => {
@ -348,6 +366,9 @@ export default class Company extends React.Component {
<Menu.Item key="4"> <Menu.Item key="4">
<a href='javascript:void(0);' onClick={() => { _this.transfer(record.id) }}>转移</a> <a href='javascript:void(0);' onClick={() => { _this.transfer(record.id) }}>转移</a>
</Menu.Item> </Menu.Item>
<Menu.Item key="5">
<a href='javascript:void(0);' onClick={() => { _this.version(record) }}>另存为版本</a>
</Menu.Item>
</Menu> </Menu>
) )
return <Dropdown overlay={menu}> return <Dropdown overlay={menu}>
@ -594,7 +615,7 @@ export default class Company extends React.Component {
isFormInit={form1.isFormInit} isFormInit={form1.isFormInit}
loading={dialogLoading} loading={dialogLoading}
isEdit={isEdit} isEdit={isEdit}
height={400} height={340}
conditionLen={2} conditionLen={2}
save={() => this.handleSave()} save={() => this.handleSave()}
onCancel={() => company.setNewVisible(false)} onCancel={() => company.setNewVisible(false)}

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-06-02 09:19:37 * @Date: 2022-06-02 09:19:37
* @LastEditTime: 2022-11-08 18:40:46 * @LastEditTime: 2022-12-09 11:47:53
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js * @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); !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) { reRenderColumns(columns) {
const { const {
@ -345,12 +364,12 @@ export default class Department extends React.Component {
} = this.props; } = this.props;
let _this = this; let _this = this;
columns.forEach((c, index) => { columns.forEach((c, index) => {
if (c.dataIndex == 'forbiddenTag') { if (c.dataIndex == 'canceled') {
c.render = function (text, record) { 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.className = "wea-table-indent"
c.render = function (text, record) { c.render = function (text, record) {
return <a href='javascript:void(0);' onClick={() => { return <a href='javascript:void(0);' onClick={() => {
@ -382,6 +401,9 @@ export default class Department extends React.Component {
<Menu.Item key="5"> <Menu.Item key="5">
<a href='javascript:void(0);' onClick={() => { _this.copy(record.id) }}>复制</a> <a href='javascript:void(0);' onClick={() => { _this.copy(record.id) }}>复制</a>
</Menu.Item> </Menu.Item>
<Menu.Item key="6">
<a href='javascript:void(0);' onClick={() => { _this.version(record) }}>另存为版本</a>
</Menu.Item>
</Menu> </Menu>
) )
return <Dropdown overlay={menu}> return <Dropdown overlay={menu}>
@ -513,7 +535,8 @@ export default class Department extends React.Component {
let tree = ( let tree = (
<WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@dhi1ro`} <WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@dhi1ro`}
ref='WeaOrgTree' ref='WeaOrgTree'
dataUrl={"/api/bs/hrmorganization/dept/getSearchTree"} // dataUrl={"/api/bs/hrmorganization/dept/getSearchTree"}
dataUrl={"/api/hrm/base/getHrmSearchTree"}
loading loading
needSearch needSearch
noCache={true} noCache={true}

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-05-26 14:05:59 * @Date: 2022-05-26 14:05:59
* @LastEditTime: 2022-10-26 15:49:00 * @LastEditTime: 2022-12-08 15:04:50
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js
*/ */
@ -343,18 +343,18 @@ export default class Job extends React.Component {
<Menu.Item key="0"> <Menu.Item key="0">
<a href='javascript:void(0);' onClick={() => { _this.view(record.id) }}>查看</a> <a href='javascript:void(0);' onClick={() => { _this.view(record.id) }}>查看</a>
</Menu.Item> </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> <a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
</Menu.Item> </Menu.Item>
<Menu.Item key="2"> <Menu.Item key="2">
<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.Item>
<Menu.Item key="3"> {/* <Menu.Item key="3">
<a href='javascript:void(0);' onClick={() => { _this.merge(record.id) }}>合并</a> <a href='javascript:void(0);' onClick={() => { _this.merge(record.id) }}>合并</a>
</Menu.Item> </Menu.Item>
<Menu.Item key="4"> <Menu.Item key="4">
<a href='javascript:void(0);' onClick={() => { _this.copy(record.id) }}>复制</a> <a href='javascript:void(0);' onClick={() => { _this.copy(record.id) }}>复制</a>
</Menu.Item> </Menu.Item> */}
</Menu> </Menu>
) )
return <Dropdown overlay={menu}> return <Dropdown overlay={menu}>
@ -481,7 +481,8 @@ export default class Job extends React.Component {
let tree = ( let tree = (
<WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@dhi1ro`} <WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@dhi1ro`}
ref='WeaOrgTree' ref='WeaOrgTree'
dataUrl={"/api/bs/hrmorganization/job/getSearchTree"} // dataUrl={"/api/bs/hrmorganization/job/getSearchTree"}
dataUrl={"/api/hrm/base/getHrmSearchTree"}
loading loading
needSearch needSearch
noCache={true} noCache={true}
@ -665,7 +666,6 @@ export default class Job extends React.Component {
onCancel={() => job.setNewVisible(false)} onCancel={() => job.setNewVisible(false)}
saveAndSetting = {() => this.handleSaveAndSetting()} saveAndSetting = {() => this.handleSaveAndSetting()}
moduleName={"job"} moduleName={"job"}
bindChangeEnvent={val => job.updateConditions(val)}
/> />
</div> </div>
) )

View File

@ -104,13 +104,13 @@ export default class newImport extends React.Component {
case 1: case 1:
newImport.importType = 'department'; newImport.importType = 'department';
break; break;
// case 2:
// newImport.importType = 'jobtitle';
// break;
case 2: case 2:
newImport.importType = 'jobtitle';
break;
case 3:
newImport.importType = 'resource'; newImport.importType = 'resource';
break; break;
case 4: case 3:
newImport.importType = 'joblevel'; newImport.importType = 'joblevel';
break; break;
} }

View File

@ -224,10 +224,11 @@ export default class Resource extends React.Component {
resource resource
} = this.props; } = this.props;
resource.setNeDialogTitle(i18n.label.newPeople()); // resource.setNeDialogTitle(i18n.label.newPeople());
resource.setIsNew(true); // resource.setIsNew(true);
resource.setVisible(true); // resource.setVisible(true);
resource.getForm(); // resource.getForm();
window.open("/spa/hrm/index_mobx.html#/main/hrm/add","_blank")
} }
import() { import() {
@ -318,7 +319,7 @@ export default class Resource extends React.Component {
reRenderColumns(columns) { reRenderColumns(columns) {
let _this = this; let _this = this;
columns.forEach((c, index) => { columns.forEach((c, index) => {
if (c.dataIndex == 'last_name') { if (c.dataIndex == 'lastname') {
c.render = function (text, record) { c.render = function (text, record) {
return <a href='javascript:void(0);' onClick={() => { return <a href='javascript:void(0);' onClick={() => {
window.open(`/spa/organization/static/index.html#/main/organization/resourceCard/${record.id}`); window.open(`/spa/organization/static/index.html#/main/organization/resourceCard/${record.id}`);
@ -334,12 +335,31 @@ export default class Resource extends React.Component {
index index
} = operate; } = operate;
(index == '0') && this.view(record.randomFieldId); (index == '0') && this.view(record.randomFieldId);
(index == '1') && this.version(record);
} }
view(id) { view(id) {
window.open(`/spa/organization/static/index.html#/main/organization/resourceCard/${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() { handleSave() {
const { const {
resource resource

View File

@ -873,6 +873,7 @@ export const i18n = {
createType: () => getLabel(30131, '新建类型'), createType: () => getLabel(30131, '新建类型'),
editTypeInfo: () => getLabel(32732, '编辑类型'), editTypeInfo: () => getLabel(32732, '编辑类型'),
nextStep:() => getLabel(30131, '下一步'), nextStep:() => getLabel(30131, '下一步'),
version:() => getLabel(30131, '查看历史版本'),
batchOpen: () => getLabel(534249, '批量解锁'), batchOpen: () => getLabel(534249, '批量解锁'),
collect: () => getLabel(28111, '收藏'), collect: () => getLabel(28111, '收藏'),

View File

@ -31,7 +31,6 @@ export class ColumnSetting {
columns: [], columns: [],
loading: true, loading: true,
selectedData: {}, //selectedData受控 selectedData: {}, //selectedData受控
authorized: false
}; };
@observable tabThreeRelatedData = { @observable tabThreeRelatedData = {
datas: [], //datas受控 datas: [], //datas受控
@ -109,11 +108,6 @@ export class ColumnSetting {
} = rs; } = rs;
if (api_status) { if (api_status) {
if (!columns || !datas) {
this.tabTwoRelatedData.authorized = false;
return;
}
this.tabTwoRelatedData.authorized = true;
columns.map((c, index) => { columns.map((c, index) => {
if (c.key === "itemurl") { if (c.key === "itemurl") {
c.title = <span> c.title = <span>

View File

@ -42,7 +42,7 @@ export class CompanyStore {
@observable form = new WeaForm(); @observable form = new WeaForm();
@observable form1 = new WeaForm(); //新增主表表单 @observable form1 = new WeaForm(); //新增主表表单
@observable companyName = ''; @observable companyName = '';
@observable conditionNum = 8; @observable conditionNum = 4;
@observable ids = ''; //选择行id @observable ids = ''; //选择行id
@observable id = ''; //页面跳转参数id @observable id = ''; //页面跳转参数id
@observable searchConditionLoading = true; @observable searchConditionLoading = true;
@ -63,10 +63,9 @@ export class CompanyStore {
@observable transferCondition = []; @observable transferCondition = [];
@action
getTableInfo() { @action("列表树") getTableInfo() {
this.setLoading(true); this.setLoading(true);
let params = { let params = {
current: this.current, current: this.current,
@ -76,7 +75,7 @@ export class CompanyStore {
if (this.isEmptyObject(this.form.getFormParams())) { if (this.isEmptyObject(this.form.getFormParams())) {
params = { params = {
...params, ...params,
compName: this.companyName subCompanyDesc: this.companyName
}; };
} else { } else {
params = { params = {
@ -102,8 +101,7 @@ export class CompanyStore {
}) })
} }
@action("联查部门") @action("联查部门") getDeptTable(id) {
getDeptTable(id) {
let params = { let params = {
parentComp: id parentComp: id
} }
@ -122,8 +120,8 @@ export class CompanyStore {
}) })
} }
//删除
@action delete() { @action("删除") delete() {
let params = { let params = {
ids: this.ids ids: this.ids
}; };
@ -144,7 +142,7 @@ export class CompanyStore {
updateForbiddenTag(checked, id) { updateForbiddenTag(checked, id) {
let params = { let params = {
forbiddenTag: checked, canceled: checked,
id: id id: id
} }
Api.updateForbiddenTag(params).then(response => { Api.updateForbiddenTag(params).then(response => {
@ -178,7 +176,10 @@ export class CompanyStore {
getCompanyForm() { getCompanyForm() {
let params = {}; let params = {
addType: 'normal',
viewattr: 2
};
this.setDialogLoadingStatus(true); this.setDialogLoadingStatus(true);
Api.getCompanyForm(params).then(res => { Api.getCompanyForm(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
@ -232,9 +233,7 @@ export class CompanyStore {
}; };
this.form1.validateForm().then(f => { this.form1.validateForm().then(f => {
if (f.isValid) { if (f.isValid) {
Api.add(params).then(response => { Api.add(params).then(data => {
return response.json()
}).then(data => {
if (data.code === 200) { if (data.code === 200) {
message.success(data.msg); message.success(data.msg);
this.getTableInfo(); this.getTableInfo();
@ -253,8 +252,7 @@ export class CompanyStore {
}); });
} }
@action @action getHasRight() {
getHasRight() {
Api.getHasRight().then(res => { Api.getHasRight().then(res => {
if (res.code === 200) { if (res.code === 200) {
res.data.rightMenu && this.setRightMenu(res.data.rightMenu); 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) { updateFields(val) {
this.form.updateFields({ this.form.updateFields({
compName: { subCompanyDesc: {
value: val value: val
} }
}); });
@ -422,6 +432,6 @@ export class CompanyStore {
this.transferCondition = transferCondition; this.transferCondition = transferCondition;
} }
} }

View File

@ -23,7 +23,9 @@ export class CompanyExtendStore {
@observable id = ''; //分部id @observable id = ''; //分部id
@observable date = ''; @observable date = '';
@observable personalEditTables; @observable personalEditTables;
@observable tabkey = '0' @observable tabkey = '0';
@observable open = false;
@observable selectedRowKeys = []; @observable selectedRowKeys = [];
@ -38,8 +40,7 @@ export class CompanyExtendStore {
} }
@action @action edit = () => {
edit = () => {
this.isEditor = true; this.isEditor = true;
this.getData(); this.getData();
this.getTabInfo(); this.getTabInfo();
@ -130,7 +131,7 @@ export class CompanyExtendStore {
if (res.code === 200) { if (res.code === 200) {
res.data.result.conditions && this.form.initFormFields(res.data.result.conditions); res.data.result.conditions && this.form.initFormFields(res.data.result.conditions);
res.data.result.conditions && this.setConditions(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(); this.getTabInfo();
res.data.result.buttons && this.setButtons(res.data.result.buttons); res.data.result.buttons && this.setButtons(res.data.result.buttons);
res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo); res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo);

View File

@ -45,7 +45,7 @@ export class DepartmentStore {
@observable form1 = new WeaForm(); //新增主表表单 @observable form1 = new WeaForm(); //新增主表表单
@observable form2 = new WeaForm(); //复制表单 @observable form2 = new WeaForm(); //复制表单
@observable departmentName = ''; @observable departmentName = '';
@observable conditionNum = 8; @observable conditionNum = 4;
@observable ids = ''; //选择行id @observable ids = ''; //选择行id
@observable id = ''; //页面跳转参数id @observable id = ''; //页面跳转参数id
@observable searchConditionLoading = true; @observable searchConditionLoading = true;
@ -73,8 +73,7 @@ export class DepartmentStore {
saveAndSetting = false; saveAndSetting = false;
@action @action getTableInfo() {
getTableInfo() {
this.setLoading(true); this.setLoading(true);
let params = { let params = {
...this.selectTreeNodeInfo, ...this.selectTreeNodeInfo,
@ -111,8 +110,7 @@ export class DepartmentStore {
}) })
} }
@action("nodetree事件") @action("nodetree事件") doSearch(params) {
doSearch(params) {
this.selectTreeNodeInfo = params; this.selectTreeNodeInfo = params;
this.setCurrent(1); this.setCurrent(1);
this.setPageSize(10); this.setPageSize(10);
@ -120,8 +118,7 @@ export class DepartmentStore {
this.getTableInfo(); this.getTableInfo();
} }
@action("联查岗位") @action("联查岗位") getPostionTable(id) {
getPostionTable(id) {
let params = { let params = {
parentDept: id parentDept: id
} }
@ -194,7 +191,12 @@ export class DepartmentStore {
getDeptForm() { getDeptForm() {
this.setDialogLoadingStatus(true); 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) { if (res.code === 200) {
this.setDialogLoadingStatus(false); this.setDialogLoadingStatus(false);
res.data.condition && this.setCondition(res.data.condition); res.data.condition && this.setCondition(res.data.condition);
@ -264,9 +266,7 @@ export class DepartmentStore {
}; };
this.form1.validateForm().then(f => { this.form1.validateForm().then(f => {
if (f.isValid) { if (f.isValid) {
Api.add(params).then(response => { Api.add(params).then(data => {
return response.json()
}).then(data => {
if (data.code === 200) { if (data.code === 200) {
message.success(data.msg); message.success(data.msg);
this.getTableInfo(); this.getTableInfo();
@ -285,7 +285,7 @@ export class DepartmentStore {
}); });
} }
merge() { @action("合并") merge() {
let params = { let params = {
id: this.ids, id: this.ids,
...this.form1.getFormParams() ...this.form1.getFormParams()
@ -312,7 +312,7 @@ export class DepartmentStore {
}); });
} }
transfer() { @action("转移") transfer() {
let params = { let params = {
id: this.ids, id: this.ids,
...this.form1.getFormParams() ...this.form1.getFormParams()
@ -339,7 +339,7 @@ export class DepartmentStore {
}); });
} }
copy() { @action("复制") copy() {
let params = { let params = {
ids: this.ids, ids: this.ids,
...this.form2.getFormParams() ...this.form2.getFormParams()
@ -374,28 +374,19 @@ export class DepartmentStore {
}) })
} }
key = ''; @action("另存为版本") version(record) {
updateConditions(val) { Api.version(record).then(res => {
this.form1.updateFields({ if (res.code === 200) {
parent_dept: { message.success(res.msg);
value: '' } else {
message.warning(res.msg);
} }
}); }, error => {
const label = "上级部门" message.warning(error.msg);
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
}
} }
updateFields(val) { updateFields(val) {
this.form.updateFields({ this.form.updateFields({
departmentName: { departmentName: {

View File

@ -129,7 +129,7 @@ export class DepartmentExtendStore {
if (res.code === 200) { if (res.code === 200) {
res.data.result.conditions && this.form.initFormFields(res.data.result.conditions); res.data.result.conditions && this.form.initFormFields(res.data.result.conditions);
res.data.result.conditions && this.setConditions(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(); this.getTabInfo();
res.data.result.buttons && this.setButtons(res.data.result.buttons); res.data.result.buttons && this.setButtons(res.data.result.buttons);
res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo); res.data.result.tabInfo && this.setTopTab(res.data.result.tabInfo);
@ -142,10 +142,6 @@ export class DepartmentExtendStore {
}, error => { }, error => {
message.warning(error.msg); message.warning(error.msg);
}) })
} }
handleTable = (datas) => { handleTable = (datas) => {

View File

@ -71,12 +71,11 @@ export class JobStore {
@action initData() { @action initData() {
this.getTableInfo(); this.getTableInfo();
this.getHasRight(); this.getHasRight();
this.getCopyForm(); // this.getCopyForm();
this.getMergeForm(); // this.getMergeForm();
} }
@action @action getTableInfo() {
getTableInfo() {
this.setLoading(true); this.setLoading(true);
let params = { let params = {
...this.selectTreeNodeInfo, ...this.selectTreeNodeInfo,
@ -113,8 +112,7 @@ export class JobStore {
}) })
} }
@action("leftTree事件") @action("leftTree事件") doSearch(params) {
doSearch(params) {
this.selectTreeNodeInfo = params; this.selectTreeNodeInfo = params;
this.setCurrent(1); this.setCurrent(1);
this.setPageSize(10); this.setPageSize(10);
@ -122,8 +120,7 @@ export class JobStore {
this.getTableInfo(); this.getTableInfo();
} }
@action("联查人员") @action("联查人员") getHrmTable(id) {
getHrmTable(id) {
let params = { let params = {
jobId: id jobId: id
} }
@ -139,8 +136,7 @@ export class JobStore {
}) })
} }
//删除 @action("删除") delete() {
delete() {
let params = { let params = {
ids: this.ids ids: this.ids
}; };
@ -209,8 +205,7 @@ export class JobStore {
}) })
} }
@action("复制表单") @action("复制表单") getCopyForm() {
getCopyForm() {
let params = {}; let params = {};
Api.getCopyForm(params).then(res => { Api.getCopyForm(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
@ -223,8 +218,7 @@ export class JobStore {
}) })
} }
@action("合并表单") @action("合并表单") getMergeForm() {
getMergeForm() {
Api.getMergeForm().then(res => { Api.getMergeForm().then(res => {
if (res.code === 200) { if (res.code === 200) {
res.data && this.setMergeCondition(res.data); res.data && this.setMergeCondition(res.data);
@ -303,123 +297,7 @@ export class JobStore {
}) })
} }
updateConditions(data) { @action getHasRight() {
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() {
Api.getHasRight().then(res => { Api.getHasRight().then(res => {
if (res.code === 200) { if (res.code === 200) {
res.data.rightMenu && this.setRightMenu(res.data.rightMenu); res.data.rightMenu && this.setRightMenu(res.data.rightMenu);

View File

@ -130,25 +130,8 @@ export class JobExtendStore {
} }
Api.getJobExtendForm(params).then((res) => { Api.getJobExtendForm(params).then((res) => {
if (res.code === 200) { if (res.code === 200) {
//默认职级职等范围 res.data.result.conditions && this.form.initFormFields(res.data.result.conditions);
let conditions = res.data.result.conditions; res.data.result.conditions && this.setCondition(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);
this.tableInfo = this.handleTable(res.data.result.tables); this.tableInfo = this.handleTable(res.data.result.tables);
this.getTabInfo(); this.getTabInfo();
res.data.result.buttons && this.setButtons(res.data.result.buttons); 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) { setLoading(val) {
this.loading = val; this.loading = val;

View File

@ -71,14 +71,14 @@ export class NewImportStore {
"linkName": "部门导入", "linkName": "部门导入",
"url": "/spa/organization/static/index.html#/main/organization/department" "url": "/spa/organization/static/index.html#/main/organization/department"
}, },
{ // {
"subTitle": "岗位设置", // "subTitle": "岗位设置",
"bgColor": "#49B2FE", // "bgColor": "#49B2FE",
"icon": "icon-coms-hrm", // "icon": "icon-coms-hrm",
"title": "岗位", // "title": "岗位",
"linkName": "岗位体系导入", // "linkName": "岗位体系导入",
"url": "/spa/organization/static/index.html#/main/organization/job" // "url": "/spa/organization/static/index.html#/main/organization/job"
}, // },
{ {
"subTitle": "组织维护", "subTitle": "组织维护",
"bgColor": "#51A39A", "bgColor": "#51A39A",

View File

@ -167,6 +167,18 @@ const {
this.tableStore.selectedRowKeys = []; 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) { updateFields(val) {
this.form2.updateFields({ this.form2.updateFields({
lastName: { lastName: {