fix: notify
This commit is contained in:
parent
8e56123e12
commit
163ff5ec12
2 changed files with 20 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ const {
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
convertDateToAPI,
|
convertDateToAPI,
|
||||||
|
notifyWarring,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const checkRoutePermisson = ref<boolean>(
|
const checkRoutePermisson = ref<boolean>(
|
||||||
|
|
@ -376,7 +377,11 @@ async function checkSave() {
|
||||||
myForm.value.validate().then(async (success) => {
|
myForm.value.validate().then(async (success) => {
|
||||||
if (success) {
|
if (success) {
|
||||||
if (edit.value) {
|
if (edit.value) {
|
||||||
await editData(id.value);
|
if (rowsPosition.value.length == 0) {
|
||||||
|
notifyWarring($q, "กรุณาเพิ่มตำแหน่ง");
|
||||||
|
} else {
|
||||||
|
await editData(id.value);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await addData();
|
await addData();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 = "") => {
|
const messageError = (q: any, e: any = "", msg: string = "") => {
|
||||||
if (e.response !== undefined) {
|
if (e.response !== undefined) {
|
||||||
|
|
@ -1523,5 +1536,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
findOrgNameOldHtml,
|
findOrgNameOldHtml,
|
||||||
findOrgChildNameHtml,
|
findOrgChildNameHtml,
|
||||||
findChildNameHtml,
|
findChildNameHtml,
|
||||||
|
notifyWarring
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue