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; + } } //新建自定义统计项目