From 6cff75a9b5a18915383432424de8fd88a270a9bd 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 13:21:04 +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/addItems.js | 3 +-
.../pages/dataAcquisition/cumDeduct/index.js | 44 ++++++++++++++-----
.../pages/dataAcquisition/dataTables.js | 8 ++--
.../pages/dataAcquisition/index.less | 31 +++++++++++++
4 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js
index 5b0705f5..463f1562 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js
@@ -165,9 +165,10 @@ class AddItems extends Component {
return (
+ needTigger showGroup col={1}/>
{
getSearchs(form, condition, 2)
}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js
index 9e1403bb..5714053f 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js
@@ -2,8 +2,12 @@ import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDatePicker, WeaFormItem, WeaHelpfulTip, WeaSearchGroup, WeaSelect } from "ecCom";
import { Button, Dropdown, Menu, message, Modal } from "antd";
-import * as API from "../../../apis/cumDeduct";
-import { autoAddAll } from "../../../apis/cumDeduct";
+import {
+ autoAddAll,
+ deleteAllAddUpDeduction,
+ deleteSelectAddUpDeduction,
+ getAddUpDeduction
+} from "../../../apis/cumDeduct";
import DataTables from "../dataTables";
import AddItems from "../addItems";
import { dataCollectCondition } from "./columns";
@@ -62,7 +66,7 @@ class Index extends Component {
title: "信息确认",
content: `确定清空税款所属期为${declareMonth}的所有累计专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`,
onOk: () => {
- API.deleteAllAddUpDeduction(payload).then(({ status, errormsg }) => {
+ deleteAllAddUpDeduction(payload).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.tableRef.getTableDate();
@@ -79,19 +83,21 @@ class Index extends Component {
* Params:
* Date: 2023/2/20
*/
- deleteSelectAddUpDeduction = () => {
+ deleteSelectAddUpDeduction = (record = {}) => {
const { declareMonth } = this.state;
const { selectedRowKeys: ids } = this.tableRef.state;
- if (ids.length === 0) {
+ const { id, departmentName, username } = record;
+ if (ids.length === 0 && !id) {
message.warning("请选择表格数据");
return;
}
- const payload = { declareMonth, ids };
+ const payload = { declareMonth, ids: !id ? ids : [id] };
Modal.confirm({
title: "信息确认",
- content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。",
+ content: !id ? "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。" :
+ `确定删除${departmentName}${username}(税款所属期:${declareMonth})的累计专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`,
onOk: () => {
- API.deleteSelectAddUpDeduction(payload).then(({ status, errormsg }) => {
+ deleteSelectAddUpDeduction(payload).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.tableRef.getTableDate();
@@ -111,25 +117,38 @@ class Index extends Component {
* Params:
* Date: 2023/2/20
*/
- handleAddData = () => {
+ handleAddData = (title = "新建", editId = {}) => {
const { taxAgentStore, cumDeductStore: { addForm } } = this.props;
+ addForm.initFormFields(dataCollectCondition);
const { slidePayload } = this.state;
const { taxAgentOption } = taxAgentStore;
this.setState({
slidePayload: {
...slidePayload,
visible: true,
- title: "新建",
+ title,
children:
this.addItemRef = dom}
taxAgentOption={taxAgentOption}
form={addForm}
- editId={{}}
+ editId={editId}
condition={dataCollectCondition}
/>
}
});
};
+ /*
+ * Author: 黎永顺
+ * Description:列表操作
+ * Params:
+ * Date: 2023/2/20
+ */
+ handleTableOperate = ({ key }, record) => {
+ const { id } = record;
+ key === "handleAddData" ? getAddUpDeduction({ id }).then(({ status, data }) => {
+ if (status) this[key]("编辑", data);
+ }) : this[key](record);
+ };
handleCloseSlide = () => {
const { slidePayload } = this.state;
this.setState({
@@ -186,7 +205,7 @@ class Index extends Component {
const { addAllLoading } = this.state;
return [
,
- ,
+ ,
,
);
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js
index 0065f92a..289479b0 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js
@@ -56,7 +56,7 @@ class DataTables extends Component {
render() {
const { columns, dataSource, loading, selectedRowKeys, pageInfo } = this.state;
- const { showOperateBtn } = this.props;
+ const { showOperateBtn, onTableOperate } = this.props;
const rowSelection = {
selectedRowKeys,
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
@@ -112,9 +112,9 @@ class DataTables extends Component {
this.handleOperate(e, record)}>
- 编辑
- 删除
+ content={} title="">
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less
index 467167f8..af9a1fa2 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/index.less
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less
@@ -22,6 +22,37 @@
}
}
+.addItemsWrapper {
+ .baseForm {
+ .wea-form-cell {
+ padding-right: 20% !important;
+ }
+ }
+
+ .wea-search-group {
+ .wea-form-cell-wrapper {
+ border: 1px solid #e5e5e5;
+
+ & > div:last-child {
+ border-bottom: none
+ }
+
+ .wea-form-cell {
+ padding: 4px 16px;
+ border-bottom: 1px solid #e5e5e5;
+
+ .wea-form-item-wrapper {
+ line-height: 30px;
+ }
+
+ .wea-form-item {
+ padding: 0;
+ }
+ }
+ }
+ }
+}
+
.layoutWrapper {
height: 100%;
display: flex;