commit
74f7329524
|
|
@ -69,6 +69,9 @@ export default class NewAndEditDialog extends React.Component {
|
|||
if (moduleName == 'job' && (data.sequence_id || data.grade_id)) {
|
||||
bindChangeEnvent(data);
|
||||
}
|
||||
if (moduleName == 'staff' && data.planId) {
|
||||
bindChangeEnvent(data);
|
||||
}
|
||||
};
|
||||
|
||||
onBlur = data => {
|
||||
|
|
|
|||
|
|
@ -517,6 +517,8 @@ export default class Staff extends React.Component {
|
|||
conditionLen={3}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => staff.setVisible(false)}
|
||||
moduleName={"staff"}
|
||||
bindChangeEnvent={val => staff.updateConditions(val)}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ export class StaffStore {
|
|||
@observable topMenu = []
|
||||
@observable rightMenu = [];
|
||||
@observable condition = [];
|
||||
fcondition = [];
|
||||
@observable leftCondition = [];
|
||||
@observable searchCondition = [];
|
||||
@observable isEdit = true;
|
||||
|
|
@ -170,6 +171,7 @@ export class StaffStore {
|
|||
Api.getForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setDialogLoadingStatus(false);
|
||||
res.data.condition && this.setFcondition(res.data.condition);
|
||||
res.data.condition && this.setCondition(res.data.condition);
|
||||
res.data.condition && this.form.initFormFields(res.data.condition);
|
||||
} else {
|
||||
|
|
@ -178,7 +180,39 @@ export class StaffStore {
|
|||
}, error => {
|
||||
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() {
|
||||
|
|
@ -321,5 +355,9 @@ export class StaffStore {
|
|||
this.getTableInfo();
|
||||
}
|
||||
|
||||
setFcondition(condition) {
|
||||
this.fcondition = condition;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue