数据采集页面重构
This commit is contained in:
parent
751659d569
commit
38f25e5a95
|
|
@ -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: <h1>3433333</h1>
|
||||
children: <h1>3433333</h1>
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -125,21 +180,19 @@ class Index extends Component {
|
|||
<Button type="ghost" loading={addAllLoading} onClick={this.autoAddAll}>一键累计</Button>,
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu className="dropdownMenuWrapper" onClick={this.handleMenuClick}>
|
||||
<Menu.Item key="handleBatchDelete">批量删除</Menu.Item>
|
||||
<Menu.Item key="handleEmpty">一键清空</Menu.Item>
|
||||
<Menu className="dropdownMenuWrapper" onClick={this.handleDataMenuClick}>
|
||||
<Menu.Item key="deleteSelectAddUpDeduction">批量删除</Menu.Item>
|
||||
<Menu.Item key="deleteAllAddUpDeduction">一键清空</Menu.Item>
|
||||
<Menu.Item key="handleExportSelect">导出选中</Menu.Item>
|
||||
<Menu.Item key="handleExportAll">导出全部</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
>
|
||||
<Button type="ghost"> 更多 </Button>
|
||||
<Button type="ghost">更多</Button>
|
||||
</Dropdown>
|
||||
];
|
||||
};
|
||||
handleMenuClick = ({ key }) => {
|
||||
console.log(key);
|
||||
};
|
||||
handleDataMenuClick = ({ key: keyFunc }) => this[keyFunc]();
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,13 @@ class DataTables extends Component {
|
|||
}
|
||||
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 清空所选
|
||||
* Params:
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
handleClearRows = () => this.setState({ selectedRowKeys: [] });
|
||||
|
||||
render() {
|
||||
const { columns, dataSource, loading, selectedRowKeys, pageInfo } = this.state;
|
||||
|
|
|
|||
Loading…
Reference in New Issue