From 38f25e5a95b5cce71f28c00d77cfa8c5a3c6df31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 20 Feb 2023 10:24:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/dataAcquisition/cumDeduct/index.js | 71 ++++++++++++++++--- .../pages/dataAcquisition/dataTables.js | 7 ++ 2 files changed, 69 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 3a946903..f9ddb4f8 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -1,7 +1,8 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDatePicker, WeaFormItem, WeaHelpfulTip, WeaSearchGroup, WeaSelect } from "ecCom"; -import { Button, Dropdown, Menu, message } from "antd"; +import { Button, Dropdown, Menu, message, Modal } from "antd"; +import * as API from "../../../apis/cumDeduct"; import { autoAddAll } from "../../../apis/cumDeduct"; import DataTables from "../dataTables"; import Layout from "../layout"; @@ -46,6 +47,60 @@ class Index extends Component { } }).catch(() => this.setState({ addAllLoading: false })); }; + /* + * Author: 黎永顺 + * Description: 一键清空 + * Params: + * Date: 2023/2/20 + */ + deleteAllAddUpDeduction = () => { + const { declareMonth, taxAgentId } = this.state; + const payload = { declareMonth, taxAgentId }; + Modal.confirm({ + title: "信息确认", + content: `确定清空税款所属期为${declareMonth}的所有累计专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.deleteAllAddUpDeduction(payload).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.tableRef.getTableDate(); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description: 删除所选 + * Params: + * Date: 2023/2/20 + */ + deleteSelectAddUpDeduction = () => { + const { declareMonth } = this.state; + const { selectedRowKeys: ids } = this.tableRef.state; + if (ids.length === 0) { + message.warning("请选择表格数据"); + return; + } + const payload = { declareMonth, ids }; + Modal.confirm({ + title: "信息确认", + content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。", + onOk: () => { + API.deleteSelectAddUpDeduction(payload).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.tableRef.getTableDate(); + this.tableRef.handleClearRows(); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + }; handleResize = (innerWidth) => this.setState({ innerWidth }); /* @@ -61,7 +116,7 @@ class Index extends Component { ...slidePayload, visible: true, title: "新建", - chidren: