diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index e115f84d..6f7f1ad1 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -108,14 +108,14 @@ export const deleteSalaryacct = (params) => { // 薪资记录--归档薪资核算记录 export const fileSalaryAcct = (params) => { - return WeaTools.callApi(`/api/bs/hrmsalary/salaryacct/file`, "GET", params); - // return fetch(`/api/bs/hrmsalary/salaryacct/file?id=${params.id}`, { - // method: "GET", - // mode: "cors", - // headers: { - // "Content-Type": "application/json" - // } - // }).then(res => res.json()); + // return WeaTools.callApi(`/api/bs/hrmsalary/salaryacct/file`, "GET", params); + return fetch(`/api/bs/hrmsalary/salaryacct/file?id=${params.id}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + } + }).then(res => res.json()); }; // 薪资记录-回算 export const backCalculate = (params) => { diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index 2cd64d80..0cb56cfe 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -6,6 +6,14 @@ import { convertToUrlString } from "../util/url"; export const mySalaryBillList = params => { return postFetch("/api/bs/hrmsalary/salaryBill/mySalaryBillList", params); }; +// 人事卡片-工资单列表 +export const mySalaryBillList4Card = params => { + return postFetch("/api/bs/hrmsalary/salaryBill/mySalaryBillList4Card", params); +}; +// 人事卡片-调薪记录列表 +export const mySalaryRecordList4Card = params => { + return WeaTools.callApi("/api/bs/hrmsalary/report/record/list4Card", "GET", params); +}; // 调薪记录列表 export const recordList = params => { diff --git a/pc4mobx/hrmSalary/apis/welfareRecord.js b/pc4mobx/hrmSalary/apis/welfareRecord.js deleted file mode 100644 index 48f5d330..00000000 --- a/pc4mobx/hrmSalary/apis/welfareRecord.js +++ /dev/null @@ -1,56 +0,0 @@ -import { WeaTools } from 'ecCom'; - -//台账 -export const getRecordList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/batch/list', 'get', params); -}; -export const getCalcForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/accountForm', 'get', params); -}; -export const save = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/save', 'post', params); -}; -export const doArchive = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/file', 'post', params); -}; -export const deleteRecord = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/delete', 'post', params); -}; - -//核算 -export const getCalcTabs = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/tabList', 'get', params); -}; -export const getNormalForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/commonForm', 'get', params); -}; -export const saveNormalForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/common/save', 'post', params); -}; -export const deleteNormal = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/common/delete', 'post', params); -}; -export const getSupplementaryForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/querySupplementaryForm', 'get', params); -}; -export const saveSupplementaryForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/supplementary/save', 'post', params); -}; -export const deleteSupplementary = params => { - return WeaTools.callApi('/api/bs/hrmsalary/siaccount/supplementary/delete', 'post', params); -}; - -// 导出正常缴纳核算 -export const exportNormalPaymentAccount = params => { - return WeaTools.callApi('/api/bs/hrmsalary/common/export', 'post', params); -}; - -// 导出总览 -export const exportOverView = params => { - return WeaTools.callApi('/api/bs/hrmsalary/overview/export', 'post', params); -}; - -// 导出补缴核算 -export const exportSupplementaryAccount = params => { - return WeaTools.callApi('/api/bs/hrmsalary/supplementary/export', 'post', params); -}; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/common/titleLogo.png b/pc4mobx/hrmSalary/common/titleLogo.png new file mode 100644 index 00000000..d02c2227 Binary files /dev/null and b/pc4mobx/hrmSalary/common/titleLogo.png differ diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js index 71c6e099..91f3e690 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js @@ -40,8 +40,11 @@ class ImpStep2 extends Component { render() { const { dataSource, columns, loading } = this.state; + const { scrollHeight } = this.props; return ( - + ); } } diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js index 481813b4..df9575ef 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js @@ -31,7 +31,7 @@ class ImpStep3 extends Component { } { - !_.isEmpty(importResult.errorData) && + (!_.isEmpty(importResult.errorNotice) || !_.isEmpty(importResult.errorData)) && } diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js index f174e93d..739fbf84 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.js +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -36,8 +36,8 @@ class Index extends Component { } renderChildren = () => { - const { current } = this.state; - const { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props; + const { current } = this.state, { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props; + const scrollHeight = this.importRef ? this.importRef.state.height - 232 : 606.6; let CurrentDom = null; switch (current) { case 0: @@ -45,7 +45,7 @@ class Index extends Component { ref={dom => this.step1Ref = dom}/>; break; case 1: - CurrentDom = ; + CurrentDom = ; if (excludeKey) { CurrentDom = ; } @@ -127,9 +127,10 @@ class Index extends Component { loading={this.props.nextloading}>{getLabel(1402, "下一步")}, ]; + return ( this.importRef = dom} scalable hasScroll className="importBox" initLoadCss buttons={current === 0 ? _.nth(btns, 1) : (!this.props.excludeKey && current === 1) ? _.take(btns, 2) : _.takeRight(btns)} style={{ diff --git a/pc4mobx/hrmSalary/components/mobileTemplate/index.js b/pc4mobx/hrmSalary/components/mobileTemplate/index.js index 7d2106ce..18de0574 100644 --- a/pc4mobx/hrmSalary/components/mobileTemplate/index.js +++ b/pc4mobx/hrmSalary/components/mobileTemplate/index.js @@ -7,7 +7,6 @@ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; import { dealTemplate } from "../pcTemplate"; -import moment from "moment"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -18,21 +17,21 @@ class Index extends Component { const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "mobile"); return ( -
{title || getLabel(111, "薪酬预览")}
+ {/*
{title || getLabel(111, "薪酬预览")}
*/}
{theme || ""}
-
{moment().format("YYYY-MM-DD HH:mm:ss")}
+ {/*
{moment().format("YYYY-MM-DD HH:mm:ss")}
*/} {/*{*/} {/* background &&*/} {/*
logo
*/} {/*}*/}
{ - !onlyOneGrup && tipPosi === "1" && tip && -
{tip}
+ !onlyOneGrup && tipPosi.toString() === "1" && tip && +
}
{ @@ -46,10 +45,11 @@ class Index extends Component { }
{ - (onlyOneGrup && tipPosi === "1" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) + (onlyOneGrup && tipPosi.toString() === "1" && tip) && ( +
+
{getLabel(111, "发放说明")}
+
{tip}
+
) } { items.map((templatItem, index) => { @@ -62,10 +62,11 @@ class Index extends Component { }) } { - (onlyOneGrup && tipPosi === "2" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) + (onlyOneGrup && tipPosi.toString() === "2" && tip) && ( +
+
{getLabel(111, "发放说明")}
+
{tip}
+
) }
); @@ -73,8 +74,8 @@ class Index extends Component { }
{ - !onlyOneGrup && tipPosi === "2" && tip && -
{tip}
+ !onlyOneGrup && tipPosi.toString() === "2" && tip && +
} {this.props.children}
diff --git a/pc4mobx/hrmSalary/components/mobileTemplate/index.less b/pc4mobx/hrmSalary/components/mobileTemplate/index.less index 5338957f..566ad60b 100644 --- a/pc4mobx/hrmSalary/components/mobileTemplate/index.less +++ b/pc4mobx/hrmSalary/components/mobileTemplate/index.less @@ -8,7 +8,7 @@ } .pbmc-body { - height: calc(100% - 150px); + height: calc(100% - 50px); background: #f6f6f6; overflow: auto; @@ -40,6 +40,7 @@ font-size: 19px; font-weight: 700; margin-bottom: 12px; + text-align: center; } .time { @@ -67,7 +68,6 @@ } .corporate-culture-text { - font-size: 14px; text-align: left; color: #111; padding: 8px 16px; @@ -84,15 +84,13 @@ .group-title { background: #fff; - background: var(--base-white); display: flex; - color: #2780c4; align-items: center; min-height: 45px; padding: 0 16px; border-bottom: 1px solid #f2f2f2; font-weight: bolder; - font-size: 16px; + font-size: 14px; } .group-list { @@ -104,16 +102,13 @@ background: #fff; .item-name { - font-size: 16px; padding: 8px 16px; - width: 40%; + width: 50%; display: flex; align-items: center; background: #fbfbfb; border-right: 1px solid #f2f2f2; flex-shrink: 0; - color: #2780c4; - font-weight: bolder; } .item-count { diff --git a/pc4mobx/hrmSalary/components/pcTemplate/content.js b/pc4mobx/hrmSalary/components/pcTemplate/content.js index b4b63874..310999d6 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/content.js +++ b/pc4mobx/hrmSalary/components/pcTemplate/content.js @@ -1,6 +1,5 @@ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; -import moment from "moment"; import { dealTemplate } from "./index"; const getLabel = WeaLocaleProvider.getLabel; @@ -11,69 +10,74 @@ class Content extends Component { const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "pc"); return (
-
-
-
{theme || ""}
-
{moment(sendTime).format("YYYY-MM-DD HH:mm:ss")}
-
-
- {/*{*/} - {/* background &&*/} - {/*
logo
*/} - {/*}*/} - { - !onlyOneGrup && tipPosi.toString() === "1" && tip && -
{tip}
- } -
- { - showData.map((groupItem, index) => { - // 如果当前组下没有条目 当前组直接不展示。 - if (!groupItem) return null; - const { groupId, groupName, items = [] } = groupItem; - return ( -
- { - groupName ?
{groupName}
: null - } -
- { - (onlyOneGrup && tipPosi.toString() === "1" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) - } - { - items.map((templatItem, index) => { - const { salaryItemValue, name, salaryItemShowName } = templatItem || {}; - return
-
- {salaryItemShowName || name || ""} -
-
{salaryItemValue || ""}
-
; - - }) - } - { - (onlyOneGrup && tipPosi.toString() === "2" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) - } -
-
); - }) - } +
+
+
+
{theme || ""}
+ {/*
{moment(sendTime).format("YYYY-MM-DD HH:mm:ss")}
*/} +
+
+ {/*{*/} + {/* background &&*/} + {/*
logo
*/} + {/*}*/} + { + !onlyOneGrup && tipPosi.toString() === "1" && tip && +
+ } +
+ { + showData.map((groupItem, index) => { + // 如果当前组下没有条目 当前组直接不展示。 + if (!groupItem) return null; + const { groupId, groupName, items = [] } = groupItem; + return ( +
+ { + groupName ?
+ + {groupName} +
: null + } +
+ { + (onlyOneGrup && tipPosi.toString() === "1" && tip) && (
+
{getLabel(111, "发放说明")}
+
{tip}
+
) + } + { + items.map((templatItem, index) => { + const { salaryItemValue, name, salaryItemShowName, id } = templatItem || {}; + return
+
+ {salaryItemShowName || name || ""} +
+
{salaryItemValue || ""}
+
; + + }) + } + { + (onlyOneGrup && tipPosi.toString() === "2" && tip) && (
+
{getLabel(111, "发放说明")}
+
{tip}
+
) + } +
+
); + }) + } +
+ { + !onlyOneGrup && tipPosi.toString() === "2" && tip && +
+ } + {this.props.children}
- { - !onlyOneGrup && tipPosi.toString() === "2" && tip && -
{tip}
- }
- {this.props.children}
); } diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.js b/pc4mobx/hrmSalary/components/pcTemplate/index.js index 824722e6..ba6cd4a0 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.js +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.js @@ -28,11 +28,11 @@ export const dealTemplate = (itemTypeList, type) => { }); if (items.length % 2 && type === "pc") items.push({}); // 未分类不展示标题 - if (!groupId.includes("222222222222222222")) { + // if (!groupId.includes("222222222222222222")) { showData.push({ groupId, groupName, items }); - } else { - showData.push({ items }); - } + // } else { + // showData.push({ items }); + // } } }); if (cloneItemTypeList.length === 1) { diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.less b/pc4mobx/hrmSalary/components/pcTemplate/index.less index 404b8a20..e57fe5e5 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.less +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.less @@ -4,7 +4,7 @@ overflow-y: auto; .weapp-salary-sp { - background: #f6f6f6; + background: #F3F9FF; } .weapp-salary-payroll-pc-preview { @@ -37,11 +37,12 @@ .header-title { height: 22px; - font-size: 17px; + font-size: 25px; color: #111; line-height: 22px; font-weight: 400; text-align: center; + font-weight: bolder; } .header-salary-date-time { @@ -57,7 +58,8 @@ .body { width: 100%; - margin-top: 32px; + background: #FFF; + //margin-top: 32px; .comp-img { text-align: center; @@ -68,30 +70,43 @@ } .corporate-culture-text { - width: 100%; - margin-top: 16px; - text-align: center; - min-height: 12px; - font-size: 12px; + text-align: left; color: #111; + margin: 16px 30px 20px 30px; white-space: pre-wrap; word-break: break-all; + padding: 10px 14px; + background: #FAFAFA; + border: 1px solid rgba(238, 238, 238, 1); + border-radius: 4px; } .data-detail { - margin-top: 16px; - .salary-group { - margin-bottom: 16px; + background: #FFF; .group-title { font-size: 14px; + padding: 16px 0 0 30px; + font-weight: bolder; + color: #333333; + + img { + width: 16px; + height: 20px; + } + + span { + vertical-align: middle; + margin-left: 10px; + } } .group-list { margin-top: 16px; display: flex; flex-wrap: wrap; + padding: 0 30px; .even { border-left: 1px solid #e5e5e5; @@ -111,17 +126,18 @@ border-right: 1px solid #e5e5e5; .item-name { - flex-basis: 170px; + //flex-basis: 170px; + //width: 170px; + flex: 1; box-sizing: border-box; - width: 170px; padding: 0 16px; height: 100%; background: #fbfbfb; border-right: 1px solid #e5e5e5; font-size: 12px; - color: #666; + color: #5F5F5F; display: flex; - justify-content: center; + justify-content: flex-start; align-items: center; flex-shrink: 0; @@ -135,13 +151,14 @@ } .item-count { - flex-basis: 328px; + //flex-basis: 328px; + flex: 1; padding-left: 16px; height: 100%; line-height: 40px; background: #fff; font-size: 12px; - color: #111; + color: #5F5F5F; word-break: break-all; } } @@ -150,4 +167,12 @@ } } } + + .space { + margin: 20px 0 40px 0 !important; + + button:last-child { + margin-right: 30px; + } + } } diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index d246f2ed..8935c086 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -1,16 +1,18 @@ import React from "react"; import Route from "react-router/lib/Route"; import { WeaLocaleProvider } from "ecCom"; +import HistoricalPayroll from "./pages/historicalPayroll"; +import SalaryAdjustmentRecords from "./pages/salaryAdjustmentRecords"; import MySalaryMobile from "./pages/mySalaryMobile"; import MySalary from "./pages/mySalaryBenefits"; -import Programme from "./pages/socialSecurityBenefits/programme"; -import Archivess from "./pages/socialSecurityBenefits/archives"; +import Programme from "./pages/socialSecurityBenefits/welfarePlan"; +// import Archivess from "./pages/socialSecurityBenefits/archives"; import Archives from "./pages/socialSecurityBenefits/welfareArchive"; //社保福利档案重构页面 -import StandingBook from "./pages/socialSecurityBenefits/standingBook"; +import StandingBook from "./pages/socialSecurityBenefits/standingBook/standingBook"; //社保福利台账重构页面 import StandingBookDetail from "./pages/socialSecurityBenefits/standingBookDetail"; import StandingBookOfflineComparison from "./pages/socialSecurityBenefits/standingBookOfflineComparison"; import SalaryItem from "./pages/salaryItem"; -import PayrollFiles from "./pages/payrollFiles"; +import SalaryFiles from "./pages/payrollFiles/salaryFiles"; import CumDeduct from "./pages/dataAcquisition/cumDeduct"; import OtherDeduct from "./pages/dataAcquisition/otherDeduct"; import CumSituation from "./pages/dataAcquisition/cumSituation"; @@ -66,6 +68,10 @@ const Home = (props) => props.children; const SocialSecurityBenefits = (props) => props.children; const DataAcquisition = (props) => props.children; +// historicalPayroll 历史工资单查看 +// salaryAdjustmentRecords 调薪记录查看 + +// mySalaryMobile 我的薪资福利-移动端 // mySalaryMobile 我的薪资福利-移动端 // mySalary 我的薪资福利 // mySalaryView 我的薪资福利-查看工资单 @@ -111,6 +117,8 @@ const Routes = ( path="hrmSalary" onEnter={getLocaleLabel} component={Home}> + + @@ -120,7 +128,6 @@ const Routes = ( component={SocialSecurityBenefits}> - - + {getLabel(543618, "生成申报表")} ]} diff --git a/pc4mobx/hrmSalary/pages/declare/declare.js b/pc4mobx/hrmSalary/pages/declare/declare.js index 0fa5dc90..f524c784 100644 --- a/pc4mobx/hrmSalary/pages/declare/declare.js +++ b/pc4mobx/hrmSalary/pages/declare/declare.js @@ -25,8 +25,8 @@ class Calculate extends Component { queryParams: { taxAgentName: "", dateRange: [ - moment(new Date()).startOf("year").format("YYYY-MM"), - moment(new Date()).startOf("month").format("YYYY-MM") + moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"), + moment(new Date()).endOf("year").format("YYYY-MM") ] }, isRefresh: false, declareDaialog: { visible: false, title: "" } diff --git a/pc4mobx/hrmSalary/pages/historicalPayroll/index.js b/pc4mobx/hrmSalary/pages/historicalPayroll/index.js new file mode 100644 index 00000000..342a69a2 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/historicalPayroll/index.js @@ -0,0 +1,43 @@ +/* + * Author: 黎永顺 + * name:历史工资单 + * Description: + * Date: 2024/1/25 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import { MonthRangePicker } from "../reportView/components/statisticalMicroSettingsSlide"; +import Payroll from "../mySalaryBenefits/components/payrollTable"; +import moment from "moment"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + dateRange: [ + moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), + moment(new Date()).endOf("year").format("YYYY-MM") + ] + }; + } + + render() { + const { dateRange } = this.state; + const employeeId = WeaTools.getUrlParams().hrmResourceID; + return ( +
+
+ {getLabel(542604, "薪资所属月")} + this.setState({ dateRange: v })}/> +
+ +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/historicalPayroll/index.less b/pc4mobx/hrmSalary/pages/historicalPayroll/index.less new file mode 100644 index 00000000..459ccbaf --- /dev/null +++ b/pc4mobx/hrmSalary/pages/historicalPayroll/index.less @@ -0,0 +1,23 @@ +.history-payroll-box { + width: 100%; + height: 100%; + background: #f6f6f6; + padding: 16px; + + .topQuery { + width: 100%; + background: #fff; + padding: 16px; + margin-bottom: 16px; + display: flex; + align-items: center; + + .title { + margin-right: 10px; + } + } + + .wea-new-table { + background: #fff; + } +} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js index 63421981..814663cb 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js @@ -255,8 +255,9 @@ class LedgerSalaryItemTable extends Component { render: (text, record) => { const { salarySobId, salaryItemId } = record; return {text}; + // href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}`} + // target="_blank" + href="javascript:void(0);">{text}; } }, { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 6ae229c8..d53d8fc7 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -159,9 +159,9 @@ export default class MobilePayroll extends React.Component { if (status) { const { mySalaryBillData } = this.state; const { salaryTemplate } = mySalaryBillData; - const { feedbackUrl } = salaryTemplate; + const { feedbackUrl, mobileFeedbackUrl } = salaryTemplate; this.getMySalaryBill(getQueryString("id")); - window.location.href = `${window.ecologyContentPath || ""}${feedbackUrl}`; + window.location.href = `${window.ecologyContentPath || ""}${getQueryString("type") === "phone" ? mobileFeedbackUrl : feedbackUrl}`; // window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); } else { message.error(errorMsg); @@ -201,7 +201,7 @@ export default class MobilePayroll extends React.Component {
; const { salaryTemplate, salaryGroups, employeeInformation, - sendTime, confirmStatus + sendTime, confirmStatus, showAck, showFeedback } = toJS(this.props.mySalaryStore.mySalaryBill); const salaryProps = { theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime, @@ -215,13 +215,11 @@ export default class MobilePayroll extends React.Component { - { - (_.isNil(confirmStatus) || confirmStatus === "0") && - - } + : @@ -229,13 +227,11 @@ export default class MobilePayroll extends React.Component { store={this.props.mySalaryStore}>
- { - (_.isNil(confirmStatus) || confirmStatus === "0") && - - } +
diff --git a/pc4mobx/hrmSalary/pages/mySalary/index.less b/pc4mobx/hrmSalary/pages/mySalary/index.less index 84745bee..0451e3c2 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/index.less +++ b/pc4mobx/hrmSalary/pages/mySalary/index.less @@ -27,12 +27,22 @@ overflow-y: auto; background: #f6f6f6; + .salary-preview-container { + max-width: 1000px; + margin: 0 auto; + border: 1px solid rgba(229,229,229,1); + padding-top: 32px; + background: #F3F9FF; + border-radius: 4px; + } + .space { width: 100%; max-width: 1000px; display: flex; align-items: center; justify-content: flex-end; + margin-bottom: 16px; .ant-btn { margin-right: 16px; diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js index 0ddd835d..5fa76f93 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js +++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js @@ -96,13 +96,11 @@ class MySalaryView extends Component { store={this.props.mySalaryStore}>
- { - (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0") && - - } +
@@ -120,7 +118,13 @@ export default MySalaryView; export const ConfirmBtns = (props) => { return
- - + { + props.showAck === "1" && + + } + { + props.showFeedback === "1" && + + }
; }; diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/SalaryAdjustmentRecords/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/SalaryAdjustmentRecords/index.js index ed75ad76..d13cd2fe 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/SalaryAdjustmentRecords/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/SalaryAdjustmentRecords/index.js @@ -8,9 +8,12 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTable } from "ecCom"; import Authority from "../../../mySalary/authority"; -import { recordList } from "../../../../apis/mySalaryBenefits"; +import { mySalaryRecordList4Card, recordList } from "../../../../apis/mySalaryBenefits"; const getLabel = WeaLocaleProvider.getLabel; +const API = { + recordList, mySalaryRecordList4Card +}; @inject("mySalaryStore") @observer @@ -24,14 +27,18 @@ class Index extends Component { } componentDidMount() { - const { mySalaryStore: { initRecordData } } = this.props; - initRecordData(this.getRecordList); + const { mySalaryStore: { initRecordData, getRecordData }, type } = this.props; + !type ? initRecordData(this.getRecordList) : getRecordData({ + status: "1", token: "", + callback: () => this.getRecordList() + }); } getRecordList = () => { const { pageInfo } = this.state; + const { employeeId, type = "recordList" } = this.props; this.setState({ loading: true }); - recordList({ ...pageInfo }).then(({ status, data }) => { + API[type]({ ...pageInfo, employeeId }).then(({ status, data }) => { this.setState({ loading: false }); if (status) { const { columns, list: dataSource, pageNum: current, pageSize, total } = data; diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js index 33cb6873..4c882560 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js @@ -6,17 +6,20 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTable } from "ecCom"; -import { mySalaryBillList } from "../../../../apis/mySalaryBenefits"; +import { mySalaryBillList, mySalaryBillList4Card } from "../../../../apis/mySalaryBenefits"; import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; +const API = { + mySalaryBillList, mySalaryBillList4Card +}; class Index extends Component { constructor(props) { super(props); this.state = { - juniorMapList: [], dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, - loading: false, employeeId: "" + dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false }; } @@ -30,9 +33,9 @@ class Index extends Component { getMySalaryBillList = (props) => { this.setState({ loading: true }); - const { pageInfo, employeeId } = this.state; - const { salaryYearMonth } = props; - mySalaryBillList({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data }) => { + const { pageInfo } = this.state; + const { salaryYearMonth, employeeId, type = "mySalaryBillList" } = props; + API[type]({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data }) => { this.setState({ loading: false }); if (status) { const { columns, datas: dataSource, pageInfo: { pageNum: current, pageSize, total } } = data; @@ -55,7 +58,7 @@ class Index extends Component { }; render() { - const { juniorMapList, dataSource, loading, columns, pageInfo } = this.state; + const { dataSource, loading, columns, pageInfo } = this.state; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js index 51277169..89d25e4d 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js @@ -18,7 +18,11 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "1", salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().endOf("year").format("YYYY-MM")] + selectedKey: "1", + salaryYearMonth: [ + moment().subtract(1, 'year').startOf("year").format("YYYY-MM"), + moment().endOf("year").format("YYYY-MM") + ] }; } diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js index 88fd95b1..0ce6b908 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js @@ -19,7 +19,9 @@ class Index extends Component { super(props); this.state = { dataSource: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, - salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().startOf("month").format("YYYY-MM")], + salaryYearMonth: [ + moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"), + moment().endOf("year").format("YYYY-MM")], isMore: true //是否还有更多数据 }; } diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js index 53802244..ba853f81 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js @@ -131,6 +131,7 @@ class SalaryItemSettings extends Component { salarySobId: this.props.salarySobId, existSalaryItemIds: _.map(record.items, it => it.id), groupId: record.groupId, + groupName: record.groupName, isReplenish: this.props.isReplenish }; getAvailableSalaryItemSet(payload).then(({ status, data }) => { diff --git a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js index 6cd7f5b6..d8a1eeb2 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js @@ -34,8 +34,10 @@ class TemplateBaseSettings extends Component { }, ackFeedbackSetting: { ackStatus: "0", + feedbackStatus: "0", autoAckDays: 7, - feedBackUrl: "" + feedBackUrl: "", + mobileFeedbackUrl: "" }, salaryBillViewingLimitSetting: { limitMonth: 0 @@ -68,8 +70,8 @@ class TemplateBaseSettings extends Component { }; salaryBillBaseSetSave = () => { const { watermark, watermarkStatus, wmSetting, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state; - const { feedBackUrl } = ackFeedbackSetting; - if (!feedBackUrl) { + const { feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting; + if (!feedBackUrl || !mobileFeedbackUrl) { Modal.warning({ title: getLabel(111, "信息确认"), content: getLabel(111, "必要信息不完整,红色*为必填项!") @@ -96,7 +98,7 @@ class TemplateBaseSettings extends Component { render() { const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state; - const { ackStatus, autoAckDays, feedBackUrl } = ackFeedbackSetting; + const { ackStatus, feedbackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting; const { limitMonth = 0 } = salaryBillViewingLimitSetting; return ( @@ -155,10 +157,23 @@ class TemplateBaseSettings extends Component { })}/> - + + } + + this.setState({ + ackFeedbackSetting: { + ...ackFeedbackSetting, feedbackStatus + } + })}/> + + { + feedbackStatus === "1" && + + this.setState({ @@ -167,6 +182,15 @@ class TemplateBaseSettings extends Component { } })}/> + + this.setState({ + ackFeedbackSetting: { + ...ackFeedbackSetting, mobileFeedbackUrl + } + })}/> + } diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.js new file mode 100644 index 00000000..3163fd29 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.js @@ -0,0 +1,33 @@ +/* + * Author: 黎永顺 + * name:薪资档案页面重构-高级搜索 + * Description: + * Date: 2024/1/8 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("payrollFilesStore") +@observer +class Index extends Component { + render() { + const { payrollFilesStore: { salaryFileQueryForm } } = this.props; + return ( +
+ salaryFileQueryForm.updateFields({ username: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.less new file mode 100644 index 00000000..9081d39f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/advanceInputBtn/index.less @@ -0,0 +1,29 @@ +.achrive-advance-search { + display: flex; + align-items: center; + position: relative; + top: -1.5px; + + .wea-advanced-search { + top: 2px; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + top: 1px; + } +} diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js new file mode 100644 index 00000000..d7b43cd5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js @@ -0,0 +1,87 @@ +/* + * Author: 黎永顺 + * name: 薪资档案页面重构-高级查询 + * Description: + * Date: 2024/1/8 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button } from "antd"; +import { inject, observer } from "mobx-react"; +import { getSearchs } from "../../../../util"; +import * as API from "../../../../apis/payrollFiles"; +import { salaryFileSearchConditions } from "../../config"; +import { getTaxAgentSelectList } from "../../../../apis/taxAgent"; + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; + +@inject("payrollFilesStore") +@observer +class salaryFileAdvanceSearchPannel extends Component { + constructor(props) { + super(props); + this.state = { + searchConditions: [] + }; + } + + async componentDidMount() { + const [{ data: userStatusList }, { data: taxAgentList }] = await Promise.all([ + API.commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }), + getTaxAgentSelectList() + ]); + this.setState({ + searchConditions: _.map(salaryFileSearchConditions, item => { + return { + ...item, + items: _.map(item.items, child => { + if (getKey(child) === "statuses") { + return { + ...child, + options: _.map(userStatusList, o => ({ key: String(o.value), showname: o.defaultLabel })) + }; + } else if (getKey(child) === "taxAgentId") { + return { + ...child, + options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content })) + }; + } + return { ...child }; + }) + }; + }) + }, () => { + const { payrollFilesStore: { salaryFileQueryForm } } = this.props; + salaryFileQueryForm.initFormFields(this.state.searchConditions); + }); + } + + render() { + const { searchConditions } = this.state; + const { payrollFilesStore: { salaryFileQueryForm } } = this.props; + return ( + +
+ {getSearchs(salaryFileQueryForm, searchConditions, 2, false)} +
+
+
+ + + + + + + + + +
+
+
+ ); + } +} + +export default salaryFileAdvanceSearchPannel; + diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileImportDialog/index.js new file mode 100644 index 00000000..1a60b901 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileImportDialog/index.js @@ -0,0 +1,117 @@ +/* + * Author: 黎永顺 + * name: 薪资档案页面重构-导入弹窗 + * Description: + * Date: 2024/1/9 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaCheckbox, WeaLocaleProvider } from "ecCom"; +import ImportDialog from "../../../.././components/importDialog"; +import { convertToUrlString, getURLParameters } from "../../../../util/url"; +import { importSalaryArchive } from "../../../../apis/payrollFiles"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("payrollFilesStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + importDialog: { + nextloading: false, link: "", importResult: {}, imageId: "", + previewUrl: "/api/bs/hrmsalary/salaryArchive/preview", + extraPreview: {} + } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + const { payrollFilesStore: { salaryFileQueryForm }, importType, isExtEmp } = nextProps; + let payload = {}, extraPreview = {}; + if (importType !== "init" && importType !== "salaryItemAdjust") { + extraPreview = { + importType: "", listType: importType + }; + payload = { + importType: "", listType: importType, hasData: false, + ...salaryFileQueryForm.getFormParams() + }; + } else { + extraPreview = { + importType: importType, listType: "FIXED" + }; + payload = { + importType: importType, listType: "FIXED", hasData: false, + ...salaryFileQueryForm.getFormParams() + }; + } + if (isExtEmp) payload = { ...payload, extSalaryArchiveList: true }; + this.setState({ + importDialog: { + ...this.state.importDialog, extraPreview, + link: `/api/bs/hrmsalary/salaryArchive/downloadTemplate?${convertToUrlString(payload)}` + } + }); + } else { + this.setState({ + importDialog: { + nextloading: false, link: "", importResult: {}, imageId: "", + previewUrl: "/api/bs/hrmsalary/salaryArchive/preview", + extraPreview: {} + } + }); + } + } + + handleImport = (payload) => { + const { importDialog } = this.state, { isExtEmp } = this.props; + const { extraPreview } = importDialog; + this.setState({ importDialog: { ...importDialog, nextloading: true } }); + importSalaryArchive({ ...payload, ...extraPreview, isExtEmp }).then(({ data, status }) => { + this.setState({ importDialog: { ...importDialog, nextloading: false } }); + if (status) { + this.setState({ + importDialog: { ...importDialog, ...payload, importResult: data } + }); + } + }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); + }; + + render() { + const { importDialog } = this.state; + const { link } = importDialog; + return ( + this.setState({ + importDialog: { + ...importDialog, importResult: {}, imageId: "", link: "" + } + })} + exportDataDom={ + { + let payload = { ...getURLParameters(link), hasData: val === "1" }; + this.setState({ + importDialog: { + ...importDialog, + link: `/api/bs/hrmsalary/salaryArchive/downloadTemplate?${convertToUrlString(payload)}` + } + }); + }} + /> + } + nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })} + nextUplaodCallback={imageId => this.handleImport({ imageId })} + /> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js new file mode 100644 index 00000000..bf3cfc17 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js @@ -0,0 +1,223 @@ +/* + * Author: 黎永顺 + * name: 薪资档案页面重构-列表 + * Description: + * Date: 2024/1/8 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; +import { WeaTableNew } from "comsMobx"; +import SalaryFilesEditSlide from "../salaryFilesEditSlide"; +import { toJS } from "mobx"; +import { message, Spin } from "antd"; +import * as API from "../../../../apis/payrollFiles"; + +const WeaTableComx = WeaTableNew.WeaTable; +const getLabel = WeaLocaleProvider.getLabel; +const URLLIST = { + pending: "/api/bs/hrmsalary/salaryArchive/pendingList", + fixed: "/api/bs/hrmsalary/salaryArchive/fixedList", + suspend: "/api/bs/hrmsalary/salaryArchive/suspendList", + stop: "/api/bs/hrmsalary/salaryArchive/stopList", + ext: "/api/bs/hrmsalary/salaryArchive/extList" +}; +const APILIST = { + addToSalarypayment: API.gotoFixed, //设为发薪员工 + delPenditngToDo: API.deletePendingTodo, //待定薪删除待办 + delSalaryFiles: API.deleteSalaryArchive, //删除薪资档案 + salarySuspension: API.gotoStop, //停薪 + delSuspendToDo: API.deleteSuspendTodo, //待停薪删除待办 + cancelSalarySuspension: API.cancelStop //取消停薪 +}; + +@inject("payrollFilesStore", "taxAgentStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [], columns: [], loading: false, selectedRowKeys: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, + salaryFilesEditSlide: { visible: false, salaryArchiveId: "" } + }; + this.SFSlideRef = null; + } + + componentDidMount() { + this.getSalaryFileList(this.props); + window.addEventListener("message", this.handleReceive, false); + window.addEventListener("resize", this.handleResize, false); + } + + handleResize = () => { + this.forceUpdate(); + }; + + componentWillReceiveProps(nextProps, nextContext) { + if ((nextProps.selectedKey !== this.props.selectedKey) || (nextProps.isQuery !== this.props.isQuery)) { + this.setState({ + pageInfo: { ...this.state.pageInfo, current: 1, pageSize: 10, total: 0 } + }, () => this.getSalaryFileList(nextProps)); + } + if ((nextProps.selectedKey !== this.props.selectedKey)) { + this.setState({ + dataSource: [], columns: [], loading: false, selectedRowKeys: [], + salaryFilesEditSlide: { ...this.state.salaryFilesEditSlide, visible: false } + }); + } + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + window.removeEventListener("resize", this.handleResize, false); + } + + handleReceive = async ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.getColumns(); + } else if (type === "turn") { + switch (id) { + case "PAGEINFO": + this.setState({ + pageInfo: { ...this.state.pageInfo, ...params } + }, () => this.getSalaryFileList(this.props)); + break; + case "ROWSELECTION": + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); + break; + case "ADD-TO-SALARYPAYMENT": + case "DEL-PENDITNG-TO-DO": + case "DEL-SALARY-FILES": + case "SALARY-SUSPENSION": + case "DEL-SUSPEND-TO-DO": + case "CANCEL-SALARY-SUSPENSION": + const { interfaceParams } = params; + this.handleSalaryOpts(_.camelCase(id), interfaceParams); + break; + case "CHANGE-SALARY": + case "VIEW": + case "EDIT": + const { taxAgentStore: { showOperateBtn }, selectedKey: runStatuses } = this.props; + const { record: { id: salaryArchiveId } } = params; + this.setState({ + salaryFilesEditSlide: { + ...this.state.salaryFilesEditSlide, visible: true, salaryArchiveId, + runStatuses, showOperateBtn + } + }); + break; + default: + break; + } + } + }; + handleSalaryOpts = (type, payload) => { + WeaLoadingGlobal.start(); + APILIST[type](payload).then(({ status, data = {}, errormsg }) => { + WeaLoadingGlobal.destroy(); + if (status) { + const { msg, type } = data; + if (type === "fail" || type === "info") { + message.error(msg); + } else if (type === "success") { + message.success(msg); + this.getSalaryFileList(this.props); + this.setState({ selectedRowKeys: [] }); + } else { + message.success(getLabel(30700, "操作成功!")); + this.getSalaryFileList(this.props); + this.setState({ selectedRowKeys: [] }); + } + } else { + message.error(errormsg); + } + }); + }; + postMessageToChild = (payload = {}) => { + const i18n = { + "操作": getLabel(30585, "操作"), "调薪": getLabel(542686, "调薪"), + "增员": getLabel(543180, "增员"), "删除档案": getLabel(23238, "删除档案"), + "删除待办": getLabel(543181, "删除待办"), "查看": getLabel(33564, "查看"), + "取消停薪": getLabel(543309, "取消停薪"), "共": getLabel(18609, "共"), + "条": getLabel(18256, "条"), "设为发薪人员": getLabel(543308, "设为发薪人员"), + "停薪": getLabel(542692, "停薪"), "编辑": getLabel(501169, "编辑") + }; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; + getSalaryFileList = (props) => { + const { pageInfo } = this.state; + const { + payrollFilesStore: { salaryFileQueryForm, queryList }, selectedKey, onChangeTopTabCount + } = props; + this.setState({ loading: true }); + queryList(pageInfo, salaryFileQueryForm.getFormParams(), URLLIST[selectedKey]).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: result } = data; + const { list: dataSource, total, pageNum: current, pageSize } = result; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource + }, () => { + onChangeTopTabCount(selectedKey, total); + }); + } + }).catch(() => this.setState({ loading: false })); + }; + getColumns = () => { + const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; + const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({ + dataIndex: it.dataIndex, title: it.title, align: "left", + width: (it.dataIndex === "taxAgentName" || it.dataIndex === "operate") ? 185 : 150, + fixed: it.dataIndex === "username" ? "left" : it.dataIndex === "operate" ? "right" : it.fixed ? it.fixed : false, + ellipsis: true + })); + if (!_.isEmpty(columns)) { + this.postMessageToChild({ + columns, showOperateBtn, selectedKey: this.props.selectedKey, + showDelSalaryFileBtn: this.props.showDelSalaryFileBtn, + dataSource: this.state.dataSource, selectedRowKeys: this.state.selectedRowKeys, + showSum: false, pageInfo: this.state.pageInfo + }); + } + }; + + render() { + const { loading, dataSource, salaryFilesEditSlide } = this.state; + const { payrollFilesStore: { tableStore } } = this.props; + const dom = document.querySelector(".wea-new-top-req-content"); + let height = 280; + if (dom && dataSource.length > 0) { + height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 39 + 113 : dataSource.length < 10 ? dataSource.length * 39 + 113 : parseFloat(dom.style.height) - 16; + } + return ( +
+ +