รอบการปฏิบัติงาน สิทธิ์
This commit is contained in:
parent
8d4db06c5a
commit
632ec8d5af
2 changed files with 64 additions and 23 deletions
|
|
@ -10,6 +10,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
/** ImportComponents*/
|
||||
import DialogForm from "@/modules/09_leave/components/3_WorkTime/DialogForm.vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const dataStore = useRoundDataStore();
|
||||
|
|
@ -20,6 +21,7 @@ const $q = useQuasar(); //ใช้ noti quasar
|
|||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const isRead = ref<boolean>(false);
|
||||
const detailData = ref<any>();
|
||||
const editCheck = ref<string>("");
|
||||
|
||||
|
|
@ -83,6 +85,20 @@ function openModal(data: any, check: string) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param data ข้อมูลรอบการปฏิบัติงาน
|
||||
* @param check action แก้ไข,เพิ่ม
|
||||
*/
|
||||
function openModalDetail(data: any, check: string) {
|
||||
modal.value = true;
|
||||
editCheck.value = check;
|
||||
if (check === "edit") {
|
||||
isRead.value = true;
|
||||
detailData.value = data;
|
||||
}
|
||||
}
|
||||
|
||||
/** Function ปิด popup รายละเอียดและการเพิ่ม*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
|
|
@ -109,9 +125,10 @@ onMounted(() => {
|
|||
<div class="row col-12 q-col-gutter-sm q-mb-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
for="#addInvestigatefacts"
|
||||
@click="openModal(null, 'add')"
|
||||
size="12px"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
|
|
@ -179,7 +196,6 @@ onMounted(() => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width></q-th>
|
||||
<q-th auto-width></q-th>
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -192,18 +208,42 @@ onMounted(() => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="info"
|
||||
icon="mdi-eye"
|
||||
@click.prevent="openModalDetail(props.row, 'edit')"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="edit"
|
||||
icon="edit"
|
||||
@click.prevent="openModal(props.row, 'edit')"
|
||||
><q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
icon="delete"
|
||||
@click="onClickDelete(props.row.id)"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
><q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-icon
|
||||
v-if="props.row.isDefault === true"
|
||||
name="mdi-bookmark"
|
||||
|
|
@ -213,12 +253,7 @@ onMounted(() => {
|
|||
<q-tooltip>เวลา Default</q-tooltip>
|
||||
</q-icon>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click.prevent="openModal(props.row, 'edit')"
|
||||
>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name === 'isActive'" class="text-center">
|
||||
<q-icon
|
||||
v-if="props.row.isActive === true"
|
||||
|
|
@ -248,6 +283,7 @@ onMounted(() => {
|
|||
:editCheck="editCheck"
|
||||
:detailData="detailData"
|
||||
:fetchData="fetchListRoind"
|
||||
v-model:isRead="isRead"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue