diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js index 57fbfa87..ccd3ddc5 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js @@ -111,6 +111,9 @@ export default class AccumulationFundForm extends React.Component { label: "公积金起始缴纳月", viewAttr: fundSchemeId ? 3 : 2, value: fundStartTime, + disabledDate: (current) => { + return current && fundEndTime && current.getTime() > new Date(fundEndTime).getTime(); + }, onChange: this.handleFormChange }) }, @@ -127,6 +130,9 @@ export default class AccumulationFundForm extends React.Component { key: "fundEndTime", label: "公积金最后缴纳月", value: fundEndTime, + disabledDate: (current) => { + return current && fundStartTime && current.getTime() < new Date(fundStartTime).getTime(); + }, onChange: this.handleFormChange }) }, diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js index 7944b3f7..f489835e 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js @@ -107,6 +107,9 @@ export default class OtherForm extends React.Component { label: "其他福利起始缴纳月", viewAttr: otherSchemeId ? 3 : 2, value: otherStartTime, + disabledDate: (current) => { + return current && otherEndTime && current.getTime() > new Date(otherEndTime).getTime(); + }, onChange: this.handleFormChange }) }, @@ -115,6 +118,9 @@ export default class OtherForm extends React.Component { key: "otherEndTime", label: "其他福利最后缴纳月", value: otherEndTime, + disabledDate: (current) => { + return current && otherStartTime && current.getTime() < new Date(otherStartTime).getTime(); + }, onChange: this.handleFormChange }) } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js index a378f168..8cc679c8 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js @@ -109,6 +109,9 @@ export default class SocialSecurityForm extends React.Component { label: "社保起始缴纳月", viewAttr: socialSchemeId ? 3 : 2, value: socialStartTime, + disabledDate: (current) => { + return current && socialEndTime && current.getTime() > new Date(socialEndTime).getTime(); + }, onChange: this.handleFormChange }) }, @@ -125,6 +128,9 @@ export default class SocialSecurityForm extends React.Component { key: "socialEndTime", label: "社保最后缴纳月", value: socialEndTime, + disabledDate: (current) => { + return current && socialStartTime && current.getTime() < new Date(socialStartTime).getTime(); + }, onChange: this.handleFormChange }) } @@ -213,12 +219,15 @@ export const SocialDatePicker = (props) => { format = "YYYY-MM", viewAttr = 2, labelColSpan = 12, - wrapperColSpan = 12 + wrapperColSpan = 12, + disabledDate = false } = props; return ( onChange({ key, value: val })}/> + onChange={(val) => onChange({ key, value: val })} + disabledDate={disabledDate} + /> ); };