refactor: handle expire date
This commit is contained in:
parent
43ec668dce
commit
71b5123f25
1 changed files with 16 additions and 1 deletions
|
|
@ -424,7 +424,6 @@ watch(
|
||||||
:id="`${prefixId}-input-citizen-issue`"
|
:id="`${prefixId}-input-citizen-issue`"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:label="$t('personnel.form.citizenIssue')"
|
:label="$t('personnel.form.citizenIssue')"
|
||||||
:disabled-dates="disabledAfterToday"
|
|
||||||
:rules="[
|
:rules="[
|
||||||
(val: string) =>
|
(val: string) =>
|
||||||
!!val ||
|
!!val ||
|
||||||
|
|
@ -432,6 +431,17 @@ watch(
|
||||||
field: $t('personnel.form.citizenIssue'),
|
field: $t('personnel.form.citizenIssue'),
|
||||||
}),
|
}),
|
||||||
]"
|
]"
|
||||||
|
@update:model-value="
|
||||||
|
(v) => {
|
||||||
|
if (!v) return;
|
||||||
|
if (!citizenExpire) return;
|
||||||
|
if (new Date(v).getTime() >= new Date(citizenExpire).getTime()) {
|
||||||
|
const newValue = new Date(v);
|
||||||
|
newValue.setDate(newValue.getDate() + 1);
|
||||||
|
citizenExpire = newValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DatePicker
|
<DatePicker
|
||||||
|
|
@ -441,6 +451,11 @@ watch(
|
||||||
:id="`${prefixId}-input-citizen-expire`"
|
:id="`${prefixId}-input-citizen-expire`"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:label="$t('personnel.form.citizenExpire')"
|
:label="$t('personnel.form.citizenExpire')"
|
||||||
|
:disabled-dates="
|
||||||
|
(date: Date) =>
|
||||||
|
date.getTime() <
|
||||||
|
((citizenIssue && new Date(citizenIssue).getTime()) || Date.now())
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-select
|
<q-select
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue