diff --git a/src/modules/02_users/views/permissionsView.vue b/src/modules/02_users/views/permissionsView.vue index c48c9bc9..be8355c5 100644 --- a/src/modules/02_users/views/permissionsView.vue +++ b/src/modules/02_users/views/permissionsView.vue @@ -23,7 +23,8 @@ import { useCounterMixin } from "@/stores/mixin"; const $q = useQuasar(); const store = usePermissionsStore(); -const { showLoader, hideLoader, messageError } = useCounterMixin(); +const { showLoader, hideLoader, messageError, success, dialogRemove } = + useCounterMixin(); /** Tree*/ const filter = ref(""); @@ -103,11 +104,11 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "role", + name: "authRoleName", align: "left", label: "สิทธิ์", sortable: false, - field: "role", + field: "authRoleName", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -208,9 +209,8 @@ const pagination = ref({ const modalDialogAdd = ref(false); /** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/ -async function fetchOrganizationActive() { - showLoader(); - await http +function fetchOrganizationActive() { + http .get(config.API.activeOrganization) .then((res) => { const data = res.data.result; @@ -227,9 +227,6 @@ async function fetchOrganizationActive() { }) .catch((err) => { messageError($q, err); - }) - .finally(() => { - hideLoader(); }); } @@ -314,6 +311,32 @@ function onClickAddRole(data: PosMaster) { dataPosMaster.value = data; } +function onDeleteRole(id: string) { + dialogRemove( + $q, + () => { + showLoader(); + http + .post(config.API.managementPermission, { + authRoleId: "", + posMasterId: id, + }) + .then(() => { + fetchDataTable(reqMaster.id, reqMaster.revisionId, reqMaster.type); + success($q, "ลบข้อมูลสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); + }, + "ยืนยันการลบสิทธิ์", + "ต้องการยืนยันการลบสิทธิ์นี้หรือไม่ ?" + ); +} + /** callblck function ทำการ fetch ข้อมูล tree เมื่อมีการเปลี่ยน Tab ปัจจับัน,แบบร่าง*/ watch( () => store.typeOrganizational, @@ -575,6 +598,24 @@ onMounted(() => { + + + +
+ +
ลบสิทธิ์
+
+
+
+