From 8931a061279f1a01c41205a0516485ab8f27e47e Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 28 Oct 2022 17:45:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E6=9D=83=E5=BC=80=E5=85=B3=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/managerDetach.js | 6 +++++- .../components/detach/ManagerDetach.js | 16 +++++++++++----- pc4mobx/organization/stores/managerDetach.js | 17 ++++++++++++++++- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/pc4mobx/organization/apis/managerDetach.js b/pc4mobx/organization/apis/managerDetach.js index c80c271..79b9766 100644 --- a/pc4mobx/organization/apis/managerDetach.js +++ b/pc4mobx/organization/apis/managerDetach.js @@ -15,10 +15,14 @@ export const getAdvanceSearchCondition = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/detach/getSearchCondition', 'GET', params); } -export const getSchemeForm = (params) => { +export const getForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/detach/getForm', 'GET', params); } +export const doDetachSwitch = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/detach/doDetach', 'GET', params); +} + export const deleteTableData = (params) => { return fetch('/api/bs/hrmorganization/detach/deleteByIds', { method: 'POST', diff --git a/pc4mobx/organization/components/detach/ManagerDetach.js b/pc4mobx/organization/components/detach/ManagerDetach.js index 929e496..08ba43c 100644 --- a/pc4mobx/organization/components/detach/ManagerDetach.js +++ b/pc4mobx/organization/components/detach/ManagerDetach.js @@ -237,17 +237,17 @@ export default class ManagerDetach extends React.Component { // }) } - updateForbiddenTag(checked, id) { + doDetachSwitch(checked) { const { managerDetach } = this.props; confirm({ title: i18n.confirm.defaultTitle(), - content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + content: (checked == true) ? "确定启用组织管理分权吗" : "确定取消组织管理分权", okText: i18n.button.ok(), cancelText: i18n.button.cancel(), onOk() { - managerDetach.updateForbiddenTag(checked, id); + managerDetach.setDetach(checked); }, onCancel() { return false; @@ -293,6 +293,8 @@ export default class ManagerDetach extends React.Component { }); } + + handleSave() { const { @@ -369,7 +371,7 @@ export default class ManagerDetach extends React.Component { } = this.props; const { isPanelShow, form2, managerName, conditionNum, tableStore, nEdialogTitle, visible, condition, - form, dialogLoading, isEdit, date, hasRight + form, dialogLoading, isEdit, date, hasRight,isDetach } = managerDetach; if (hasRight === false) { @@ -381,7 +383,11 @@ export default class ManagerDetach extends React.Component { this.handleMenuClick(key)} - > + > +
+ 启用组织管理分权: + this.doDetachSwitch(checked)} /> +
} diff --git a/pc4mobx/organization/stores/managerDetach.js b/pc4mobx/organization/stores/managerDetach.js index 9e7ea88..6f3e7a4 100644 --- a/pc4mobx/organization/stores/managerDetach.js +++ b/pc4mobx/organization/stores/managerDetach.js @@ -44,6 +44,7 @@ export class ManagerDetachStore { @observable detachId = ''; @observable date = ''; @observable hasRight = ''; + @observable isDetach = ''; @action("列表数据加载") getTableInfo(isOnChange = false) { let params; @@ -60,6 +61,7 @@ export class ManagerDetachStore { Api.getSearchList(params).then(res => { if (res.code === 200) { this.setHasRight(res.data.hasRight); + this.isDetach = res.data.isDetach; isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1); } else { message.warning(res.msg); @@ -145,7 +147,7 @@ export class ManagerDetachStore { id: this.detachId } this.setDialogLoadingStatus(true); - Api.getSchemeForm(params).then(res => { + Api.getForm(params).then(res => { if (res.code === 200) { this.setDialogLoadingStatus(false); res.data.condition && this.setCondition(res.data.condition); @@ -188,6 +190,19 @@ export class ManagerDetachStore { }) } + @action("分权设置") setDetach(checked) { + Api.doDetachSwitch({idDetach:checked}).then(res => { + if (res.code === 200) { + this.isDetach = res.data; + message.success(res.msg); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + updateFields(val) { this.form2.updateFields({ ecManager: {