个税-release开发

This commit is contained in:
黎永顺 2023-08-28 10:08:28 +08:00
parent a4eab6fa47
commit 85ab345651
1 changed files with 32 additions and 4 deletions

View File

@ -22,12 +22,15 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
super(props);
this.state = {
loading: false,
eConditions: []
eConditions: [],
employeeInfo: {}
};
this.employeeChangeInfo = {};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.employeedeclareGetForm(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.employeeChangeInfo = {};
}
employeedeclareGetForm = (props) => {
@ -86,7 +89,8 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
return { ...child };
})
};
})
}),
employeeInfo: data.data
}, () => {
const { data: result, columns } = data;
const { employeeDeclareStore: { declareForm } } = this.props;
@ -129,7 +133,12 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
const { employeeDeclareStore: { declareForm } } = this.props;
const key = Object.keys(res)[0];
const value = res[key].value;
console.log(132, res, declareForm.getFormParams());
if (key === "employeeType") {
const [v1, v2] = value;
this.employeeChangeInfo = {
employee: [{ _entityType: v1, name: v2[1], id: v2[0] }]
};
}
switch (key) {
case "employmentStatus":
this.setState({
@ -148,8 +157,17 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
};
})
}, () => {
console.log(150, this.state.eConditions);
declareForm.initFormFields(this.state.eConditions);
const [employeeData] = this.state.employeeInfo["employee"] || this.employeeChangeInfo["employee"] || [];
!_.isEmpty(employeeData) && declareForm.updateFields({
employeeType: {
value: [employeeData._entityType, [employeeData.id, employeeData.name, [{
id: employeeData.id,
lastname: employeeData.name
}]]],
valueSpan: ["employeeId"]
}
});
});
break;
case "employmentType":
@ -170,6 +188,16 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
})
}, () => {
declareForm.initFormFields(this.state.eConditions);
const [employeeData] = this.state.employeeInfo["employee"] || this.employeeChangeInfo["employee"] || [];
!_.isEmpty(employeeData) && declareForm.updateFields({
employeeType: {
value: [employeeData._entityType, [employeeData.id, employeeData.name, [{
id: employeeData.id,
lastname: employeeData.name
}]]],
valueSpan: ["employeeId"]
}
});
});
break;
default: