From 43c71e32ccc9a6ae37f9804f7824c5f5a81f4218 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, 25 Apr 2023 09:37:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E8=96=AA=E9=85=AC=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=88=86=E6=9E=90=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statisticalMicroSettingsSlide.js | 35 +++++++++++++++---- pc4mobx/hrmSalary/pages/reportView/index.less | 5 +++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 97306cd7..bda4cc15 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -8,11 +8,11 @@ import React, { Component } from "react"; import { toJS } from "mobx"; import { WeaButtonIcon, + WeaDatePicker, WeaError, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, - WeaRangePicker, WeaSearchGroup, WeaSelect, WeaSlideModal, @@ -113,7 +113,7 @@ class StatisticalMicroSettingsSlide extends Component { const [salaryStartMonth, salaryEndMonth] = salaryMonth; const { department, employee, position, subCompany, taxAgent, ...extra } = form.getFormDatas(); const { value, valueSpan } = taxAgent; - if (!salaryEndMonth && !salaryStartMonth) { + if (!salaryEndMonth || !salaryStartMonth) { this.refs.weaError.showError(); return; } @@ -266,10 +266,8 @@ class StatisticalMicroSettingsSlide extends Component { - this.setState({ salaryMonth: v })} - /> + this.setState({ salaryMonth: v })}/> @@ -323,3 +321,28 @@ const TitleDialog = (props) => { ; }; +const MonthRangePicker = (props) => { + const { dateRange, onChange, viewAttr } = props; + const [startDate, endDate] = dateRange || []; + return
+ { + return current && endDate && current.getTime() > new Date(endDate).getTime(); + }} + format="YYYY-MM" + onChange={(val) => onChange([val, endDate])} + viewAttr={viewAttr} + /> + + { + return current && startDate && current.getTime() < new Date(startDate).getTime(); + }} + format="YYYY-MM" + viewAttr={viewAttr} + onChange={(val) => onChange([startDate, val])} + /> +
; +}; diff --git a/pc4mobx/hrmSalary/pages/reportView/index.less b/pc4mobx/hrmSalary/pages/reportView/index.less index a77a7050..cb65cade 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.less +++ b/pc4mobx/hrmSalary/pages/reportView/index.less @@ -251,6 +251,11 @@ } } } + + .rangePickerBox { + display: flex; + align-items: center; + } } //新建自定义统计项目