release/2.15.1.2407.01-个税

This commit is contained in:
黎永顺 2024-07-17 11:21:19 +08:00
parent 096e545444
commit 97d87f614b
4 changed files with 75 additions and 22 deletions

View File

@ -290,4 +290,11 @@ export const calcTaxFeedback = (params) => {
export const listPage4NotDeclare = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/listPage4NotDeclare", params);
};
// 核算结果--核算税后工资
export const afterTaxAccounting = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/afterTaxAccounting", params);
};
// 核算税后工资进度条
export const getAfterTaxAccountingProgress = (id) => {
return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=AFTER_TAX_ACCT_PROGRESS_" + id, "get", {});
};

View File

@ -148,13 +148,50 @@ class Index extends Component {
API.calcTaxFeedback({ salaryAcctRecordId }).then(({ status, errormsg }) => {
this.setState({ loading: { ...this.state.loading, feedback: false } });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.calc.onAdSearch(false);
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(111, "成功获取个税信息,是否继续计算税后工资?"),
onOk: () => this.afterTaxAccounting()
});
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: { ...this.state.loading, feedback: false } }));
};
afterTaxAccounting = () => {
const { routeParams: { salaryAcctRecordId } } = this.props;
this.setState({ progress: 0 });
let payload = { salaryAcctRecordId };
API.afterTaxAccounting(payload).then(() => {
this.setState({ progressVisible: true });
if (this.timer) clearInterval(this.timer);
this.timer = setInterval(() => {
API.getAfterTaxAccountingProgress(salaryAcctRecordId).then(({ data }) => {
let progress = data.progress;
if (progress === 1 && this.timer) {
clearInterval(this.timer);
this.timer = null;
this.setState({
progressVisible: false,
accountExceptInfo: data.message
});
message.success(getLabel(111, "操作完成"));
this.calc.onAdSearch(false);
} else if (!data.status) {
clearInterval(this.timer);
this.timer = null;
this.setState({
progressVisible: false,
accountExceptInfo: data.message
});
message.error(data.message);
}
this.setState({ progress: Number(progress) * 100 });
});
}, 1000);
});
};
renderReqBtns = () => {
const { selectedKey, accountExceptInfo, loading } = this.state;
let reqBtns = [];

View File

@ -176,7 +176,9 @@ class PaymentFeedbackBtn extends Component {
const { paymentDialog, paymentFeedbackDialog } = this.state;
return (
<React.Fragment>
<Button type="ghost" onClick={this.handlePaymentFeedback}>{getLabel(111, "缴款反馈")}</Button>
{/*个税接口改造*/}
{/*<Button type="ghost" onClick={this.handlePaymentFeedback}>{getLabel(111, "缴款反馈")}</Button>*/}
<Button type="ghost" onClick={this.taxPaymentAgreementPayFeedback}>{getLabel(111, "缴款反馈")}</Button>
<PaymentDialog
{...paymentDialog}
onCancel={this.handleCancel}

View File

@ -104,7 +104,6 @@ class LedgerSlide extends Component {
this.setState({ loading: false });
if (status) {
message.success("保存成功");
this.handleClose();
} else {
message.success(errormsg || "保存失败");
}
@ -159,7 +158,7 @@ class LedgerSlide extends Component {
*/
taxRuleSave = () => {
const { editId } = this.props;
const { taxruleKeys, taxruleFields, saveSalarySobId } = this.state;
const { taxruleKeys, taxruleFields, saveSalarySobId, taxableItems } = this.state;
const payload = {
salarySobId: editId || saveSalarySobId,
incomeCategoryParams: _.map(taxruleFields, it => {
@ -185,6 +184,7 @@ class LedgerSlide extends Component {
this.setState({ loading: false });
if (status) {
message.success(getLabel(22619, "保存成功!"));
!editId && (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && this.handleClose();
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
@ -292,6 +292,7 @@ class LedgerSlide extends Component {
this.setState({ loading: false });
if (status) {
message.success(getLabel(22619, "保存成功!"));
!editId && this.handleClose();
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
@ -373,11 +374,13 @@ class LedgerSlide extends Component {
children: <LedgerBackCalculatedSalaryItem {...this.props} saveSalarySobId={saveSalarySobId}/>
},
{
key: 7, title: getLabel(543469, "调薪计薪规则"),
key: 4, title: getLabel(543469, "调薪计薪规则"),
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.saveLedgerAdjustRule}>{getLabel(111, "完成")}</Button>
<Button type="primary" loading={loading}
onClick={() => this.setState({ current: current + 1 }, () => this.saveLedgerAdjustRule())}>{getLabel(111, "保存并进入下一步")}</Button>
],
editBtns: [
<Button type="primary" loading={loading}
@ -387,13 +390,13 @@ class LedgerSlide extends Component {
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>
},
{
key: 6, title: getLabel(111, "个税申报配置"),
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.addupruleSave())}>{getLabel(111, "保存并进入下一步")}</Button>
onClick={() => this.setState({ current: current + 1 }, () => this.taxreportruleSave())}>{getLabel(111, "保存并进入下一步")}</Button>
],
editBtns: [<Button type="primary" loading={loading}
onClick={this.taxreportruleSave}>{getLabel(111, "保存")}</Button>],
@ -404,14 +407,20 @@ class LedgerSlide extends Component {
})}/>
},
{
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>
],
key: 6, title: getLabel(111, "同步个税配置"),
createBtns:
!(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ?
[
<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>
] : [
<Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
<Button type="primary" loading={loading} onClick={this.taxRuleSave}>{getLabel(111, "完成")}</Button>
],
editBtns: [<Button type="primary" loading={loading}
onClick={this.taxRuleSave}>{getLabel(111, "保存")}</Button>],
children: <IncomeTaxFieldsCorresponding {...this.props} saveSalarySobId={saveSalarySobId}
@ -420,13 +429,11 @@ class LedgerSlide extends Component {
})}/>
},
{
key: 4, title: getLabel(111, "累计字段对应"),
key: 7, 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>
<Button type="primary" loading={loading} onClick={this.addupruleSave}>{getLabel(111, "完成")}</Button>
],
editBtns: [<Button type="primary" loading={loading}
onClick={this.addupruleSave}>{getLabel(111, "保存")}</Button>],
@ -437,7 +444,7 @@ class LedgerSlide extends Component {
}
];
(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") &&
(tabs = _.map(_.filter(tabs, o => o.key !== 4), (k, j) => ({ ...k, key: j })));
(tabs = _.map(_.filter(tabs, o => o.key !== 7), (k, j) => ({ ...k, key: j })));
return (
<WeaSlideModal
className="ledgerSlideLayout slideOuterWrapper"