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