薪资账套-薪资项目公式保存bug
This commit is contained in:
parent
8f8ffa5714
commit
2dd2175ea2
|
|
@ -139,13 +139,32 @@ export const getLedgerItemGroupForm = params => {
|
||||||
|
|
||||||
//保存薪资帐套薪资项目
|
//保存薪资帐套薪资项目
|
||||||
export const saveLedgerItem = params => {
|
export const saveLedgerItem = params => {
|
||||||
|
const { itemGroups, items, ...extra } = params;
|
||||||
|
const payload = {
|
||||||
|
itemGroups: _.map(itemGroups, item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
items: _.map(item.items, it => {
|
||||||
|
delete it.formulaContent;
|
||||||
|
return { ...it };
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
items: _.map(items, child => {
|
||||||
|
delete child.formulaContent;
|
||||||
|
return { ...child };
|
||||||
|
}) || [],
|
||||||
|
...extra
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
return fetch("/api/bs/hrmsalary/salarysob/item/save", {
|
return fetch("/api/bs/hrmsalary/salarysob/item/save", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
mode: "cors",
|
mode: "cors",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
body: JSON.stringify(params)
|
body: JSON.stringify(payload)
|
||||||
}).then(res => res.json());
|
}).then(res => res.json());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ class LedgerSlide extends Component {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
items: _.map(item.items, it => {
|
items: _.map(item.items, it => {
|
||||||
delete it.formulaContent;
|
// delete it.formulaContent;
|
||||||
// if (it.id && it.id.length > 4) delete it.id;
|
// if (it.id && it.id.length > 4) delete it.id;
|
||||||
return { ...it };
|
return { ...it };
|
||||||
})
|
})
|
||||||
|
|
@ -127,7 +127,7 @@ class LedgerSlide extends Component {
|
||||||
}),
|
}),
|
||||||
items: _.map(_.find(itemGroups, it => it.name === "未分类").items, child => {
|
items: _.map(_.find(itemGroups, it => it.name === "未分类").items, child => {
|
||||||
// if (child.id && child.id.length > 4) delete child.id;
|
// if (child.id && child.id.length > 4) delete child.id;
|
||||||
delete child.formulaContent;
|
// delete child.formulaContent;
|
||||||
return { ...child };
|
return { ...child };
|
||||||
}) || [],
|
}) || [],
|
||||||
salarySobId: salarySobId || saveSalarySobId
|
salarySobId: salarySobId || saveSalarySobId
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue