diff --git a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue index 475b965e4..27acd5c6b 100644 --- a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue @@ -41,6 +41,7 @@ const { showLoader, hideLoader, convertDateToAPI, + notifyWarring, } = mixin; const checkRoutePermisson = ref( @@ -376,7 +377,11 @@ async function checkSave() { myForm.value.validate().then(async (success) => { if (success) { if (edit.value) { - await editData(id.value); + if (rowsPosition.value.length == 0) { + notifyWarring($q, "กรุณาเพิ่มตำแหน่ง"); + } else { + await editData(id.value); + } } else { await addData(); } diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index bee63cd7a..3284fd227 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -345,6 +345,19 @@ export const useCounterMixin = defineStore("mixin", () => { }); } } + function notifyWarring(q: any, val: string) { + if (val !== "") { + q.notify({ + color: "warning", + message: val, + icon: "mdi-alert-circle", + position: "top", + multiLine: true, + timeout: 12000, + actions: [{ label: "ปิด", color: "white", handler: () => {} }], + }); + } + } const messageError = (q: any, e: any = "", msg: string = "") => { if (e.response !== undefined) { @@ -1523,5 +1536,6 @@ export const useCounterMixin = defineStore("mixin", () => { findOrgNameOldHtml, findOrgChildNameHtml, findChildNameHtml, + notifyWarring }; });