commit
74f7329524
|
|
@ -69,6 +69,9 @@ export default class NewAndEditDialog extends React.Component {
|
||||||
if (moduleName == 'job' && (data.sequence_id || data.grade_id)) {
|
if (moduleName == 'job' && (data.sequence_id || data.grade_id)) {
|
||||||
bindChangeEnvent(data);
|
bindChangeEnvent(data);
|
||||||
}
|
}
|
||||||
|
if (moduleName == 'staff' && data.planId) {
|
||||||
|
bindChangeEnvent(data);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onBlur = data => {
|
onBlur = data => {
|
||||||
|
|
|
||||||
|
|
@ -517,6 +517,8 @@ export default class Staff extends React.Component {
|
||||||
conditionLen={3}
|
conditionLen={3}
|
||||||
save={() => this.handleSave()}
|
save={() => this.handleSave()}
|
||||||
onCancel={() => staff.setVisible(false)}
|
onCancel={() => staff.setVisible(false)}
|
||||||
|
moduleName={"staff"}
|
||||||
|
bindChangeEnvent={val => staff.updateConditions(val)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ export class StaffStore {
|
||||||
@observable topMenu = []
|
@observable topMenu = []
|
||||||
@observable rightMenu = [];
|
@observable rightMenu = [];
|
||||||
@observable condition = [];
|
@observable condition = [];
|
||||||
|
fcondition = [];
|
||||||
@observable leftCondition = [];
|
@observable leftCondition = [];
|
||||||
@observable searchCondition = [];
|
@observable searchCondition = [];
|
||||||
@observable isEdit = true;
|
@observable isEdit = true;
|
||||||
|
|
@ -170,6 +171,7 @@ export class StaffStore {
|
||||||
Api.getForm(params).then(res => {
|
Api.getForm(params).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.setDialogLoadingStatus(false);
|
this.setDialogLoadingStatus(false);
|
||||||
|
res.data.condition && this.setFcondition(res.data.condition);
|
||||||
res.data.condition && this.setCondition(res.data.condition);
|
res.data.condition && this.setCondition(res.data.condition);
|
||||||
res.data.condition && this.form.initFormFields(res.data.condition);
|
res.data.condition && this.form.initFormFields(res.data.condition);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -178,7 +180,39 @@ export class StaffStore {
|
||||||
}, error => {
|
}, error => {
|
||||||
message.warning(error.msg);
|
message.warning(error.msg);
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
updateConditions(data) {
|
||||||
|
this.form.updateFields({
|
||||||
|
compId: {
|
||||||
|
value: ''
|
||||||
|
},
|
||||||
|
deptId: {
|
||||||
|
value: ''
|
||||||
|
},
|
||||||
|
jobId: {
|
||||||
|
value: ''
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const type = data.planId.valueObj[0].control_dimensions;
|
||||||
|
this.condition = this.fcondition;
|
||||||
|
switch(type) {
|
||||||
|
case '分部':
|
||||||
|
this.condition[0].items = this.condition[0].items.filter(item => {
|
||||||
|
return (item.domkey[0] != 'deptId' && item.domkey[0] != 'jobId')
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case '部门':
|
||||||
|
this.condition[0].items = this.condition[0].items.filter(item => {
|
||||||
|
return item.domkey[0] != 'jobId'
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case '岗位':
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
this.setCondition(this.condition);
|
||||||
|
this.form.initFormFields(this.condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSearchCondition() {
|
getSearchCondition() {
|
||||||
|
|
@ -321,5 +355,9 @@ export class StaffStore {
|
||||||
this.getTableInfo();
|
this.getTableInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setFcondition(condition) {
|
||||||
|
this.fcondition = condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue