fix: validate hq abbreviation

This commit is contained in:
puriphatt 2024-08-08 08:07:55 +00:00
parent 637c503303
commit c241d70c3c
3 changed files with 9 additions and 0 deletions

View file

@ -58,6 +58,11 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
:label="$t('formDialogHqAbbreviation')"
for="input-abbreviation"
:model-value="view ? formatCode(abbreviation, 'code') : abbreviation"
:rules="[
(val) =>
(val && val.length > 0 && /[a-zA-Z]+/.test(val)) ||
$t('formDialogInputHqAbbreviation'),
]"
@update:model-value="(v) => (abbreviation = v as string)"
/>
<q-input