薪资账套页面薪资项目项修改

This commit is contained in:
黎永顺 2023-02-08 17:54:01 +08:00
parent 7d5c026611
commit 0d70495c4f
5 changed files with 38 additions and 21 deletions

View File

@ -1,11 +1,13 @@
.dataList-wrapper {
.ant-modal-body{
.ant-modal-body {
padding: 16px 120px
}
.formItem {
.wea-select, .ant-select {
width: 100%;
}
.ant-select-selection {
width: 100%;
height: 30px;
@ -14,15 +16,21 @@
}
}
.salarySobNameWrapper{
.salarySobNameWrapper {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
.salarySobNameTagWrapper{
& > span {
flex: 1;
}
.salarySobNameTagWrapper {
display: flex;
align-items: center;
i{
i {
color: #5d9cec;
margin-right: 10px;
cursor: pointer;

View File

@ -38,7 +38,7 @@ class LedgerSalaryItem extends Component {
if (status) {
const { empFields, itemGroups, items, incomeCategories } = data;
const obj = {
id: itemGroups.length,
uuid: itemGroups.length.toString(),
itemHide: null,
items,
name: "未分类",
@ -48,7 +48,7 @@ class LedgerSalaryItem extends Component {
this.setState({
empFields,
incomeCategoriesTitleName: incomeCategories[0].name,
itemGroups: [...itemGroups, obj]
itemGroups: [..._.map(itemGroups, it => ({ ...it, uuid: it.id })), obj]
}, () => {
const { empFields, itemGroups } = this.state;
const { onSaveSalaryItem } = this.props;
@ -81,15 +81,19 @@ class LedgerSalaryItem extends Component {
if (payload.id) {
this.setState({
itemGroups: _.map(itemGroups, it => {
if (it.id === payload.id) {
if (it.uuid === payload.id) {
return { ...it, name: payload.name };
}
return { ...it };
})
}, () => {
const { empFields, itemGroups } = this.state;
const { onSaveSalaryItem } = this.props;
onSaveSalaryItem(empFields, itemGroups);
});
} else {
const obj = {
id: new Date().getTime(),
uuid: new Date().getTime().toString(),
itemHide: null,
items: [],
name: payload.name
@ -112,7 +116,7 @@ class LedgerSalaryItem extends Component {
handleDeleteCategroy = (id) => {
const { itemGroups } = this.state;
this.setState({
itemGroups: _.filter(itemGroups, it => it.id !== id)
itemGroups: _.filter(itemGroups, it => it.uuid !== id)
}, () => {
const { empFields, itemGroups } = this.state;
const { onSaveSalaryItem } = this.props;
@ -129,7 +133,7 @@ class LedgerSalaryItem extends Component {
const { itemGroups } = this.state;
this.setState({
itemGroups: _.map(itemGroups, item => {
if (item.id === id) {
if (item.uuid === id) {
return {
...item,
items: _.filter(item.items, it => !selectedRowKeys.includes(it.id)),
@ -204,7 +208,7 @@ class LedgerSalaryItem extends Component {
const { itemGroups } = this.state;
this.setState({
itemGroups: _.map(itemGroups, it => {
if (filed.id === it.id) {
if (filed.uuid === it.uuid) {
return {
...it,
items: _.map(data, (child, childIndex) => {
@ -233,7 +237,7 @@ class LedgerSalaryItem extends Component {
const { itemGroups } = this.state;
this.setState({
itemGroups: _.map(itemGroups, it => {
if (filed.id === it.id) {
if (filed.uuid === it.uuid) {
return { ...it, selectedRowKeys: data };
}
return { ...it };
@ -254,7 +258,7 @@ class LedgerSalaryItem extends Component {
const { itemGroups } = this.state;
this.setState({
itemGroups: _.map(itemGroups, it => {
if (id === it.id) {
if (id === it.uuid) {
return { ...it, items: [...it.items, ...items] };
}
return { ...it };
@ -275,7 +279,7 @@ class LedgerSalaryItem extends Component {
const { itemGroups } = this.state;
this.setState({
itemGroups: _.map(itemGroups, it => {
if (id === it.id) {
if (id === it.uuid) {
return { ...it, items };
}
return { ...it };

View File

@ -82,7 +82,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
handleAdd = () => {
const { dataSource, selectedRowKeys } = this.state;
const { onAddSalaryItems, id, onCancel, itemGroups } = this.props;
const arrItems = _.find(itemGroups, it => it.id === id).items || [];
const arrItems = _.find(itemGroups, it => it.uuid === id).items || [];
let selectItems = [];
dataSource.map((item) => {
item = { ...item };

View File

@ -66,7 +66,7 @@ class LedgerSalaryItemNormal extends Component {
}
return { ...it };
});
onSaveFormnul(formnulField.id, formnulData);
onSaveFormnul(formnulField.uuid, formnulData);
};
handleAddCategory = (name = "", id = "") => {
const { categoryModal } = this.state;
@ -214,7 +214,7 @@ export default LedgerSalaryItemNormal;
const TitleNormalComp = (props) => {
const {
name, onEditCategory, onDeleteCategory,
sortedIndex, dataSourceLen, id, onUpgo,
sortedIndex, dataSourceLen, uuid, onUpgo,
onDowngo, selectedRowKeys = [], onDeleteCategoryItems,
onAddCategoryItems
} = props;
@ -223,11 +223,11 @@ const TitleNormalComp = (props) => {
<span>{name}</span>
{
name !== "未分类" &&
<i className="icon-coms-edit" title="编辑" onClick={() => onEditCategory(name, id)}/>
<i className="icon-coms-edit" title="编辑" onClick={() => onEditCategory(name, uuid)}/>
}
{
name !== "未分类" &&
<i className="icon-coms-Delete" title="删除" onClick={() => onDeleteCategory(id)}/>
<i className="icon-coms-Delete" title="删除" onClick={() => onDeleteCategory(uuid)}/>
}
{
sortedIndex !== 0 &&
@ -240,8 +240,8 @@ const TitleNormalComp = (props) => {
</div>
<div className="titleBtnWrapper">
<WeaButtonIcon buttonType="del" type="primary" disabled={_.isEmpty(selectedRowKeys)}
onClick={() => onDeleteCategoryItems(id, selectedRowKeys)}/>
<WeaButtonIcon buttonType="add" type="primary" onClick={() => onAddCategoryItems(id)}/>
onClick={() => onDeleteCategoryItems(uuid, selectedRowKeys)}/>
<WeaButtonIcon buttonType="add" type="primary" onClick={() => onAddCategoryItems(uuid)}/>
</div>
</div>;
};

View File

@ -41,6 +41,11 @@ export const importEmployColumns = [
dataIndex: "mobile",
key: "mobile"
},
{
title: "员工状态",
dataIndex: "employeeStatus",
key: "employeeStatus"
},
];