From 88f03e0b0da8c3b6aabc1f01aef8996c1cbdd16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 1 Mar 2024 16:56:32 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.10.1.2402.01-=E4=B8=AA=E7=A8=8E-?= =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5=E7=BA=BF=E4=B8=8B=E5=AF=B9?= =?UTF-8?q?=E6=AF=94=E6=B7=BB=E5=8A=A0=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E7=BC=93=E5=AD=98=E5=AF=B9=E6=AF=94=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=9A=84=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/declareOnlineComparison/index.js | 75 ++++++++++--------- pc4mobx/hrmSalary/stores/payrollFiles.js | 19 +++++ 2 files changed, 57 insertions(+), 37 deletions(-) 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(); + }); + }); + }; }