diff --git a/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js b/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js index bd77c193..49471b95 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js @@ -13,7 +13,7 @@ import { WeaLocaleProvider, WeaTop } from "ecCom"; import { MonthRangePicker } from "../../reportView/components/statisticalMicroSettingsSlide"; import { postFetch } from "../../../util/request"; import moment from "moment"; -import { Spin } from "antd"; +import { message, Spin } from "antd"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -67,6 +67,10 @@ class PersonalSalaryReport extends Component { getSalaryReport = (props) => { const { pageInfo, dateRange: pageDateRange } = this.state, { dateRange } = props || this.props; const [startDateStr, endDateStr] = dateRange || pageDateRange; + if (!startDateStr || !endDateStr) { + message.warning(getLabel(111, "请选择薪资所属月!")); + return; + } const payload = { startDateStr, endDateStr, ...pageInfo }; this.setState({ loading: true }); postFetch("/api/bs/hrmsalary/report/statistics/employee/salaryReport", payload).then(({ status, data }) => { diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js index d4190df1..ca2cb3d9 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js @@ -27,8 +27,8 @@ class Index extends Component { selectedKey: "0", sysinfo: {}, tabs: [], store: { loading: false, hasRight: false }, logDialogVisible: false, filterConditions: "[]", captchaVisible: false, salaryYearMonth: [ - moment().subtract(1, "year").startOf("year").format("YYYY-MM"), - moment().endOf("year").format("YYYY-MM") + moment(new Date()).subtract(11, "months").format("YYYY-MM"), + moment(new Date()).format("YYYY-MM") ] }; } @@ -111,7 +111,7 @@ class Index extends Component { const btns = [
{getLabel(542604, "薪资所属月")}
- this.setState({ salaryYearMonth: v })}/>
]; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 6124375d..df6cfbd9 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -442,12 +442,15 @@ const StatisticalScopePicker = (props) => { ; }; export const MonthRangePicker = (props) => { - const { dateRange, onChange, viewAttr, disabled = false } = props; + const { dateRange, onChange, viewAttr, disabled = false, isOneYear = false } = props; const [startDate, endDate] = dateRange || []; return
{ + if (isOneYear) { + return current && endDate && ((current.getTime() > new Date(endDate).getTime()) || (current.getTime() < new Date(moment(endDate).subtract(12, "months").format("YYYY-MM")).getTime())); + } return current && endDate && current.getTime() > new Date(endDate).getTime(); }} format="YYYY-MM" @@ -458,6 +461,9 @@ export const MonthRangePicker = (props) => { { + if (isOneYear) { + return current && startDate && ((current.getTime() < new Date(startDate).getTime()) || (current.getTime() > new Date(moment(startDate).add(12, "months").format("YYYY-MM")).getTime())); + } return current && startDate && current.getTime() < new Date(startDate).getTime(); }} format="YYYY-MM" @@ -510,4 +516,4 @@ export const getSalaryMonthValue = (dateType) => { break; } return [start, end]; -}; +}; \ No newline at end of file