diff --git a/pc4mobx/organization/apis/company.js b/pc4mobx/organization/apis/company.js index d90adc4..fc06b9c 100644 --- a/pc4mobx/organization/apis/company.js +++ b/pc4mobx/organization/apis/company.js @@ -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); } diff --git a/pc4mobx/organization/apis/department.js b/pc4mobx/organization/apis/department.js index 799ff3d..c0f15eb 100644 --- a/pc4mobx/organization/apis/department.js +++ b/pc4mobx/organization/apis/department.js @@ -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) => { diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index 6199217..f90612d 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -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) => { diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 2308825..73dfe84 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -48,6 +48,10 @@ export default class NewAndEditDialog extends React.Component { tipPosition="bottom" wrapperCol={{ span: `${field.fieldcol}` }}> {} + {field.domkey[0] == 'subcompanycode' && field.viewAttr != '1' && } + {field.domkey[0] == 'departmentcode' && field.viewAttr != '1' && } + {field.domkey[0] == 'job_no' && field.viewAttr != '1' && } + {field.domkey[0] == 'work_code' && field.viewAttr != '1' && } ) }) }) @@ -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 { > - {field.domkey[0] == 'comp_no' && field.viewAttr != '1' && } - {field.domkey[0] == 'dept_no' && field.viewAttr != '1' && } + {field.domkey[0] == 'subcompanycode' && field.viewAttr != 1 && } + {field.domkey[0] == 'departmentcode' && field.viewAttr != '1' && } {field.domkey[0] == 'job_no' && field.viewAttr != '1' && } {field.domkey[0] == 'work_code' && field.viewAttr != '1' && } diff --git a/pc4mobx/organization/components/NewNumberField.js b/pc4mobx/organization/components/NewNumberField.js index 2d2cb08..648f22f 100644 --- a/pc4mobx/organization/components/NewNumberField.js +++ b/pc4mobx/organization/components/NewNumberField.js @@ -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" }; diff --git a/pc4mobx/organization/components/columnSetting/index.js b/pc4mobx/organization/components/columnSetting/index.js index e60639e..632b8c3 100644 --- a/pc4mobx/organization/components/columnSetting/index.js +++ b/pc4mobx/organization/components/columnSetting/index.js @@ -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 ( diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js index c2d8a78..97c53b7 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -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( 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}` }}> - {field.domkey[0] == 'comp_no' && field.viewAttr != '1' && } + {field.domkey[0] == 'comp_no' && field.viewAttr != '1' && } ), colSpan: 1 }); @@ -179,6 +179,13 @@ export default class CompanyExtend extends React.Component { onClick: key => { this.editCard(); } + }, { + icon: , + content: i18n.button.version(), + key: 'view', + onClick: key => { + this.editCard(); + } } ] } @@ -193,6 +200,7 @@ export default class CompanyExtend extends React.Component { const save = ; const back = ; const edit = ; + const view = ; 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 ( -
- + + } + iconBgcolor='#217346' + buttons={this.getTopButtons()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} > - } - iconBgcolor='#217346' - buttons={this.getTopButtons()} - showDropIcon={true} - dropMenuDatas={this.getRightMenu()} - > - - - {this.getSearchs()} - { - !isEmpty(tabInfo) &&
- { - companyExtend.updateDetailSelectedKey(v); - }} - /> - {this.getTabChildren()} -
- } -
-
-
+ + + {this.getSearchs()} + { + !isEmpty(tabInfo) &&
+ { + companyExtend.updateDetailSelectedKey(v); + }} + /> + {this.getTabChildren()} +
+ } +
+ + + -
- ) - } - catch (e) { - return -
{i18n.message.authFailed()}
-
- } + + + console.log('onAnimationEnd')}/> + + + ) + //} + // catch (e) { + // return + //
{i18n.message.authFailed()}
+ //
+ // } } } diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index fc73210..9736dd3 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -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 _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; - if (c.dataIndex == 'compName') { + if (c.dataIndex == 'subCompanyDesc') { c.className = "wea-table-indent" c.render = function (text, record) { return { @@ -348,6 +366,9 @@ export default class Company extends React.Component { { _this.transfer(record.id) }}>转移 + + { _this.version(record) }}>另存为版本 + ) return @@ -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)} diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index 20dc3d1..62b9228 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -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 _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; - if (c.dataIndex == 'deptName') { + if (c.dataIndex == 'departmentMark') { c.className = "wea-table-indent" c.render = function (text, record) { return { @@ -382,6 +401,9 @@ export default class Department extends React.Component { { _this.copy(record.id) }}>复制 + + { _this.version(record) }}>另存为版本 + ) return @@ -513,7 +535,8 @@ export default class Department extends React.Component { let tree = ( { _this.view(record.id) }}>查看 - + { _this.doDel(record.id) }}>删除 { _this.select(record.id) }}>联查人员 - + {/* { _this.merge(record.id) }}>合并 { _this.copy(record.id) }}>复制 - + */} ) return @@ -481,7 +481,8 @@ export default class Job extends React.Component { let tree = ( job.setNewVisible(false)} saveAndSetting = {() => this.handleSaveAndSetting()} moduleName={"job"} - bindChangeEnvent={val => job.updateConditions(val)} /> ) diff --git a/pc4mobx/organization/components/newImport/index.js b/pc4mobx/organization/components/newImport/index.js index 2614f77..13dfd72 100644 --- a/pc4mobx/organization/components/newImport/index.js +++ b/pc4mobx/organization/components/newImport/index.js @@ -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; } diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index 3a88c60..fffa35a 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -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 { 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 diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index f7c6c57..6cd5a65 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -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, '收藏'), diff --git a/pc4mobx/organization/stores/columnSetting.js b/pc4mobx/organization/stores/columnSetting.js index 9596f17..c9ce74f 100644 --- a/pc4mobx/organization/stores/columnSetting.js +++ b/pc4mobx/organization/stores/columnSetting.js @@ -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 = diff --git a/pc4mobx/organization/stores/company.js b/pc4mobx/organization/stores/company.js index 40f0e1e..813a65e 100644 --- a/pc4mobx/organization/stores/company.js +++ b/pc4mobx/organization/stores/company.js @@ -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; } - + } \ No newline at end of file diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index c9685d3..7729e26 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -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); diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index b9c33bb..b3808b1 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -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: { diff --git a/pc4mobx/organization/stores/departmentextend.js b/pc4mobx/organization/stores/departmentextend.js index 0b9d348..806607d 100644 --- a/pc4mobx/organization/stores/departmentextend.js +++ b/pc4mobx/organization/stores/departmentextend.js @@ -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) => { diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index a78751a..3e4ab51 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -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); diff --git a/pc4mobx/organization/stores/jobextend.js b/pc4mobx/organization/stores/jobextend.js index 46fa8d0..0b45fce 100644 --- a/pc4mobx/organization/stores/jobextend.js +++ b/pc4mobx/organization/stores/jobextend.js @@ -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; diff --git a/pc4mobx/organization/stores/newImport.js b/pc4mobx/organization/stores/newImport.js index 20a3cde..8f72d3d 100644 --- a/pc4mobx/organization/stores/newImport.js +++ b/pc4mobx/organization/stores/newImport.js @@ -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", diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js index 90c45af..0b0dc6f 100644 --- a/pc4mobx/organization/stores/resource.js +++ b/pc4mobx/organization/stores/resource.js @@ -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: {