2023-12-13 13:09:50 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted, watch, reactive } from "vue";
|
|
|
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
import { useQuasar } from "quasar";
|
|
|
|
|
import type { QTableProps } from "quasar";
|
|
|
|
|
import type { RowList } from "@/modules/11_discipline/interface/response/appealComplain";
|
|
|
|
|
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
|
|
|
|
// importStroe
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
|
|
|
|
import { useAppealComplainStore } from "@/modules/11_discipline/store/AppealComplainStore";
|
|
|
|
|
|
|
|
|
|
// impoet Components
|
|
|
|
|
import DialogStatus from "@/modules/11_discipline/components/8_AppealComplain/dialog/DialogEditStatus.vue";
|
|
|
|
|
import config from "@/app.config";
|
|
|
|
|
import http from "@/plugins/http";
|
|
|
|
|
|
2024-08-05 16:34:03 +07:00
|
|
|
import { checkPermission } from "@/utils/permissions";
|
|
|
|
|
|
2023-12-13 13:09:50 +07:00
|
|
|
const $q = useQuasar();
|
|
|
|
|
const mixin = useCounterMixin();
|
|
|
|
|
|
|
|
|
|
const { showLoader, messageError, hideLoader, dialogConfirm } = mixin;
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const modalStatusEdit = ref<boolean>(false);
|
|
|
|
|
/** stoer */
|
|
|
|
|
const dataStore = useAppealComplainStore();
|
|
|
|
|
const { fetchAppealComplain } = dataStore;
|
|
|
|
|
const type = ref<DataOption[]>([
|
|
|
|
|
{ id: "ALL", name: "ทั้งหมด" },
|
|
|
|
|
...dataStore.typeOptions,
|
|
|
|
|
]);
|
|
|
|
|
const filterTable = ref<string>("");
|
|
|
|
|
const filterKeyword = ref<string>("");
|
|
|
|
|
|
|
|
|
|
const dataRow = ref<RowList[]>([]);
|
|
|
|
|
const currentPage = ref<number>(1);
|
|
|
|
|
const maxPage = ref<number>(1);
|
|
|
|
|
const page = ref<number>(1);
|
2024-04-26 14:23:14 +07:00
|
|
|
const totalList = ref<number>(0);
|
|
|
|
|
|
2023-12-13 13:09:50 +07:00
|
|
|
const rowsPerPage = ref<number>(10);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*pagination ของตาราง
|
|
|
|
|
*/
|
|
|
|
|
const pagination = ref({
|
|
|
|
|
descending: false,
|
|
|
|
|
page: page.value,
|
|
|
|
|
rowsPerPage: rowsPerPage.value,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const formData = reactive<any>({
|
|
|
|
|
type: "ALL",
|
2024-01-10 18:02:47 +07:00
|
|
|
status: "NEW",
|
2023-12-13 13:09:50 +07:00
|
|
|
year: new Date().getFullYear().toString(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const visibleColumns = ref<string[]>([
|
|
|
|
|
"no",
|
|
|
|
|
"type",
|
|
|
|
|
"title",
|
2023-12-14 10:18:04 +07:00
|
|
|
"fullname",
|
|
|
|
|
"citizenId",
|
2024-01-16 15:52:51 +07:00
|
|
|
"year",
|
2023-12-13 13:09:50 +07:00
|
|
|
"caseType",
|
2023-12-14 10:18:04 +07:00
|
|
|
"caseNumber",
|
2024-01-05 15:24:22 +07:00
|
|
|
"description",
|
2023-12-14 10:18:04 +07:00
|
|
|
"lastUpdatedAt",
|
2023-12-13 13:09:50 +07:00
|
|
|
"status",
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
// หัวตาราง
|
|
|
|
|
const columns = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "no",
|
|
|
|
|
align: "center",
|
|
|
|
|
label: "ลำดับ",
|
|
|
|
|
sortable: false,
|
|
|
|
|
field: "no",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "type",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ประเภท",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "type",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "title",
|
|
|
|
|
align: "left",
|
2023-12-14 18:03:01 +07:00
|
|
|
label: "เรื่องอุทธรณ์/ร้องทุกข์",
|
2023-12-13 13:09:50 +07:00
|
|
|
sortable: true,
|
|
|
|
|
field: "title",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-14 10:18:04 +07:00
|
|
|
name: "fullname",
|
2023-12-13 13:09:50 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อ-นามสกุล",
|
|
|
|
|
sortable: true,
|
2023-12-14 10:18:04 +07:00
|
|
|
field: "fullname",
|
2023-12-13 13:09:50 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-14 10:18:04 +07:00
|
|
|
name: "citizenId",
|
2023-12-13 13:09:50 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "เลขประจำตัวประชาชน",
|
|
|
|
|
sortable: true,
|
2023-12-14 10:18:04 +07:00
|
|
|
field: "citizenId",
|
2023-12-13 13:09:50 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-16 15:52:51 +07:00
|
|
|
name: "year",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ปีงบประมาณ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "year",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-13 13:09:50 +07:00
|
|
|
name: "caseType",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ประเภทคดี",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "caseType",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-14 10:18:04 +07:00
|
|
|
name: "caseNumber",
|
2023-12-13 13:09:50 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "คดีเลขที่",
|
|
|
|
|
sortable: true,
|
2023-12-14 10:18:04 +07:00
|
|
|
field: "caseNumber",
|
2023-12-13 13:09:50 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
2024-01-05 15:24:22 +07:00
|
|
|
{
|
|
|
|
|
name: "description",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "รายละเอียด",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "description",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
2023-12-13 13:09:50 +07:00
|
|
|
{
|
2023-12-14 10:18:04 +07:00
|
|
|
name: "lastUpdatedAt",
|
2023-12-13 13:09:50 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่แก้ไข",
|
|
|
|
|
sortable: true,
|
2023-12-14 10:18:04 +07:00
|
|
|
field: "lastUpdatedAt",
|
2023-12-13 13:09:50 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "status",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "สถานะของคำร้อง",
|
|
|
|
|
sortable: false,
|
|
|
|
|
field: "status",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => currentPage.value,
|
|
|
|
|
() => {
|
|
|
|
|
rowsPerPage.value = pagination.value.rowsPerPage;
|
2023-12-15 15:08:24 +07:00
|
|
|
getData();
|
2023-12-13 13:09:50 +07:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => pagination.value.rowsPerPage,
|
|
|
|
|
() => {
|
|
|
|
|
rowsPerPage.value = pagination.value.rowsPerPage;
|
|
|
|
|
currentPage.value = 1;
|
2023-12-15 15:08:24 +07:00
|
|
|
getData();
|
2023-12-13 13:09:50 +07:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2024-08-05 16:34:03 +07:00
|
|
|
/** ไปยังหน้าเพิ่มข้อมูล */
|
|
|
|
|
function redirectToPageDetail(id: string) {
|
|
|
|
|
dataStore.rowsAdd = [];
|
|
|
|
|
router.push(`/discipline-appealcomplain-detail/${id}`);
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-13 13:09:50 +07:00
|
|
|
/** ไปยังหน้าเพิ่มข้อมูล */
|
|
|
|
|
function redirectToPageadd() {
|
2023-12-15 15:08:24 +07:00
|
|
|
dataStore.rowsAdd = [];
|
2023-12-13 13:09:50 +07:00
|
|
|
router.push(`/discipline-appealcomplain/add`);
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-15 17:52:25 +07:00
|
|
|
/** เปิดหน้า แก้ไข */
|
2023-12-14 10:18:04 +07:00
|
|
|
function editPage(id: string) {
|
|
|
|
|
router.push(`/discipline-appealcomplain/${id}`);
|
|
|
|
|
}
|
2024-01-15 17:52:25 +07:00
|
|
|
|
|
|
|
|
/** ดึงข้อมูลเมื่อ กด enter */
|
2023-12-13 13:09:50 +07:00
|
|
|
function filterFn() {
|
2024-01-05 15:24:22 +07:00
|
|
|
getData();
|
2023-12-13 13:09:50 +07:00
|
|
|
}
|
|
|
|
|
|
2024-01-15 17:52:25 +07:00
|
|
|
/** ปิด pop up */
|
2023-12-13 13:09:50 +07:00
|
|
|
function close() {
|
|
|
|
|
modalStatusEdit.value = false;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-25 16:31:24 +07:00
|
|
|
/** ดึงข้อมูลเริ่มต้น */
|
2024-01-05 11:40:39 +07:00
|
|
|
async function getData() {
|
2023-12-14 10:18:04 +07:00
|
|
|
showLoader();
|
2024-01-05 11:40:39 +07:00
|
|
|
await http
|
2023-12-14 10:18:04 +07:00
|
|
|
.get(
|
|
|
|
|
config.API.appealMainList(
|
|
|
|
|
formData.status,
|
|
|
|
|
formData.type,
|
|
|
|
|
formData.year,
|
|
|
|
|
currentPage.value,
|
|
|
|
|
rowsPerPage.value,
|
|
|
|
|
filterKeyword.value
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
2024-04-26 14:23:14 +07:00
|
|
|
totalList.value = res.data.result.total;
|
2023-12-15 15:08:24 +07:00
|
|
|
fetchAppealComplain(res.data.result.data);
|
2023-12-14 10:18:04 +07:00
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-25 16:31:24 +07:00
|
|
|
/** update status */
|
2023-12-15 15:08:24 +07:00
|
|
|
function dataUpdate() {
|
|
|
|
|
getData();
|
2023-12-14 10:18:04 +07:00
|
|
|
}
|
|
|
|
|
|
2023-12-25 16:31:24 +07:00
|
|
|
/** set ปี ทั้งหมด */
|
2023-12-15 15:08:24 +07:00
|
|
|
function yearAll() {
|
|
|
|
|
formData.year = 0;
|
|
|
|
|
getData();
|
|
|
|
|
}
|
2023-12-27 15:50:41 +07:00
|
|
|
|
2024-01-15 17:52:25 +07:00
|
|
|
/** ฟังชั่น เคลียฟิลเตอร์ */
|
2024-01-05 11:40:39 +07:00
|
|
|
function resetFilter() {
|
2023-12-27 15:50:41 +07:00
|
|
|
filterKeyword.value = "";
|
2024-01-05 11:40:39 +07:00
|
|
|
getData();
|
|
|
|
|
}
|
2024-07-10 15:11:22 +07:00
|
|
|
const option = ref<any[]>(dataStore.statusOptions);
|
|
|
|
|
const optionType = ref<any[]>(type.value);
|
|
|
|
|
/**
|
|
|
|
|
* function ค้นหาข้อมูลใน option
|
|
|
|
|
* @param val คำค้นหา
|
|
|
|
|
* @param update function
|
|
|
|
|
*/
|
|
|
|
|
function filterOptionFn(val: string, update: Function) {
|
|
|
|
|
update(() => {
|
|
|
|
|
option.value = dataStore.statusOptions.filter(
|
|
|
|
|
(e: any) => e.name.search(val) !== -1
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* function ค้นหาข้อมูลใน option
|
|
|
|
|
* @param val คำค้นหา
|
|
|
|
|
* @param update function
|
|
|
|
|
*/
|
|
|
|
|
function filterOptionFnType(val: string, update: Function) {
|
|
|
|
|
update(() => {
|
|
|
|
|
optionType.value = type.value.filter((e: any) => e.name.search(val) !== -1);
|
|
|
|
|
});
|
|
|
|
|
}
|
2023-12-27 15:50:41 +07:00
|
|
|
|
2023-12-13 13:09:50 +07:00
|
|
|
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
|
|
|
|
onMounted(async () => {
|
2023-12-15 15:08:24 +07:00
|
|
|
getData();
|
2023-12-13 13:09:50 +07:00
|
|
|
dataStore.visibleColumns = visibleColumns.value;
|
|
|
|
|
dataStore.columns = columns.value;
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="toptitle text-dark col-12 row items-center">
|
2023-12-22 17:17:11 +07:00
|
|
|
รายการอุทธรณ์/ร้องทุกข์
|
2023-12-13 13:09:50 +07:00
|
|
|
</div>
|
|
|
|
|
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
2024-01-30 11:17:25 +07:00
|
|
|
<div class="row q-mb-sm q-col-gutter-sm">
|
2024-04-26 14:23:14 +07:00
|
|
|
<div>
|
|
|
|
|
<q-btn
|
2024-08-05 16:34:03 +07:00
|
|
|
v-if="checkPermission($route)?.attrIsCreate"
|
2024-04-26 14:23:14 +07:00
|
|
|
id="addComplaints"
|
|
|
|
|
for="addComplaints"
|
|
|
|
|
size="12px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="primary"
|
|
|
|
|
icon="mdi-plus"
|
|
|
|
|
@click="redirectToPageadd()"
|
|
|
|
|
><q-tooltip>เพิ่มการอุทธรณ์/ร้องทุกข์</q-tooltip></q-btn
|
2023-12-13 13:09:50 +07:00
|
|
|
>
|
2024-04-26 14:23:14 +07:00
|
|
|
</div>
|
|
|
|
|
<q-space />
|
|
|
|
|
<q-input
|
|
|
|
|
for="#search"
|
|
|
|
|
class="col-xs-12 col-sm-3 col-md-2"
|
|
|
|
|
standout
|
|
|
|
|
dense
|
|
|
|
|
v-model="filterKeyword"
|
|
|
|
|
ref="filterRef"
|
|
|
|
|
outlined
|
|
|
|
|
placeholder="ค้นหา"
|
|
|
|
|
@keydown.enter.prevent="filterFn"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon
|
|
|
|
|
v-if="filterKeyword !== ''"
|
|
|
|
|
name="clear"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
@click="resetFilter"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
2023-12-13 13:09:50 +07:00
|
|
|
|
2024-04-26 14:23:14 +07:00
|
|
|
<q-select
|
|
|
|
|
id="visibleColumns"
|
|
|
|
|
for="visibleColumns"
|
|
|
|
|
v-model="dataStore.visibleColumns"
|
|
|
|
|
multiple
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
options-dense
|
|
|
|
|
:display-value="$q.lang.table.columns"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
:options="dataStore.columns"
|
|
|
|
|
option-value="name"
|
|
|
|
|
options-cover
|
|
|
|
|
class="col-xs-12 col-sm-3 col-md-2"
|
|
|
|
|
/>
|
2024-01-30 11:17:25 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-12 row q-mb-sm">
|
|
|
|
|
<q-card bordered class="col-12 filter-card q-pa-sm">
|
|
|
|
|
<div class="row col-12 q-col-gutter-sm">
|
|
|
|
|
<div class="col-2">
|
|
|
|
|
<datepicker
|
|
|
|
|
menu-class-name="modalfix"
|
|
|
|
|
v-model="formData.year"
|
|
|
|
|
class="col-2"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
year-picker
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
@update:model-value="dataUpdate"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">{{ year + 543 }}</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">{{
|
|
|
|
|
parseInt(value + 543)
|
|
|
|
|
}}</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
:model-value="
|
2024-07-04 13:44:29 +07:00
|
|
|
formData.year === 0
|
|
|
|
|
? 'ทั้งหมด'
|
|
|
|
|
: Number(formData.year) + 543
|
2024-01-30 11:17:25 +07:00
|
|
|
"
|
|
|
|
|
:label="`${'ปีงบประมาณ'}`"
|
|
|
|
|
>
|
|
|
|
|
<template v-if="formData.year" v-slot:append>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="cancel"
|
|
|
|
|
@click.stop.prevent="yearAll"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:prepend>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="event"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
style="color: var(--q-primary)"
|
|
|
|
|
>
|
|
|
|
|
</q-icon>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</template>
|
|
|
|
|
</datepicker>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-2">
|
|
|
|
|
<q-select
|
|
|
|
|
v-model="formData.type"
|
|
|
|
|
label="ประเภท"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
|
|
|
|
option-value="id"
|
2024-07-10 15:11:22 +07:00
|
|
|
:options="optionType"
|
2024-01-30 11:17:25 +07:00
|
|
|
@update:model-value="dataUpdate"
|
2024-07-10 15:11:22 +07:00
|
|
|
use-input
|
|
|
|
|
@filter="filterOptionFnType"
|
2024-07-04 13:44:29 +07:00
|
|
|
>
|
|
|
|
|
<template v-if="formData.type !== 'ALL'" v-slot:append>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="cancel"
|
2024-07-10 15:11:22 +07:00
|
|
|
@click.stop.prevent="
|
2024-08-05 16:34:03 +07:00
|
|
|
(optionType = type), (formData.type = 'ALL'), dataUpdate()
|
2024-07-10 15:11:22 +07:00
|
|
|
"
|
2024-07-04 13:44:29 +07:00
|
|
|
class="cursor-pointer"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
2024-07-10 15:11:22 +07:00
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
2024-07-04 13:44:29 +07:00
|
|
|
</q-select>
|
2024-01-30 11:17:25 +07:00
|
|
|
</div>
|
2024-07-04 13:44:29 +07:00
|
|
|
<div class="col-3">
|
2024-01-30 11:17:25 +07:00
|
|
|
<q-select
|
|
|
|
|
v-model="formData.status"
|
|
|
|
|
label="สถานะ"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
|
|
|
|
option-value="id"
|
2024-07-10 15:11:22 +07:00
|
|
|
:options="option"
|
2024-01-30 11:17:25 +07:00
|
|
|
@update:model-value="dataUpdate"
|
2024-07-10 15:11:22 +07:00
|
|
|
use-input
|
|
|
|
|
@filter="filterOptionFn"
|
2024-07-04 13:44:29 +07:00
|
|
|
>
|
|
|
|
|
<template v-if="formData.status !== 'ALL'" v-slot:append>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="cancel"
|
2024-07-10 15:11:22 +07:00
|
|
|
@click.stop.prevent="
|
|
|
|
|
(option = dataStore.statusOptions),
|
|
|
|
|
(formData.status = 'ALL'),
|
|
|
|
|
dataUpdate()
|
|
|
|
|
"
|
2024-07-04 13:44:29 +07:00
|
|
|
class="cursor-pointer"
|
2024-07-10 15:11:22 +07:00
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
2024-01-30 11:17:25 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card>
|
2023-12-13 13:09:50 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<d-table
|
|
|
|
|
ref="table"
|
|
|
|
|
:columns="dataStore.columns"
|
|
|
|
|
:rows="dataStore.rows"
|
2023-12-14 10:18:04 +07:00
|
|
|
row-key="id"
|
2023-12-13 13:09:50 +07:00
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
:paging="true"
|
|
|
|
|
dense
|
|
|
|
|
class="custom-header-table"
|
|
|
|
|
:visible-columns="dataStore.visibleColumns"
|
|
|
|
|
v-model:pagination="pagination"
|
|
|
|
|
:rows-per-page-options="[10, 25, 50, 100]"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:pagination="scope">
|
2024-04-26 14:23:14 +07:00
|
|
|
ทั้งหมด {{ totalList }} รายการ
|
2023-12-13 13:09:50 +07:00
|
|
|
<q-pagination
|
|
|
|
|
v-model="currentPage"
|
|
|
|
|
active-color="primary"
|
|
|
|
|
color="dark"
|
|
|
|
|
:max="Number(maxPage)"
|
|
|
|
|
size="sm"
|
|
|
|
|
boundary-links
|
|
|
|
|
direction-links
|
|
|
|
|
></q-pagination>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
2024-08-05 16:34:03 +07:00
|
|
|
<q-th
|
|
|
|
|
auto-width
|
|
|
|
|
v-if="
|
|
|
|
|
checkPermission($route)?.attrIsGet !== false ||
|
|
|
|
|
checkPermission($route)?.attrIsUpdate !== false
|
|
|
|
|
"
|
|
|
|
|
></q-th>
|
2023-12-13 13:09:50 +07:00
|
|
|
<q-th
|
|
|
|
|
v-for="col in props.cols"
|
|
|
|
|
:key="col.name"
|
|
|
|
|
:props="props"
|
|
|
|
|
style="color: #000000; font-weight: 500"
|
|
|
|
|
>
|
|
|
|
|
<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">
|
2023-12-14 10:18:04 +07:00
|
|
|
<q-td
|
2024-08-05 16:34:03 +07:00
|
|
|
auto-width
|
|
|
|
|
v-if="
|
|
|
|
|
checkPermission($route)?.attrIsGet !== false ||
|
|
|
|
|
checkPermission($route)?.attrIsUpdate !== false
|
|
|
|
|
"
|
2023-12-14 10:18:04 +07:00
|
|
|
>
|
2024-08-05 16:34:03 +07:00
|
|
|
<q-btn
|
|
|
|
|
v-if="checkPermission($route)?.attrIsGet"
|
|
|
|
|
id="addComplaints"
|
|
|
|
|
for="addComplaints"
|
|
|
|
|
size="12px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="info"
|
|
|
|
|
icon="mdi-eye"
|
|
|
|
|
@click="redirectToPageDetail(props.row.id)"
|
|
|
|
|
><q-tooltip>รายละเอียดการอุทธรณ์/ร้องทุกข์</q-tooltip></q-btn
|
|
|
|
|
>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="checkPermission($route)?.attrIsUpdate"
|
|
|
|
|
id="addComplaints"
|
|
|
|
|
for="addComplaints"
|
|
|
|
|
size="12px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="edit"
|
|
|
|
|
icon="edit"
|
|
|
|
|
@click="editPage(props.row.id)"
|
|
|
|
|
><q-tooltip>แก้ไขการอุทธรณ์/ร้องทุกข์</q-tooltip></q-btn
|
|
|
|
|
>
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
2023-12-13 13:09:50 +07:00
|
|
|
<div v-if="col.name == 'no'">
|
2023-12-18 09:46:33 +07:00
|
|
|
{{
|
2024-01-05 11:40:39 +07:00
|
|
|
(currentPage - 1) * Number(pagination.rowsPerPage) +
|
|
|
|
|
props.rowIndex +
|
|
|
|
|
1
|
|
|
|
|
}}
|
2023-12-13 13:09:50 +07:00
|
|
|
</div>
|
2024-01-17 11:23:10 +07:00
|
|
|
<div v-else-if="col.name === 'title'" class="table_ellipsis">
|
|
|
|
|
{{ props.row.title }}
|
|
|
|
|
</div>
|
2024-01-05 15:24:22 +07:00
|
|
|
<div
|
|
|
|
|
v-else-if="col.name === 'description'"
|
|
|
|
|
class="table_ellipsis"
|
|
|
|
|
>
|
2024-04-26 14:23:14 +07:00
|
|
|
{{ props.row.description ? props.row.description : "-" }}
|
2024-01-05 15:24:22 +07:00
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
2024-04-26 14:23:14 +07:00
|
|
|
{{ col.value ?? "-" }}
|
2023-12-13 13:09:50 +07:00
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card>
|
|
|
|
|
|
2024-01-17 11:23:10 +07:00
|
|
|
<DialogStatus :modal="modalStatusEdit" :data="dataRow" :close="close" />
|
2023-12-13 13:09:50 +07:00
|
|
|
</template>
|
|
|
|
|
|
2024-01-30 11:17:25 +07:00
|
|
|
<style scoped>
|
|
|
|
|
.filter-card {
|
|
|
|
|
background-color: #f1f1f1b0;
|
|
|
|
|
}
|
|
|
|
|
</style>
|