产品-薪酬统计分析完善
This commit is contained in:
parent
29b8d377d3
commit
43c71e32cc
|
|
@ -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 {
|
|||
<WeaSearchGroup title={getLabel(111, "统计时间范围")} col={2} showGroup needTigger>
|
||||
<WeaFormItem label={getLabel(111, "薪资所属月")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaError tipPosition="bottom" ref="weaError" error={getLabel(111, "此项必填")}>
|
||||
<WeaRangePicker
|
||||
value={salaryMonth} viewAttr={3} format="YYYY-MM"
|
||||
onChange={v => this.setState({ salaryMonth: v })}
|
||||
/>
|
||||
<MonthRangePicker viewAttr={3} dateRange={salaryMonth}
|
||||
onChange={v => this.setState({ salaryMonth: v })}/>
|
||||
</WeaError>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
|
|
@ -323,3 +321,28 @@ const TitleDialog = (props) => {
|
|||
</div>
|
||||
</div>;
|
||||
};
|
||||
const MonthRangePicker = (props) => {
|
||||
const { dateRange, onChange, viewAttr } = props;
|
||||
const [startDate, endDate] = dateRange || [];
|
||||
return <div className="rangePickerBox">
|
||||
<WeaDatePicker
|
||||
value={startDate}
|
||||
disabledDate={(current) => {
|
||||
return current && endDate && current.getTime() > new Date(endDate).getTime();
|
||||
}}
|
||||
format="YYYY-MM"
|
||||
onChange={(val) => onChange([val, endDate])}
|
||||
viewAttr={viewAttr}
|
||||
/>
|
||||
<span className="to" style={{ margin: "0 10px" }}>至</span>
|
||||
<WeaDatePicker
|
||||
value={endDate}
|
||||
disabledDate={(current) => {
|
||||
return current && startDate && current.getTime() < new Date(startDate).getTime();
|
||||
}}
|
||||
format="YYYY-MM"
|
||||
viewAttr={viewAttr}
|
||||
onChange={(val) => onChange([startDate, val])}
|
||||
/>
|
||||
</div>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -251,6 +251,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rangePickerBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
//新建自定义统计项目
|
||||
|
|
|
|||
Loading…
Reference in New Issue