diff --git a/src/components/01_branch-management/FormBranchInformation.vue b/src/components/01_branch-management/FormBranchInformation.vue index 5eb6a751..3834de95 100644 --- a/src/components/01_branch-management/FormBranchInformation.vue +++ b/src/components/01_branch-management/FormBranchInformation.vue @@ -126,8 +126,12 @@ function formatCode(input: string | undefined, type: 'code' | 'number') { : $t('branch.form.branchName') " v-model="name" - :rules="[(val) => val && val.length > 0]" - :error-message="$t('form.error.required')" + :rules="[ + (val) => !!val || $t('form.error.required'), + (val) => + /^[A-Za-z0-9ก-๙\s&.,'-]+$/.test(val) || + $t('form.error.branchNameField'), + ]" for="input-name" /> diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 847dbc35..72a29a99 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -291,6 +291,9 @@ export default { letterAndNumOnly: 'Only _ letters and number are allowed', numOnly: 'Only number are allowed', requireLength: 'Please enter {msg} character', + branchNameField: "Only letters, numbers, or the characters . , - ' &.", + branchNameENField: + "Only English letters, numbers, or the characters . , - ' &.", }, warning: { title: 'Warning {msg}', diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index 0f58ef54..23cb4128 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -290,6 +290,9 @@ export default { letterAndNumOnly: 'โปรดใช้เฉพาะ _ ตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น', numOnly: 'โปรดใช้เฉพาะตัวเลขเท่านั้น', requireLength: 'กรุณากรอกให้ครบ {msg} หลัก', + branchNameField: "โปรดใช้ตัวอักษร ตัวเลข หรือ . , - ' & เท่านั้น", + branchNameENField: + "โปรดใช้ตัวอักษรภาษาอังกฤษ ตัวเลข หรือ . , - ' & เท่านั้น", }, warning: { title: 'แจ้งเตือน {msg}', @@ -865,7 +868,7 @@ export default { work: { Pending: 'รอสั่งงาน', Ready: 'พร้อมสั่งงาน', - Waiting: 'สั่งงานเเล้วรอดำเนินการ', + Waiting: 'สั่งFเล้วรอดำเนินการ', InProgress: 'กำลังดำเนินการ', Validate: 'รอตรวจสอบ', Ended: 'เสร็จสิ้น',