在这种情况下,如果我单击休闲单选按钮,则请假总天数显示为3天。这里的问题是我们最多可以休2天。请问如何安排条件?如果总休假天数超过2天,则显示回电按摩“您一次只能请求2个以上的休闲假”。我该怎么办?
这是我的单选按钮代码:
<RadioGroup onChange={this.onChange} value={this.state.leavevalue}>
<Radio value={1} >Casual</Radio>
<Radio value={2} >Medical</Radio>
<Radio value={3} >Annual</Radio>
<Radio value={4}>Lieu</Radio>
<Radio value={5}>Special</Radio>
<Radio value={6} >Maternity</Radio>
<Radio value={7} >Paternity</Radio>
<Radio value={8}>NoPay</Radio>
</RadioGroup>
此代码用于开始日期选择器:
<DatePicker disabledDate={this.disableThreeDate} placeholder="Start Date" onChange={this.changeStart} dateRender={this.dateStyle} allowClear={false} />
此代码用于结束日期选择器:
<DatePicker disabledDate={this.disabledDate} placeholder="End Date" onChange={this.changeEnd} dateRender={this.dateStyle} allowClear={false} />
此代码用于请假天数:
<FormItem {...formItemLayout} label="Number of Leave Days">
{getFieldDecorator('numberOfDays', {
rules: [{ required: true, message: 'Please provide your leave period in days!' }, { validator: this.tackenLeaves }],
})(
<Input prefix={<Icon type="schedule" style={{ fontSize: 13 }} />} placeholder="Leave Days" value={this.state.noOfDays} style={{ width: 120 }} onKeyUp={this.daysChange} readOnly />
)}
</FormItem>