数据采集页面重构
This commit is contained in:
parent
1674f9071f
commit
6cff75a9b5
|
|
@ -165,9 +165,10 @@ class AddItems extends Component {
|
|||
return (
|
||||
<div className="addItemsWrapper">
|
||||
<WeaSearchGroup
|
||||
className="baseForm"
|
||||
title="基础信息"
|
||||
items={!isCum ? items : baseInfo.personArea === "ORGANIZATION" ? [...cumSituationitems, ...insider] : baseInfo.personArea === "EXT_EMPLOYEE" ? [...cumSituationitems, ...noSysPerson] : cumSituationitems}
|
||||
needTigger showGroup/>
|
||||
needTigger showGroup col={1}/>
|
||||
{
|
||||
getSearchs(form, condition, 2)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: <AddItems
|
||||
ref={(dom) => 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 [
|
||||
<Button type="primary">导入</Button>,
|
||||
<Button type="ghost" onClick={this.handleAddData}>新建</Button>,
|
||||
<Button type="ghost" onClick={() => this.handleAddData()}>新建</Button>,
|
||||
<Button type="ghost" loading={addAllLoading} onClick={this.autoAddAll}>一键累计</Button>,
|
||||
<Dropdown
|
||||
overlay={
|
||||
|
|
@ -218,6 +237,7 @@ class Index extends Component {
|
|||
url="/api/bs/hrmsalary/addUpDeduction/list"
|
||||
payload={tablePayload}
|
||||
showOperateBtn={showOperateBtn}
|
||||
onTableOperate={this.handleTableOperate}
|
||||
/>
|
||||
</Layout>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => this.handleOperate(e, record)}>
|
||||
<Menu.Item key="edit">编辑</Menu.Item>
|
||||
<Menu.Item key="delete">删除</Menu.Item>
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="handleAddData">编辑</Menu.Item>
|
||||
<Menu.Item key="deleteSelectAddUpDeduction">删除</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue