From 0a1173faaa72e2eb6250199d9b9e8746000f17f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 13 Nov 2023 10:41:47 +0800 Subject: [PATCH 01/20] =?UTF-8?q?feature/2.9.42311.02-=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E7=A6=8F=E5=88=A9=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 3 + .../components/mobileDatePicker/index.js | 101 ++++++++++++ .../components/payrollList/index.js | 36 +++++ .../hrmSalary/pages/mySalaryMobile/index.js | 144 ++++++++++++++++++ .../hrmSalary/pages/mySalaryMobile/index.less | 101 ++++++++++++ 5 files changed, 385 insertions(+) create mode 100644 pc4mobx/hrmSalary/pages/mySalaryMobile/components/mobileDatePicker/index.js create mode 100644 pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js create mode 100644 pc4mobx/hrmSalary/pages/mySalaryMobile/index.js create mode 100644 pc4mobx/hrmSalary/pages/mySalaryMobile/index.less diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index af5bbfb0..4781c1cc 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -1,6 +1,7 @@ import React from "react"; import Route from "react-router/lib/Route"; import { WeaLocaleProvider } from "ecCom"; +import MySalaryMobile from "./pages/mySalaryMobile"; import MySalary from "./pages/mySalary"; import Programme from "./pages/socialSecurityBenefits/programme"; import Archives from "./pages/socialSecurityBenefits/archives"; @@ -59,6 +60,7 @@ const Home = (props) => props.children; const SocialSecurityBenefits = (props) => props.children; const DataAcquisition = (props) => props.children; +// mySalaryMobile 我的薪资福利-移动端 // mySalary 我的薪资福利 // mySalaryView 我的薪资福利-查看工资单 // socialSecurityBenefits 社保福利 @@ -102,6 +104,7 @@ const Routes = ( path="hrmSalary" onEnter={getLocaleLabel} component={Home}> + { + console.log(this.state); + }); + } + } + + handleChangeYear = (year) => { + this.setState({ + yearList: { + ...this.state.yearList, + defaultValue: year + } + }, () => this.props.onChange(this.props.type, "defaultValueYear", year)); + }; + handleChangeMonth = (month) => { + this.setState({ + monthList: { + ...this.state.monthList, + defaultValue: "" + } + }, () => this.props.onChange(this.props.type, "defaultValueMonth", month)); + }; + + render() { + const { yearList, monthList } = this.state; + return ( +
+ + + + +
+ ); + } +} + +export default Index; +const YearFn = (lowEnd, highEnd) => { + let list = []; + for (let i = lowEnd; i <= highEnd; i++) { + list.push(i.toString()); + } + return list; +}; diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js new file mode 100644 index 00000000..ce3d6de2 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js @@ -0,0 +1,36 @@ +/* + * Author: 黎永顺 + * name: 我的薪资福利-移动端列表数据 + * Description: + * Date: 2023/11/13 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import moment from "moment"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + + render() { + const { dataSource } = this.props; + return ( +
    + { + _.map(dataSource, it => { + return
  • +
    {moment(it.salaryYearMonth).format("YYYY-MM")}
    +
    + {getLabel(111, "发放时间")} + {moment(it.sendTime).format("YYYY-MM")} +
    + {`${getLabel(33564, "查看")}>`} +
  • ; + }) + } +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js new file mode 100644 index 00000000..ede6ce6f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js @@ -0,0 +1,144 @@ +/* + * Author: 黎永顺 + * name: 我的薪资福利-移动端列表 + * Description: + * Date: 2023/11/10 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTab } from "ecCom"; +import { message } from "antd"; +import moment from "moment"; +import MobileDatePicker from "./components/mobileDatePicker"; +import PayrollList from "./components/payrollList"; +import { mySalaryBillList } from "../../apis/mySalaryBenefits"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + 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")], + salaryStart: { + visible: false, type: "", + salaryStart: { + defaultValueYear: moment().year().toString(), + defaultValueMonth: (moment().startOf("year").month() + 1).toString() + } + }, + salaryEnd: { + visible: false, + salaryEnd: { + defaultValueYear: moment().year().toString(), + defaultValueMonth: (moment().month() + 1).toString() + } + } + }; + } + + componentDidMount() { + this.getMySalaryBillList(); + const mySalaryMobile = document.getElementById("mySalaryMobile"); + mySalaryMobile.addEventListener("scroll", this.handleScroll, true); + } + + handleScroll = () => { + this.isTouchBottom(this.handleLoadMore); + }; + + componentWillUnmount() { + const mySalaryMobile = document.getElementById("mySalaryMobile"); + mySalaryMobile.removeEventListener("scroll", this.handleScroll, true); + } + + getMySalaryBillList = () => { + const { salaryYearMonth, pageInfo } = this.state; + this.setState({ loading: true }); + mySalaryBillList({ salaryYearMonth, ...pageInfo }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { datas: dataSource, pageInfo } = data; + const { pageNum: current, pageSize, total } = pageInfo; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total } + }); + } + }).catch(() => this.setState({ loading: false })); + }; + handleLoadMore = () => { + // 为测试效果临时使用 message + message.info("触底了~"); + }; + isTouchBottom = (handler) => { + const div = document.getElementById("mySalaryMobile"); + if ((div.scrollHeight - div.scrollTop) === div.clientHeight) handler(); + }; + handleChange = (type, key, val) => { + this.setState({ + [type]: { + ...this.state[type], + [type]: { + ...this.state[type][type], + [key]: val + } + } + }); + }; + handleCancel = () => { + this.setState({ + salaryStart: { + visible: false, type: "", + salaryStart: { + defaultValueYear: moment().year().toString(), + defaultValueMonth: (moment().startOf("year").month() + 1).toString() + } + }, + salaryEnd: { + visible: false, + salaryEnd: { + defaultValueYear: moment().year().toString(), + defaultValueMonth: (moment().month() + 1).toString() + } + } + }); + }; + handleConfirm = () => { + this.handleCancel(); + }; + + render() { + const { salaryStart, salaryEnd, salaryYearMonth, dataSource } = this.state; + const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth; + const mobilePorps = { ...salaryStart, ...salaryEnd, visible: salaryEnd.visible || salaryStart.visible }; + return ( +
+
+ +
+
+ this.setState({ + salaryStart: { ...salaryStart, visible: true, type: "salaryStart" } + })}>{salaryStartYearMonth} + {getLabel(15322, "至")} + this.setState({ + salaryEnd: { ...salaryEnd, visible: true, type: "salaryEnd" } + })}>{salaryEndYearMonth} +
+ + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less new file mode 100644 index 00000000..259f5e9e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less @@ -0,0 +1,101 @@ +.salary-mobile-list-wrapper { + height: 100%; + overflow-y: auto; + background: #f6f6f6; + position: relative; + + .salary-mobile-list-tab { + background: #fff; + position: fixed; + width: 100%; + } + + .wea-tab { + display: flex; + justify-content: center; + } + + .searchWrapper { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + padding: 10px 0; + background: #fff; + height: 40px; + position: fixed; + top: 47px; + + .date { + color: #333; + } + + .to { + margin: 0 10px; + color: #999; + } + } + + .ui-picker-address { + .ui-popup-title { + font-size: 12px !important; + } + + .ui-popup-content { + display: flex; + + .ui-picker-wrapper { + flex: 1; + + .ui-picker-item { + font-size: 12px !important; + } + } + } + } +} + +.payrollList-wrapper { + padding: 8px 0; + margin-top: 87px; + + li { + display: flex; + flex-direction: column; + border-radius: 5px; + background: #FFF; + margin: 0 8px 8px; + + .salaryMonth { + display: flex; + padding: 10px; + border-bottom: 1px solid #e5e5e5; + + & > span:first-child { + color: #2db7f5; + font-size: 14px; + } + } + + .sendTime { + padding: 10px; + + & > span:first-child { + color: #999; + margin-right: 80px; + } + + & > span:last-child { + color: #333; + } + } + + a { + color: #2db7f5; + display: inline-block; + width: 100%; + text-align: center; + padding-bottom: 10px; + } + } +} From 3ab54027f9bb24ef9a4cf0806a436ceccfda1079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 13 Nov 2023 14:13:03 +0800 Subject: [PATCH 02/20] =?UTF-8?q?feature/2.9.42311.02-=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E7=A6=8F=E5=88=A9=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobileDatePicker/index.js | 65 +++++++---------- .../hrmSalary/pages/mySalaryMobile/index.js | 73 +++---------------- .../hrmSalary/pages/mySalaryMobile/index.less | 8 +- 3 files changed, 43 insertions(+), 103 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/components/mobileDatePicker/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/mobileDatePicker/index.js index a17b065e..dde59609 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/components/mobileDatePicker/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/mobileDatePicker/index.js @@ -16,60 +16,49 @@ class Index extends Component { constructor(props) { super(props); this.state = { - yearList: {}, monthList: {} + visible: false, + salaryYearMonth: { year: "", month: "" } }; } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible && nextProps.visible) { - this.setState({ - yearList: { - list: YearFn(Number(moment().subtract(100, "year").format("YYYY")), Number(moment().add(100, "year").format("YYYY"))), - defaultValue: nextProps[nextProps.type].defaultValueYear, - displayValue(name) { - return name; - } - }, - monthList: { - list: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], - defaultValue: nextProps.type === "salaryStart" ? "0" : nextProps[nextProps.type].defaultValueMonth, - displayValue(name) { - return name; - } - } - }, () => { - console.log(this.state); - }); - } + const { value } = nextProps; + const [year, month] = value.split("-"); + this.setState({ + salaryYearMonth: { year, month } + }); } handleChangeYear = (year) => { - this.setState({ - yearList: { - ...this.state.yearList, - defaultValue: year - } - }, () => this.props.onChange(this.props.type, "defaultValueYear", year)); + this.setState({ salaryYearMonth: { ...this.state.salaryYearMonth, year } }); }; handleChangeMonth = (month) => { - this.setState({ - monthList: { - ...this.state.monthList, - defaultValue: "" - } - }, () => this.props.onChange(this.props.type, "defaultValueMonth", month)); + + this.setState({ salaryYearMonth: { ...this.state.salaryYearMonth, month: parseInt(month).toString() } }); + }; + handleCancel = () => { + this.setState({ visible: false }); + }; + handleConfirm = () => { + const { year, month } = this.state.salaryYearMonth; + this.setState({ visible: false }, () => { + this.props.onChange(moment(new Date(`${year}- ${month}`)).format("YYYY-MM")); + }); }; render() { - const { yearList, monthList } = this.state; + const { value } = this.props; + const { visible } = this.state; + const [year, month] = value.split("-"); return (
- + this.setState({ visible: true })}>{value} + { this.setState({ loading: false }); if (status) { - const { datas: dataSource, pageInfo } = data; - const { pageNum: current, pageSize, total } = pageInfo; + const { datas: dataSource, pageInfo: pageResult } = data; + const { pageNum: current, pageSize, total } = pageResult; this.setState({ dataSource, pageInfo: { ...pageInfo, current, pageSize, total } }); @@ -75,43 +61,17 @@ class Index extends Component { const div = document.getElementById("mySalaryMobile"); if ((div.scrollHeight - div.scrollTop) === div.clientHeight) handler(); }; - handleChange = (type, key, val) => { + handleChange = (type, val) => { + const { salaryYearMonth } = this.state; + const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth; this.setState({ - [type]: { - ...this.state[type], - [type]: { - ...this.state[type][type], - [key]: val - } - } - }); - }; - handleCancel = () => { - this.setState({ - salaryStart: { - visible: false, type: "", - salaryStart: { - defaultValueYear: moment().year().toString(), - defaultValueMonth: (moment().startOf("year").month() + 1).toString() - } - }, - salaryEnd: { - visible: false, - salaryEnd: { - defaultValueYear: moment().year().toString(), - defaultValueMonth: (moment().month() + 1).toString() - } - } - }); - }; - handleConfirm = () => { - this.handleCancel(); + salaryYearMonth: type === "salaryStartYearMonth" ? [val, salaryEndYearMonth] : [salaryStartYearMonth, val] + }, () => this.getMySalaryBillList()); }; render() { - const { salaryStart, salaryEnd, salaryYearMonth, dataSource } = this.state; + const { salaryYearMonth, dataSource } = this.state; const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth; - const mobilePorps = { ...salaryStart, ...salaryEnd, visible: salaryEnd.visible || salaryStart.visible }; return (
@@ -121,21 +81,12 @@ class Index extends Component { />
- this.setState({ - salaryStart: { ...salaryStart, visible: true, type: "salaryStart" } - })}>{salaryStartYearMonth} + this.handleChange("salaryStartYearMonth", v)}/> {getLabel(15322, "至")} - this.setState({ - salaryEnd: { ...salaryEnd, visible: true, type: "salaryEnd" } - })}>{salaryEndYearMonth} + this.handleChange("salaryEndYearMonth", v)}/>
-
); } diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less index 259f5e9e..16ae3726 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less @@ -26,10 +26,6 @@ position: fixed; top: 47px; - .date { - color: #333; - } - .to { margin: 0 10px; color: #999; @@ -37,6 +33,10 @@ } .ui-picker-address { + .date { + color: #333; + } + .ui-popup-title { font-size: 12px !important; } From 1d110fe25db7db946520f8111bff79a93e94dac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 13 Nov 2023 15:35:43 +0800 Subject: [PATCH 03/20] =?UTF-8?q?feature/2.9.42311.02-=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E7=A6=8F=E5=88=A9=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/payrollList/index.js | 10 ++++++++-- .../hrmSalary/pages/mySalaryMobile/index.js | 20 ++++++++++++------- .../hrmSalary/pages/mySalaryMobile/index.less | 7 ++++++- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js index ce3d6de2..5e4cf85b 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js @@ -13,12 +13,12 @@ const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { render() { - const { dataSource } = this.props; + const { dataSource, isMore, loading } = this.props; return (
    { _.map(dataSource, it => { - return
  • + return
  • {moment(it.salaryYearMonth).format("YYYY-MM")}
    {getLabel(111, "发放时间")} @@ -28,6 +28,12 @@ class Index extends Component {
  • ; }) } + { + loading &&
  • {getLabel(31230, "加载中")}
  • + } + { + !isMore &&
  • {getLabel(83553, "暂无数据")}
  • + }
); } diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js index e4d5d47f..e1fade72 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js @@ -6,7 +6,6 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTab } from "ecCom"; -import { message } from "antd"; import moment from "moment"; import MobileDatePicker from "./components/mobileDatePicker"; import PayrollList from "./components/payrollList"; @@ -20,7 +19,8 @@ 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().startOf("year").format("YYYY-MM"), moment().startOf("month").format("YYYY-MM")], + isMore: true //是否还有更多数据 }; } @@ -48,14 +48,20 @@ class Index extends Component { const { datas: dataSource, pageInfo: pageResult } = data; const { pageNum: current, pageSize, total } = pageResult; this.setState({ - dataSource, pageInfo: { ...pageInfo, current, pageSize, total } - }); + 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 - message.info("触底了~"); + const { pageInfo, isMore } = this.state; + if (!isMore) return; + const { current } = pageInfo; + this.setState({ + pageInfo: { ...pageInfo, current: current + 1 } + }, () => this.getMySalaryBillList()); }; isTouchBottom = (handler) => { const div = document.getElementById("mySalaryMobile"); @@ -70,7 +76,7 @@ class Index extends Component { }; render() { - const { salaryYearMonth, dataSource } = this.state; + const { salaryYearMonth, dataSource, isMore, loading } = this.state; const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth; return (
@@ -86,7 +92,7 @@ class Index extends Component { {getLabel(15322, "至")} this.handleChange("salaryEndYearMonth", v)}/>
- +
); } diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less index 16ae3726..2db7cfab 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less @@ -59,7 +59,12 @@ padding: 8px 0; margin-top: 87px; - li { + li.empty, li.more { + text-align: center; + color: #999; + } + + li.item { display: flex; flex-direction: column; border-radius: 5px; From f51de576619a1e8568e9b2e1307e2094f076b2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 13 Nov 2023 15:49:45 +0800 Subject: [PATCH 04/20] =?UTF-8?q?feature/2.9.42311.02-=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E7=A6=8F=E5=88=A9=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mySalaryMobile/components/payrollList/index.js | 5 ++++- pc4mobx/hrmSalary/pages/mySalaryMobile/index.less | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js index 5e4cf85b..ae884bc6 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js @@ -19,7 +19,10 @@ class Index extends Component { { _.map(dataSource, it => { return
  • -
    {moment(it.salaryYearMonth).format("YYYY-MM")}
    +
    + {moment(it.salaryYearMonth).format("YYYY-MM")} + {`${getLabel(15323, "第")}${it.acctTimes}${getLabel(18929, "次")}`} +
    {getLabel(111, "发放时间")} {moment(it.sendTime).format("YYYY-MM")} diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less index 2db7cfab..9dd4d275 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less @@ -74,12 +74,23 @@ .salaryMonth { display: flex; padding: 10px; + justify-content: space-between; + align-items: center; border-bottom: 1px solid #e5e5e5; & > span:first-child { color: #2db7f5; font-size: 14px; } + + & > span:last-child { + background: rgba(45, 183, 245, .1); + color: #2db7f5; + font-size: 12px; + display: inline-block; + padding: 4px; + transform: scale(.8); + } } .sendTime { From 23f15bd4235577f2ba2bf60bfbb4e647e35c4b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 27 Nov 2023 19:17:44 +0800 Subject: [PATCH 05/20] =?UTF-8?q?feature/2.9.42311.02-=E7=A4=BE=E4=BF=9D?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E4=BB=A5=E5=8F=8A=E8=96=AA=E8=B5=84=E8=B4=A6?= =?UTF-8?q?=E5=A5=97=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ledgerPage/components/ledgerSearchComp.js | 66 +++++++++++++++++++ pc4mobx/hrmSalary/pages/ledgerPage/config.js | 32 +++++++++ pc4mobx/hrmSalary/pages/ledgerPage/index.js | 12 ++-- pc4mobx/hrmSalary/pages/ledgerPage/index.less | 31 +++++++++ pc4mobx/hrmSalary/stores/ledger.js | 1 + 5 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js new file mode 100644 index 00000000..7756173c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js @@ -0,0 +1,66 @@ +/* + * Author: 黎永顺 + * name: 薪资账套查询 + * Description: + * Date: 2023/11/27 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaSwitch } from "comsMobx"; +import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { Button } from "antd"; +import { searchConditions } from "../config"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("ledgerStore") +@observer +class LedgerSearchComp extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [] + }; + } + + componentDidMount() { + const { ledgerStore: { searchForm } } = this.props; + searchForm.initFormFields(searchConditions); + } + + formRender = (form, condition) => { + const { isFormInit } = form, formParams = form.getFormParams(); + let group = []; + isFormInit && condition && condition.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + + ), + colSpan: 2 + }); + }); + group.push( + ); + }); + return group; + }; + + render() { + const { ledgerStore: { searchForm } } = this.props; + return ( +
    + {this.formRender(searchForm, searchConditions)} + +
    + ); + } +} + +export default LedgerSearchComp; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/config.js b/pc4mobx/hrmSalary/pages/ledgerPage/config.js index 1a9f3717..0c56f799 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/config.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/config.js @@ -27,6 +27,38 @@ export const copyConditions = [ defaultshow: true } ]; +export const searchConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["name"], + fieldcol: 24, + otherParams: { + placeholder: "请输入薪资账套名称" + }, + lanId: 543431, + labelcol: 0, + value: "", + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["taxAgentId"], + fieldcol: 24, + placeholder: "请选择个税扣缴义务人", + lanId: 543234, + label: "", + labelcol: 0, + value: "", + viewAttr: 2 + } + ], + defaultshow: true + } +]; export const categoryConditions = [ { items: [ diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/index.js b/pc4mobx/hrmSalary/pages/ledgerPage/index.js index 9cef3433..30db032d 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/index.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/index.js @@ -10,6 +10,7 @@ import { WeaInputSearch, WeaTop } from "ecCom"; import { Button } from "antd"; import LedgerTable from "./components/ledgerTable"; import LedgerSlide from "./components/ledgerSlide"; +import LedgerSearchComp from "./components/ledgerSearchComp"; import "./index.less"; @inject("taxAgentStore") @@ -60,11 +61,12 @@ class Index extends Component { type="primary" onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })} >新建, - this.setState({ searchVal })} - onSearch={() => this.setState({ doSearch: !doSearch })} - /> + + // this.setState({ searchVal })} + // onSearch={() => this.setState({ doSearch: !doSearch })} + // /> ]; return ( button { + position: absolute; + right: -70px; + top: 0; + } + + .wea-search-group, .wea-content { + padding: 0; + } + + .wea-form-cell-wrapper { + & > div.wea-form-cell { + padding: 0; + + .wea-form-item { + padding: 0; + } + } + + & > div.wea-form-cell:first-child { + padding-right: 10px; + } + } +} diff --git a/pc4mobx/hrmSalary/stores/ledger.js b/pc4mobx/hrmSalary/stores/ledger.js index d1a0860c..8dc46dc8 100644 --- a/pc4mobx/hrmSalary/stores/ledger.js +++ b/pc4mobx/hrmSalary/stores/ledger.js @@ -12,6 +12,7 @@ export class LedgerStore { //重构薪资账套 @observable copyForm = new WeaForm(); // 复制form @observable categoryForm = new WeaForm(); // 新增分类form + @observable searchForm = new WeaForm(); // 查询form /*******************************************************/ From 7cc9e422b1c08700ec735b98fbc38c6ab94e9db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 28 Nov 2023 13:44:53 +0800 Subject: [PATCH 06/20] =?UTF-8?q?1feature/2.9.9.2312.01-=E7=A4=BE=E4=BF=9D?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E4=BB=A5=E5=8F=8A=E8=96=AA=E8=B5=84=E8=B4=A6?= =?UTF-8?q?=E5=A5=97=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../calcOc/components/salaryCalcOcList.js | 137 +++++++++--------- .../pages/calculate/calcOc/index.less | 21 +-- .../ledgerPage/components/ledgerSearchComp.js | 37 ++++- .../ledgerPage/components/ledgerTable.js | 7 +- pc4mobx/hrmSalary/pages/ledgerPage/index.js | 11 +- pc4mobx/hrmSalary/pages/ledgerPage/index.less | 4 + .../pages/reportView/components/condition.js | 26 ++-- .../statisticalMicroSettingsSlide.js | 4 +- 8 files changed, 126 insertions(+), 121 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js index e3dda5fb..aefd3e5b 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,47 @@ 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(columns), pageInfo: { ...pageInfo, current, pageSize, total } + }, () => { + const { pageInfo, dataSource, columns } = this.state; + this.postMessageToChild({ dataSource, pageInfo, columns }); }); } }).catch(() => this.setState({ loading: false })); }; - 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)); + convertColumns = (cols) => { + return _.map(cols, (item, index) => { + const col = { title: item.text, dataIndex: item.column }; + if (_.isNaN(parseInt(item.column))) { + return item.fixed ? { ...col, width: 150, fixed: item.fixed } : index < 2 ? { + ...col, width: 150, fixed: "left" + } : { ...col, width: 150 }; + } else { + return { ...col, width: 180, children: this.convertColumns(item.children) }; } - }; + }); + }; + + render() { + 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" }; - })} - /> - + +