diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 0dd811a2..8cf772a5 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -191,3 +191,9 @@ export const exportSiaccountWelfaresupplyimporttemplatetemplate = params => { export const exportSiaccountWelfarebalanceimporttemplatetetemplate = params => { return postExportFetch("/api/bs/hrmsalary/siaccount/welfare/balanceimporttemplate/export", params); }; +export const getBalancePaymentGroup = params => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/getBalancePaymentGroup", params); +}; +export const addNewBalance = params => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/addNewBalance", params); +}; diff --git a/pc4mobx/hrmSalary/components/mobileTemplate/index.js b/pc4mobx/hrmSalary/components/mobileTemplate/index.js index 46cae517..063b8b8d 100644 --- a/pc4mobx/hrmSalary/components/mobileTemplate/index.js +++ b/pc4mobx/hrmSalary/components/mobileTemplate/index.js @@ -53,9 +53,10 @@ class Index extends Component { } { items.map((templatItem, index) => { - const { salaryItemValue, name } = templatItem || {}; + const { salaryItemValue, name, salaryItemShowName } = templatItem || {}; return
-
{name || ""}
+
{salaryItemShowName || name || ""}
{salaryItemValue || "100"}
; }) diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.js b/pc4mobx/hrmSalary/components/pcTemplate/index.js index 8c9040c5..511a42bc 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.js +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.js @@ -47,11 +47,11 @@ class Index extends Component { } { items.map((templatItem, index) => { - const { salaryItemValue, name } = templatItem || {}; + const { salaryItemValue, name, salaryItemShowName } = templatItem || {}; return
-
- {name || ""} +
+ {salaryItemShowName || name || ""}
{salaryItemValue || ""}
; diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index ae7aea5a..c9c0e3cf 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -1,7 +1,7 @@ import React from "react"; import Route from "react-router/lib/Route"; import { WeaLocaleProvider } from "ecCom"; -// import MySalary from "./pages/mySalary"; +import MySalaryMobile from "./pages/mySalaryMobile"; import MySalary from "./pages/mySalaryBenefits"; import Programme from "./pages/socialSecurityBenefits/programme"; import Archives from "./pages/socialSecurityBenefits/archives"; @@ -62,6 +62,7 @@ const Home = (props) => props.children; const SocialSecurityBenefits = (props) => props.children; const DataAcquisition = (props) => props.children; +// mySalaryMobile 我的薪资福利-移动端 // mySalary 我的薪资福利 // mySalaryView 我的薪资福利-查看工资单 // socialSecurityBenefits 社保福利 @@ -105,6 +106,7 @@ const Routes = ( path="hrmSalary" onEnter={getLocaleLabel} component={Home}> + - + diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js index 817a7b6d..fb0f3166 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js @@ -5,8 +5,8 @@ * Date: 2023/9/26 */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaTable } from "ecCom"; -import { Alert } from "antd"; +import { WeaLocaleProvider } from "ecCom"; +import { Alert, Spin } from "antd"; import { comparisonResultList } from "../../../../apis/calculate"; const getLabel = WeaLocaleProvider.getLabel; @@ -21,9 +21,35 @@ class SalaryCalcOcList extends Component { } componentDidMount() { - this.comparisonResultList(this.props); + window.addEventListener("message", this.handleReceive, false); } + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + handleReceive = async ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.comparisonResultList(this.props); + } else if (type === "turn") { + switch (id) { + case "PAGEINFO": + const { size: pageSize, pageNum: current } = params; + this.setState({ + pageInfo: { ...this.state.pageInfo, current, pageSize } + }, () => this.comparisonResultList(this.props)); + break; + case "FORMULA": + const { formulaDesc } = params; + this.setState({ formulaDesc }); + break; + default: + break; + } + } + }; + componentWillReceiveProps(nextProps, nextContext) { if ( (nextProps.form.onlyDiffEmployee !== this.props.form.onlyDiffEmployee) || @@ -34,6 +60,15 @@ class SalaryCalcOcList extends Component { } } + postMessageToChild = (payload = {}) => { + const i18n = { + "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), + "总计": getLabel(523, "总计"), "系统值": getLabel(543280, "系统值"), + "线下值": getLabel(543281, "线下值"), "差值": getLabel(543282, "差值") + }; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; comparisonResultList = (props) => { const { form, routeParams: { salaryAcctRecordId } } = props; const { pageInfo } = this.state; @@ -42,85 +77,54 @@ class SalaryCalcOcList extends Component { comparisonResultList(payload).then(({ status, data }) => { this.setState({ loading: false }); if (status) { - const { list: dataSource, columns, pageNum: current, pageSize, total } = data; + const { columns, pageInfo: { pageNum: current, pageSize, total, list: dataSource } } = data; this.setState({ - dataSource, columns, + dataSource, columns: this.convertColumns(this.removeItem(columns)), pageInfo: { ...pageInfo, current, pageSize, total } + }, () => { + const { pageInfo, dataSource, columns } = this.state; + this.postMessageToChild({ dataSource, pageInfo, columns }); }); } }).catch(() => this.setState({ loading: false })); }; + removeItem = (cols) => { + return _.filter(cols, o => { + if (JSON.stringify(o.children) === "[]") { + return false; + } else { + this.removeItem(o.children); + return true; + } + }); + }; + convertColumns = (cols) => { + return _.map(cols, (item, index) => { + const col = { title: item.text, dataIndex: item.column }; + if (_.isNaN(parseInt(item.column))) { + return { ...col, width: 150, fixed: item.fixed || false }; + } else { + return { ...col, width: 180, children: this.convertColumns(item.children) }; + } + }); + }; render() { - const { dataSource, loading, columns, pageInfo, formulaDesc } = this.state; - const pagination = { - ...pageInfo, - showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, - showQuickJumper: true, - showSizeChanger: true, - pageSizeOptions: ["10", "20", "50", "100"], - onShowSizeChange: (current, pageSize) => { - this.setState({ - pageInfo: { ...pageInfo, current, pageSize } - }, () => this.comparisonResultList(this.props)); - }, - onChange: current => { - this.setState({ - pageInfo: { ...pageInfo, current } - }, () => this.comparisonResultList(this.props)); - } - }; + const { loading, formulaDesc } = this.state; return ( - +
- { - if (i > 1) { - if (i > 2) { - return { - ...o, width: 180, - render: (__, record) => { - const formulaDesc = record["customParameters"][`${o["dataIndex"]}`]; - const showDifference = record[`${o["dataIndex"]}_type`] === "number"; - const { acctResultValue, excelResultValue } = record[o["dataIndex"]] || {}; - return
this.setState({ formulaDesc })}> -
- {getLabel(543280, "系统值")}: - {acctResultValue} -
-
- {getLabel(543281, "线下值")}: - {excelResultValue} -
- { - showDifference && -
- {getLabel(543282, "差值")}: - {calculateDifference(acctResultValue, excelResultValue)} -
- } -
; - } - }; - } - return { ...o, width: 180 }; - } - return { ...o, width: 150, fixed: "left" }; - })} - /> - + +