|
@@ -185,8 +185,8 @@ function checkValidForm() {
|
|
|
const date = $('#add-qi input[name="date"]').val();
|
|
|
const period = $('#add-qi input[name="period"]').val();
|
|
|
const startDate = period.split('~')[0];
|
|
|
- const endDate = period.split('~')[1];
|
|
|
- if (startDate.indexOf(date) === -1 && endDate.indexOf(date) === -1) {
|
|
|
+ const endDate = period.split('~')[1] ? period.split('~')[1] : null;
|
|
|
+ if ((startDate.indexOf(date) === -1 && !endDate) || (startDate.indexOf(date) === -1 && endDate && endDate.indexOf(date) === -1)) {
|
|
|
toastr.error('所选日期与当前月份不匹配,请重新选择');
|
|
|
$('#add-qi input[name="period"]').parents('.form-group').find('.text-danger').remove();
|
|
|
$('#add-qi input[name="period"]').parents('.form-group').append('<small class="text-danger">所选日期与当前月份不匹配,请重新选择</small>');
|