feature/2.10.1.2402.01-个税-个税申报线下对比添加导出功能以及缓存对比项目的功能开发

This commit is contained in:
黎永顺 2024-03-01 17:36:37 +08:00
parent 88f03e0b0d
commit 2a7db5f6d3
1 changed files with 33 additions and 20 deletions

View File

@ -8,10 +8,12 @@ import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { WeaCheckbox, WeaLoadingGlobal, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
import { Dropdown, Menu } from "antd";
import { Button } from "antd";
import { WeaTableNew } from "comsMobx";
import { exportContrast } from "../../apis/declare";
import "./index.less";
const WeaTableComx = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel;
@inject("payrollFilesStore")
@ -50,19 +52,13 @@ class Index extends Component {
queryParams: { ...queryParams, [key]: value === "1" }
}, () => this.getTaxdeclarationContrastList());
};
handleCompareOpts = async ({ key }) => {
handleExport = async () => {
const { params: { taxDeclarationId } } = this.props;
const { queryParams } = this.state;
switch (key) {
case "exportContrast":
WeaLoadingGlobal.start();
const payload = { taxDeclarationId, ...queryParams };
const promise = await exportContrast(payload);
WeaLoadingGlobal.destroy();
break;
default:
break;
}
};
getColumns = () => {
const { showColumns } = this.state;
@ -91,8 +87,20 @@ class Index extends Component {
}
}));
};
onDropMenuClick = (key) => {
switch (key) {
case "custom_cols":
const { payrollFilesStore: { declareTableStore } } = this.props;
declareTableStore.setColSetVisible(true);
declareTableStore.tableColSet(true);
break;
default:
break;
}
};
render() {
const { payrollFilesStore: { declareTableStore } } = this.props;
const { dataSource, pageInfo, queryParams } = this.state;
const { onlyShowDiffEmp, onlyShowDiffItem } = queryParams;
const pagination = {
@ -114,26 +122,31 @@ class Index extends Component {
};
return (
<WeaTop title={getLabel(111, "在线对比")} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" buttonSpace={10} showDropIcon={false}
iconBgcolor="#F14A2D" buttonSpace={10} showDropIcon onDropMenuClick={this.onDropMenuClick}
buttons={[
<Dropdown.Button type="primary"
overlay={<Menu onClick={this.handleCompareOpts}>
<Menu.Item key="exportContrast">{getLabel(81272, "导出全部")}</Menu.Item>
</Menu>}>
{getLabel(111, "项目筛选")}
</Dropdown.Button>,
<Button type="primary" onClick={this.handleExport}>{getLabel(81272, "导出全部")}</Button>,
<WeaCheckbox content={getLabel(543283, "只显示有差异的人员")} value={onlyShowDiffEmp ? 1 : 0}
onChange={v => this.handleDiffChange("onlyShowDiffEmp", v)}
/>,
<WeaCheckbox content={getLabel(543284, "只显示有差异的薪资项目")} value={onlyShowDiffItem ? 1 : 0}
onChange={v => this.handleDiffChange("onlyShowDiffItem", v)}
/>
]}
]} dropMenuDatas={[{
key: "custom_cols",
icon: <i className="icon-coms-Custom"/>,
content: getLabel(32535, "显示列定制")
}]}
>
<WeaTable rowKey="id" dataSource={dataSource} pagination={pagination} bordered
scroll={{ x: 1200, y: `calc(100vh - 170px)` }} className="online-comparison-table"
columns={this.getColumns()}
/>
<WeaTableComx
style={{ display: "none" }}
comsWeaTableStore={declareTableStore}
needScroll={true}
columns={this.getColumns()}
/>
</WeaTop>
);
}