需求统一优化处理
This commit is contained in:
parent
32a0c9cbd2
commit
4102c1e135
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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 <Switch defaultChecked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
return <Switch checked={record.forbiddenTag == "0" ? true : false} onChange={checked => _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) {
|
||||
|
|
|
|||
|
|
@ -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 <Switch defaultChecked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
return <Switch checked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
}
|
||||
};
|
||||
if (c.dataIndex == 'deptName') {
|
||||
|
|
|
|||
|
|
@ -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 <Switch defaultChecked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
return <Switch checked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
}
|
||||
};
|
||||
if (c.dataIndex == 'jobName') {
|
||||
|
|
|
|||
|
|
@ -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 <Switch defaultChecked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked,record.id)} />
|
||||
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _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) {
|
||||
|
|
|
|||
|
|
@ -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 <Switch defaultChecked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _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) {
|
||||
|
|
|
|||
|
|
@ -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 <Switch defaultChecked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _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() {
|
||||
|
|
|
|||
|
|
@ -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 <Switch defaultChecked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked,record.id)} />
|
||||
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _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) {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 <Switch defaultChecked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked,record.id)} />
|
||||
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _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) {
|
||||
|
|
|
|||
|
|
@ -940,8 +940,8 @@ export const i18n = {
|
|||
deleteImg: () => getLabel('16075', "删除图片")
|
||||
},
|
||||
confirm: {
|
||||
forbiddenTag: () => getLabel(131329, '确定禁用该记录吗'),
|
||||
enableTag: () => getLabel(131329, '确定启用该记录吗'),
|
||||
forbiddenTag: () => getLabel(-131329, '确定禁用该记录吗'),
|
||||
enableTag: () => getLabel(-131328, '确定启用该记录吗'),
|
||||
|
||||
|
||||
defaultTitle: () => getLabel(131329, '信息确认'),
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ export class RankSchemeStore {
|
|||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ export class StaffSchemeStore {
|
|||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue