From ee712a50562ddf87a90acf03ca97da0db56366db 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, 28 Feb 2023 09:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E6=97=A5=E6=9C=9F=E6=8E=A7=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../archives/accumulationFundForm.js | 6 ++++++ .../socialSecurityBenefits/archives/otherForm.js | 6 ++++++ .../archives/socialSecurityForm.js | 13 +++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) 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} + /> ); };