Merge branch 'feature/2.9.42309.01-个税-数据采集累计专项附加扣除个税在线获取' into release/2.9.42309.01-个税
This commit is contained in:
commit
adfaf2bf64
|
|
@ -137,3 +137,15 @@ export const getTableRecordDate = ({ url, ...params }) => {
|
|||
return postFetch(url, params);
|
||||
};
|
||||
|
||||
//个税-在线获取
|
||||
export const onlineRequest = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/addUpDeduction/online/request", params);
|
||||
};
|
||||
|
||||
//个税-在线获取结果查询
|
||||
export const onlineFeedback = () => {
|
||||
return fetch("/api/bs/hrmsalary/addUpDeduction/online/feedback", {
|
||||
method: "GET",
|
||||
mode: "cors"
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
|
|
|||
|
|
@ -121,3 +121,7 @@ export const deleteAllAddUpSituation = (params) => {
|
|||
export const getAddUpSituation = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/addUpSituation/getAddUpSituation', params);
|
||||
}
|
||||
//个税相关-在线获取
|
||||
export const onlineActualAddUpAdvanceTax = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/addUpSituation/online/actualAddUpAdvanceTax', params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -469,7 +469,27 @@ export const dataCollectCondition = [
|
|||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
title: '数据采集',
|
||||
title: "数据采集",
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
export const cumTaxPeriodCondition = [
|
||||
{
|
||||
items: [{
|
||||
colSpan: 1,
|
||||
conditionType: "MONTHPICKER",
|
||||
domkey: ["declareMonth"],
|
||||
fieldcol: 18,
|
||||
label: "税款所属期",
|
||||
lanId: 542240,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}],
|
||||
title: "",
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 个税对接-在线获取
|
||||
* Description:
|
||||
* Date: 2023/9/5
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { cumTaxPeriodCondition } from "../columns";
|
||||
import { onlineRequest } from "../../../../apis/cumDeduct";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("cumDeductStore")
|
||||
@observer
|
||||
class SalaryCumDeductChooseTaxPeriodDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
const { cumDeductStore: { cumTaxPeriodForm, changeCumTaxPeriodForm } } = nextProps;
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
cumTaxPeriodForm.initFormFields(cumTaxPeriodCondition);
|
||||
}
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
cumTaxPeriodForm.resetForm();
|
||||
changeCumTaxPeriodForm();
|
||||
}
|
||||
}
|
||||
|
||||
save = () => {
|
||||
const { cumDeductStore: { cumTaxPeriodForm } } = this.props;
|
||||
cumTaxPeriodForm.validateForm().then(f => {
|
||||
const { declareMonth } = cumTaxPeriodForm.getFormParams();
|
||||
if (f.isValid) {
|
||||
this.setState({ loading: true });
|
||||
onlineRequest({ declareMonth: declareMonth + "-01" }).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "获取成功!"));
|
||||
this.props.onCancel();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading } = this.state;
|
||||
const { cumDeductStore: { cumTaxPeriodForm } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} className="paymentDialog" initLoadCss
|
||||
style={{ width: 550 }}
|
||||
buttons={[<Button type="primary" loading={loading} onClick={this.save}>{getLabel(33703, "确认")}</Button>]}
|
||||
bottomLeft={getLabel(111, "点击保存后,稍后请点击【获取结果下载】下载获取结果。获取的数据将覆盖列表原本数据(有则覆盖无则新增)。")}
|
||||
>
|
||||
<div className="paymentDialogContent">
|
||||
{getSearchs(cumTaxPeriodForm, cumTaxPeriodCondition, 1, false)}
|
||||
</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryCumDeductChooseTaxPeriodDialog;
|
||||
|
|
@ -1,6 +1,14 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDatePicker, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSearchGroup, WeaSelect } from "ecCom";
|
||||
import {
|
||||
WeaDatePicker,
|
||||
WeaFormItem,
|
||||
WeaHelpfulTip,
|
||||
WeaInput,
|
||||
WeaLocaleProvider,
|
||||
WeaSearchGroup,
|
||||
WeaSelect
|
||||
} from "ecCom";
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import {
|
||||
autoAddAll,
|
||||
|
|
@ -11,7 +19,8 @@ import {
|
|||
getAddUpDeduction,
|
||||
getCumDeductSaCondition,
|
||||
importCumDeductParam,
|
||||
importCumDeductPreview
|
||||
importCumDeductPreview,
|
||||
onlineFeedback
|
||||
} from "../../../apis/cumDeduct";
|
||||
import DataTables from "../dataTables";
|
||||
import AddItems from "../addItems";
|
||||
|
|
@ -22,6 +31,9 @@ import { removePropertyCondition } from "../../../util/response";
|
|||
import { convertToUrlString } from "../../../util/url";
|
||||
import Layout from "../layout";
|
||||
import moment from "moment";
|
||||
import SalaryCumDeductChooseTaxPeriodDialog from "./components/salaryCumDeductChooseTaxPeriodDialog";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore", "cumDeductStore")
|
||||
@observer
|
||||
|
|
@ -54,7 +66,11 @@ class Index extends Component {
|
|||
},
|
||||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null
|
||||
advanceCondition: null,
|
||||
cumTaxPeriodDialog: {
|
||||
visible: false, title: ""
|
||||
},
|
||||
feedbackLoading: false
|
||||
};
|
||||
this.tableRef = null;
|
||||
this.addItemRef = null;
|
||||
|
|
@ -498,11 +514,26 @@ class Index extends Component {
|
|||
});
|
||||
};
|
||||
|
||||
onlineFeedback = () => {
|
||||
this.setState({ feedbackLoading: true });
|
||||
onlineFeedback().then(({ status, errormsg }) => {
|
||||
this.setState({ feedbackLoading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "获取成功!"));
|
||||
this.tableRef.getTableDate();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.setState({ feedbackLoading: false });
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { showOperateBtn }, cumDeductStore: { form } } = this.props;
|
||||
const {
|
||||
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
|
||||
importPayload, exportPayloadType
|
||||
importPayload, exportPayloadType, cumTaxPeriodDialog, feedbackLoading
|
||||
} = this.state;
|
||||
const tablePayload = { declareMonth: [declareMonth], taxAgentId };
|
||||
return (
|
||||
|
|
@ -516,6 +547,17 @@ class Index extends Component {
|
|||
importPayload={importPayload} onImportFile={this.handleImportFile}
|
||||
onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()}
|
||||
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
|
||||
ref={dom => this.tableRef = dom}
|
||||
|
|
@ -526,6 +568,12 @@ class Index extends Component {
|
|||
onViewDetails={(record) => this.handleAddData("累计专项附加扣除记录", record)}
|
||||
form={form}
|
||||
/>
|
||||
<SalaryCumDeductChooseTaxPeriodDialog
|
||||
{...cumTaxPeriodDialog}
|
||||
onCancel={() => this.setState({
|
||||
cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "" }
|
||||
})}
|
||||
/>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaSearchGroup } from "ecCom";
|
||||
import { WeaLoadingGlobal, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import {
|
||||
createAddUpSituation,
|
||||
|
|
@ -16,7 +16,8 @@ import {
|
|||
getAddUpSituation,
|
||||
getCumSituationSaCondition,
|
||||
importCumSituationParam,
|
||||
importCumSituationPreview
|
||||
importCumSituationPreview,
|
||||
onlineActualAddUpAdvanceTax
|
||||
} from "../../../apis/cumSituation";
|
||||
import { removePropertyCondition } from "../../../util/response";
|
||||
import DataTables from "../dataTables";
|
||||
|
|
@ -30,6 +31,8 @@ import TableRecord from "../components/tableRecord";
|
|||
import { situationModalColumns } from "../cumDeduct/columns";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore", "cumSituationStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
|
|
@ -304,6 +307,40 @@ class Index extends Component {
|
|||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=${ids.join(",")}&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}`
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 个税相关-在线获取
|
||||
* Params:
|
||||
* Date: 2023/9/6
|
||||
*/
|
||||
handleOnlineAccess = () => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(111, "确定要在线获取税局数据更新实际累计已预扣预缴税额?\n" +
|
||||
"此操作会依据实际累计已预扣预缴税额自动计算个税调差,不可回退,可重复获取,每次获取后重复数据会进行覆盖处理。"),
|
||||
onOk: this.onlineActualAddUpAdvanceTax
|
||||
});
|
||||
};
|
||||
onlineActualAddUpAdvanceTax = () => {
|
||||
const { declareMonth, year } = this.state;
|
||||
const payload = {
|
||||
declareMonth: year + "-" + declareMonth + "-01"
|
||||
};
|
||||
WeaLoadingGlobal.start();
|
||||
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();
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 顶部操作按钮
|
||||
|
|
@ -314,6 +351,7 @@ class Index extends Component {
|
|||
const { addAllLoading } = this.state;
|
||||
return [
|
||||
<Button type="primary" onClick={this.handleOpenImport}>导入</Button>,
|
||||
<Button type="ghost" onClick={this.handleOnlineAccess}>{getLabel(111, "在线获取")}</Button>,
|
||||
<Button type="ghost" onClick={() => this.handleAddData()}>新建</Button>,
|
||||
<Dropdown
|
||||
overlay={
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class Layout extends Component {
|
|||
title, btns, leftComp, children, taxAgentStore: { showOperateBtn },
|
||||
slidePayload, onClose, onSave, slideLoading, form, condition,
|
||||
onAdSearch, onCancel, importPayload, onImportSetStep, onImportFile,
|
||||
onPreviewImport, detailOptBtns, columns
|
||||
onPreviewImport, detailOptBtns, columns, tabBtns = []
|
||||
} = this.props;
|
||||
const { visible, title: subtitle, children: slideChildren } = slidePayload;
|
||||
const {
|
||||
|
|
@ -80,6 +80,7 @@ class Layout extends Component {
|
|||
onSearch={onAdSearch}
|
||||
onSearchChange={(v) => form.updateFields({ username: v })}
|
||||
searchsBaseValue={form.getFormParams().username}
|
||||
buttons={showOperateBtn ? tabBtns : []}
|
||||
/>
|
||||
<div className="dataContent">
|
||||
<WeaNewScroll height="100%">{children}</WeaNewScroll>
|
||||
|
|
|
|||
|
|
@ -149,6 +149,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
.ant-modal-footer {
|
||||
.ext-link {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 10px !important;
|
||||
text-align: left !important;
|
||||
}
|
||||
}
|
||||
|
||||
.paymentDialogContent {
|
||||
padding: 16px 25px;
|
||||
background: #f6f6f6;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import { removePropertyCondition } from "../util/response";
|
|||
const { TableStore } = WeaTableNew;
|
||||
|
||||
export class CumDeductStore {
|
||||
@observable cumTaxPeriodForm = new WeaForm(); // 新增form
|
||||
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
@observable slideTableStore = new TableStore();
|
||||
@observable form = new WeaForm(); // new 一个form
|
||||
|
|
@ -30,6 +32,9 @@ export class CumDeductStore {
|
|||
@observable slidePageObj = {}; //详情分页列表数据
|
||||
@observable slideTableDataSource = []; //详情列表数据
|
||||
|
||||
|
||||
@action changeCumTaxPeriodForm = () => this.cumTaxPeriodForm = new WeaForm();
|
||||
|
||||
// ** 设置导入参数 start **
|
||||
@action
|
||||
setSlideDataSource = (slideDataSource) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue