2023-11-22 18:05:59 +07:00
|
|
|
<script setup lang="ts">
|
2023-11-23 09:51:00 +07:00
|
|
|
import { ref, watch } from "vue";
|
|
|
|
|
import { useQuasar } from "quasar";
|
2023-11-22 18:05:59 +07:00
|
|
|
import type { QTableProps } from "quasar";
|
|
|
|
|
|
2023-11-23 09:51:00 +07:00
|
|
|
const $q = useQuasar();
|
|
|
|
|
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2023-11-22 18:05:59 +07:00
|
|
|
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
|
|
|
|
const complainstStore = useComplainstDataStore();
|
2023-11-23 09:51:00 +07:00
|
|
|
|
|
|
|
|
const mixin = useCounterMixin();
|
|
|
|
|
const { dialogConfirm, success } = mixin;
|
|
|
|
|
|
2023-11-22 18:05:59 +07:00
|
|
|
const props = defineProps({
|
|
|
|
|
modal: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
require: true,
|
|
|
|
|
},
|
|
|
|
|
close: {
|
|
|
|
|
type: Function,
|
|
|
|
|
require: true,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/** หัวตาราง */
|
|
|
|
|
const columns = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "no",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ลำดับ",
|
|
|
|
|
sortable: false,
|
|
|
|
|
field: "no",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "idcard",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เลขบัตรประชาชน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "idcard",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "name",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อ - นามสกุล",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "name",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "positionNo",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่งเลขที่",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionNo",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "position",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "position",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "positionLevel",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ระดับ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionLevel",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "salary",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เงินเดือน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "salary",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "organization",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "หน่วยงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "organization",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
/** หัวข้อที่เเสดงในตาราง */
|
|
|
|
|
const visibleColumns = ref<string[]>([
|
|
|
|
|
"no",
|
|
|
|
|
"idcard",
|
|
|
|
|
"name",
|
|
|
|
|
"positionNo",
|
|
|
|
|
"position",
|
|
|
|
|
"positionLevel",
|
|
|
|
|
"salary",
|
|
|
|
|
"organization",
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const selected = ref<any>([]);
|
2023-11-23 09:51:00 +07:00
|
|
|
const inspectionResults = ref<string>("");
|
|
|
|
|
const inputRef = ref<any>(null);
|
2023-11-22 18:05:59 +07:00
|
|
|
|
2023-11-23 09:51:00 +07:00
|
|
|
function onclickSend() {
|
|
|
|
|
inputRef.value.validate();
|
|
|
|
|
if (!inputRef.value.hasError) {
|
|
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
async () => {
|
|
|
|
|
success($q, "ส่งข้อมูลไปสืบสวนสำเร็จ");
|
|
|
|
|
console.log(selected.value);
|
|
|
|
|
|
|
|
|
|
props.close?.();
|
|
|
|
|
},
|
|
|
|
|
"ยืนยันการส่งไปสืบสวน",
|
|
|
|
|
"ต้องการยืนยันการส่งไปสืบสวนหรือไม่"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-11-22 18:05:59 +07:00
|
|
|
|
|
|
|
|
function onClickClose() {
|
|
|
|
|
props.close?.();
|
|
|
|
|
}
|
2023-11-23 09:51:00 +07:00
|
|
|
|
|
|
|
|
watch([() => props.modal], () => {
|
|
|
|
|
inspectionResults.value = props.modal ? "" : "";
|
|
|
|
|
selected.value.push(complainstStore.rowsAdd);
|
|
|
|
|
});
|
2023-11-22 18:05:59 +07:00
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<q-dialog v-model="props.modal">
|
|
|
|
|
<q-card style="width: 700px; max-width: 80vw">
|
|
|
|
|
<q-toolbar class="q-py-md">
|
|
|
|
|
<q-toolbar-title class="header-text">มีมูลส่งไปสืบสวน </q-toolbar-title>
|
|
|
|
|
<q-btn
|
|
|
|
|
icon="close"
|
|
|
|
|
unelevated
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
@click="onClickClose"
|
|
|
|
|
style="color: #ff8080; background-color: #ffdede"
|
|
|
|
|
/>
|
|
|
|
|
</q-toolbar>
|
|
|
|
|
<q-separator />
|
|
|
|
|
|
|
|
|
|
<q-card-section class="q-pt-none q-mt-md">
|
|
|
|
|
<d-table
|
|
|
|
|
ref="table"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:rows="complainstStore.rowsAdd"
|
|
|
|
|
row-key="id"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
:paging="true"
|
|
|
|
|
dense
|
|
|
|
|
class="custom-header-table"
|
|
|
|
|
:visible-columns="visibleColumns"
|
2023-11-23 09:51:00 +07:00
|
|
|
selection="multiple"
|
|
|
|
|
v-model:selected="selected"
|
2023-11-22 18:05:59 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th auto-width>
|
|
|
|
|
<q-checkbox
|
|
|
|
|
keep-color
|
|
|
|
|
color="primary"
|
|
|
|
|
dense
|
2023-11-23 09:51:00 +07:00
|
|
|
v-model="props.selected"
|
2023-11-22 18:05:59 +07:00
|
|
|
/>
|
|
|
|
|
</q-th>
|
|
|
|
|
<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">
|
|
|
|
|
<q-td>
|
|
|
|
|
<q-checkbox
|
|
|
|
|
keep-color
|
|
|
|
|
color="primary"
|
|
|
|
|
dense
|
2023-11-23 09:51:00 +07:00
|
|
|
v-model="props.selected"
|
2023-11-22 18:05:59 +07:00
|
|
|
/>
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<div v-if="col.name == 'no'">
|
|
|
|
|
{{ props.rowIndex + 1 }}
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
{{ col.value }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
2023-11-23 09:51:00 +07:00
|
|
|
<div class="col-xs-12 col-sm-12 q-mt-sm">
|
2023-11-22 18:05:59 +07:00
|
|
|
<q-input
|
2023-11-23 09:51:00 +07:00
|
|
|
for="inputInspectionResults"
|
|
|
|
|
ref="inputRef"
|
2023-11-22 18:05:59 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
2023-11-23 09:51:00 +07:00
|
|
|
v-model="inspectionResults"
|
|
|
|
|
:rules="[(val) => !!val || 'กรุณากรอกผลการตรวจสอบเรื่องร้องเรียน']"
|
2023-11-22 18:05:59 +07:00
|
|
|
lazy-rules
|
2023-11-23 09:51:00 +07:00
|
|
|
label="ผลการตรวจสอบเรื่องร้องเรียน"
|
2023-11-22 18:05:59 +07:00
|
|
|
type="textarea"
|
|
|
|
|
rows="5"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<q-card-actions align="right" class="bg-white text-teal">
|
2023-11-23 09:51:00 +07:00
|
|
|
<q-btn label="มีมูลส่งไปสืบสวน" color="public" @click="onclickSend" />
|
2023-11-22 18:05:59 +07:00
|
|
|
</q-card-actions>
|
|
|
|
|
</q-card>
|
|
|
|
|
</q-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|