薪资项目管理以及字段管理页面修改

This commit is contained in:
黎永顺 2023-02-17 09:20:03 +08:00
parent c93d68f451
commit 1ea8eb9e9d
3 changed files with 10 additions and 13 deletions

View File

@ -41,8 +41,8 @@ class FieldSlide extends Component {
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.editId !== this.props.editId && nextProps.editId) {
this.getSalaryFieldForm(nextProps.editId);
if (nextProps.record.id !== this.props.record.id && nextProps.record.id) {
this.getSalaryFieldForm(nextProps.record.id);
}
}
@ -111,7 +111,7 @@ class FieldSlide extends Component {
});
return false;
}
const { onRefreshList, onCancel, editId } = this.props;
const { onRefreshList, onCancel, record } = this.props;
const {
name,
useDefault,
@ -135,7 +135,7 @@ class FieldSlide extends Component {
pattern: Number(pattern)
};
this.setState({ loading: true });
saveSalaryField({ ...payload, id: editId }).then(({ status, errormsg }) => {
saveSalaryField({ ...record, ...payload }).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
onRefreshList();
@ -171,7 +171,7 @@ class FieldSlide extends Component {
};
render() {
const { title, visible, editId, taxAgentStore: { taxAgentOption }, onCancel } = this.props;
const { title, visible, record: { id: editId }, taxAgentStore: { taxAgentOption }, onCancel } = this.props;
const {
loading,
name,

View File

@ -24,15 +24,14 @@ class FieldManagement extends Component {
slideparams: {
visible: false,
title: "新建字段",
editId: ""
record: {}
}
};
}
handleEditField = (record) => {
const { slideparams } = this.state;
const { id } = record;
this.setState({ slideparams: { ...slideparams, visible: true, title: "编辑字段", editId: id } });
this.setState({ slideparams: { ...slideparams, visible: true, title: "编辑字段", record } });
};
handleDeleteField = (filedIds) => {
Modal.confirm({
@ -57,7 +56,7 @@ class FieldManagement extends Component {
...slideparams,
visible: false,
title: "新建字段",
editId: ""
record: {}
}
});
};

View File

@ -47,15 +47,13 @@ class SalaryItemForm extends Component {
case "valueType":
return {
...item,
// viewAttr: isAdd ? 2 : 1
viewAttr: 2
viewAttr: isAdd ? 2 : 1
};
case "formulaContent":
return {
...item,
display: valueType === "2" || valueType === "3",
// viewAttr: (editable && record.canEdit) || isAdd ? 2 : 1
viewAttr: 2
viewAttr: (editable && record.canEdit) || isAdd ? 2 : 1
};
default:
break;