有效期页面的生效失效时间判断修改
This commit is contained in:
parent
4950c8d8fe
commit
99b5327280
@ -229,11 +229,29 @@ class _ElectronicKeyPeriodValidityPageState
|
|||||||
if ((state.selectIndexList.value.isNotEmpty &&
|
if ((state.selectIndexList.value.isNotEmpty &&
|
||||||
state.isHaveEffectiveDate.value == true &&
|
state.isHaveEffectiveDate.value == true &&
|
||||||
state.isHaveFailureDate.value == true)) {
|
state.isHaveFailureDate.value == true)) {
|
||||||
Map<String, dynamic> resultMap = {};
|
DateTime startDateTime = DateTime(
|
||||||
resultMap['validityValue'] = state.selectIndexList.value;
|
state.effectiveDateTime.value.year,
|
||||||
resultMap['starDate'] = state.effectiveDateTime.value;
|
state.effectiveDateTime.value.month,
|
||||||
resultMap['endDate'] = state.failureDateTime.value;
|
state.effectiveDateTime.value.day,
|
||||||
Navigator.pop(context, resultMap);
|
state.effectiveDateTime.value.hour,
|
||||||
|
state.effectiveDateTime.value.minute);
|
||||||
|
DateTime endDateTime = DateTime(
|
||||||
|
state.failureDateTime.value.year,
|
||||||
|
state.failureDateTime.value.month,
|
||||||
|
state.failureDateTime.value.day,
|
||||||
|
state.failureDateTime.value.hour,
|
||||||
|
state.failureDateTime.value.minute);
|
||||||
|
//时间判断
|
||||||
|
if (!startDateTime.isBefore(endDateTime) ||
|
||||||
|
startDateTime.isAtSameMomentAs(endDateTime)) {
|
||||||
|
Toast.show(msg: '失效时间需大于生效时间');
|
||||||
|
} else {
|
||||||
|
Map<String, dynamic> resultMap = {};
|
||||||
|
resultMap['validityValue'] = state.selectIndexList.value;
|
||||||
|
resultMap['starDate'] = state.effectiveDateTime.value;
|
||||||
|
resultMap['endDate'] = state.failureDateTime.value;
|
||||||
|
Navigator.pop(context, resultMap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user