feature/2.10.1.2402.01-社保台账导入缓存

This commit is contained in:
黎永顺 2024-03-05 14:23:13 +08:00
parent 5e9a9c2822
commit 91bc849b49
2 changed files with 14 additions and 1 deletions

View File

@ -232,6 +232,10 @@ export const updateLockStatus = (params) => {
export const cacheImportField = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", params);
};
// 导入社保台账添加表头字段缓存
export const cacheWelfareListField = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/cacheWelfareList", params);
};
//薪资核算-页面查看权限
export const salaryacctAcctresultCheckAuth = params => {
return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/checkAuth", "GET", params);

View File

@ -2,7 +2,7 @@ import React from "react";
import { Button, Col, Row } from "antd";
import { inject, observer } from "mobx-react";
import { WeaCheckbox, WeaDialog } from "ecCom";
import { cacheImportField } from "../../../../apis/calculate";
import { cacheImportField, cacheWelfareListField } from "../../../../apis/calculate";
@inject("calculateStore", "standingBookStore")
@observer
@ -112,15 +112,24 @@ export default class SelectFieldModal extends React.Component {
//薪资核算详情页面的导入表单字段缓存功能
if (window.location.hash.indexOf("calculateDetail") !== -1) {
const { status } = await this.cacheImportField();
} else if (window.location.hash.indexOf("standingBookDetail") !== -1) {
const { status } = await this.cacheWelfareListField();
}
this.props.onAdd(this.fieldData);
this.props.onCancel();
};
//薪资核算导入缓存字段
cacheImportField = () => {
const salaryItemList = _.reduce(_.keys(this.fieldData), (pre, cur) => ([...pre, ...this.fieldData[cur]]), []);
const salaryItems = _.map(_.filter(salaryItemList, it => !!it.checked), item => item.salaryItemId);
return cacheImportField({ salaryItems });
};
//社保台账导入缓存字段
cacheWelfareListField = () => {
const salaryItemList = _.reduce(_.keys(this.fieldData), (pre, cur) => ([...pre, ...this.fieldData[cur]]), []);
const welfareNames = _.map(_.filter(salaryItemList, it => !!it.checked), item => item.fieldId);
return cacheWelfareListField({ welfareNames });
};
// 标题checkbox点击
handleTitleCheckboxChange(value, flag) {