diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index bd794ec..9f64dcf 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -7,19 +7,8 @@ export const getSearchList = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/listPage', 'GET', params); } -export const deleteTableData = (params) => { - return fetch('/api/bs/hrmorganization/scheme/deleteByIds', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }) -} - export const getAdvanceSearchCondition = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSearchCondition', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSearchCondition', 'GET', params); } export const add = (params) => { @@ -33,34 +22,13 @@ export const add = (params) => { }) } -export const edit = (params) => { - return fetch('/api/bs/hrmorganization/scheme/updateScheme', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }) -} - -export const updateForbiddenTag = (params) => { - return fetch('/api/bs/hrmorganization/scheme/updateForbiddenTagById', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }) -} export const getSchemeForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSaveForm', 'GET', params); } export const getHasRight = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTableBtn', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getHasRight', 'GET', params); } export const editResource = (params) => { diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index f026a49..560202f 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-06-07 16:39:25 + * @LastEditTime: 2022-06-22 10:08:54 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -255,7 +255,7 @@ export default class Company extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbiddenTag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; if (c.dataIndex == 'compName') { @@ -294,7 +294,18 @@ export default class Company extends React.Component { const { company } = this.props; - company.updateForbiddenTag(checked, id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + company.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } doDel(id) { diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index ec8277f..b533783 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-06-07 16:15:54 + * @LastEditTime: 2022-06-22 10:10:28 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -295,7 +295,18 @@ const { department } = this.props; - department.updateForbiddenTag(checked, id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + department.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } @@ -321,7 +332,7 @@ columns.forEach((c, index) => { if (c.dataIndex == 'forbiddenTag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; if (c.dataIndex == 'deptName') { diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index 3d6ce54..1131898 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-06-08 16:03:50 + * @LastEditTime: 2022-06-22 10:10:58 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -268,7 +268,18 @@ export default class Job extends React.Component { const { job } = this.props; - job.updateForbiddenTag(checked, id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + job.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } @@ -294,7 +305,7 @@ export default class Job extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbiddenTag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; if (c.dataIndex == 'jobName') { diff --git a/pc4mobx/organization/components/postionrank/JobGrade.js b/pc4mobx/organization/components/postionrank/JobGrade.js index a3be8e6..347501d 100644 --- a/pc4mobx/organization/components/postionrank/JobGrade.js +++ b/pc4mobx/organization/components/postionrank/JobGrade.js @@ -241,7 +241,7 @@ export default class JobGrade extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> + return _this.updateForbiddenTag(checked,record.id)} /> } }; }) @@ -251,7 +251,18 @@ export default class JobGrade extends React.Component { const { jobGrade } = this.props; - jobGrade.updateForbiddenTag(checked,id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + jobGrade.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } onOperatesClick(record, rowIndex, operate) { diff --git a/pc4mobx/organization/components/postionrank/JobLevel.js b/pc4mobx/organization/components/postionrank/JobLevel.js index 426ff7b..88a1103 100644 --- a/pc4mobx/organization/components/postionrank/JobLevel.js +++ b/pc4mobx/organization/components/postionrank/JobLevel.js @@ -226,7 +226,7 @@ export default class JobLevel extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; }) @@ -236,7 +236,18 @@ export default class JobLevel extends React.Component { const { jobLevel } = this.props; - jobLevel.updateForbiddenTag(checked, id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + jobLevel.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } onOperatesClick(record, rowIndex, operate) { diff --git a/pc4mobx/organization/components/postionrank/RankScheme.js b/pc4mobx/organization/components/postionrank/RankScheme.js index 86e8ab6..2158d77 100644 --- a/pc4mobx/organization/components/postionrank/RankScheme.js +++ b/pc4mobx/organization/components/postionrank/RankScheme.js @@ -232,20 +232,19 @@ export default class RankScheme extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function (text, record) { - return _this.updateForbiddenTag(checked, record.id)} /> + return _this.updateForbiddenTag(checked, record.id)} /> } }; }) } updateForbiddenTag(checked, id) { - debugger const { rankScheme } = this.props; confirm({ title: i18n.confirm.defaultTitle(), - content: (checked == '0') ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), okText: i18n.button.ok(), cancelText: i18n.button.cancel(), onOk() { diff --git a/pc4mobx/organization/components/sequence/Sequence.js b/pc4mobx/organization/components/sequence/Sequence.js index deb6b49..042000f 100644 --- a/pc4mobx/organization/components/sequence/Sequence.js +++ b/pc4mobx/organization/components/sequence/Sequence.js @@ -227,7 +227,7 @@ export default class Sequence extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> + return _this.updateForbiddenTag(checked,record.id)} /> } }; }) @@ -248,7 +248,18 @@ export default class Sequence extends React.Component { const { sequence } = this.props; - sequence.updateForbiddenTag(checked,id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + sequence.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } onOperatesClick(record, rowIndex, operate) { diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 5b354b6..7b8222f 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -222,12 +222,6 @@ export default class Staff extends React.Component { // }) } - updateForbiddenTag(checked,id) { - const { - staff - } = this.props; - staff.updateForbiddenTag(checked,id); - } onOperatesClick(record, rowIndex, operate) { const { diff --git a/pc4mobx/organization/components/staff/StaffScheme.js b/pc4mobx/organization/components/staff/StaffScheme.js index 2ee79bf..7860494 100644 --- a/pc4mobx/organization/components/staff/StaffScheme.js +++ b/pc4mobx/organization/components/staff/StaffScheme.js @@ -220,7 +220,7 @@ export default class StaffScheme extends React.Component { columns.forEach((c, index) => { if (c.dataIndex == 'forbidden_tag') { c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> + return _this.updateForbiddenTag(checked,record.id)} /> } }; }) @@ -230,7 +230,18 @@ export default class StaffScheme extends React.Component { const { staffScheme } = this.props; - staffScheme.updateForbiddenTag(checked,id); + confirm({ + title: i18n.confirm.defaultTitle(), + content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), + okText: i18n.button.ok(), + cancelText: i18n.button.cancel(), + onOk() { + staffScheme.updateForbiddenTag(checked, id); + }, + onCancel() { + return false; + }, + }); } onOperatesClick(record, rowIndex, operate) { diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index 80b356f..4b4c0e0 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -941,8 +941,8 @@ export const i18n = { deleteImg: () => getLabel('16075', "删除图片") }, confirm: { - forbiddenTag: () => getLabel(131329, '确定禁用该记录吗'), - enableTag: () => getLabel(131329, '确定启用该记录吗'), + forbiddenTag: () => getLabel(-131329, '确定禁用该记录吗'), + enableTag: () => getLabel(-131328, '确定启用该记录吗'), defaultTitle: () => getLabel(131329, '信息确认'), diff --git a/pc4mobx/organization/stores/department.js b/pc4mobx/organization/stores/department.js index 224bd5f..1f6f10b 100644 --- a/pc4mobx/organization/stores/department.js +++ b/pc4mobx/organization/stores/department.js @@ -158,6 +158,7 @@ export class DepartmentStore { }).then(data => { if (data.code === 200) { message.success(data.msg, 1); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 306b269..853dd2a 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -152,6 +152,7 @@ export class JobStore { }).then(data => { if (data.code === 200) { message.success(data.msg, 1); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index e6adaf2..5014b82 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -77,8 +77,8 @@ export class JobGradeStore { }, error => { message.warning(error.msg); }) - //获取tab信息 - this.getTabInfo(); + //获取tab信息(去除) + //this.getTabInfo(); } @@ -175,6 +175,7 @@ export class JobGradeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/joblevel.js b/pc4mobx/organization/stores/joblevel.js index 607bc43..8a2e8e2 100644 --- a/pc4mobx/organization/stores/joblevel.js +++ b/pc4mobx/organization/stores/joblevel.js @@ -55,7 +55,7 @@ export class JobLevelStore { getTableInfo() { let params; //获取tab信息 - this.getTabInfo(); + // this.getTabInfo(); this.tableStore = new TableStore(); if (this.isEmptyObject(this.form2.getFormParams())) { params = { @@ -166,6 +166,7 @@ export class JobLevelStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/rankscheme.js b/pc4mobx/organization/stores/rankscheme.js index 11f799a..955f10a 100644 --- a/pc4mobx/organization/stores/rankscheme.js +++ b/pc4mobx/organization/stores/rankscheme.js @@ -156,6 +156,7 @@ export class RankSchemeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js index 8dc8d88..2eba6ae 100644 --- a/pc4mobx/organization/stores/resource.js +++ b/pc4mobx/organization/stores/resource.js @@ -37,7 +37,7 @@ const { @observable form = new WeaForm(); @observable form1 = new WeaForm(); @observable schemeName = ''; - @observable conditionNum = 2; + @observable conditionNum = 8; @observable ids = ''; //选择行id @observable searchConditionLoading = true; @observable nEdialogTitle = ''; @@ -78,26 +78,6 @@ const { } - //删除 - delete() { - let params = { - ids: this.ids - }; - Api.deleteTableData(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(i18n.message.deleteSuccess()); - this.getTableInfo(); - } else { - message.warning(data.msg); - } - }) - .catch(error => { - message.warning(error.msg); - }) - } - save() { let params = { ...this.form.getFormParams() @@ -124,30 +104,6 @@ const { }); } - edit() { - let params = { ...this.form.getFormParams(), id: this.schemeId }; - this.form.validateForm().then(f => { - if (f.isValid) { - Api.edit(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(data.msg); - this.getTableInfo(); - this.setVisible(false); - } else { - message.warning(data.msg); - } - }).catch(error => { - message.warning(error.msg); - }) - } else { - f.showErrors(); - this.setDate(new Date()); - } - }); - } - updateForbiddenTag(checked, id) { let params = { forbiddenTag: checked, diff --git a/pc4mobx/organization/stores/sequence.js b/pc4mobx/organization/stores/sequence.js index d7556c7..e2ec395 100644 --- a/pc4mobx/organization/stores/sequence.js +++ b/pc4mobx/organization/stores/sequence.js @@ -77,7 +77,7 @@ export class SequenceStore { message.warning(error.msg); }) //获取tab信息 - this.getTabInfo(); + // this.getTabInfo(); } @@ -165,6 +165,7 @@ export class SequenceStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); } diff --git a/pc4mobx/organization/stores/staffscheme.js b/pc4mobx/organization/stores/staffscheme.js index 11fe89e..adf62a4 100644 --- a/pc4mobx/organization/stores/staffscheme.js +++ b/pc4mobx/organization/stores/staffscheme.js @@ -156,6 +156,7 @@ export class StaffSchemeStore { }).then(data => { if (data.code === 200) { message.success(data.msg); + this.getTableInfo(); } else { message.warning(data.msg); }