เครื่องราชฯ => permission

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-20 16:48:21 +07:00
parent 46e7fa3088
commit bcf7414298
5 changed files with 137 additions and 226 deletions

View file

@ -3,6 +3,7 @@ import { ref, onMounted, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermission } from "@/utils/permissions";
/** impotrType */
import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main";
@ -45,7 +46,6 @@ const visibleColumns = ref<String[]>([
"returnOrganization",
"returnDate",
"returnReason",
]);
const columns = ref<QTableProps["columns"]>([
{
@ -235,7 +235,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const filterRef = ref<QInput>();
const filter = ref<string>("");
@ -263,7 +262,7 @@ const employeeClassOps = ref<any>(DataStore.employeeClassOps);
/** function เรียกรอบการเสนอขอพระราชทานเครื่องราชฯ*/
async function fecthRound() {
// showLoader();
showLoader();
await http
.get(config.API.noteround())
.then(async (res) => {
@ -295,15 +294,15 @@ async function fecthRound() {
roundYear.value = data[0].year;
if (roundYear.value) {
await fecthInsigniaType();
} else {
hideLoader();
}
}
})
.catch((err) => {
messageError($q, err);
})
// .finally(() => {
// hideLoader();
// });
hideLoader();
});
}
/** function เรียกประเภทเครื่องราชฯ*/
@ -430,16 +429,6 @@ function filterSelector(val: any, update: Function, name: any) {
});
}
// const clearInsigniaFilters = (name: string) => {
// if (name === "employeeClassOps") {
// DataStore.employeeClass = "all";
// employeeClassOps.value = DataStore.employeeClassOps;
// } else if (name === "fileterInsigniaList") {
// DataStore.insignia = "";
// fileterInsigniaList.value = insigniaList.value;
// }
// };
/** Hook*/
onMounted(async () => {
await fecthRound();
@ -585,13 +574,6 @@ watch(tab, async () => {
)"
>
<template v-if="DataStore.insignia !== ''" v-slot:append>
<!-- <q-icon name="cancel" @click.stop.prevent="
clearInsigniaFilters('fileterInsigniaList'),
DataStore.searchDatatable(
DataStore.insignia,
DataStore.employeeClass
)
" class="cursor-pointer" /> -->
</template>
<template v-slot:no-option>
<q-item>
@ -633,13 +615,6 @@ watch(tab, async () => {
v-if="DataStore.employeeClass !== 'all'"
v-slot:append
>
<!-- <q-icon name="cancel" @click.stop.prevent="
clearInsigniaFilters('employeeClassOps'),
DataStore.searchDatatable(
DataStore.insignia,
DataStore.employeeClass
)
" class="cursor-pointer" /> -->
</template>
<template v-slot:no-option>
<q-item>
@ -652,8 +627,8 @@ watch(tab, async () => {
<div>
<q-btn
v-if="checkPermission($route)?.attrIsCreate"
@click="addData()"
size="12px"
flat
round
color="add"
@ -689,6 +664,7 @@ watch(tab, async () => {
>
<q-td>
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
label="คืนเครื่องราชฯ"
@click="editData(props.row.id)"
color="blue"
@ -711,19 +687,6 @@ watch(tab, async () => {
</div>
</q-tab-panel>
</q-tab-panels>
<DialogForm
:modal="modal"
:close="close"
:close-and-fecth="closeAndFecth"
:type="type"
:round-id="selectRound == '0' ? 'all' : selectRound"
:action="action"
:profile-id="profileId"
v-model:selectRoundOption="selectRoundOption"
v-model:filterSelectRoundOption="filterSelectRoundOption"
:type-id="tab"
/>
</q-card>
<q-card v-else>
<div class="q-pa-md q-gutter-sm">
@ -732,6 +695,19 @@ watch(tab, async () => {
</q-banner>
</div>
</q-card>
<DialogForm
:modal="modal"
:close="close"
:close-and-fecth="closeAndFecth"
:type="type"
:round-id="selectRound == '0' ? 'all' : selectRound"
:action="action"
:profile-id="profileId"
v-model:selectRoundOption="selectRoundOption"
v-model:filterSelectRoundOption="filterSelectRoundOption"
:type-id="tab"
/>
</template>
<style lang="scss" scoped>
.arrow {