hrms-mgt/src/modules/11_discipline/components/3_InvestigateDisciplinary/MainPage.vue

120 lines
3.8 KiB
Vue

<script setup lang="ts">
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import Table from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue";
import { useInvestigateDisStore } from "../../store/InvestigateDisStore";
import { useRouter } from "vue-router";
const dataInvestigateDis = useInvestigateDisStore();
const { fecthList } = dataInvestigateDis;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const { hideLoader } = mixin;
const filter = ref<string>(""); //search data table
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
});
onMounted(async () => {
fecthList([
{
subject: "ทุจริตในหน้าที่",
interrogated: "ศิรินภา คงน้อยี่",
fault: "1",
penaltyLevel: "7",
caseFault: "ทุจริตในหน้าที่",
dateInvestigate: "1 ธ.ค. 2565",
status: "0",
active: "2",
},
{
subject: "ทุจริตในหน้าที่",
interrogated: "ภัทรานุช คงน้อย",
fault: "1",
penaltyLevel: "7",
caseFault: "ทุจริตในหน้าที่",
dateInvestigate: "30 พ.ย. 2565",
status: "0",
active: "0",
},
{
subject: "กระทำทุจริตเงินกองทุน",
interrogated: "ปรมาพร ศรีมี",
fault: "2",
penaltyLevel: "1",
caseFault: "พบการทุจริต",
dateInvestigate: "14 ก.ย. 2565",
status: "1",
active: "1",
},
{
subject: "พูดจาไม่สุภาพ",
interrogated: "สมรัก ใจอารีย์",
fault: "2",
penaltyLevel: "1",
caseFault: "พูดจาไม่สุภาพกับผู้บังคับบัญชา",
dateInvestigate: "11 ส.ค. 2565",
status: "0",
active: "1",
},
]);
await hideLoader();
});
const clickAdd = () => {
router.push(`/discipline/InvestigateDisciplinary/add`);
};
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการการสอบสวนความผดทางว
</div>
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
<div>
<Table
style="max-height: 80vh"
:rows="dataInvestigateDis.rows"
:columns="dataInvestigateDis.columns"
:filter="filter"
:visible-columns="dataInvestigateDis.visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="dataInvestigateDis.visibleColumns"
:pagination="initialPagination"
:nornmalData="true"
:add="clickAdd"
:paging="true"
:titleText="''"
>
<template #columns="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<q-td v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</q-td>
<div>
{{ col.value }}
</div>
</q-td>
<q-td style="font-size: 14px; width: 10rem">
<q-btn
v-if="props.row.active === 'ยืนยันผล'"
color="primary"
class="q-px-md"
dense
unelevated
>นยนผล</q-btn
>
<span v-else>{{ props.row.active }}</span>
</q-td>
</q-tr>
</template>
</Table>
</div>
</q-card>
</template>
<style></style>