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

This commit is contained in:
黎永顺 2024-03-01 16:56:32 +08:00
parent b57a95979d
commit 88f03e0b0d
2 changed files with 57 additions and 37 deletions

View File

@ -5,18 +5,22 @@
* Date: 2024/1/22
*/
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 { exportContrast, getTaxdeclarationContrastList } from "../../apis/declare";
import { exportContrast } from "../../apis/declare";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("payrollFilesStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: [], columns: [],
dataSource: [], showColumns: [],
pageInfo: { current: 1, pageSize: 10, total: 0 },
queryParams: { onlyShowDiffEmp: true, onlyShowDiffItem: true }
};
@ -28,39 +32,15 @@ class Index extends Component {
getTaxdeclarationContrastList = () => {
const { pageInfo, queryParams } = this.state;
const { params: { taxDeclarationId } } = this.props;
const { params: { taxDeclarationId }, payrollFilesStore: { getTaxdeclarationContrastList } } = this.props;
WeaLoadingGlobal.start();
getTaxdeclarationContrastList({ taxDeclarationId, ...pageInfo, ...queryParams })
.then(({ status, data }) => {
WeaLoadingGlobal.destroy();
if (status) {
const { columns, pageInfo: result } = data;
const { pageInfo: result, columns: showColumns } = data;
const { list: dataSource, pageNum: current, pageSize, total } = result;
this.setState({
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
columns: _.map(columns, o => ({
dataIndex: o, title: o, width: 150,
render: (__, record) => {
return <div className="comparison-column-item-container">
<div className="comparison-single-row">
<span>{getLabel(543280, "系统值")}</span>
<span>{record[o].local}</span>
</div>
<div className="comparison-single-row">
<span>{getLabel(111, "线上值")}</span>
<span>{record[o].online}</span>
</div>
{
!_.isNil(record[o].diff) &&
<div className="comparison-single-row danger">
<span>{getLabel(543282, "差值")}</span>
<span>{record[o].diff}</span>
</div>
}
</div>;
}
}))
});
this.setState({ showColumns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } });
}
}).catch(() => WeaLoadingGlobal.destroy());
};
@ -84,9 +64,36 @@ class Index extends Component {
break;
}
};
getColumns = () => {
const { showColumns } = this.state;
const { payrollFilesStore: { declareTableStore } } = this.props;
return _.map(_.filter(toJS(declareTableStore.columns), (item) => (item.display === "true" && showColumns.includes(item["dataIndex"]))), o => ({
dataIndex: o.dataIndex, title: o.title, width: 150,
render: (text, record) => {
return Object.prototype.toString.call(record[o["dataIndex"]]) === "[object String]" ? <span>{text}</span> :
<div className="comparison-column-item-container">
<div className="comparison-single-row">
<span>{getLabel(543280, "系统值")}</span>
<span>{record[o["dataIndex"]].local}</span>
</div>
<div className="comparison-single-row">
<span>{getLabel(111, "线上值")}</span>
<span>{record[o["dataIndex"]].online}</span>
</div>
{
!_.isNil(record[o["dataIndex"]].diff) &&
<div className="comparison-single-row danger">
<span>{getLabel(543282, "差值")}</span>
<span>{record[o["dataIndex"]].diff}</span>
</div>
}
</div>;
}
}));
};
render() {
const { columns, dataSource, pageInfo, queryParams } = this.state;
const { dataSource, pageInfo, queryParams } = this.state;
const { onlyShowDiffEmp, onlyShowDiffItem } = queryParams;
const pagination = {
...pageInfo,
@ -125,13 +132,7 @@ class Index extends Component {
>
<WeaTable rowKey="id" dataSource={dataSource} pagination={pagination} bordered
scroll={{ x: 1200, y: `calc(100vh - 170px)` }} className="online-comparison-table"
columns={[
{ dataIndex: getLabel(1933, "工号"), title: getLabel(1933, "工号"), width: 100 },
{ dataIndex: getLabel(25034, "姓名"), title: getLabel(25034, "姓名"), width: 150 },
{ dataIndex: getLabel(23787, "证件类型"), title: getLabel(23787, "证件类型"), width: 150 },
{ dataIndex: getLabel(1839, "证件号码"), title: getLabel(1839, "证件号码"), width: 180 },
...columns
]}
columns={this.getColumns()}
/>
</WeaTop>
);

View File

@ -2,6 +2,7 @@ import { action, observable } from "mobx";
import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from "../apis/payrollFiles";
import { getDataPerspective, statisticsEmployeeDetailList } from "../apis/statistics";
import { getTaxdeclarationContrastList } from "../apis/declare";
const { TableStore } = WeaTableNew;
@ -10,6 +11,7 @@ export class PayrollFilesStore {
@observable tableStore = new TableStore();
@observable employeeTableStore = new TableStore();
@observable pivotTableStore = new TableStore();
@observable declareTableStore = new TableStore();//个税申请线下对比
@observable adjustForm = new WeaForm(); //调薪记录-核算form
@action initAdjustForm = () => this.adjustForm = new WeaForm();//调薪记录-初始化核算form
/*薪资档案页面重构*/
@ -78,4 +80,21 @@ export class PayrollFilesStore {
});
});
};
@action("个税申请线下对比-列表查询")
getTaxdeclarationContrastList = (payload) => {
return new Promise((resolve, reject) => {
getTaxdeclarationContrastList(payload).then(res => {
const { data, status } = res;
if (status) {
const { dataKey } = data;
const { datas } = dataKey;
this.declareTableStore.getDatas(datas); // table 请求数据
}
resolve(res);
}).catch(() => {
reject();
});
});
};
}