no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-29 17:09:25 +07:00
parent a19a0634d4
commit 9dc56a34e8

View file

@ -14,7 +14,7 @@ import { useQuasar } from "quasar";
const $q = useQuasar(); // noti quasar
const mixin = useCounterMixin();
const { messageError, success, showLoader, hideLoader } = mixin;
const { messageError, success, showLoader, hideLoader, dialogConfirm } = mixin;
const modal = ref<boolean>(false);
const pagination = ref({
@ -164,43 +164,7 @@ const columns2 = ref<QTableProps["columns"]>([
]);
// ()
const rows2 = ref<FormMainProbation2[]>([
// {
// no: "1",
// name: " ",
// position: "",
// level: "",
// institution: " ",
// },
// {
// no: "2",
// name: " ",
// position: "",
// level: "",
// institution: " ",
// },
// {
// no: "3",
// name: " ",
// position: "",
// level: "",
// institution: "",
// },
// {
// no: "4",
// name: " ",
// position: "",
// level: "",
// institution: "",
// },
// {
// no: "5",
// name: " ",
// position: "",
// level: "",
// institution: "",
// },
]);
const rows2 = ref<FormMainProbation2[]>([]);
onMounted(async () => {
getpersonalList();
@ -291,24 +255,18 @@ const clickDelete = (id: string) => {
};
const clickAdd = (id: string) => {
$q.dialog({
title: "ยืนยันการเพิ่มข้อมูล",
message: "ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {
dialogConfirm(
$q,
async () => {
showLoader();
const postData = {
personal_id: id,
};
await http
.post(config.API.personalAdd(), postData)
.then((res) => {
.then(() => {
getpersonalList();
success($q, "เพิ่มข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
@ -317,9 +275,24 @@ const clickAdd = (id: string) => {
clickClose();
hideLoader();
});
})
.onCancel(() => {})
.onDismiss(() => {});
},
"ยันยันการเพิ่มข้อมูล",
"ต้องการเพิ่มข้อมูลนี้หรือไม่ ?"
);
// $q.dialog({
// title: "",
// message: "?",
// cancel: {
// flat: true,
// color: "negative",
// },
// persistent: true,
// })
// .onOk(async () => {
// })
// .onCancel(() => {})
// .onDismiss(() => {});
};
const clickClose = async () => {