feature/2.14.4.2406.02-个税在线算税
This commit is contained in:
parent
12a7871ef0
commit
d14003a125
|
|
@ -278,5 +278,11 @@ export const getCompareSobConfig = params => {
|
|||
export const updateSobConfig = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/updateSobConfig", "GET", params);
|
||||
};
|
||||
|
||||
|
||||
//薪资核算-计算个税
|
||||
export const acctresultCalcTax = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/calcTax", params);
|
||||
};
|
||||
//薪资核算-获取个税计算反馈
|
||||
export const calcTaxFeedback = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/calcTaxFeedback", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ export const deleteLedger = params => {
|
|||
export const getLedgerBasicForm = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salarysob/basic/getForm", "get", params);
|
||||
};
|
||||
//薪资帐套基本信息工资类型接口
|
||||
export const getIncomeCategoryList = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salarysob/incomeCategoryList", "get", params);
|
||||
};
|
||||
|
||||
//保存薪资帐套基本信息
|
||||
export const saveLedgerBasic = params => {
|
||||
|
|
@ -143,6 +147,10 @@ export const getBackitemForm = params => {
|
|||
export const taxreportruleGetForm = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salarysob/taxreportrule/getForm", "GET", params);
|
||||
};
|
||||
//薪资账套下的个税字段对应-个税字段对应
|
||||
export const taxruleGetForm = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salarysob/taxrule/getForm", "GET", params);
|
||||
};
|
||||
//薪资账套下的个税申报-累计字段对应
|
||||
export const addupruleGetForm = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salarysob/adduprule/getForm", "GET", params);
|
||||
|
|
@ -151,6 +159,10 @@ export const addupruleGetForm = params => {
|
|||
export const taxreportruleSave = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/taxreportrule/save", params);
|
||||
};
|
||||
//保存薪资账套下的个税字段对应规则
|
||||
export const taxruleSave = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/taxrule/save", params);
|
||||
};
|
||||
//保存薪资账套下的累计字段对应关系
|
||||
export const addupruleSave = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/adduprule/save", params);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaReqTop } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
return (
|
||||
<WeaReqTop
|
||||
title={getLabel(111, "编辑账套")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
showDropIcon={false} tabDatas={this.props.tabDatas} {...this.props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
return (
|
||||
<WeaTop title={getLabel(111, "新建账套")} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" {...this.props}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -9,7 +9,7 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom";
|
|||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import Layout from "./layout";
|
||||
import { acctresultAccounting, getCalculateProgress, getExportField } from "../../../apis/calculate";
|
||||
import * as API from "../../../apis/calculate";
|
||||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm";
|
||||
import SalaryEditCalc from "./components/salaryEditCalc";
|
||||
|
|
@ -27,7 +27,7 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "person", progressVisible: false, progress: 0,
|
||||
selectedKey: "person", progressVisible: false, progress: 0, loading: { calcTax: false, feedback: false },
|
||||
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
|
||||
salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" },
|
||||
accountExceptInfo: "" //核算报错信息,
|
||||
|
|
@ -60,11 +60,11 @@ class Index extends Component {
|
|||
this.setState({ progress: 0 });
|
||||
let payload = { salaryAcctRecordId };
|
||||
if (key === "calc_selected") payload = _.assign(payload, { ids: selectedRowKeys });
|
||||
acctresultAccounting(payload).then(() => {
|
||||
API.acctresultAccounting(payload).then(() => {
|
||||
this.setState({ progressVisible: true });
|
||||
if (this.timer) clearInterval(this.timer);
|
||||
this.timer = setInterval(() => {
|
||||
getCalculateProgress(salaryAcctRecordId).then(({ data }) => {
|
||||
API.getCalculateProgress(salaryAcctRecordId).then(({ data }) => {
|
||||
let progress = data.progress;
|
||||
if (progress === 1 && this.timer) {
|
||||
clearInterval(this.timer);
|
||||
|
|
@ -101,7 +101,7 @@ class Index extends Component {
|
|||
window.open(`${window.ecologyContentPath || ""}${url}`, "_blank");
|
||||
break;
|
||||
case "export_custom":
|
||||
getExportField({ salaryAcctRecordId }).then(({ status, data }) => {
|
||||
API.getExportField({ salaryAcctRecordId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { checkItems, itemsByGroup } = data;
|
||||
this.setState({
|
||||
|
|
@ -129,8 +129,34 @@ class Index extends Component {
|
|||
break;
|
||||
}
|
||||
};
|
||||
acctresultCalcTax = () => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
this.setState({ loading: { ...this.state.loading, calcTax: true } });
|
||||
API.acctresultCalcTax({ salaryAcctRecordId }).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: { ...this.state.loading, calcTax: false } });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.calc.onAdSearch(false);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: { ...this.state.loading, calcTax: false } }));
|
||||
};
|
||||
calcTaxFeedback = () => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
this.setState({ loading: { ...this.state.loading, feedback: true } });
|
||||
API.calcTaxFeedback({ salaryAcctRecordId }).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: { ...this.state.loading, feedback: false } });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.calc.onAdSearch(false);
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: { ...this.state.loading, feedback: false } }));
|
||||
};
|
||||
renderReqBtns = () => {
|
||||
const { selectedKey, accountExceptInfo } = this.state;
|
||||
const { selectedKey, accountExceptInfo, loading } = this.state;
|
||||
let reqBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "calc":
|
||||
|
|
@ -151,6 +177,10 @@ class Index extends Component {
|
|||
<Dropdown.Button onClick={() => this.doCacl("ALL")} overlay={menu} type="primary">
|
||||
{getLabel(543545, "核算所有人")}
|
||||
</Dropdown.Button>,
|
||||
<Button type="ghost" onClick={this.acctresultCalcTax}
|
||||
loading={loading.calcTax}>{getLabel(111, "在线算税")}</Button>,
|
||||
<Button type="ghost" loading={loading.feedback}
|
||||
onClick={this.calcTaxFeedback}>{getLabel(111, "获取算税结果")}</Button>,
|
||||
<Dropdown overlay={moreMenu}><Button type="ghost">{getLabel(17499, "更多")}</Button></Dropdown>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calc.openAdvanceSearch()}
|
||||
onAdvanceSearch={() => this.calc.onAdSearch(false)}/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
*
|
||||
* 个税字段对应
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/6/17
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom";
|
||||
import LedgerFieldsItemPopver from "./ledgerFieldsItemPopver";
|
||||
import { taxruleGetForm } from "../../../apis/ledger";
|
||||
import LedgerFieldsTable from "./ledgerFieldsTable";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
class IncomeTaxFields extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "", tabs: [],
|
||||
incomeTaxFields: [], keywords: ""
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.taxruleGetForm();
|
||||
}
|
||||
|
||||
taxruleGetForm = () => {
|
||||
const { editId, saveSalarySobId } = this.props;
|
||||
taxruleGetForm({ id: editId || saveSalarySobId }).then(({ status, data }) => {
|
||||
if (status && !_.isEmpty(data)) {
|
||||
this.setState({
|
||||
tabs: _.map(data, it => ({ viewcondition: it.incomeCategoryId, title: it.incomeCategoryName })),
|
||||
selectedKey: _.take(data)[0].incomeCategoryId,
|
||||
incomeTaxFields: _.map(data, it => ({
|
||||
...it, taxReportRules: _.map(it.taxRules, o => ({
|
||||
...o, canEdit: o.canEdit, id: "", reportColumnDataIndex: o.taxIndex, reportColumnName: o.name,
|
||||
salaryItem: [{ id: o.salaryItemId, name: o.salaryItemName }]
|
||||
}))
|
||||
}))
|
||||
}, () => this.props.onSetTaxreportrule(this.state.incomeTaxFields, this.state.selectedKey));
|
||||
}
|
||||
});
|
||||
};
|
||||
handleChangeSwitch = (visible, id) => {
|
||||
const { incomeTaxFields, selectedKey } = this.state;
|
||||
this.setState({
|
||||
incomeTaxFields: _.map(incomeTaxFields, it => {
|
||||
if (it.incomeCategoryId === selectedKey) {
|
||||
return {
|
||||
...it,
|
||||
taxReportRules: _.map(it.taxReportRules, child => {
|
||||
if (child.id === id) {
|
||||
return { ...child, visible };
|
||||
}
|
||||
return { ...child, visible: false };
|
||||
})
|
||||
};
|
||||
}
|
||||
return { ...it };
|
||||
})
|
||||
}, () => this.props.onSetTaxreportrule(this.state.incomeTaxFields, this.state.selectedKey));
|
||||
};
|
||||
handleChangeIncomeFieldsItem = (salaryItem, recordRuleId) => {
|
||||
const { incomeTaxFields, selectedKey } = this.state;
|
||||
this.setState({
|
||||
incomeTaxFields: _.map(incomeTaxFields, it => {
|
||||
if (it.incomeCategoryId === selectedKey) {
|
||||
return {
|
||||
...it,
|
||||
taxReportRules: _.map(it.taxReportRules, child => {
|
||||
if (child.id === recordRuleId) {
|
||||
return { ...child, visible: false, salaryItem };
|
||||
}
|
||||
return { ...child, visible: false };
|
||||
})
|
||||
};
|
||||
}
|
||||
return { ...it };
|
||||
})
|
||||
}, () => {
|
||||
this.props.onSetTaxreportrule(this.state.incomeTaxFields, this.state.selectedKey);
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { editId, saveSalarySobId } = this.props;
|
||||
const { selectedKey, tabs, incomeTaxFields, keywords } = this.state;
|
||||
const list = _.map(incomeTaxFields, it => {
|
||||
if (it.incomeCategoryId === selectedKey) {
|
||||
return {
|
||||
...it,
|
||||
taxReportRules: _.filter(it.taxReportRules, item => item.reportColumnName.indexOf(keywords) !== -1)
|
||||
};
|
||||
}
|
||||
return { ...it };
|
||||
});
|
||||
const dataSource = _.takeWhile(list, it => it.incomeCategoryId === selectedKey);
|
||||
return (
|
||||
<WeaSearchGroup
|
||||
className="incomeWrapper" showGroup needTigger={false}
|
||||
title={
|
||||
<div className="incomeTitleContail">
|
||||
<WeaTab
|
||||
datas={tabs} keyParam="viewcondition" selectedKey={selectedKey}
|
||||
searchType={["base"]} searchsBasePlaceHolder={getLabel(111, "请输入对象")}
|
||||
onSearch={val => this.setState({ keywords: val })}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<LedgerFieldsTable
|
||||
columns={[
|
||||
{
|
||||
title: <span>
|
||||
<span style={{ marginRight: 8 }}>{getLabel(111, "个税申报表字段")}</span>
|
||||
{/*<WeaHelpfulTip*/}
|
||||
{/* title={getLabel(111, "若【个税申报表字段】与【对应本账套薪资项目】对应,则申报表内数据为当前账套核算数据,若【个税申报表字段】未与【对应本账套薪资项目】对应,则申报表内数据默认显示为0")}*/}
|
||||
{/* placement="top" width={250}*/}
|
||||
{/*/>*/}
|
||||
</span>,
|
||||
width: "50%",
|
||||
dataIndex: "reportColumnName"
|
||||
},
|
||||
{
|
||||
title: getLabel(111, "对应本账套薪资项目"),
|
||||
width: "50%",
|
||||
dataIndex: "salaryItem",
|
||||
render: (_, record) => (
|
||||
<LedgerFieldsItemPopver salarySobId={editId || saveSalarySobId} record={record}
|
||||
onChangeSwitch={this.handleChangeSwitch}
|
||||
onChange={this.handleChangeIncomeFieldsItem}
|
||||
/>
|
||||
)
|
||||
}
|
||||
]}
|
||||
dataSource={dataSource}
|
||||
/>
|
||||
</WeaSearchGroup>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default IncomeTaxFields;
|
||||
|
|
@ -9,7 +9,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
.ledgerSlideContent {
|
||||
.ledgerSlideLayout {
|
||||
.wea-new-top {
|
||||
.ant-col-10 {
|
||||
padding-right: 45px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-new-top-req-wapper .wea-new-top-req-title > div:last-child {
|
||||
right: 45px !important;
|
||||
}
|
||||
|
||||
.ledgerSlideContent {
|
||||
}
|
||||
}
|
||||
|
||||
.copyWrapper {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
* Date: 2022/12/9
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSelect, WeaTextarea } from "ecCom";
|
||||
import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaLocaleProvider, WeaSelect, WeaTextarea } from "ecCom";
|
||||
import { Col, Row } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { baseSettingFormItem } from "../config";
|
||||
import { getLedgerBasicForm } from "../../../apis/ledger";
|
||||
import { getIncomeCategoryList, getLedgerBasicForm } from "../../../apis/ledger";
|
||||
import {
|
||||
generateBasicInfo,
|
||||
getAddMonthYearMonth,
|
||||
|
|
@ -18,10 +18,12 @@ import {
|
|||
getSubtractMonthYearMonth,
|
||||
prefixAddZero
|
||||
} from "../../../util/date";
|
||||
import { commonEnumList } from "../../../apis/ruleconfig";
|
||||
import moment from "moment";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class LedgerBaseSetting extends Component {
|
||||
|
|
@ -124,10 +126,7 @@ class LedgerBaseSetting extends Component {
|
|||
});
|
||||
};
|
||||
commonEenumList = () => {
|
||||
const payload = {
|
||||
enumClass: "com.engine.salary.enums.salarysob.IncomeCategoryEnum"
|
||||
};
|
||||
commonEnumList(payload).then(({ status, data }) => {
|
||||
getIncomeCategoryList().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { baseForm } = this.state;
|
||||
this.setState({
|
||||
|
|
@ -135,7 +134,16 @@ class LedgerBaseSetting extends Component {
|
|||
if (it.key === "taxableItems") {
|
||||
return {
|
||||
...it,
|
||||
options: _.map(data, it => ({ key: it.value.toString(), showname: it.defaultLabel }))
|
||||
options: _.map(data, it => ({
|
||||
key: it.value.toString(),
|
||||
showname: <div className="reportTypeName-box">
|
||||
<span>{it.defaultLabel}</span>
|
||||
<span
|
||||
className={cs("reportTypeName", { "danger": it.reportTypeName === getLabel(111, "非居民所得") })}>
|
||||
{it.reportTypeName}
|
||||
</span>
|
||||
</div>
|
||||
}))
|
||||
};
|
||||
}
|
||||
return { ...it };
|
||||
|
|
|
|||
|
|
@ -8,20 +8,23 @@ import React, { Component } from "react";
|
|||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import LedgerBaseSetting from "./ledgerBaseSetting";
|
||||
import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
|
||||
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
|
||||
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
|
||||
import LedgerSalaryItem from "./ledgerSalaryItem";
|
||||
import IncomeTaxFields from "./incomeTaxFields";
|
||||
import IncomeTaxFieldsCorresponding from "./incomeTaxFieldsCorresponding";
|
||||
import CumulativeFields from "./cumulativeFields";
|
||||
import WeaTopTitle from "../../../components/custom-title/weaTopTitle";
|
||||
import WeaReqTitle from "../../../components/custom-title/weaReqTitle";
|
||||
import {
|
||||
addupruleSave,
|
||||
saveAdjustmentRule,
|
||||
saveLedgerBasic,
|
||||
saveLedgerItem,
|
||||
taxreportruleSave
|
||||
taxreportruleSave,
|
||||
taxruleSave
|
||||
} from "../../../apis/ledger";
|
||||
import "./index.less";
|
||||
|
||||
|
|
@ -39,6 +42,7 @@ class LedgerSlide extends Component {
|
|||
baseSettingInfo: {},
|
||||
adjustRules: [],
|
||||
empFields: [], itemGroups: [],
|
||||
taxruleFields: [], taxruleKeys: "", //个税字段对应
|
||||
incomeTaxFields: [], incomeTaxKeys: "", //个税申报字段对应
|
||||
addupruleFields: [], addupruleKeys: "", //累计字段对应
|
||||
saveSalarySobId: "",
|
||||
|
|
@ -147,6 +151,45 @@ class LedgerSlide extends Component {
|
|||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description:个税字段对应-保存
|
||||
* Params:
|
||||
* Date: 2023/8/16
|
||||
*/
|
||||
taxRuleSave = () => {
|
||||
const { editId } = this.props;
|
||||
const { taxruleKeys, taxruleFields, saveSalarySobId } = this.state;
|
||||
const payload = {
|
||||
salarySobId: editId || saveSalarySobId,
|
||||
incomeCategoryParams: _.map(taxruleFields, it => {
|
||||
if (it.incomeCategoryId === taxruleKeys) {
|
||||
return {
|
||||
incomeCategory: it.incomeCategoryId,
|
||||
taxRuleParams: _.map(it.taxReportRules, child => {
|
||||
return {
|
||||
taxIndex: child.reportColumnDataIndex,
|
||||
salaryItemId: _.map(child.salaryItem, o => o.id).join(",")
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
return {
|
||||
incomeCategory: it.incomeCategoryId,
|
||||
taxRuleParams: []
|
||||
};
|
||||
})
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
taxruleSave(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(22619, "保存成功!"));
|
||||
} else {
|
||||
message.error(errormsg || getLabel(22620, "保存失败!"));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description:个税申报字段对应-保存
|
||||
|
|
@ -154,33 +197,29 @@ class LedgerSlide extends Component {
|
|||
* Date: 2023/8/16
|
||||
*/
|
||||
taxreportruleSave = () => {
|
||||
const { taxableItems, incomeTaxKeys, incomeTaxFields, saveSalarySobId } = this.state;
|
||||
const { editId } = this.props;
|
||||
if ((!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489")) {
|
||||
this.saveLedgerAdjustRule();
|
||||
} else {
|
||||
const payload = {
|
||||
salarySobId: editId || saveSalarySobId,
|
||||
incomeCategoryParams: _.map(incomeTaxFields, it => {
|
||||
if (it.incomeCategoryId === incomeTaxKeys) {
|
||||
return {
|
||||
incomeCategory: it.incomeCategoryId,
|
||||
taxReportRuleParams: _.map(it.taxReportRules, child => {
|
||||
return {
|
||||
reportColumnDataIndex: child.reportColumnDataIndex,
|
||||
salaryItemId: _.map(child.salaryItem, o => o.id).join(",")
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
const { incomeTaxKeys, incomeTaxFields, saveSalarySobId } = this.state;
|
||||
const payload = {
|
||||
salarySobId: editId || saveSalarySobId,
|
||||
incomeCategoryParams: _.map(incomeTaxFields, it => {
|
||||
if (it.incomeCategoryId === incomeTaxKeys) {
|
||||
return {
|
||||
incomeCategory: it.incomeCategoryId,
|
||||
taxReportRuleParams: []
|
||||
taxReportRuleParams: _.map(it.taxReportRules, child => {
|
||||
return {
|
||||
reportColumnDataIndex: child.reportColumnDataIndex,
|
||||
salaryItemId: _.map(child.salaryItem, o => o.id).join(",")
|
||||
};
|
||||
})
|
||||
};
|
||||
})
|
||||
};
|
||||
this.saveTaxreportrule(payload);
|
||||
}
|
||||
}
|
||||
return {
|
||||
incomeCategory: it.incomeCategoryId,
|
||||
taxReportRuleParams: []
|
||||
};
|
||||
})
|
||||
};
|
||||
this.saveTaxreportrule(payload);
|
||||
};
|
||||
saveTaxreportrule = (payload) => {
|
||||
this.setState({ loading: true });
|
||||
|
|
@ -200,7 +239,10 @@ class LedgerSlide extends Component {
|
|||
* Date: 2023/8/17
|
||||
*/
|
||||
addupruleSave = () => {
|
||||
const { taxableItems, incomeTaxFields, incomeTaxKeys, addupruleFields, addupruleKeys, saveSalarySobId } = this.state;
|
||||
const {
|
||||
taxableItems, incomeTaxFields, incomeTaxKeys, addupruleFields,
|
||||
addupruleKeys, saveSalarySobId
|
||||
} = this.state;
|
||||
const { editId } = this.props;
|
||||
if ((!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489")) {
|
||||
const payload = {
|
||||
|
|
@ -256,21 +298,14 @@ class LedgerSlide extends Component {
|
|||
}).catch(() => this.setState({ loading: false }));
|
||||
}
|
||||
};
|
||||
handleChangeSlideTab = (current) => {
|
||||
this.setState({ current: Number(current) });
|
||||
};
|
||||
handleClose = () => {
|
||||
this.setState({ current: 0 }, () => this.props.onCancel());
|
||||
};
|
||||
handleClose = () => this.setState({ current: 0, baseSettingInfo: {} }, () => this.props.onCancel());
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 基础信息字段切换
|
||||
* Params:
|
||||
* Date: 2022/12/9
|
||||
*/
|
||||
handleChangeSaveParams = (baseSettingInfo) => {
|
||||
this.setState({ baseSettingInfo });
|
||||
};
|
||||
handleChangeSaveParams = (baseSettingInfo) => this.setState({ baseSettingInfo });
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 薪资项目保存数据
|
||||
|
|
@ -280,179 +315,132 @@ class LedgerSlide extends Component {
|
|||
handleSaveSalaryItemParams = (empFields, itemGroups) => {
|
||||
this.setState({ empFields, itemGroups });
|
||||
};
|
||||
renderChildren = () => {
|
||||
const { editId } = this.props;
|
||||
const { current, saveSalarySobId, taxableItems } = this.state;
|
||||
let CurrentDom = null;
|
||||
switch (current) {
|
||||
case 0:
|
||||
CurrentDom = <LedgerBaseSetting
|
||||
{...this.props} onSaveParams={this.handleChangeSaveParams}
|
||||
onTaxableItemsChange={(val) => this.setState({ taxableItems: val })}
|
||||
/>;
|
||||
break;
|
||||
case 1:
|
||||
CurrentDom = <LedgerAssociatedPersonnel {...this.props} saveSalarySobId={saveSalarySobId}/>;
|
||||
break;
|
||||
case 2:
|
||||
CurrentDom = <LedgerSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSaveSalaryItem={this.handleSaveSalaryItemParams}/>;
|
||||
break;
|
||||
case 3:
|
||||
CurrentDom = <LedgerBackCalculatedSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}/>;
|
||||
break;
|
||||
case 4:
|
||||
CurrentDom = (!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ?
|
||||
<IncomeTaxFields {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSetTaxreportrule={(incomeTaxFields, selectedKey) => this.setState({
|
||||
incomeTaxFields,
|
||||
incomeTaxKeys: selectedKey
|
||||
})}/> :
|
||||
<CumulativeFields {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSetAdduprule={(addupruleFields, selectedKey) => this.setState({
|
||||
addupruleFields,
|
||||
addupruleKeys: selectedKey
|
||||
})}/>;
|
||||
break;
|
||||
case 5:
|
||||
CurrentDom = (!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ?
|
||||
<LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/> :
|
||||
<IncomeTaxFields {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSetTaxreportrule={(incomeTaxFields, selectedKey) => this.setState({
|
||||
incomeTaxFields,
|
||||
incomeTaxKeys: selectedKey
|
||||
})}/>;
|
||||
break;
|
||||
case 6:
|
||||
CurrentDom =
|
||||
<LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>;
|
||||
break;
|
||||
default:
|
||||
CurrentDom = null;
|
||||
break;
|
||||
}
|
||||
return CurrentDom;
|
||||
};
|
||||
renderCustomOperate = () => {
|
||||
const { taxAgentStore: { showOperateBtn }, editId } = this.props;
|
||||
const { current, loading, taxableItems } = this.state;
|
||||
let CurrentDom = [];
|
||||
//管理员操作权限
|
||||
if (showOperateBtn) {
|
||||
switch (current) {
|
||||
case 0:
|
||||
CurrentDom = [
|
||||
<Button
|
||||
type="primary"
|
||||
loading={loading}
|
||||
onClick={this.saveLedgerBasic}
|
||||
>{editId ? "保存" : "保存并进入下一步"}</Button>
|
||||
];
|
||||
break;
|
||||
case 1:
|
||||
CurrentDom = !editId ? [
|
||||
<Button type="ghost" onClick={this.handleClose}>完成,跳过所有步骤</Button>,
|
||||
<Button type="primary" onClick={() => this.setState({ current: current + 1 })}>下一步</Button>
|
||||
] : [];
|
||||
break;
|
||||
case 2:
|
||||
CurrentDom = !editId ?
|
||||
[
|
||||
<Button type="ghost" onClick={this.handleClose}>完成,跳过所有步骤</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>,
|
||||
<Button
|
||||
type="primary"
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
this.setState({ current: current + 1 }, () => {
|
||||
this.saveLedgerItem();
|
||||
});
|
||||
}}
|
||||
>保存并进入下一步</Button>
|
||||
] : [
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerItem}>保存</Button>
|
||||
];
|
||||
break;
|
||||
case 3:
|
||||
CurrentDom = !editId ?
|
||||
[
|
||||
<Button type="ghost" onClick={this.handleClose}>完成,跳过所有步骤</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>,
|
||||
<Button type="primary" onClick={() => this.setState({ current: current + 1 })}>下一步</Button>
|
||||
] : [];
|
||||
break;
|
||||
case 4:
|
||||
CurrentDom = !editId ?
|
||||
[
|
||||
<Button type="ghost" onClick={this.handleClose}>完成,跳过所有步骤</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>,
|
||||
<Button
|
||||
type="primary"
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
this.setState({ current: current + 1 }, () => this.addupruleSave());
|
||||
}}
|
||||
>保存并进入下一步</Button>
|
||||
] : [
|
||||
<Button type="primary" loading={loading} onClick={this.addupruleSave}>保存</Button>
|
||||
];
|
||||
break;
|
||||
case 5:
|
||||
CurrentDom = !editId ?
|
||||
[
|
||||
<Button type="ghost" onClick={this.handleClose}>完成,跳过所有步骤</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>,
|
||||
<Button
|
||||
type="primary"
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
this.setState({ current: current + 1 }, () => this.taxreportruleSave());
|
||||
}}
|
||||
>
|
||||
{
|
||||
(!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ?
|
||||
getLabel(555, "完成") :
|
||||
getLabel(33199, "保存并进入下一步")
|
||||
}
|
||||
</Button>
|
||||
] : [
|
||||
<Button type="primary" loading={loading} onClick={this.taxreportruleSave}>保存</Button>
|
||||
];
|
||||
break;
|
||||
case 6:
|
||||
CurrentDom = !editId ?
|
||||
[
|
||||
<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>,
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>完成</Button>
|
||||
] : [
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>保存</Button>
|
||||
];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return CurrentDom;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { current, taxableItems, saveSalarySobId, loading } = this.state;
|
||||
let tabs = [
|
||||
{ key: 0, title: getLabel(82751, "基础设置") },
|
||||
{ key: 1, title: getLabel(543467, "关联人员") },
|
||||
{ key: 2, title: getLabel(542362, "薪资项目") },
|
||||
{ key: 3, title: getLabel(543468, "回算薪资项目") },
|
||||
{ key: 4, title: getLabel(111, "累计字段对应") },
|
||||
{ key: 5, title: getLabel(111, "个税申报字段对应") },
|
||||
{ key: 6, title: getLabel(543469, "调薪计薪规则") }
|
||||
{
|
||||
key: 0, title: getLabel(82751, "基础设置"),
|
||||
createBtns: [
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={this.saveLedgerBasic}>{getLabel(111, "保存并进入下一步")}</Button>
|
||||
],
|
||||
editBtns: [
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerBasic}>{getLabel(111, "保存")}</Button>
|
||||
],
|
||||
children: <LedgerBaseSetting
|
||||
{...this.props} onSaveParams={this.handleChangeSaveParams}
|
||||
onTaxableItemsChange={(val) => this.setState({ taxableItems: val })}
|
||||
/>
|
||||
},
|
||||
{
|
||||
key: 1, title: getLabel(543467, "关联人员"),
|
||||
createBtns: [
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="primary"
|
||||
onClick={() => this.setState({ current: current + 1 })}>{getLabel(111, "下一步")}</Button>
|
||||
],
|
||||
editBtns: [],
|
||||
children: <LedgerAssociatedPersonnel {...this.props} saveSalarySobId={saveSalarySobId}/>
|
||||
},
|
||||
{
|
||||
key: 2, title: getLabel(542362, "薪资项目"),
|
||||
createBtns: [
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading} onClick={() => {
|
||||
this.setState({ current: current + 1 }, () => this.saveLedgerItem());
|
||||
}}>{getLabel(111, "保存并进入下一步")}</Button>
|
||||
],
|
||||
editBtns: [
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerItem}>{getLabel(111, "保存")}</Button>
|
||||
],
|
||||
children: <LedgerSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSaveSalaryItem={this.handleSaveSalaryItemParams}/>
|
||||
},
|
||||
{
|
||||
key: 3, title: getLabel(543468, "回算薪资项目"),
|
||||
createBtns: [
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary"
|
||||
onClick={() => this.setState({ current: current + 1 })}>{getLabel(111, "下一步")}</Button>
|
||||
],
|
||||
editBtns: [],
|
||||
children: <LedgerBackCalculatedSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}/>
|
||||
},
|
||||
{
|
||||
key: 4, title: getLabel(111, "累计字段对应"),
|
||||
createBtns: [
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.setState({ current: current + 1 }, () => this.addupruleSave())}>{getLabel(111, "保存并进入下一步")}</Button>
|
||||
],
|
||||
editBtns: [<Button type="primary" loading={loading}
|
||||
onClick={this.addupruleSave}>{getLabel(111, "保存")}</Button>],
|
||||
children: <CumulativeFields {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSetAdduprule={(addupruleFields, selectedKey) => this.setState({
|
||||
addupruleFields, addupruleKeys: selectedKey
|
||||
})}/>
|
||||
},
|
||||
{
|
||||
key: 5, title: getLabel(111, "个税字段对应"),
|
||||
createBtns: [
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.setState({ current: current + 1 }, () => this.taxRuleSave())}>{getLabel(111, "保存并进入下一步")}</Button>
|
||||
],
|
||||
editBtns: [<Button type="primary" loading={loading}
|
||||
onClick={this.taxRuleSave}>{getLabel(111, "保存")}</Button>],
|
||||
children: <IncomeTaxFieldsCorresponding {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSetTaxreportrule={(taxruleFields, selectedKey) => this.setState({
|
||||
taxruleFields, taxruleKeys: selectedKey
|
||||
})}/>
|
||||
},
|
||||
{
|
||||
key: 6, title: getLabel(111, "个税申报字段对应"),
|
||||
createBtns: [
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.setState({ current: current + 1 }, () => this.addupruleSave())}>{getLabel(111, "保存并进入下一步")}</Button>
|
||||
],
|
||||
editBtns: [<Button type="primary" loading={loading}
|
||||
onClick={this.taxreportruleSave}>{getLabel(111, "保存")}</Button>],
|
||||
children: <IncomeTaxFields {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSetTaxreportrule={(incomeTaxFields, selectedKey) => this.setState({
|
||||
incomeTaxFields,
|
||||
incomeTaxKeys: selectedKey
|
||||
})}/>
|
||||
},
|
||||
{
|
||||
key: 7, title: getLabel(543469, "调薪计薪规则"),
|
||||
createBtns: [
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>{getLabel(111, "完成")}</Button>
|
||||
],
|
||||
editBtns: [
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={this.saveLedgerAdjustRule}>{getLabel(111, "保存")}</Button>
|
||||
],
|
||||
children: <LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>
|
||||
}
|
||||
];
|
||||
const { title, visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { current, taxableItems } = this.state;
|
||||
(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && (tabs = _.filter(tabs, o => o.key !== 4));
|
||||
(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") &&
|
||||
(tabs = _.map(_.filter(tabs, o => o.key !== 4), (k, j) => ({ ...k, key: j })));
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className="slideOuterWrapper"
|
||||
className="ledgerSlideLayout slideOuterWrapper"
|
||||
visible={visible}
|
||||
top={0}
|
||||
width={100}
|
||||
|
|
@ -460,18 +448,10 @@ class LedgerSlide extends Component {
|
|||
direction="right"
|
||||
measure="%"
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={title}
|
||||
tabs={editId ? tabs : []}
|
||||
loading={false}
|
||||
showOperateBtn={showOperateBtn}
|
||||
editable={false}
|
||||
onSave={() => {
|
||||
}}
|
||||
selectedTab={current}
|
||||
customOperate={this.renderCustomOperate()}
|
||||
subItemChange={this.handleChangeSlideTab}
|
||||
/>
|
||||
!editId ? <WeaTopTitle buttons={_.find(tabs, o => current === o.key).createBtns}/> :
|
||||
<WeaReqTitle buttons={showOperateBtn ? _.find(tabs, o => current === o.key).editBtns : []}
|
||||
tabDatas={tabs} selectedKey={String(current)}
|
||||
onChange={cur => this.setState({ current: parseInt(cur) })}/>
|
||||
}
|
||||
content={
|
||||
<div className="ledgerSlideContent">
|
||||
|
|
@ -486,9 +466,7 @@ class LedgerSlide extends Component {
|
|||
}
|
||||
</WeaSteps>
|
||||
}
|
||||
{
|
||||
this.renderChildren()
|
||||
}
|
||||
{_.find(tabs, o => current === o.key).children}
|
||||
</div>
|
||||
}
|
||||
onClose={this.handleClose}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,3 @@
|
|||
.ledgerOuter {
|
||||
.wea-new-top {
|
||||
.ant-col-10 {
|
||||
& > span:nth-child(2) {
|
||||
margin-top: -6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ledgerWrapper {
|
||||
height: 100%;
|
||||
|
||||
|
|
|
|||
|
|
@ -83,3 +83,27 @@
|
|||
|
||||
}
|
||||
|
||||
//薪资账套-工资类型下拉选项样式自定义
|
||||
.reportTypeName-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.reportTypeName {
|
||||
display: flex;
|
||||
padding: 0 8px;
|
||||
align-items: center;
|
||||
color: #ffcd50;
|
||||
border: 1px solid #ffde8a;
|
||||
background-color: #fff5db;
|
||||
border-radius: 2px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.danger {
|
||||
color: #ff666a !important;
|
||||
border: 1px solid #ffc1c3 !important;
|
||||
background-color: #ffdfe0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue