2023-10-16 18:07:42 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted } from "vue";
|
|
|
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
import type { QTableProps } from "quasar";
|
|
|
|
|
// importStroe
|
2023-10-18 17:50:37 +07:00
|
|
|
import { useComplainstDataStore } from "../../store/ComplaintsStore";
|
2023-10-16 18:07:42 +07:00
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
const complainstStore = useComplainstDataStore();
|
2023-10-18 14:41:11 +07:00
|
|
|
const { fectComplainst } = complainstStore; // function จาก stores
|
2023-10-16 18:07:42 +07:00
|
|
|
|
|
|
|
|
//ข้อมูล Table
|
|
|
|
|
const filterTable = ref<string>("");
|
|
|
|
|
const columns = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "no",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ลำดับ",
|
|
|
|
|
sortable: false,
|
|
|
|
|
field: "no",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "subject",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เรื่อง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "subject",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "detail",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "รายละเอียด",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "detail",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "complainant",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ผู้ถูกร้องเรียน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "complainant",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "offenseDescription",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ลักษณะความผิด",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "offenseDescription",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "creationDate",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่สร้างเรื่องร้องเรียน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "creationDate",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "considerationLevel",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ระดับการพิจารณา",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "considerationLevel",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "considerationDeadlineDate",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่กำหนดพิจารณา",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "considerationDeadlineDate",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
const visibleColumns = ref<string[]>([
|
|
|
|
|
"no",
|
|
|
|
|
"subject",
|
|
|
|
|
"detail",
|
|
|
|
|
"complainant",
|
|
|
|
|
"offenseDescription",
|
|
|
|
|
"creationDate",
|
|
|
|
|
"considerationLevel",
|
|
|
|
|
"considerationDeadlineDate",
|
|
|
|
|
]);
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
await fecthListComplaints();
|
|
|
|
|
});
|
|
|
|
|
|
2023-10-18 14:41:11 +07:00
|
|
|
// เรีนกรายการเรื่องร้องเรียน
|
2023-10-16 18:07:42 +07:00
|
|
|
async function fecthListComplaints() {
|
|
|
|
|
const listData = [
|
|
|
|
|
{
|
|
|
|
|
subject: "ทุจริตในหน้าที่",
|
|
|
|
|
detail: "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
|
|
|
|
complainant: "นางศิรินภา คงน้อย",
|
|
|
|
|
offenseDescription: "ร้ายแรง",
|
|
|
|
|
creationDate: "2023-10-16",
|
|
|
|
|
considerationLevel: "ด่วนมาก",
|
|
|
|
|
considerationDeadlineDate: "2023-11-01",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
subject: "ทุจริตในหน้าที่",
|
|
|
|
|
detail: "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
|
|
|
|
complainant: "นายแก้ว คำ",
|
|
|
|
|
offenseDescription: "ร้ายแรง",
|
|
|
|
|
creationDate: "2023-10-16",
|
|
|
|
|
considerationLevel: "ด่วนมาก",
|
|
|
|
|
considerationDeadlineDate: "2023-11-01",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
subject: "ทุจริตในหน้าที่",
|
|
|
|
|
detail:
|
|
|
|
|
"มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
|
|
|
|
complainant: "นายภัทรานุย คงนอย",
|
|
|
|
|
offenseDescription: "ร้ายแรง",
|
|
|
|
|
creationDate: "2023-10-16",
|
|
|
|
|
considerationLevel: "ด่วนมาก",
|
|
|
|
|
considerationDeadlineDate: "2023-11-01",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
await fectComplainst(listData);
|
|
|
|
|
}
|
|
|
|
|
function redirectToPageadd() {
|
|
|
|
|
router.push(`/discipline/complaints/add`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//pagination
|
|
|
|
|
const pagination = ref({
|
|
|
|
|
descending: true,
|
|
|
|
|
page: 1,
|
|
|
|
|
rowsPerPage: 10,
|
|
|
|
|
});
|
|
|
|
|
const paging = ref<boolean>(true);
|
|
|
|
|
const paginationLabel = (start: string, end: string, total: string) => {
|
|
|
|
|
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
|
|
|
|
else return start + "-" + end + " ใน " + total;
|
|
|
|
|
};
|
|
|
|
|
</script>
|
2023-10-16 13:28:48 +07:00
|
|
|
|
|
|
|
|
<template>
|
2023-10-16 18:07:42 +07:00
|
|
|
<div class="toptitle text-dark col-12 row items-center">เรื่องร้องเรียน</div>
|
|
|
|
|
<div class="col-12 q-mt-sm">
|
|
|
|
|
<q-card flat bordered>
|
|
|
|
|
<div class="q-pa-md">
|
|
|
|
|
<q-toolbar style="padding: 0" class="q-gutter-sm q-mb-md">
|
|
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
dense
|
|
|
|
|
round
|
|
|
|
|
color="primary"
|
|
|
|
|
icon="mdi-plus"
|
|
|
|
|
@click="redirectToPageadd()"
|
2023-10-17 17:49:31 +07:00
|
|
|
><q-tooltip>เพิ่มเรื่องร้องเรียน </q-tooltip></q-btn
|
2023-10-16 18:07:42 +07:00
|
|
|
>
|
|
|
|
|
<q-space />
|
|
|
|
|
<div class="col-2">
|
|
|
|
|
<q-input dense outlined v-model="filterTable" label="ค้นหา" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-2">
|
|
|
|
|
<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
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</q-toolbar>
|
|
|
|
|
<d-table
|
|
|
|
|
ref="table"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:rows="complainstStore.rows"
|
|
|
|
|
:filter="filterTable"
|
|
|
|
|
row-key="subject"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
:paging="true"
|
|
|
|
|
dense
|
|
|
|
|
class="custom-header-table"
|
|
|
|
|
:visible-columns="visibleColumns"
|
|
|
|
|
:pagination-label="paginationLabel"
|
|
|
|
|
v-model:pagination="pagination"
|
|
|
|
|
>
|
|
|
|
|
<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-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer" style="height: 40px">
|
|
|
|
|
<q-td key="no" :props="props">
|
|
|
|
|
{{ props.rowIndex + 1 }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="subject" :props="props">
|
|
|
|
|
{{ props.row.subject }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="detail" :props="props">
|
|
|
|
|
<div class="table_ellipsis">
|
|
|
|
|
{{ props.row.detail }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="complainant" :props="props">
|
|
|
|
|
{{ props.row.complainant }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="offenseDescription" :props="props">
|
|
|
|
|
{{ props.row.offenseDescription }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="creationDate" :props="props">
|
|
|
|
|
{{ props.row.creationDate }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="considerationLevel" :props="props">
|
|
|
|
|
{{ props.row.considerationLevel }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="considerationDeadlineDate" :props="props">
|
|
|
|
|
{{ props.row.considerationDeadlineDate }}
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
2023-10-18 18:01:20 +07:00
|
|
|
<!-- <template v-slot:pagination="scope">
|
2023-10-16 18:07:42 +07:00
|
|
|
<q-pagination
|
|
|
|
|
v-model="pagination.page"
|
|
|
|
|
active-color="primary"
|
|
|
|
|
color="dark"
|
|
|
|
|
:max="scope.pagesNumber"
|
|
|
|
|
:max-pages="5"
|
|
|
|
|
size="sm"
|
|
|
|
|
boundary-links
|
|
|
|
|
direction-links
|
|
|
|
|
></q-pagination>
|
2023-10-18 18:01:20 +07:00
|
|
|
</template> -->
|
2023-10-16 18:07:42 +07:00
|
|
|
</d-table>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card>
|
2023-10-16 13:28:48 +07:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2023-10-16 18:07:42 +07:00
|
|
|
<style scoped></style>
|