feature/2.9.42309.01-个税-数据采集累计专项附加扣除个税在线获取

This commit is contained in:
黎永顺 2023-09-08 09:38:07 +08:00
parent d330b0b40e
commit b68578e82b
4 changed files with 161 additions and 105 deletions

View File

@ -11,8 +11,13 @@ import { Button, message } from "antd";
import { getSearchs } from "../../../../util"; import { getSearchs } from "../../../../util";
import { cumTaxPeriodCondition } from "../columns"; import { cumTaxPeriodCondition } from "../columns";
import { onlineRequest } from "../../../../apis/cumDeduct"; import { onlineRequest } from "../../../../apis/cumDeduct";
import { onlineActualAddUpAdvanceTax } from "../../../../apis/cumSituation";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
const APIFox = {
online: onlineRequest,
advance: onlineActualAddUpAdvanceTax
};
@inject("cumDeductStore") @inject("cumDeductStore")
@observer @observer
@ -36,12 +41,12 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component {
} }
save = () => { save = () => {
const { cumDeductStore: { cumTaxPeriodForm } } = this.props; const { cumDeductStore: { cumTaxPeriodForm }, type } = this.props;
cumTaxPeriodForm.validateForm().then(f => { cumTaxPeriodForm.validateForm().then(f => {
const { declareMonth } = cumTaxPeriodForm.getFormParams(); const { declareMonth } = cumTaxPeriodForm.getFormParams();
if (f.isValid) { if (f.isValid) {
this.setState({ loading: true }); this.setState({ loading: true });
onlineRequest({ declareMonth: declareMonth + "-01" }).then(({ status, errormsg }) => { APIFox[type]({ declareMonth: declareMonth + "-01" }).then(({ status, errormsg }) => {
this.setState({ loading: false }); this.setState({ loading: false });
if (status) { if (status) {
message.success(getLabel(111, "获取成功!")); message.success(getLabel(111, "获取成功!"));

View File

@ -22,6 +22,7 @@ import {
importCumDeductPreview, importCumDeductPreview,
onlineFeedback onlineFeedback
} from "../../../apis/cumDeduct"; } from "../../../apis/cumDeduct";
import { apiflowBillingConfigStatus } from "../../../apis/intelligentCalculateSalarySettings";
import DataTables from "../dataTables"; import DataTables from "../dataTables";
import AddItems from "../addItems"; import AddItems from "../addItems";
import ImportFormCom from "./components/importFormCom"; import ImportFormCom from "./components/importFormCom";
@ -68,9 +69,10 @@ class Index extends Component {
exportPayloadType: false, exportPayloadType: false,
advanceCondition: null, advanceCondition: null,
cumTaxPeriodDialog: { cumTaxPeriodDialog: {
visible: false, title: "" visible: false, title: "", type: ""
}, },
feedbackLoading: false feedbackLoading: false,
incomeTaxStatus: false
}; };
this.tableRef = null; this.tableRef = null;
this.addItemRef = null; this.addItemRef = null;
@ -79,8 +81,14 @@ class Index extends Component {
componentDidMount() { componentDidMount() {
this.getAdvanceCondition(); this.getAdvanceCondition();
this.apiflowBillingConfigStatus();
} }
apiflowBillingConfigStatus = () => {
apiflowBillingConfigStatus().then(({ status, data }) => {
this.setState({ incomeTaxStatus: status && data });
});
};
/* /*
* Author: 黎永顺 * Author: 黎永顺
* Description:一键累计 * Description:一键累计
@ -399,8 +407,8 @@ class Index extends Component {
* Date: 2023/2/17 * Date: 2023/2/17
*/ */
getTopBtns = () => { getTopBtns = () => {
const { addAllLoading } = this.state; const { addAllLoading, cumTaxPeriodDialog, feedbackLoading, incomeTaxStatus } = this.state;
return [ const commonBtns = [
<Button type="primary" onClick={this.handleOpenImport}>导入</Button>, <Button type="primary" onClick={this.handleOpenImport}>导入</Button>,
<Button type="ghost" onClick={() => this.handleAddData()}>新建</Button>, <Button type="ghost" onClick={() => this.handleAddData()}>新建</Button>,
<Button type="ghost" loading={addAllLoading} onClick={this.autoAddAll}>一键累计</Button>, <Button type="ghost" loading={addAllLoading} onClick={this.autoAddAll}>一键累计</Button>,
@ -417,6 +425,18 @@ class Index extends Component {
<Button type="ghost">更多</Button> <Button type="ghost">更多</Button>
</Dropdown> </Dropdown>
]; ];
const incomeTaxBtns = [
<Button type="primary" onClick={() => this.setState({
cumTaxPeriodDialog: {
...cumTaxPeriodDialog,
visible: true, type: "online",
title: getLabel(542240, "税款所属期")
}
})}>{getLabel(111, "在线获取")}</Button>,
<Button type="ghost" onClick={this.onlineFeedback}
loading={feedbackLoading}>{getLabel(111, "查询在线获取结果")}</Button>
];
return incomeTaxStatus ? [...incomeTaxBtns, ...commonBtns] : commonBtns;
}; };
handleDataMenuClick = ({ key: keyFunc }) => this[keyFunc](); handleDataMenuClick = ({ key: keyFunc }) => this[keyFunc]();
/* /*
@ -533,7 +553,7 @@ class Index extends Component {
const { taxAgentStore: { showOperateBtn }, cumDeductStore: { form } } = this.props; const { taxAgentStore: { showOperateBtn }, cumDeductStore: { form } } = this.props;
const { const {
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
importPayload, exportPayloadType, cumTaxPeriodDialog, feedbackLoading importPayload, exportPayloadType, cumTaxPeriodDialog
} = this.state; } = this.state;
const tablePayload = { declareMonth: [declareMonth], taxAgentId }; const tablePayload = { declareMonth: [declareMonth], taxAgentId };
return ( return (
@ -547,17 +567,6 @@ class Index extends Component {
importPayload={importPayload} onImportFile={this.handleImportFile} importPayload={importPayload} onImportFile={this.handleImportFile}
onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()} onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()}
columns={modalColumns} columns={modalColumns}
tabBtns={[
<Button type="primary" onClick={() => this.setState({
cumTaxPeriodDialog: {
...cumTaxPeriodDialog,
visible: true,
title: getLabel(542240, "税款所属期")
}
})}>{getLabel(111, "在线获取")}</Button>,
<Button type="ghost" onClick={this.onlineFeedback}
loading={feedbackLoading}>{getLabel(111, "查询在线获取结果")}</Button>
]}
> >
<DataTables <DataTables
ref={dom => this.tableRef = dom} ref={dom => this.tableRef = dom}
@ -571,7 +580,7 @@ class Index extends Component {
<SalaryCumDeductChooseTaxPeriodDialog <SalaryCumDeductChooseTaxPeriodDialog
{...cumTaxPeriodDialog} {...cumTaxPeriodDialog}
onCancel={() => this.setState({ onCancel={() => this.setState({
cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "" } cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "", type: "" }
})} })}
/> />
</Layout> </Layout>

View File

@ -108,66 +108,68 @@ export const dataCollectCondition = [
precision: 2, precision: 2,
viewAttr: 2 viewAttr: 2
}, },
{
conditionType: "INPUTNUMBER", // {
domkey: ["addUpChildEducation"], // conditionType: "INPUTNUMBER",
fieldcol: 14, // domkey: ["addUpChildEducation"],
label: "累计子女教育", // fieldcol: 14,
labelcol: 8, // label: "累计子女教育",
value: "", // labelcol: 8,
precision: 2, // value: "",
viewAttr: 2 // precision: 2,
}, // viewAttr: 2
{ // },
conditionType: "INPUTNUMBER", // {
domkey: ["addUpContinuingEducation"], // conditionType: "INPUTNUMBER",
fieldcol: 14, // domkey: ["addUpContinuingEducation"],
label: "累计继续教育", // fieldcol: 14,
labelcol: 8, // label: "累计继续教育",
value: "", // labelcol: 8,
precision: 2, // value: "",
viewAttr: 2 // precision: 2,
}, // viewAttr: 2
{ // },
conditionType: "INPUTNUMBER", // {
domkey: ["addUpHousingLoanInterest"], // conditionType: "INPUTNUMBER",
fieldcol: 14, // domkey: ["addUpHousingLoanInterest"],
label: "累计住房贷款利息", // fieldcol: 14,
labelcol: 8, // label: "累计住房贷款利息",
value: "", // labelcol: 8,
precision: 2, // value: "",
viewAttr: 2 // precision: 2,
}, // viewAttr: 2
{ // },
conditionType: "INPUTNUMBER", // {
domkey: ["addUpHousingRent"], // conditionType: "INPUTNUMBER",
fieldcol: 14, // domkey: ["addUpHousingRent"],
label: "累计住房租金", // fieldcol: 14,
labelcol: 8, // label: "累计住房租金",
value: "", // labelcol: 8,
precision: 2, // value: "",
viewAttr: 2 // precision: 2,
}, // viewAttr: 2
{ // },
conditionType: "INPUTNUMBER", // {
domkey: ["addUpSupportElderly"], // conditionType: "INPUTNUMBER",
fieldcol: 14, // domkey: ["addUpSupportElderly"],
label: "累计赡养老人", // fieldcol: 14,
labelcol: 8, // label: "累计赡养老人",
value: "", // labelcol: 8,
precision: 2, // value: "",
viewAttr: 2 // precision: 2,
}, // viewAttr: 2
{ // },
conditionType: "INPUTNUMBER", // {
domkey: ["addUpIllnessMedical"], // conditionType: "INPUTNUMBER",
fieldcol: 14, // domkey: ["addUpIllnessMedical"],
label: "累计大病医疗", // fieldcol: 14,
labelcol: 8, // label: "累计大病医疗",
value: "", // labelcol: 8,
precision: 2, // value: "",
viewAttr: 2 // precision: 2,
}, // viewAttr: 2
// },
{ {
conditionType: "INPUTNUMBER", conditionType: "INPUTNUMBER",
domkey: ["addUpEnterpriseAndOther"], domkey: ["addUpEnterpriseAndOther"],
@ -230,14 +232,47 @@ export const dataCollectCondition = [
}, },
{ {
conditionType: "INPUTNUMBER", conditionType: "INPUTNUMBER",
domkey: ["addUpInfantCare"], domkey: ["actualAddUpAdvanceTax"],
fieldcol: 14, fieldcol: 14,
label: "累计婴幼儿照护", label: "实际累计已预扣预缴税额",
labelcol: 8, labelcol: 8,
value: "", value: "",
precision: 2, precision: 2,
viewAttr: 2 viewAttr: 2
} },
{
conditionType: "INPUTNUMBER",
domkey: ["taxAdjustment"],
fieldcol: 14,
label: "个税调差",
helpfulTitle: "1、【个税调差】=【实际累计已预扣预缴税额】-【累计已预扣预缴税额】。\n" +
"2、直接输入或导入【个税调差】值则以输入/导入为准,公式失效。再次编辑减数或被减数,会再次按公式自动计算。",
labelcol: 8,
value: "",
precision: 2,
viewAttr: 2
},
{
conditionType: "INPUTNUMBER",
domkey: ["addUpTaxableIncome"],
fieldcol: 14,
label: "累计应纳税所得额",
labelcol: 8,
value: "",
precision: 2,
viewAttr: 2
},
// {
// conditionType: "INPUTNUMBER",
// domkey: ["addUpInfantCare"],
// fieldcol: 14,
// label: "累计婴幼儿照护",
// labelcol: 8,
// value: "",
// precision: 2,
// viewAttr: 2
// }
], ],
title: "数据采集", title: "数据采集",
defaultshow: true defaultshow: true

View File

@ -6,7 +6,7 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { WeaLoadingGlobal, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; import { WeaLocaleProvider, WeaSearchGroup } from "ecCom";
import { Button, Dropdown, Menu, message, Modal } from "antd"; import { Button, Dropdown, Menu, message, Modal } from "antd";
import { import {
createAddUpSituation, createAddUpSituation,
@ -16,9 +16,9 @@ import {
getAddUpSituation, getAddUpSituation,
getCumSituationSaCondition, getCumSituationSaCondition,
importCumSituationParam, importCumSituationParam,
importCumSituationPreview, importCumSituationPreview
onlineActualAddUpAdvanceTax
} from "../../../apis/cumSituation"; } from "../../../apis/cumSituation";
import { apiflowBillingConfigStatus } from "../../../apis/intelligentCalculateSalarySettings";
import { removePropertyCondition } from "../../../util/response"; import { removePropertyCondition } from "../../../util/response";
import DataTables from "../dataTables"; import DataTables from "../dataTables";
import Layout from "../layout"; import Layout from "../layout";
@ -30,6 +30,7 @@ import AddItems from "../addItems";
import TableRecord from "../components/tableRecord"; import TableRecord from "../components/tableRecord";
import { situationModalColumns } from "../cumDeduct/columns"; import { situationModalColumns } from "../cumDeduct/columns";
import { convertToUrlString } from "../../../util/url"; import { convertToUrlString } from "../../../util/url";
import SalaryCumDeductChooseTaxPeriodDialog from "../cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog";
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@ -64,7 +65,11 @@ class Index extends Component {
}, },
exportPayloadUrl: "", exportPayloadUrl: "",
exportPayloadType: false, exportPayloadType: false,
advanceCondition: null advanceCondition: null,
incomeTaxStatus: false,
cumTaxPeriodDialog: {
visible: false, title: "", type: ""
}
}; };
this.tableRef = null; this.tableRef = null;
this.addItemRef = null; this.addItemRef = null;
@ -73,8 +78,14 @@ class Index extends Component {
componentDidMount() { componentDidMount() {
this.getAdvanceCondition(); this.getAdvanceCondition();
this.apiflowBillingConfigStatus();
} }
apiflowBillingConfigStatus = () => {
apiflowBillingConfigStatus().then(({ status, data }) => {
this.setState({ incomeTaxStatus: status && data });
});
};
/* /*
* Author: 黎永顺 * Author: 黎永顺
* Description: 高级搜素框-表单项 * Description: 高级搜素框-表单项
@ -322,23 +333,12 @@ class Index extends Component {
}); });
}; };
onlineActualAddUpAdvanceTax = () => { onlineActualAddUpAdvanceTax = () => {
const { declareMonth, year } = this.state; this.setState({
const payload = { cumTaxPeriodDialog: {
declareMonth: year + "-" + declareMonth + "-01" ...this.state.cumTaxPeriodDialog,
}; visible: true, type: "advance",
WeaLoadingGlobal.start(); title: getLabel(542240, "税款所属期")
onlineActualAddUpAdvanceTax(payload).then(({ status, errormsg }) => {
WeaLoadingGlobal.end();
WeaLoadingGlobal.destroy();
if (status) {
message.success(getLabel(111, "获取成功!"));
this.tableRef.getTableDate();
} else {
message.error(errormsg);
} }
}).catch(() => {
WeaLoadingGlobal.end();
WeaLoadingGlobal.destroy();
}); });
}; };
/* /*
@ -348,8 +348,8 @@ class Index extends Component {
* Date: 2023/2/17 * Date: 2023/2/17
*/ */
getTopBtns = () => { getTopBtns = () => {
const { addAllLoading } = this.state; const { addAllLoading, incomeTaxStatus } = this.state;
return [ const commonBtns = [
<Button type="primary" onClick={this.handleOpenImport}>导入</Button>, <Button type="primary" onClick={this.handleOpenImport}>导入</Button>,
<Button type="ghost" onClick={this.handleOnlineAccess}>{getLabel(111, "在线获取")}</Button>, <Button type="ghost" onClick={this.handleOnlineAccess}>{getLabel(111, "在线获取")}</Button>,
<Button type="ghost" onClick={() => this.handleAddData()}>新建</Button>, <Button type="ghost" onClick={() => this.handleAddData()}>新建</Button>,
@ -366,6 +366,7 @@ class Index extends Component {
<Button type="ghost">更多</Button> <Button type="ghost">更多</Button>
</Dropdown> </Dropdown>
]; ];
return incomeTaxStatus ? commonBtns : _.filter(commonBtns, (__, index) => index !== 1);
}; };
handleDataMenuClick = ({ key: keyFunc }) => this[keyFunc](); handleDataMenuClick = ({ key: keyFunc }) => this[keyFunc]();
/* /*
@ -554,7 +555,7 @@ class Index extends Component {
const { taxAgentStore: { showOperateBtn }, cumSituationStore: { form } } = this.props; const { taxAgentStore: { showOperateBtn }, cumSituationStore: { form } } = this.props;
const { const {
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
importPayload, year, exportPayloadType importPayload, year, exportPayloadType, cumTaxPeriodDialog
} = this.state; } = this.state;
const tablePayload = { taxYearMonth: `${year}-${declareMonth}`, year, taxAgentId }; const tablePayload = { taxYearMonth: `${year}-${declareMonth}`, year, taxAgentId };
return ( return (
@ -570,6 +571,12 @@ class Index extends Component {
onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()} onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()}
columns={situationModalColumns} columns={situationModalColumns}
> >
<SalaryCumDeductChooseTaxPeriodDialog
{...cumTaxPeriodDialog}
onCancel={() => this.setState({
cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "", type: "" }
})}
/>
<DataTables <DataTables
ref={dom => this.tableRef = dom} ref={dom => this.tableRef = dom}
url="/api/bs/hrmsalary/addUpSituation/list" url="/api/bs/hrmsalary/addUpSituation/list"