From d446bcb133099ef568b8264a0595d7e39a028635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 5 Sep 2023 13:30:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0=E6=89=A3?= =?UTF-8?q?=E9=99=A4=E6=B7=BB=E5=8A=A0=E5=9C=A8=E7=BA=BF=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/cumDeduct.js | 12 +++ .../dataAcquisition/cumDeduct/columns.js | 22 +++++- .../salaryCumDeductChooseTaxPeriodDialog.js | 77 +++++++++++++++++++ .../pages/dataAcquisition/cumDeduct/index.js | 56 +++++++++++++- .../hrmSalary/pages/dataAcquisition/layout.js | 3 +- .../hrmSalary/pages/declareDetail/index.less | 8 ++ pc4mobx/hrmSalary/stores/cumDeduct.js | 5 ++ 7 files changed, 177 insertions(+), 6 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index fc963bb5..c06780e1 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -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()); +}; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index 9956585a..8a35e6e9 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -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 } ]; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js new file mode 100644 index 00000000..e6a6c7e2 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js @@ -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 ( + {getLabel(33703, "确认")}]} + bottomLeft={getLabel(111, "点击保存后,稍后请点击【获取结果下载】下载获取结果。获取的数据将覆盖列表原本数据(有则覆盖无则新增)。")} + > +
+ {getSearchs(cumTaxPeriodForm, cumTaxPeriodCondition, 1, false)} +
+
+ ); + } +} + +export default SalaryCumDeductChooseTaxPeriodDialog; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 0e106ae3..b4da4981 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -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={[ + , + + ]} > this.tableRef = dom} @@ -526,6 +568,12 @@ class Index extends Component { onViewDetails={(record) => this.handleAddData("累计专项附加扣除记录", record)} form={form} /> + this.setState({ + cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "" } + })} + /> ); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js b/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js index 4c421d60..0d5f93ba 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js @@ -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 : []} />
{children} diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.less b/pc4mobx/hrmSalary/pages/declareDetail/index.less index 485966f0..596d9423 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.less +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.less @@ -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; diff --git a/pc4mobx/hrmSalary/stores/cumDeduct.js b/pc4mobx/hrmSalary/stores/cumDeduct.js index 55d2cf60..34306f2e 100644 --- a/pc4mobx/hrmSalary/stores/cumDeduct.js +++ b/pc4mobx/hrmSalary/stores/cumDeduct.js @@ -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) => { From d330b0b40e015953d3372bd4da6434ae2d0d5e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 6 Sep 2023 11:26:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1=E6=83=85=E5=86=B5=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=9C=A8=E7=BA=BF=E8=8E=B7=E5=8F=96=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/cumSituation.js | 4 ++ .../dataAcquisition/cumSituation/index.js | 42 ++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/cumSituation.js b/pc4mobx/hrmSalary/apis/cumSituation.js index 512f3d14..cd712d88 100644 --- a/pc4mobx/hrmSalary/apis/cumSituation.js +++ b/pc4mobx/hrmSalary/apis/cumSituation.js @@ -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); +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 78c77a40..0efccee6 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -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 [ , + , ,