refactor: hq abbrev rule

This commit is contained in:
puriphatt 2024-09-04 14:44:41 +07:00
parent bcc27580b9
commit b617acfc38

View file

@ -55,9 +55,12 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
for="input-abbreviation"
:model-value="view ? formatCode(abbreviation, 'code') : abbreviation"
:rules="[
(val) => (val && val.length > 0) || $t('form.error.required'),
(val) =>
(val && val.length > 0 && /^[a-zA-Z]+$/.test(val)) ||
$t('form.error.invalid'),
$t('form.error.invalidCustomeMessage', {
msg: $t('form.error.letterOnly'),
}),
]"
@update:model-value="(v) => (abbreviation = v as string)"
/>
@ -86,7 +89,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
<!-- view ? `${formatCode(code, 'number')}${branchCount}` : code -->
<!-- <q-input
v-if="typeBranch !== 'headOffice'"
:dense="dense"
outlined