From 3eb8c47a877a9df3e5624fed6c7da30fedb95d0a 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, 8 Dec 2023 13:39:55 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.9.9.2312.01-=E5=B7=A5=E8=B5=84?= =?UTF-8?q?=E5=8D=95=E6=9F=A5=E7=9C=8B=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/pcTemplate/content.js | 81 +++++ .../hrmSalary/components/pcTemplate/index.js | 71 +---- .../components/pcTemplate/index.less | 276 +++++++++--------- pc4mobx/hrmSalary/pages/mySalary/index.less | 9 + .../hrmSalary/pages/mySalary/mySalaryView.js | 54 ++-- .../hrmSalary/pages/mySalaryMobile/index.js | 8 +- 6 files changed, 266 insertions(+), 233 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/pcTemplate/content.js diff --git a/pc4mobx/hrmSalary/components/pcTemplate/content.js b/pc4mobx/hrmSalary/components/pcTemplate/content.js new file mode 100644 index 00000000..97497f2b --- /dev/null +++ b/pc4mobx/hrmSalary/components/pcTemplate/content.js @@ -0,0 +1,81 @@ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import moment from "moment"; +import { dealTemplate } from "./index"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Content extends Component { + render() { + const { theme, background, tip, tipPosi, itemTypeList, sendTime = new Date() } = this.props; + 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}
+
) + } +
+
); + }) + } +
+ { + !onlyOneGrup && tipPosi.toString() === "2" && tip && +
{tip}
+ } +
+
+
+ ); + } +} + +export default Content; diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.js b/pc4mobx/hrmSalary/components/pcTemplate/index.js index 511a42bc..88e12f72 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.js +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.js @@ -1,82 +1,15 @@ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; -import moment from "moment"; +import Content from "./content"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { render() { - const { theme, background, tip, tipPosi, itemTypeList } = this.props; - const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "pc"); return (
-
-
-
-
-
{theme || ""}
-
{moment().format("YYYY-MM-DD HH:mm:ss")}
-
-
- { - background && -
logo
- } - { - !onlyOneGrup && tipPosi === "1" && tip && -
{tip}
- } -
- { - showData.map((groupItem, index) => { - // 如果当前组下没有条目 当前组直接不展示。 - if (!groupItem) return null; - const { groupId, groupName, items = [] } = groupItem; - return ( -
- { - groupName ?
{groupName}
: null - } -
- { - (onlyOneGrup && tipPosi === "1" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) - } - { - items.map((templatItem, index) => { - const { salaryItemValue, name, salaryItemShowName } = templatItem || {}; - return
-
- {salaryItemShowName || name || ""} -
-
{salaryItemValue || ""}
-
; - - }) - } - { - (onlyOneGrup && tipPosi === "2" && tip) && (
-
{getLabel(111, "发放说明")}
-
{tip}
-
) - } -
-
); - }) - } -
- { - !onlyOneGrup && tipPosi === "2" && tip && -
{tip}
- } -
-
-
-
+
); } diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.less b/pc4mobx/hrmSalary/components/pcTemplate/index.less index 1341316d..404b8a20 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.less +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.less @@ -5,144 +5,6 @@ .weapp-salary-sp { background: #f6f6f6; - - .salary-preview-container { - display: flex; - justify-content: flex-start; - align-items: center; - flex-direction: column; - width: 100%; - - .edition-center { - max-width: 1000px; - display: flex; - flex-direction: column; - align-items: center; - width: 100%; - padding-bottom: 32px; - - .header { - height: 48px; - padding: 0 16px; - font-size: 12px; - color: #111; - - .header-title { - height: 22px; - font-size: 17px; - color: #111; - line-height: 22px; - font-weight: 400; - text-align: center; - } - - .header-salary-date-time { - margin-top: 16px; - text-align: center; - height: 14px; - font-size: 14px; - color: #999; - line-height: 14px; - font-weight: 400; - } - } - - .body { - width: 100%; - margin-top: 32px; - - .comp-img { - text-align: center; - - img { - width: 100%; - } - } - - .corporate-culture-text { - width: 100%; - margin-top: 16px; - text-align: center; - min-height: 12px; - font-size: 12px; - color: #111; - white-space: pre-wrap; - word-break: break-all; - } - - .data-detail { - margin-top: 16px; - - .salary-group { - margin-bottom: 16px; - - .group-title { - font-size: 14px; - } - - .group-list { - margin-top: 16px; - display: flex; - flex-wrap: wrap; - - .even { - border-left: 1px solid #e5e5e5; - } - - .zero, .first { - border-top: 1px solid #e5e5e5; - } - - .list-item { - width: 50%; - display: flex; - justify-content: left; - min-height: 40px; - align-items: center; - border-bottom: 1px solid #e5e5e5; - border-right: 1px solid #e5e5e5; - - .item-name { - flex-basis: 170px; - box-sizing: border-box; - width: 170px; - padding: 0 16px; - height: 100%; - background: #fbfbfb; - border-right: 1px solid #e5e5e5; - font-size: 12px; - color: #666; - display: flex; - justify-content: center; - align-items: center; - flex-shrink: 0; - - .text { - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - overflow: hidden; - text-overflow: ellipsis; - } - } - - .item-count { - flex-basis: 328px; - padding-left: 16px; - height: 100%; - line-height: 40px; - background: #fff; - font-size: 12px; - color: #111; - word-break: break-all; - } - } - } - } - } - } - } - } } .weapp-salary-payroll-pc-preview { @@ -151,3 +13,141 @@ overflow-y: auto; } } + +.salary-preview-container { + display: flex; + justify-content: flex-start; + align-items: center; + flex-direction: column; + width: 100%; + + .edition-center { + max-width: 1000px; + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + padding-bottom: 32px; + + .header { + height: 48px; + padding: 0 16px; + font-size: 12px; + color: #111; + + .header-title { + height: 22px; + font-size: 17px; + color: #111; + line-height: 22px; + font-weight: 400; + text-align: center; + } + + .header-salary-date-time { + margin-top: 16px; + text-align: center; + height: 14px; + font-size: 14px; + color: #999; + line-height: 14px; + font-weight: 400; + } + } + + .body { + width: 100%; + margin-top: 32px; + + .comp-img { + text-align: center; + + img { + width: 100%; + } + } + + .corporate-culture-text { + width: 100%; + margin-top: 16px; + text-align: center; + min-height: 12px; + font-size: 12px; + color: #111; + white-space: pre-wrap; + word-break: break-all; + } + + .data-detail { + margin-top: 16px; + + .salary-group { + margin-bottom: 16px; + + .group-title { + font-size: 14px; + } + + .group-list { + margin-top: 16px; + display: flex; + flex-wrap: wrap; + + .even { + border-left: 1px solid #e5e5e5; + } + + .zero, .first { + border-top: 1px solid #e5e5e5; + } + + .list-item { + width: 50%; + display: flex; + justify-content: left; + min-height: 40px; + align-items: center; + border-bottom: 1px solid #e5e5e5; + border-right: 1px solid #e5e5e5; + + .item-name { + flex-basis: 170px; + box-sizing: border-box; + width: 170px; + padding: 0 16px; + height: 100%; + background: #fbfbfb; + border-right: 1px solid #e5e5e5; + font-size: 12px; + color: #666; + display: flex; + justify-content: center; + align-items: center; + flex-shrink: 0; + + .text { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + text-overflow: ellipsis; + } + } + + .item-count { + flex-basis: 328px; + padding-left: 16px; + height: 100%; + line-height: 40px; + background: #fff; + font-size: 12px; + color: #111; + word-break: break-all; + } + } + } + } + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/mySalary/index.less b/pc4mobx/hrmSalary/pages/mySalary/index.less index 8a2b690e..9f744351 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/index.less +++ b/pc4mobx/hrmSalary/pages/mySalary/index.less @@ -20,3 +20,12 @@ } } } + +.weapp-salary-my-salary-view-payroll { + padding: 32px 0; + height: 100vh; + overflow-y: auto; +} + +.page { +} diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js index 574c315d..0a3e05a3 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js +++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js @@ -9,10 +9,12 @@ import { inject, observer } from "mobx-react"; import { Button, message, Modal } from "antd"; import { WeaLocaleProvider } from "ecCom"; import Authority from "./authority"; -import ComputerTemplate from "../payroll/templatePreview/computerTemplate"; +import Content from "../../components/pcTemplate/content"; +// import ComputerTemplate from "../payroll/templatePreview/computerTemplate"; import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll"; import CaptchaModal from "../../components/captchaModal"; -import "../payroll/templatePreview/index.less"; +import "./index.less"; +// import "../payroll/templatePreview/index.less"; const { getLabel } = WeaLocaleProvider; @@ -57,7 +59,7 @@ class MySalaryView extends Component { handleGoFeedback = () => { Modal.confirm({ title: getLabel(131329, "信息确认"), - content: getLabel(111, "请确认薪资信息是有误,进行反馈并发起反馈流程。"), + content: getLabel(544271, "请确认薪资信息是有误,进行反馈并发起反馈流程。"), onOk: () => { const { params: { salaryInfoId }, mySalaryStore: { getMySalaryBill } } = this.props; feedBackSalaryBill({ salaryInfoId }).then(({ status, errorMsg }) => { @@ -84,29 +86,37 @@ class MySalaryView extends Component { if (_.isEmpty(mySalaryStore)) { return
; } - const employeeInformation = !_.isEmpty(mySalaryStore) && mySalaryStore.employeeInformation; - const salaryGroups = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryGroups; - const salaryTemplateShowSet = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryTemplate; + const { salaryTemplate, salaryGroups, employeeInformation, sendTime } = mySalaryStore; + const salaryProps = { + theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime, + background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "", + itemTypeList: [employeeInformation, ...salaryGroups] + }; + console.log(mySalaryStore); + // const employeeInformation = !_.isEmpty(mySalaryStore) && mySalaryStore.employeeInformation; + // const salaryGroups = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryGroups; + // const salaryTemplateShowSet = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryTemplate; return ( -
-
- - { - (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0")) && - - } - -
+
+ + {/*
*/} + {/* */} + {/* {*/} + {/* (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0")) &&*/} + {/* */} + {/* }*/} + {/* */} + {/*
*/}
{ + getMySalaryBillList = (type) => { const { salaryYearMonth, pageInfo } = this.state; this.setState({ loading: true }); mySalaryBillList({ salaryYearMonth, ...pageInfo }).then(({ status, data }) => { @@ -48,14 +48,13 @@ class Index extends Component { const { datas: dataSource, pageInfo: pageResult } = data; const { pageNum: current, pageSize, total } = pageResult; this.setState({ - dataSource: [...this.state.dataSource, ...dataSource], + dataSource: type ? dataSource : [...this.state.dataSource, ...dataSource], pageInfo: { ...pageInfo, current, pageSize, total } }, () => this.setState({ isMore: this.state.dataSource.length < total })); } }).catch(() => this.setState({ loading: false })); }; handleLoadMore = () => { - // 为测试效果临时使用 message const { pageInfo, isMore } = this.state; if (!isMore) return; const { current } = pageInfo; @@ -71,8 +70,9 @@ class Index extends Component { const { salaryYearMonth } = this.state; const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth; this.setState({ + pageInfo: { ...this.state.pageInfo, current: 1 }, salaryYearMonth: type === "salaryStartYearMonth" ? [val, salaryEndYearMonth] : [salaryStartYearMonth, val] - }, () => this.getMySalaryBillList()); + }, () => this.getMySalaryBillList(true)); }; render() {