start commit for admin system

This commit is contained in:
Warunee Tamkoo 2024-05-29 17:58:57 +07:00
commit badb676529
300 changed files with 58634 additions and 0 deletions

View file

@ -0,0 +1,315 @@
<script setup lang="ts">
import { ref, onMounted, reactive, watch } from "vue";
import { useRouter } from "vue-router";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
import type {
DataOption,
NewPagination,
DataAssignment,
} from "@/modules/01_metadata/interface/index/Main";
import type { FormFilterAssignment } from "@/modules/01_metadata/interface/request/Main";
import type { ResAssignment } from "@/modules/01_metadata/interface/response/Main";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const router = useRouter();
const { showLoader, hideLoader, dialogRemove, success, messageError } =
useCounterMixin();
/** table*/
const columns = ref<QTableProps["columns"]>([
{
name: "including",
align: "left",
label: "รหัสตัวชี้วัด",
sortable: true,
field: "including",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "includingName",
align: "left",
label: "ชื่อตัวชี้วัด",
sortable: true,
field: "includingName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>(["including", "includingName"]);
/** Option รอบการประเมิน*/
const roundOp = ref<DataOption[]>([
{ id: "APR", name: "รอบเมษายน" },
{ id: "OCT", name: "รอบตุลาคม" },
]);
const rows = ref<DataAssignment[]>([]);
const formFilter = reactive<FormFilterAssignment>({
keyword: "",
period: "",
year: new Date().getFullYear(),
pageSize: 10,
page: 1,
});
const totalList = ref<number>(0); //
const maxPage = ref<number>(1);
function fetchList() {
showLoader();
formFilter.year = formFilter.year ? formFilter.year.toString() : null;
http
.post(config.API.kpiSpecial + `/search`, formFilter)
.then((res: ResAssignment) => {
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
totalList.value = res.data.result.total;
rows.value = res.data.result.data;
})
.catch((err) => {
messageError($q, err);
rows.value = [];
})
.finally(() => {
hideLoader();
});
}
function onClickView(id: string = "") {
router.push(`/assignment/${id}`);
}
function onClickDelete(id: string) {
dialogRemove($q, () => {
showLoader();
http
.delete(config.API.kpiSpecial + `/${id}`)
.then(() => {
fetchList();
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
}
function fetchNewList() {
formFilter.page = 1;
fetchList();
}
function updatePageSize(newPagination: NewPagination) {
formFilter.page = 1;
formFilter.pageSize = newPagination.rowsPerPage;
}
watch(
() => formFilter.pageSize,
() => {
fetchList();
}
);
onMounted(() => {
fetchList();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการงานทไดบมอบหมาย
</div>
<q-card flat bordered class="q-pa-md">
<div class="row q-col-gutter-sm q-pl-sm">
<q-toolbar style="padding: 0">
<div class="row q-gutter-sm">
<datepicker
style="width: 150px"
menu-class-name="modalfix"
v-model="formFilter.year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
@update:model-value="(formFilter.period = ''), fetchNewList()"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
:model-value="
formFilter.year === null
? 'ทั้งหมด'
: Number(formFilter.year) + 543
"
:label="`${'ปีงบประมาณ'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
<template v-if="formFilter.year" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(formFilter.year = null), fetchNewList()
"
class="cursor-pointer"
/>
</template>
</q-input>
</template>
</datepicker>
<q-select
dense
outlined
v-model="formFilter.period"
:model-value="
formFilter.period === '' ? 'ทั้งหมด' : formFilter.period
"
:options="roundOp"
label="รอบการประเมิน"
option-label="name"
option-value="id"
emit-value
map-options
@update:model-value="fetchNewList"
style="width: 160px"
>
<template v-if="formFilter.period" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="(formFilter.period = ''), fetchNewList()"
class="cursor-pointer"
/>
</template>
</q-select>
</div>
<q-space />
<div class="row q-gutter-sm">
<q-input
dense
outlined
v-model="formFilter.keyword"
label="ค้นหา"
@keydown.enter="fetchNewList"
>
<template v-slot:append>
<q-icon
v-if="formFilter.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="(formFilter.keyword = ''), fetchNewList()"
/>
<q-icon v-else name="search" color="grey-5" />
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
</div>
</q-toolbar>
</div>
<div class="col-12">
<d-table
for="table"
ref="table"
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
dense
class="custom-header-table"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
@update:pagination="updatePageSize"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
flat
round
color="primary"
size="14px"
icon="mdi-eye"
@click.pervent="onClickView(props.row.id)"
>
<q-tooltip>อม</q-tooltip>
</q-btn>
<q-btn
flat
round
color="red"
size="14px"
icon="mdi-delete "
@click.pervent="onClickDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ totalList }} รายการ
<q-pagination
v-model="formFilter.page"
active-color="primary"
color="dark"
:max="maxPage"
:max-pages="5"
size="sm"
boundary-links
direction-links
@update:model-value="fetchList"
></q-pagination>
</template>
</d-table>
</div>
</q-card>
</template>
<style scoped></style>

View file

@ -0,0 +1,375 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import type { ItemsMenu } from "@/modules/01_metadata/interface/index/Main";
import type { DataStrategic } from "@/modules/01_metadata/interface/response/Strategic";
import DialogHeader from "@/components/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const {
showLoader,
hideLoader,
dialogConfirm,
dialogRemove,
messageError,
success,
} = useCounterMixin();
const ListMenu = ref<ItemsMenu[]>([
{
label: "เพิ่ม",
icon: "add",
value: "ADD",
color: "primary",
},
{
label: "แก้ไข",
icon: "edit",
value: "EDIT",
color: "edit",
},
{
label: "ลบ",
icon: "delete",
value: "DEL",
color: "red",
},
]);
const nodes = ref<any[]>([]);
const filter = ref<string>("");
const expanded = ref<Array<string>>([]);
const nodeId = ref<string>("");
const modalDialog = ref<boolean>(false);
const isStatusEdit = ref<boolean>(false);
const strategicName = ref<string>("");
const levelnode = ref<number>(0);
const titleDialog = ref<string>("");
/** ดึงข้อมูล ในรูปแบบ tree */
function fetchDataTree() {
showLoader();
http
.get(config.API.devStrategy)
.then((res) => {
const data: DataStrategic[] = res.data.result;
nodes.value = data;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
/**
* เพ ลบ แกไข
* @param type ประเภท node
* @param data อม
*/
function onClickAction(type: string, data: DataStrategic | null = null) {
switch (type) {
case "ADD":
onClickOpenDialog(false, data);
break;
case "EDIT":
onClickOpenDialog(true, data);
break;
case "DEL":
data && onDelete(data);
break;
default:
break;
}
}
/**
* เป dialog
* @param status true/false
* @param data อมลยทธศาสตร
*/
function onClickOpenDialog(
status: boolean = false,
data: DataStrategic | null = null
) {
isStatusEdit.value = status;
if (status) {
if (data) {
nodeId.value = data.id;
strategicName.value = data.name;
levelnode.value = data.level;
titleDialog.value =
data.level === 1
? "ยุทธศาสตร์/แผน"
: data.level === 2
? "ยุทธศาสตร์ที่"
: data.level === 3
? "ยุทธศาสตร์ย่อย"
: data.level === 4
? "กลยุทธ์ที่/เป้าประสงค์ที่"
: "";
}
} else {
if (data) {
titleDialog.value =
data.level === 1
? "ยุทธศาสตร์ที่"
: data.level === 2
? "ยุทธศาสตร์ย่อย"
: data.level === 3
? "กลยุทธ์ที่/เป้าประสงค์ที่"
: "";
levelnode.value = data.level;
nodeId.value = data.id;
} else {
levelnode.value = 0;
titleDialog.value = "ยุทธศาสตร์/แผน";
}
}
modalDialog.value = true;
}
/** ปิด dialog */
function closeDialog() {
modalDialog.value = false;
strategicName.value = "";
}
/** บันทึกข้อมูล */
function onSubmit() {
dialogConfirm($q, async () => {
const formData = {
idnode: levelnode.value === 0 ? "0" : nodeId.value,
levelnode: levelnode.value,
name: strategicName.value,
};
try {
const method = isStatusEdit.value ? "patch" : "post";
await http[method](config.API.devStrategy, formData);
fetchDataTree();
success($q, "บันทึกข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
closeDialog();
}
});
}
/** ลบข้อมูลตาม id */
function onDelete(data: DataStrategic) {
dialogRemove($q, () => {
showLoader();
const formData = {
idnode: data.id,
levelnode: data.level,
};
http
.delete(config.API.devStrategy, { data: formData })
.then(() => {
fetchDataTree();
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
}
/** ดึงข้อมูลเมื่ออยู่ในหน้า */
onMounted(() => {
fetchDataTree();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">ทธศาสตร</div>
<q-card flat bordered class="q-pa-md">
<div class="row q-col-gutter-sm q-pl-sm">
<q-toolbar class="text-primary">
<q-btn
dense
flat
round
color="primary"
icon="add"
@click.stop="onClickAction('ADD')"
>
<q-tooltip>เพมยทธศาสตร</q-tooltip>
</q-btn>
<q-input dense outlined v-model="filter" label="ค้นหา">
<template v-slot:append>
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template>
</q-input>
</q-toolbar>
</div>
<div class="bg-white tree-container q-pa-xs">
<q-tree
class="q-pa-sm q-gutter-sm"
dense
:nodes="nodes"
node-key="id"
label-key="name"
:filter="filter"
no-results-label="ไม่พบข้อมูลที่ค้นหา"
no-nodes-label="ไม่มีข้อมูล"
v-model:expanded="expanded"
>
<template v-slot:default-header="prop">
<q-item
clickable
@click.stop
:active="nodeId == prop.node.name"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<div>
<div class="text-weight-medium">
{{ prop.node.name }}
</div>
</div>
<q-btn
flat
dense
icon="mdi-dots-vertical"
class="q-ml-xs"
color="grey-13"
size="12px"
round
>
<q-menu>
<q-list
dense
v-for="(item, index) in prop.node.level !== 4
? ListMenu
: ListMenu.slice(1, 4)"
:key="index"
style="min-width: 100px"
>
<q-item
clickable
v-close-popup
@click.stop="onClickAction(item.value, prop.node)"
>
<q-item-section avatar style="min-width: 20px">
<q-icon
size="17px"
:color="item.color"
:name="item.icon"
/>
</q-item-section>
<div v-if="item.value === 'ADD'">
<q-item-section v-if="prop.node.level === 1">
{{ `${item.label}ยุทธศาสตร์ที่ 1` }}
</q-item-section>
<q-item-section v-if="prop.node.level === 2">
{{ `${item.label}ยุทธศาสตร์ย่อย` }}
</q-item-section>
<q-item-section v-if="prop.node.level === 3">
{{ `${item.label}กลยุทธ์ที่/เป้าประสงค์` }}
</q-item-section>
</div>
<div v-else-if="item.value === 'EDIT'">
<q-item-section v-if="prop.node.level === 1">
{{ `${item.label}ยุทธศาสตร์/แผน` }}
</q-item-section>
<q-item-section v-if="prop.node.level === 2">
{{ `${item.label}ยุทธศาสตร์ที่` }}
</q-item-section>
<q-item-section v-if="prop.node.level === 3">
{{ `${item.label}ยุทธศาสตร์ย่อย` }}
</q-item-section>
<q-item-section v-if="prop.node.level === 4">
{{ `${item.label}กลยุทธ์ที่/เป้าประสงค์` }}
</q-item-section>
</div>
<div v-else>
<q-item-section>{{ item.label }}</q-item-section>
</div>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-item>
</template>
</q-tree>
</div>
</q-card>
<q-dialog v-model="modalDialog" persistent>
<q-card style="width: 700px; max-width: 80vw">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader
:tittle="`${
isStatusEdit ? `แก้ไข${titleDialog}` : `เพิ่ม${titleDialog}`
}`"
:close="closeDialog"
/>
<q-separator />
<q-card-section class="q-pt-none">
<div class="row q-pa-md">
<div class="col">
<q-input
dense
outlined
v-model="strategicName"
:label="`ชื่อ${titleDialog}`"
hide-bottom-space
lazy-rules
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกชื่อ'}${titleDialog}`,
]"
/>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
dense
unelevated
label="บันทึก"
id="onSubmit"
type="submit"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>
<style lang="scss" scoped>
.tree-container {
overflow: auto;
height: 75vh;
}
</style>

View file

@ -0,0 +1,108 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import type { DataSumCalendarObject } from "@/modules/01_metadata/interface/index/Calendar";
import calendarComponent from "@/modules/01_metadata/components/calendar/calendarMain.vue";
import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin();
const $q = useQuasar();
const { showLoader, hideLoader, messageError, genColor15 } = mixin;
const listsSumCalendar = ref<DataSumCalendarObject[]>([]);
const year = ref<number>(new Date().getFullYear());
/** function เรียกข้อมูลสรุปวันหยุด */
async function fetchDataSummaryCalendar() {
showLoader();
await http
.get(config.API.summaryHolidayHistoryYear(year.value))
.then((res) => {
let data = res.data.result;
listsSumCalendar.value = [];
data.map((e: DataSumCalendarObject) => {
listsSumCalendar.value.push({
id: e.id,
monthFull: e.monthFull,
count: e.count,
color: genColor15(e.id),
});
});
})
.catch(async (e) => {
// await defaultListsSumCalendar;
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
onMounted(async () => {
await fetchDataSummaryCalendar();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
อมลปฏนวนหย
</div>
<div class="row col-12 q-col-gutter-sm">
<div class="col-3">
<q-card bordered style="height: 100%">
<div class="text-grey-9 items-center q-pa-md">
<div class="row no-wrap items-center">
<div class="text-dark text-weight-medium q-pb-sm q-px-xs">
สรปวนหยดในแตละเดอนประจำป
<span class="text-weight-bold text-primary q-pl-sm">
{{ year + 543 }}</span
>
</div>
<q-space />
</div>
<div class="col-12 row">
<div
class="col-xs-4 col-md-6 row q-pa-xs"
v-for="(list, index) in listsSumCalendar"
:key="index"
>
<q-card bordered class="col-12">
<div
class="col-12 text-subtitle2 row q-px-sm items-center q-px-sm"
>
<span :class="'text-weight-medium text-' + `${list.color}`">{{
list.monthFull
}}</span>
<q-space />
<q-badge
color="white"
:class="
'text-weight-bold text-subtitle1 text-' + `${list.color}`
"
:label="list.count"
rounded
/>
</div>
</q-card>
</div>
</div>
</div>
</q-card>
</div>
<div class="col-9">
<q-card bordered class="q-pa-md">
<calendarComponent
v-model:dateYear="year"
:fetchDataSummaryCalendar="fetchDataSummaryCalendar"
/>
</q-card>
</div>
</div>
</template>
<style scoped></style>

View file

@ -0,0 +1,72 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import ListCompetency from "@/modules/01_metadata/components/competency/01ListCompetency.vue";
import ListLinkPosition from "@/modules/01_metadata/components/competency/02ListLinkPosition.vue";
import ListLinkGroup from "@/modules/01_metadata/components/competency/03ListLinkGroup.vue";
import ListCriteria from "@/modules/01_metadata/components/competency/04ListCriteria.vue";
import ListDetail from "@/modules/01_metadata/components/competency/05ListDetail.vue";
const currentTab = ref<string>("list_competency");
const tabs = ref<Array<any>>([]);
onMounted(() => {
const tab = [
{ label: "รายการสมรรถนะ", value: "list_competency" },
{ label: "กลุ่มงาน", value: "list_linkPosition" },
{ label: "เชื่อมโยงกับกลุ่มงานและตำแหน่ง", value: "list_linkGroup" },
{ label: "เกณฑ์การประเมิน", value: "list_criteria" },
{ label: "การประเมินพฤติกรรมการปฏิบัติราชการ", value: "list_detail" },
];
tabs.value = tab;
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">สมรรถนะ</div>
<q-card flat bordered>
<div class="text-subtitle1 text-grey-9">
<q-tabs
dense
v-model="currentTab"
align="left"
indicator-color="primary"
active-color="primary bg-teal-1"
inline-label
class="text-body2 text-grey-7"
>
<q-tab
v-for="tab in tabs"
:key="tab.value"
v-on:click="currentTab = tab.value"
:label="tab.label"
:name="tab.value"
class="q-py-xs"
/>
</q-tabs>
<q-separator />
<!-- person -->
<q-tab-panels v-model="currentTab" animated>
<q-tab-panel name="list_competency">
<ListCompetency v-if="currentTab == 'list_competency'" />
</q-tab-panel>
<q-tab-panel name="list_linkPosition">
<ListLinkPosition v-if="currentTab == 'list_linkPosition'" />
</q-tab-panel>
<q-tab-panel name="list_linkGroup">
<ListLinkGroup v-if="currentTab == 'list_linkGroup'" />
</q-tab-panel>
<q-tab-panel name="list_criteria">
<ListCriteria v-if="currentTab == 'list_criteria'" />
</q-tab-panel>
<q-tab-panel name="list_detail">
<ListDetail v-if="currentTab == 'list_detail'" />
</q-tab-panel>
</q-tab-panels>
</div>
</q-card>
</template>
<style scoped></style>

View file

@ -0,0 +1,508 @@
<script setup lang="ts">
import { ref, reactive, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import type { DataOption } from "@/modules/01_metadata/interface/index/Main";
import DialogHistory from "@/modules/01_metadata/components/Indicators/DialogHistory.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const dataHistory = ref<any[]>([]);
const modalHistory = ref<boolean>(false);
const isAll = ref<boolean>(false);
const $q = useQuasar();
const router = useRouter();
const { showLoader, hideLoader, dialogRemove, success, messageError } =
useCounterMixin();
/** หัวตาราง */
const rows = ref<any[]>([]);
const columns = ref<QTableProps["columns"]>([
{
name: "including",
align: "left",
label: "ลำดับ/รหัสตัวชี้วัด",
sortable: true,
field: "including",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "includingName",
align: "left",
label: "ชื่อตัวชี้วัด",
sortable: true,
field: "includingName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const node = ref<any>([]);
const expanded = ref<any>([]);
const filterMain = ref<string>("");
const visibleColumns = ref<string[]>(["including", "includingName"]);
const roundOp = ref<DataOption[]>([
{ id: "APR", name: "รอบเมษายน" },
{ id: "OCT", name: "รอบตุลาคม" },
]);
const totalList = ref<number>(1);
const year = ref<number | null>(new Date().getFullYear());
const nodeData = reactive<any>({
page: 1,
pageSize: 10,
round: "",
nodeId: null,
node: null,
keyword: "",
});
function fetchList() {
showLoader();
http
.post(config.API.kpiPlan + `/search`, {
isAll: isAll.value,
keyword: nodeData.keyword,
node: nodeData.node ? nodeData.node : 0,
nodeId: nodeData.nodeId,
period: nodeData.round,
year: year.value?.toString(),
pageSize: nodeData.pageSize,
page: nodeData.page,
})
.then((res) => {
const data = res.data.result.data;
totalList.value = Math.ceil(res.data.result.total / nodeData.pageSize);
rows.value = data;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function onClickAddOrView(status: boolean = false, id: string = "") {
status
? router.push(`/KPI-indicator-plan/${id}`)
: router.push("/KPI-indicator-plan/add");
}
function fetchActive() {
showLoader();
http
.get(config.API.activeOrganization)
.then((res) => {
const data = res.data.result;
fetchTree(data.activeId);
})
.catch((err) => {
messageError($q, err);
hideLoader();
});
}
async function fetchTree(id: string) {
showLoader();
http
.get(config.API.orgByid(id.toString()))
.then((res) => {
const data = res.data.result;
node.value = data;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function updateSelectedTreeMain(data: any) {
if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) {
nodeData.node = null;
nodeData.nodeId = null;
} else {
nodeData.node = data.orgLevel;
nodeData.nodeId = data.orgTreeId;
}
fetchListProjectNew();
}
function fetchListProjectNew() {
nodeData.page = 1;
fetchList();
}
async function deleteData(idData: string) {
dialogRemove($q, () =>
http
.delete(config.API.kpiPlanById(idData))
.then(() => {
fetchList();
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
})
);
}
function clearFilter() {
nodeData.keyword = "";
fetchActive();
fetchListProjectNew();
}
/**
* เป dialog history
* @param id
*/
function onClickHistory(id: string) {
showLoader();
http
.get(config.API.kpiPlan + `/history/${id}`)
.then((res) => {
const data = res.data.result;
dataHistory.value = data;
modalHistory.value = true;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
onMounted(async () => {
await fetchActive();
await fetchList();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการตวชดตามแผนฯ
</div>
<q-card bordered class="col-12 row caedNone">
<div class="col-xs-12 col-sm-3 row">
<div class="col-12 row no-wrap">
<div class="col-12 q-py-sm q-px-sm">
<div class="q-gutter-sm">
<div class="text-subtitle2 text-bold">หนวยงาน/วนราชการ</div>
<q-input dense outlined v-model="filterMain" label="ค้นหา">
<template v-slot:append>
<q-icon
v-if="filterMain !== ''"
name="clear"
class="cursor-pointer"
@click="filterMain = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template>
</q-input>
<q-tree
class="tree-container"
dense
:nodes="node"
node-key="orgTreeName"
label-key="labelName"
v-model:expanded="expanded"
:filter="filterMain"
no-results-label="ไม่พบข้อมูลที่ค้นหา"
no-nodes-label="ไม่มีข้อมูล"
v-model:selected="nodeData.nodeId"
>
<template v-slot:default-header="prop">
<q-item
clickable
@click.stop="updateSelectedTreeMain(prop.node)"
:active="nodeData.nodeId === prop.node.orgTreeId"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<div>
<div class="text-weight-medium">
{{ prop.node.orgTreeName }}
</div>
<div class="text-weight-light text-grey-8">
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
{{
prop.node.orgTreeShortName == null
? null
: prop.node.orgTreeShortName
}}
</div>
</div>
</q-item>
</template>
</q-tree>
</div>
</div>
<div class="col-12 row">
<q-separator :vertical="!$q.screen.lt.md" />
</div>
</div>
</div>
<div class="col-xs-12 col-sm-9 q-pa-md row">
<div class="col-12">
<div class="row q-col-gutter-sm items-center q-mb-sm no-wrap">
<datepicker
menu-class-name="modalfix"
v-model="year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
style="width: 150px"
@update:model-value="fetchListProjectNew"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
:model-value="year === null ? 'ทั้งหมด' : Number(year) + 543"
:label="`${'ปีงบประมาณ'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
<template v-if="year" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(year = null), (nodeData.page = 1), fetchListProjectNew()
"
class="cursor-pointer"
/>
</template>
</q-input>
</template>
</datepicker>
<q-select
dense
outlined
v-model="nodeData.round"
:options="roundOp"
label="รอบการประเมิน"
option-label="name"
option-value="id"
emit-value
map-options
@update:model-value="fetchListProjectNew"
style="min-width: 120px"
>
<template v-if="nodeData.round" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(nodeData.round = ''), fetchListProjectNew()
"
class="cursor-pointer"
/>
</template>
</q-select>
<q-btn
flat
round
dense
icon="add"
color="primary"
@click="onClickAddOrView()"
>
<q-tooltip>เพ</q-tooltip>
</q-btn>
<q-space />
<q-checkbox
keep-color
v-model="isAll"
label="แสดงทั้งหมด"
color="primary"
@update:model-value="fetchListProjectNew"
>
<q-tooltip
>แสดงตำแหนงทงหมดภายใตหนวยงาน/วนราชการทเลอก</q-tooltip
>
</q-checkbox>
<q-input
standout
dense
v-model="nodeData.keyword"
ref="filterRef"
outlined
style="width: 150px"
placeholder="ค้นหา"
@keydown.enter.prevent="fetchListProjectNew"
>
<template v-slot:append>
<q-icon v-if="nodeData.keyword == ''" name="search" />
<q-icon
v-if="nodeData.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="clearFilter"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 120px"
/>
</div>
<div class="col-12">
<d-table
for="table"
ref="table"
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
dense
class="custom-header-table"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
flat
round
color="grey"
@click.stop
size="14px"
icon="more_vert"
>
<q-menu>
<q-list style="min-width: 180px">
<q-item
clickable
v-close-popup
@click="onClickAddOrView(true, props.row.id)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>แกไขขอม</q-tooltip>
<q-icon
color="primary"
size="xs"
name="mdi-pencil-outline"
/>
</q-item-section>
<q-item-section>แกไขขอม</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@click="onClickHistory(props.row.id)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>ประวการแกไข</q-tooltip>
<q-icon color="info" size="xs" name="mdi-history" />
</q-item-section>
<q-item-section>ประวการแกไข</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@click.stop.pervent="deleteData(props.row.id)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>ลบขอม</q-tooltip>
<q-icon color="red" size="xs" name="mdi-delete" />
</q-item-section>
<q-item-section>ลบขอม</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</div>
</q-card>
<DialogHistory v-model:modal="modalHistory" :rows="dataHistory" />
</template>
<style lang="scss" scoped>
.tree-container {
overflow: auto;
height: 73vh;
border: 1px solid #e6e6e7;
border-radius: 10px;
}
.my-list-link {
color: rgb(118, 168, 222);
border-radius: 5px;
background: #a3d3fb48 !important;
font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217);
}
</style>

View file

@ -0,0 +1,526 @@
<script setup lang="ts">
import { ref, reactive, onMounted, watch } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import type { FormListMainByRole } from "@/modules/01_metadata/interface/request/Main";
import type {
DataOption,
NewPagination,
} from "@/modules/01_metadata/interface/index/Main";
import DialogHistory from "@/modules/01_metadata/components/Indicators/DialogHistory.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const dataHistory = ref<any[]>([]);
const modalHistory = ref<boolean>(false);
const total = ref<number>();
const $q = useQuasar();
const router = useRouter();
const { showLoader, hideLoader, dialogRemove, success, messageError } =
useCounterMixin();
const positionOp = ref<DataOption[]>([]);
const positionMainOp = ref<DataOption[]>([]);
const maxPage = ref<number>(1);
const totalList = ref<number>(1); //
/** หัวตาราง */
const rows = ref<any>([]);
const columns = ref<QTableProps["columns"]>([
// {
// name: "no",
// align: "left",
// label: " ",
// sortable: true,
// field: "no",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
{
name: "including",
align: "left",
label: "รหัสตัวชี้วัด",
sortable: true,
field: "including",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "includingName",
align: "left",
label: "ชื่อตัวชี้วัด",
sortable: true,
field: "includingName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>(["including", "includingName"]);
const formFilter = reactive<FormListMainByRole>({
page: 1,
pageSize: 10,
position: "",
round: "",
keyword: "",
year: new Date().getFullYear(),
});
const pagination = ref({
page: formFilter.page,
rowsPerPage: formFilter.pageSize,
});
/** Option รอบการประเมิน*/
const roundOp = ref<DataOption[]>([
{ id: "APR", name: "รอบเมษายน" },
{ id: "OCT", name: "รอบตุลาคม" },
]);
function fetchList() {
http
.post(config.API.kpiRoleMainList + `/search`, {
// ?page=${formFilter.page}&pageSize=${formFilter.pageSize}&period=${formFilter.round}&position=${formFilter.position}&keyword=${formFilter.keyword}&year=${formFilter.year}
keyword: formFilter.keyword,
position: formFilter.position,
period: formFilter.round,
node: 0,
nodeId: "",
year: formFilter.year?.toString(),
pageSize: formFilter.pageSize,
page: formFilter.page,
})
.then((res) => {
const data = res.data.result.data;
total.value = res.data.result.total;
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
rows.value = data;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function onClickAddOrView(status: boolean = false, id: string = "") {
status
? router.push(`/KPI-indicator-role/${id}`)
: router.push("/KPI-indicator-role/add");
}
function onClickDelete(id: number) {
dialogRemove($q, () => {
showLoader();
http
.delete(config.API.kpiRoleMainList + `/${id}`)
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
fetchList();
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
}
function updatePage(val: number) {
formFilter.page = val;
fetchList();
}
function updatePageSize(newPagination: NewPagination) {
formFilter.page = 1;
formFilter.pageSize = newPagination.rowsPerPage;
}
watch(
() => formFilter.pageSize,
() => {
fetchList();
}
);
/**
* function นหาขอมลของ Option
* @param val าทองการฟลเตอร
* @param update พเดทค
* @param refData ดาตาทองการฟลเตอร
*/
function filterOption(val: any, update: Function) {
update(() => {
positionOp.value = positionMainOp.value.filter(
(v: any) => v.name.indexOf(val) > -1
);
});
}
/** ดึงข้อมูลตำแหน่ง */
function getOptions() {
showLoader();
http
.get(config.API.orgSalaryPosition)
.then((res) => {
const dataOp = res.data.result;
const uniqueNames = new Set();
const filteredData = dataOp
.filter((item: any) => {
if (!uniqueNames.has(item.positionName)) {
uniqueNames.add(item.positionName);
return true;
}
return false;
})
.map((item: any) => ({
id: item.positionName,
name: item.positionName,
}));
positionMainOp.value = filteredData;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function statusTothai(val: string) {
switch (val) {
case "SPECIAL":
return "รอบพิเศษ";
case "APR":
return "รอบเมษายน";
case "OCT":
return "รอบตุลาคม";
default:
return "-";
}
}
function setModel(val: string) {
formFilter.position = val;
}
/**
* เป dialog history
* @param id
*/
function onClickHistory(id: string) {
showLoader();
http
.get(config.API.kpiRoleMainList + `/history/${id}`)
.then((res) => {
const data = res.data.result;
dataHistory.value = data;
modalHistory.value = true;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
onMounted(async () => {
await getOptions();
await fetchList();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการตวชดตามตำแหน
</div>
<q-card flat bordered class="q-pa-md">
<div class="row q-gutter-sm no-wrap q-mb-sm">
<q-select
dense
:model-value="formFilter.position"
label="ตำแหน่ง"
outlined
emit-value
map-options
fill-input
hide-selected
hide-bottom-space
option-label="name"
option-value="id"
:options="positionOp"
use-input
@input-value="setModel"
@filter="(inputValue:any,doneFn:Function) => filterOption(inputValue, doneFn) "
@update:model-value="fetchList"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey"> ไมอม </q-item-section>
</q-item>
</template>
<template v-if="formFilter.position" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
formFilter.position = '';
fetchList();
"
class="cursor-pointer"
/>
</template>
</q-select>
<datepicker
style="width: 150px"
menu-class-name="modalfix"
v-model="formFilter.year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
@update:model-value="(formFilter.page = 1), fetchList()"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
:model-value="
formFilter.year === null
? 'ทั้งหมด'
: Number(formFilter.year) + 543
"
:label="`${'ปีงบประมาณ'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
<template v-if="formFilter.year" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(formFilter.year = null), (formFilter.page = 1), fetchList()
"
class="cursor-pointer"
/>
</template>
</q-input>
</template>
</datepicker>
<q-select
dense
outlined
v-model="formFilter.round"
:options="roundOp"
label="รอบการประเมิน"
option-label="name"
option-value="id"
emit-value
map-options
@update:model-value="fetchList"
style="width: 160px"
>
<template v-if="formFilter.round" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="(formFilter.round = ''), fetchList()"
class="cursor-pointer"
/>
</template>
</q-select>
<q-btn
flat
round
dense
icon="add"
color="primary"
@click="onClickAddOrView()"
>
<q-tooltip>เพ</q-tooltip>
</q-btn>
<q-space />
<q-input
standout
dense
v-model="formFilter.keyword"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
@keyup.enter="fetchList()"
>
<template v-slot:append>
<q-icon v-if="formFilter.keyword == ''" name="search" />
<q-icon
v-if="formFilter.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="formFilter.keyword = ''"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
</div>
<div class="col-12">
<d-table
for="table"
ref="table"
:columns="columns"
:rows="rows"
row-key="subject"
flat
bordered
dense
class="custom-header-table"
:visible-columns="visibleColumns"
:rows-per-page-options="[10, 20, 50, 100]"
@update:pagination="updatePageSize"
>
<template v-slot:pagination="scope">
งหมด {{ total }} รายการ
<q-pagination
v-model="formFilter.page"
active-color="primary"
color="dark"
:max="maxPage"
:max-pages="5"
size="sm"
boundary-links
direction-links
@update:model-value="updatePage"
></q-pagination>
</template>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name === 'no'">
{{
(formFilter.page - 1) * Number(pagination.rowsPerPage) +
props.rowIndex +
1
}}
</div>
<div v-else class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
flat
round
color="grey"
@click.stop
size="14px"
icon="more_vert"
>
<q-menu>
<q-list style="min-width: 180px">
<q-item
clickable
v-close-popup
@click.stop.pervent="onClickAddOrView(true, props.row.id)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>แกไขขอม</q-tooltip>
<q-icon
color="primary"
size="xs"
name="mdi-pencil-outline"
/>
</q-item-section>
<q-item-section>แกไขขอม</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@click="onClickHistory(props.row.id)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>ประวการแกไข</q-tooltip>
<q-icon color="info" size="xs" name="mdi-history" />
</q-item-section>
<q-item-section>ประวการแกไข</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@click.stop.pervent="onClickDelete(props.row.id)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>ลบขอม</q-tooltip>
<q-icon color="red" size="xs" name="mdi-delete" />
</q-item-section>
<q-item-section>ลบขอม</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</q-card>
<DialogHistory v-model:modal="modalHistory" :rows="dataHistory" />
</template>
<style scoped></style>

View file

@ -0,0 +1,12 @@
<script setup lang="ts">
import InsigniaType from "@/modules/01_metadata/components/insignia/InsigniaType.vue";
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
อมลเครองราชอสรยาภรณ
</div>
<q-card flat bordered class="q-pa-md"> <InsigniaType /> </q-card>
</template>
<style scoped></style>

View file

@ -0,0 +1,89 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { usePersonalDataStore } from "@/modules/01_metadata/stores/personalStore";
import ListPrefix from "@/modules/01_metadata/components/personal/01ListPrefix.vue";
import ListRank from "@/modules/01_metadata/components/personal/02ListRank.vue";
import ListBloodGroup from "@/modules/01_metadata/components/personal/03ListBloodGroup.vue";
import ListGender from "@/modules/01_metadata/components/personal/04ListGender.vue";
import ListReligion from "@/modules/01_metadata/components/personal/05ListReligion.vue";
import ListRelationship from "@/modules/01_metadata/components/personal/06ListRelationship.vue";
import ListEducation from "@/modules/01_metadata/components/personal/07ListEducationLevel.vue";
import ListProvince from "@/modules/01_metadata/components/personal/08ListProvince.vue";
const store = usePersonalDataStore();
const tabs = ref<Array<any>>([]);
onMounted(() => {
const tabsPerson = [
{ label: "คำนำหน้าชื่อ", value: "list_prefix" },
{ label: "ยศ", value: "list_rank" },
{ label: "เพศ", value: "list_gender" },
{ label: "สถานภาพ", value: "list_relationship" },
{ label: "กลุ่มเลือด", value: "list_bloodGroup" },
{ label: "ศาสนา", value: "list_religion" },
{ label: "จังหวัด", value: "list_province" },
{ label: "ระดับการศึกษา", value: "list_education" },
];
tabs.value = tabsPerson;
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
อมลเกยวกบบคคล
</div>
<q-card flat bordered>
<div class="text-subtitle1 text-grey-9">
<q-tabs
dense
v-model="store.currentTab"
align="left"
indicator-color="primary"
active-color="primary bg-teal-1"
inline-label
class="text-body2 text-grey-7"
>
<q-tab
v-for="tab in tabs"
:key="tab.value"
v-on:click="store.currentTab = tab.value"
:label="tab.label"
:name="tab.value"
class="q-py-xs"
/>
</q-tabs>
<q-separator />
<!-- person -->
<q-tab-panels v-model="store.currentTab" animated>
<q-tab-panel name="list_prefix">
<ListPrefix v-if="store.currentTab == 'list_prefix'" />
</q-tab-panel>
<q-tab-panel name="list_rank">
<ListRank v-if="store.currentTab == 'list_rank'" />
</q-tab-panel>
<q-tab-panel name="list_gender">
<ListGender v-if="store.currentTab == 'list_gender'" />
</q-tab-panel>
<q-tab-panel name="list_relationship">
<ListRelationship v-if="store.currentTab == 'list_relationship'" />
</q-tab-panel>
<q-tab-panel name="list_bloodGroup">
<ListBloodGroup v-if="store.currentTab == 'list_bloodGroup'" />
</q-tab-panel>
<q-tab-panel name="list_religion">
<ListReligion v-if="store.currentTab == 'list_religion'" />
</q-tab-panel>
<q-tab-panel name="list_province">
<ListProvince v-if="store.currentTab == 'list_province'" />
</q-tab-panel>
<q-tab-panel name="list_education">
<ListEducation v-if="store.currentTab == 'list_education'" />
</q-tab-panel>
</q-tab-panels>
</div>
</q-card>
</template>
<style scoped></style>

View file

@ -0,0 +1,64 @@
div
<script setup lang="ts">
import { ref, onMounted } from "vue";
import ListPosition from "@/modules/01_metadata/components/position/01ListPosition.vue";
import ListType from "@/modules/01_metadata/components/position/02ListType.vue";
import ListExecutive from "@/modules/01_metadata/components/position/04ListExecutive.vue";
import { usePositionDataStore } from "../stores/positionListStore";
// const store.pathLocation = ref<string>("list_position");
const tabs = ref<Array<any>>([]);
const store = usePositionDataStore();
onMounted(() => {
const tabsPerson = [
{ label: "ตำแหน่ง", value: "list_position" },
{ label: "รายการประเภทตำแหน่ง", value: "list_type" },
{ label: "ตำแหน่งทางการบริหาร", value: "list_executive" },
];
tabs.value = tabsPerson;
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
อมลตำแหนงขาราชการ
</div>
<q-card flat bordered>
<q-tabs
dense
v-model="store.pathLocation"
align="left"
indicator-color="primary"
active-color="primary bg-teal-1"
inline-label
class="text-body2 text-grey-7"
>
<q-tab
v-for="tab in tabs"
:key="tab.value"
v-on:click="store.pathLocation = tab.value"
:label="tab.label"
:name="tab.value"
class="q-py-xs"
/>
</q-tabs>
<q-separator />
<q-tab-panels v-model="store.pathLocation" animated>
<q-tab-panel name="list_position">
<ListPosition v-if="store.pathLocation == 'list_position'" />
</q-tab-panel>
<q-tab-panel name="list_type">
<ListType v-if="store.pathLocation == 'list_type'" />
</q-tab-panel>
<q-tab-panel name="list_executive">
<ListExecutive v-if="store.pathLocation == 'list_executive'" />
</q-tab-panel>
</q-tab-panels>
</q-card>
</template>
<style scoped></style>

View file

@ -0,0 +1,62 @@
div
<script setup lang="ts">
import { ref, onMounted } from "vue";
import ListPosition from "@/modules/01_metadata/components/position-employee/01ListPosition.vue";
import ListType from "@/modules/01_metadata/components/position-employee/02ListType.vue";
import { usePositionEmployeeDataStore } from "../stores/positionEmployeeStore";
// const store.pathLocation = ref<string>("list_position");
const tabs = ref<Array<any>>([]);
const store = usePositionEmployeeDataStore();
onMounted(() => {
const tabsPerson = [
{ label: "ตำแหน่ง", value: "list_position" },
{ label: "รายการกลุ่มงาน", value: "list_type" },
];
tabs.value = tabsPerson;
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
อมลตำแหนงลกจางประจำ
</div>
<q-card flat bordered>
<q-tabs
dense
v-model="store.pathLocation"
align="left"
indicator-color="primary"
active-color="primary bg-teal-1"
inline-label
class="text-body2 text-grey-7"
>
<q-tab
v-for="tab in tabs"
:key="tab.value"
v-on:click="store.pathLocation = tab.value"
:label="tab.label"
:name="tab.value"
class="q-py-xs"
/>
</q-tabs>
<q-separator />
<q-tab-panels v-model="store.pathLocation" animated>
<q-tab-panel name="list_position">
<ListPosition v-if="store.pathLocation == 'list_position'" />
</q-tab-panel>
<q-tab-panel name="list_type">
<ListType v-if="store.pathLocation == 'list_type'" />
</q-tab-panel>
<q-tab-panel name="list_executive">
<ListExecutive v-if="store.pathLocation == 'list_executive'" />
</q-tab-panel>
</q-tab-panels>
</q-card>
</template>
<style scoped></style>