fixed
This commit is contained in:
parent
1d9ac506e8
commit
07d2ff9832
|
|
@ -51,7 +51,6 @@ export default class JobLevel extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Route from "react-router/lib/Route";
|
import Route from "react-router/lib/Route";
|
||||||
|
import { message } from "antd";
|
||||||
import { WeaLocaleProvider } from "ecCom";
|
import { WeaLocaleProvider } from "ecCom";
|
||||||
import Home from "./components/Home";
|
import Home from "./components/Home";
|
||||||
import SimpleOrg from "./components/tree/index";
|
import SimpleOrg from "./components/tree/index";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @Author: 程亮
|
* @Author: 程亮
|
||||||
* @Date: 2022-06-09 10:16:00
|
* @Date: 2022-06-09 10:16:00
|
||||||
* @LastEditTime: 2022-08-18 13:53:57
|
* @LastEditTime: 2022-08-22 15:25:05
|
||||||
* @Description:
|
* @Description:
|
||||||
* @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js
|
* @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js
|
||||||
*/
|
*/
|
||||||
|
|
@ -227,7 +227,7 @@ export class FieldDefinedStore extends HrmBaseStore {
|
||||||
key: 'fieldType',
|
key: 'fieldType',
|
||||||
useRecord: true,
|
useRecord: true,
|
||||||
colSpan: 1,
|
colSpan: 1,
|
||||||
width: "30%",
|
width: "40%",
|
||||||
com: [{
|
com: [{
|
||||||
label: '',
|
label: '',
|
||||||
type: 'CUSTOMFIELD',
|
type: 'CUSTOMFIELD',
|
||||||
|
|
|
||||||
|
|
@ -128,8 +128,25 @@ 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);
|
//默认职级职等范围
|
||||||
res.data.result.conditions && this.setCondition(res.data.result.conditions);
|
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[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);
|
||||||
|
|
@ -173,7 +190,12 @@ export class JobExtendStore {
|
||||||
updateConditions(data) {
|
updateConditions(data) {
|
||||||
if (data.sequence_id) {
|
if (data.sequence_id) {
|
||||||
if (data.sequence_id.valueObj.length > 0) {
|
if (data.sequence_id.valueObj.length > 0) {
|
||||||
let label = "等级方案"
|
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, id: data.sequence_id.value }];
|
||||||
|
this.condition[1].items[2].browserConditionParam.replaceDatas = [{ name: "", id: "" }];
|
||||||
|
this.condition[1].items[3].browserConditionParam.replaceDatas = [{ name: "", id: "" }];
|
||||||
|
label = "等级方案"
|
||||||
const index = findIndex(this.condition[1].items, { label });
|
const index = findIndex(this.condition[1].items, { label });
|
||||||
const schemeId = data.sequence_id.valueObj[0].scheme_values;
|
const schemeId = data.sequence_id.valueObj[0].scheme_values;
|
||||||
this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }];
|
this.condition[1].items[index].browserConditionParam.replaceDatas = [{ name: data.sequence_id.valueObj[0].scheme_ids, id: schemeId }];
|
||||||
|
|
@ -182,43 +204,33 @@ export class JobExtendStore {
|
||||||
const index1 = findIndex(this.condition[1].items, { label });
|
const index1 = findIndex(this.condition[1].items, { label });
|
||||||
let currenttime = 1657247378274
|
let currenttime = 1657247378274
|
||||||
let key = `scheme_id_${currenttime}`;
|
let key = `scheme_id_${currenttime}`;
|
||||||
this.condition[1].items[index1].browserConditionParam.completeParams = {
|
let condition = this.rangeLimit(key,schemeId,index1,currenttime,this.condition);
|
||||||
...this.condition[1].items[index1].browserConditionParam.completeParams,
|
this.form.updateFields({
|
||||||
[key]: schemeId,
|
scheme_id: {
|
||||||
currenttime: currenttime
|
value: schemeId
|
||||||
}
|
},
|
||||||
this.condition[1].items[index1].browserConditionParam.conditionDataParams = {
|
level_id: {
|
||||||
...this.condition[1].items[index1].browserConditionParam.conditionDataParams,
|
value: ''
|
||||||
[key]: schemeId,
|
},
|
||||||
currenttime: currenttime
|
grade_id: {
|
||||||
}
|
value: ''
|
||||||
this.condition[1].items[index1].browserConditionParam.dataParams = {
|
}
|
||||||
...this.condition[1].items[index1].browserConditionParam.dataParams,
|
});
|
||||||
[key]: schemeId,
|
this.setCondition(condition);
|
||||||
currenttime: currenttime
|
this.form.initFormFields(condition);
|
||||||
}
|
|
||||||
this.condition[1].items[index1].browserConditionParam.destDataParams = {
|
|
||||||
...this.condition[1].items[index1].browserConditionParam.destDataParams,
|
|
||||||
[key]: schemeId,
|
|
||||||
currenttime: currenttime
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.form.updateFields({
|
|
||||||
scheme_id: {
|
|
||||||
value: ''
|
|
||||||
},
|
|
||||||
level_id: {
|
|
||||||
value: ''
|
|
||||||
},
|
|
||||||
grade_id: {
|
|
||||||
value: ''
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (data.grade_id) {
|
} else if (data.grade_id) {
|
||||||
if (data.grade_id.valueObj.length > 0) {
|
let condition = this.condition;
|
||||||
//清空职等并限制范围
|
//清空职等并限制范围
|
||||||
let label = "职等"
|
let label = "职等"
|
||||||
const index2 = findIndex(this.condition[1].items, { 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.valueObj.length > 0 ? data.grade_id.valueObj[0].grade_names : "";
|
||||||
|
let value = data.grade_id.valueObj.length > 0 ? data.grade_id.value : "";
|
||||||
|
this.condition[1].items[item].browserConditionParam.replaceDatas = [{ name: grade_names, id: value }];
|
||||||
|
if (data.grade_id.valueObj.length > 0) {
|
||||||
let currenttime = 1657247378274;
|
let currenttime = 1657247378274;
|
||||||
let key1 = `level_id_${currenttime}`;
|
let key1 = `level_id_${currenttime}`;
|
||||||
let key2 = `scheme_id_${currenttime}`;
|
let key2 = `scheme_id_${currenttime}`;
|
||||||
|
|
@ -228,30 +240,7 @@ export class JobExtendStore {
|
||||||
Api.getLevelId(params).then(res => {
|
Api.getLevelId(params).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
const levelId = res.data;
|
const levelId = res.data;
|
||||||
this.condition[1].items[index2].browserConditionParam.completeParams = {
|
condition = this.rangeLimitLevel(key1,key2,index2,levelId,currenttime,this.condition);
|
||||||
...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 {
|
} else {
|
||||||
message.warning(res.msg);
|
message.warning(res.msg);
|
||||||
}
|
}
|
||||||
|
|
@ -265,9 +254,64 @@ export class JobExtendStore {
|
||||||
value: ''
|
value: ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.setCondition(condition);
|
||||||
|
this.form.initFormFields(condition);
|
||||||
|
|
||||||
}
|
}
|
||||||
this.setCondition(this.condition);
|
}
|
||||||
//this.form.initFormFields(this.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) {
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ export class newImportStore {
|
||||||
"icon": "icon-coms-Department-number",
|
"icon": "icon-coms-Department-number",
|
||||||
"title": "分部",
|
"title": "分部",
|
||||||
"linkName": "分部导入",
|
"linkName": "分部导入",
|
||||||
"url": "/spa/hrm/engine.html#/hrmengine/organization"
|
"url": "/spa/organization/static/index.html#/main/organization/company"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"subTitle": "部门设置",
|
"subTitle": "部门设置",
|
||||||
|
|
@ -69,7 +69,7 @@ export class newImportStore {
|
||||||
"icon": "icon-coms-Department-number",
|
"icon": "icon-coms-Department-number",
|
||||||
"title": "部门",
|
"title": "部门",
|
||||||
"linkName": "部门导入",
|
"linkName": "部门导入",
|
||||||
"url": "/spa/hrm/engine.html#/hrmengine/organization"
|
"url": "/spa/organization/static/index.html#/main/organization/department"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"subTitle": "岗位设置",
|
"subTitle": "岗位设置",
|
||||||
|
|
@ -77,7 +77,7 @@ export class newImportStore {
|
||||||
"icon": "icon-coms-hrm",
|
"icon": "icon-coms-hrm",
|
||||||
"title": "岗位",
|
"title": "岗位",
|
||||||
"linkName": "岗位体系导入",
|
"linkName": "岗位体系导入",
|
||||||
"url": "/spa/hrm/engine.html#/hrmengine/post"
|
"url": "/spa/organization/static/index.html#/main/organization/job"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"subTitle": "组织维护",
|
"subTitle": "组织维护",
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@ export class RankSchemeStore {
|
||||||
return response.json()
|
return response.json()
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
if (data.code === 200) {
|
if (data.code === 200) {
|
||||||
message.success(i18n.message.deleteSuccess());
|
|
||||||
this.getTableInfo();
|
this.getTableInfo();
|
||||||
|
message.success(i18n.message.deleteSuccess());
|
||||||
} else {
|
} else {
|
||||||
message.warning(data.msg);
|
message.warning(data.msg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue