薪资账套修改

This commit is contained in:
黎永顺 2023-01-30 09:39:40 +08:00
parent 42ee5f0cd8
commit 0d0a9fc31e
2 changed files with 18 additions and 9 deletions

View File

@ -17,7 +17,8 @@ class LedgerSalaryItem extends Component {
this.state = {
previewVisible: false, //预览标识
empFields: [], //员工基本信息
itemGroups: [] //正常工资薪金所得项
itemGroups: [], //正常工资薪金所得项,
incomeCategoriesTitleName: "" //薪资项目的薪资类型名称
};
}
@ -35,7 +36,7 @@ class LedgerSalaryItem extends Component {
const { editId: salarySobId, saveSalarySobId } = this.props;
getLedgerItemForm({ salarySobId: salarySobId || saveSalarySobId }).then(({ status, data }) => {
if (status) {
const { empFields, itemGroups, items } = data;
const { empFields, itemGroups, items, incomeCategories } = data;
const obj = {
id: itemGroups.length,
itemHide: null,
@ -44,7 +45,11 @@ class LedgerSalaryItem extends Component {
salarySobId,
sortedIndex: itemGroups.length
};
this.setState({ empFields, itemGroups: [...itemGroups, obj] }, () => {
this.setState({
empFields,
incomeCategoriesTitleName: incomeCategories[0].name,
itemGroups: [...itemGroups, obj]
}, () => {
const { empFields, itemGroups } = this.state;
const { onSaveSalaryItem } = this.props;
onSaveSalaryItem(empFields, itemGroups);
@ -293,7 +298,7 @@ class LedgerSalaryItem extends Component {
};
render() {
const { empFields, itemGroups, previewVisible } = this.state;
const { empFields, itemGroups, incomeCategoriesTitleName, previewVisible } = this.state;
return (
<div className="ledgerSalaryItemWrapper">
<LedgerSalaryItemBaseInfo
@ -309,6 +314,7 @@ class LedgerSalaryItem extends Component {
<LedgerSalaryItemNormal
ref={dom => this.ledgerSalaryItemNormalRef = dom}
{...this.props} dataSource={itemGroups}
incomeCategoriesTitleName={incomeCategoriesTitleName}
onSaveCategory={this.handleSaveCateGory}
onDeleteCategroy={this.handleDeleteCategroy}
onDeleteCategroyItems={this.handleDeleteCategroyItems}

View File

@ -11,8 +11,8 @@ import { Button, Modal } from "antd";
import CategoryAddModal from "./categoryAddModal";
import LedgerSalaryItemAddModal from "./ledgerSalaryItemAddModal";
import LedgerSalaryItemTable from "./ledgerSalaryItemTable";
import "./index.less";
import FormalFormModal from "../../salaryItem/formalFormModal";
import "./index.less";
@inject("ledgerStore")
@observer
@ -147,11 +147,14 @@ class LedgerSalaryItemNormal extends Component {
onDropCategoryItem,
onHandleItemhide,
onChangeSelectedRowKeys,
onAddSalaryItems
onAddSalaryItems,
incomeCategoriesTitleName
} = this.props;
console.log(this.props);
const { categoryModal, addCategoryItemsVisible, editFormulModal } = this.state;
return (
<WeaSearchGroup needTigger={false} showGroup title={<TitleComp onAddCategory={this.handleAddCategory}/>}>
<WeaSearchGroup needTigger={false} showGroup
title={<TitleComp titleName={incomeCategoriesTitleName} onAddCategory={this.handleAddCategory}/>}>
<div className="categroyListWrapper">
{
_.map(dataSource, field => {
@ -244,9 +247,9 @@ const TitleNormalComp = (props) => {
};
const TitleComp = (props) => {
const { onAddCategory } = props;
const { onAddCategory, titleName } = props;
return <div className="titleWrapper">
<span>正常工资薪金所得</span>
<span>{titleName}</span>
<Button type="ghost" onClick={() => onAddCategory()}>新增分类</Button>
</div>;
};