diff --git a/pc4mobx/hrmSalary/pages/declareOnlineComparison/index.js b/pc4mobx/hrmSalary/pages/declareOnlineComparison/index.js
index c6394f04..5090667b 100644
--- a/pc4mobx/hrmSalary/pages/declareOnlineComparison/index.js
+++ b/pc4mobx/hrmSalary/pages/declareOnlineComparison/index.js
@@ -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
-
- {getLabel(543280, "系统值")}:
- {record[o].local}
-
-
- {getLabel(111, "线上值")}:
- {record[o].online}
-
- {
- !_.isNil(record[o].diff) &&
-
- {getLabel(543282, "差值")}:
- {record[o].diff}
-
- }
-
;
- }
- }))
- });
+ 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]" ? {text} :
+
+
+ {getLabel(543280, "系统值")}:
+ {record[o["dataIndex"]].local}
+
+
+ {getLabel(111, "线上值")}:
+ {record[o["dataIndex"]].online}
+
+ {
+ !_.isNil(record[o["dataIndex"]].diff) &&
+
+ {getLabel(543282, "差值")}:
+ {record[o["dataIndex"]].diff}
+
+ }
+
;
+ }
+ }));
+ };
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 {
>
);
diff --git a/pc4mobx/hrmSalary/stores/payrollFiles.js b/pc4mobx/hrmSalary/stores/payrollFiles.js
index c9095936..947549b2 100644
--- a/pc4mobx/hrmSalary/stores/payrollFiles.js
+++ b/pc4mobx/hrmSalary/stores/payrollFiles.js
@@ -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();
+ });
+ });
+ };
}