เพิ่มเเจ้งเตือน

This commit is contained in:
setthawutttty 2025-03-26 16:33:53 +07:00
parent 3d16eeedce
commit 469d51542a

View file

@ -17,8 +17,14 @@ import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar();
const store = useDataStoreUser();
const { showLoader, hideLoader, messageError, success, dialogConfirm } =
useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
success,
dialogConfirm,
dialogMessageNotify,
} = useCounterMixin();
const modal = defineModel<boolean>("modal", { required: true });
const orgId = defineModel<string>("orgId", { required: true });
@ -120,33 +126,37 @@ async function onSearchListPerson(newPage: boolean = false) {
*/
function onSubmitPerson() {
const arrayId = selected.value.map((e: DataProfile) => e.id);
dialogConfirm(
$q,
async () => {
showLoader();
const body = {
nodeId: orgId.value,
isEdit: isEdit.value,
isCheck: isCheck.value,
personId: arrayId,
};
await http
.post(config.API.permissioProfileOrg, body)
.then(async () => {
await props.fetchData?.(false);
success($q, "เพิ่มราชชื่อสำเร็จ");
onClose();
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการเพิ่มรายชื่อ",
"ต้องการยืนยันการเพิ่มรายชื่อนี้หรือไม่ ?"
);
if (isEdit.value == false && isCheck.value == false) {
dialogMessageNotify($q, "กรุณาเลือกสิทธิ์อย่างน้อย 1 สิทธิ์");
} else {
dialogConfirm(
$q,
async () => {
showLoader();
const body = {
nodeId: orgId.value,
isEdit: isEdit.value,
isCheck: isCheck.value,
personId: arrayId,
};
await http
.post(config.API.permissioProfileOrg, body)
.then(async () => {
await props.fetchData?.(false);
success($q, "เพิ่มราชชื่อสำเร็จ");
onClose();
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการเพิ่มรายชื่อ",
"ต้องการยืนยันการเพิ่มรายชื่อนี้หรือไม่ ?"
);
}
}
/**