2023-10-16 18:07:42 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted } from "vue";
|
2023-10-17 17:49:31 +07:00
|
|
|
import { useQuasar } from "quasar";
|
2023-10-18 14:41:11 +07:00
|
|
|
import { useRouter } from "vue-router";
|
2023-10-16 18:07:42 +07:00
|
|
|
|
2023-10-18 14:41:11 +07:00
|
|
|
// import Type
|
|
|
|
|
import type {
|
|
|
|
|
DataOption,
|
|
|
|
|
MyObjectComplaintsRef,
|
|
|
|
|
} from "../../interface/index/Main";
|
2023-10-16 18:07:42 +07:00
|
|
|
|
|
|
|
|
// importStroe
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2023-10-18 17:50:37 +07:00
|
|
|
import { useComplainstDataStore } from "../../store/ComplaintsStore";
|
2023-10-16 18:07:42 +07:00
|
|
|
|
2023-10-17 17:49:31 +07:00
|
|
|
const $q = useQuasar();
|
2023-10-16 18:07:42 +07:00
|
|
|
const router = useRouter();
|
|
|
|
|
const mixin = useCounterMixin();
|
2023-10-18 14:41:11 +07:00
|
|
|
const { date2Thai, dialogConfirm } = mixin; //function จาก stores หลัก
|
2023-10-16 18:07:42 +07:00
|
|
|
|
|
|
|
|
const complainstStore = useComplainstDataStore();
|
2023-10-18 14:41:11 +07:00
|
|
|
const { selectComplainantTpye, filterSelector, fectOptioin } = complainstStore; // function จาก store complainstStore
|
2023-10-16 18:07:42 +07:00
|
|
|
|
2023-10-18 14:41:11 +07:00
|
|
|
// options ทั้งหมด
|
2023-10-16 18:07:42 +07:00
|
|
|
const complainantoptions = ref<DataOption[]>([
|
|
|
|
|
{ id: "0", name: "บุคคล" },
|
|
|
|
|
{ id: "1", name: "หน่ายงาน" },
|
|
|
|
|
{ id: "2", name: "กรุงเทพหมานคร" },
|
|
|
|
|
]);
|
|
|
|
|
const agencytoptions = ref<DataOption[]>([
|
|
|
|
|
{ id: "0", name: "หน่ายงานเอ" },
|
|
|
|
|
{ id: "1", name: "หน่ายงานบี" },
|
|
|
|
|
{ id: "2", name: "หน่ายงานชี" },
|
|
|
|
|
]);
|
2023-10-17 17:49:31 +07:00
|
|
|
const offenseDescriptiontoptions = ref<DataOption[]>([
|
|
|
|
|
{ id: "0", name: "ยังไม่ระบุ" },
|
|
|
|
|
{ id: "1", name: "ไม่ร้ายแรง" },
|
|
|
|
|
{ id: "2", name: "ร้ายแรง" },
|
|
|
|
|
]);
|
|
|
|
|
const considerationLeveltoptions = ref<DataOption[]>([
|
|
|
|
|
{ id: "0", name: "ปกติ" },
|
|
|
|
|
{ id: "1", name: "ด่วน" },
|
|
|
|
|
{ id: "2", name: "ด่วนมาก" },
|
|
|
|
|
]);
|
|
|
|
|
const receivecomplaintstoptions = ref<DataOption[]>([
|
|
|
|
|
{ id: "0", name: "สตง" },
|
|
|
|
|
{ id: "1", name: "ปปช" },
|
|
|
|
|
{ id: "2", name: "ปปท" },
|
|
|
|
|
{ id: "3", name: "จดหมาย" },
|
|
|
|
|
{ id: "4", name: "อีเมล" },
|
|
|
|
|
{ id: "5", name: "โทรศัพท์" },
|
|
|
|
|
{ id: "6", name: "บอกกล่าว" },
|
|
|
|
|
]);
|
|
|
|
|
// ข้อมูล form
|
|
|
|
|
const complainantType = ref<string>("");
|
|
|
|
|
const complainant = ref<string>(""); // รายชื่อจากทะเบียน
|
|
|
|
|
const office = ref<string>(""); // สำนักงาน
|
|
|
|
|
const agency = ref<string>("");
|
2023-10-16 18:07:42 +07:00
|
|
|
const topicComplaint = ref<string>("");
|
|
|
|
|
const detail = ref<string>("");
|
|
|
|
|
const datereceive = ref<Date>();
|
2023-10-17 17:49:31 +07:00
|
|
|
const dateconsideration = ref<Date>();
|
|
|
|
|
const offenseDescription = ref<string>("");
|
|
|
|
|
const considerationLevel = ref<string>("");
|
|
|
|
|
const datewarn = ref<Date>();
|
|
|
|
|
const receivecomplaints = ref<string>("");
|
|
|
|
|
const petitioner = ref<string>("");
|
2023-10-16 18:07:42 +07:00
|
|
|
const files = ref<any>();
|
|
|
|
|
const fileDocDataUpload = ref<File[]>([]);
|
|
|
|
|
|
2023-10-17 17:49:31 +07:00
|
|
|
onMounted(() => {
|
|
|
|
|
fectOptioin(complainantoptions.value, agencytoptions.value);
|
|
|
|
|
});
|
2023-10-18 14:41:11 +07:00
|
|
|
// เลือกผู้ร้องเรียน
|
2023-10-16 18:07:42 +07:00
|
|
|
async function selectComplainant(val: string) {
|
|
|
|
|
complainant.value = "";
|
|
|
|
|
office.value = "";
|
|
|
|
|
agency.value = "";
|
|
|
|
|
if (val === "0") {
|
2023-10-18 14:41:11 +07:00
|
|
|
await fectListname(); // ถ้าเลือกบุกคลจะเรียก function fectListname เรียกรายชื่อจากทะเบียน
|
2023-10-16 18:07:42 +07:00
|
|
|
} else if (val === "1") {
|
2023-10-18 14:41:11 +07:00
|
|
|
await fectOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fectOffice เรียกโครงสร้างสำนักงาน
|
2023-10-16 18:07:42 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// เรียกรายชื่อ
|
|
|
|
|
async function fectListname() {
|
|
|
|
|
const listName = [
|
|
|
|
|
{
|
|
|
|
|
id: "1",
|
|
|
|
|
name: "นายเอ",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "2",
|
|
|
|
|
name: "นายบี",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "3",
|
|
|
|
|
name: "นายชี",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
selectComplainantTpye(listName);
|
|
|
|
|
}
|
2023-10-18 14:41:11 +07:00
|
|
|
// เรียกโครงสร้างสำนักงาน
|
2023-10-16 18:07:42 +07:00
|
|
|
async function fectOffice() {
|
|
|
|
|
// const listOffice = [
|
|
|
|
|
// {
|
|
|
|
|
// id: "1",
|
|
|
|
|
// name: "สำนักเอ",
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// id: "2",
|
|
|
|
|
// name: "สำนักเอ",
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// id: "3",
|
|
|
|
|
// name: "สำนักเอ",
|
|
|
|
|
// },
|
|
|
|
|
// ];
|
|
|
|
|
}
|
2023-10-18 14:41:11 +07:00
|
|
|
// อัพโหลดไฟล์
|
2023-10-16 18:07:42 +07:00
|
|
|
const fileUploadDoc = async (files: any) => {
|
|
|
|
|
files.forEach((file: any) => {
|
|
|
|
|
fileDocDataUpload.value.push(file);
|
|
|
|
|
});
|
|
|
|
|
};
|
2023-10-18 14:41:11 +07:00
|
|
|
// เลือกระดับการพิจารณา
|
2023-10-18 10:09:11 +07:00
|
|
|
function selectLevel(val: string) {
|
|
|
|
|
let dayNum = 0;
|
|
|
|
|
if (val == "0") {
|
2023-10-18 14:41:11 +07:00
|
|
|
dayNum = 45; // ปกติ
|
2023-10-18 10:09:11 +07:00
|
|
|
} else if (val == "1") {
|
2023-10-18 14:41:11 +07:00
|
|
|
dayNum = 30; // ด่วน
|
2023-10-18 10:09:11 +07:00
|
|
|
} else {
|
2023-10-18 14:41:11 +07:00
|
|
|
dayNum = 15; // ด่วนมาก
|
2023-10-18 10:09:11 +07:00
|
|
|
}
|
2023-10-18 14:41:11 +07:00
|
|
|
// วันแจ้งเตือนล่วงหน้า
|
2023-10-18 10:09:11 +07:00
|
|
|
if (dateconsideration.value) {
|
|
|
|
|
const currentDate = new Date(dateconsideration.value);
|
|
|
|
|
const newDate = new Date(
|
|
|
|
|
currentDate.getTime() + dayNum * 24 * 60 * 60 * 1000
|
|
|
|
|
);
|
|
|
|
|
datewarn.value = newDate;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-10-18 14:41:11 +07:00
|
|
|
// validateForm
|
|
|
|
|
const complainantTypeRef = ref<any>(null);
|
|
|
|
|
const complainantRef = ref<any>(null);
|
|
|
|
|
const officeRef = ref<any>(null);
|
|
|
|
|
const agencyRef = ref<any>(null);
|
|
|
|
|
const topicComplaintRef = ref<any>(null);
|
|
|
|
|
const detailRef = ref<any>(null);
|
|
|
|
|
const datereceiveRef = ref<any>();
|
|
|
|
|
const dateconsiderationRef = ref<any>(null);
|
|
|
|
|
const offenseDescriptionRef = ref<any>(null);
|
|
|
|
|
const considerationLevelRef = ref<any>(null);
|
|
|
|
|
const datewarnRef = ref<any>(null);
|
|
|
|
|
const receivecomplaintsRef = ref<any>(null);
|
|
|
|
|
const petitionerRef = ref<any>(null);
|
|
|
|
|
const filesRef = ref<any>(null);
|
2023-10-18 10:09:11 +07:00
|
|
|
|
2023-10-18 14:41:11 +07:00
|
|
|
const objectComplaintsRef: MyObjectComplaintsRef = {
|
|
|
|
|
complainantType: complainantTypeRef,
|
|
|
|
|
complainant: complainantRef,
|
|
|
|
|
office: officeRef,
|
|
|
|
|
agency: agencyRef,
|
|
|
|
|
topicComplaint: topicComplaintRef,
|
|
|
|
|
detail: detailRef,
|
|
|
|
|
datereceive: datereceiveRef,
|
|
|
|
|
dateconsideration: dateconsiderationRef,
|
|
|
|
|
offenseDescription: offenseDescriptionRef,
|
|
|
|
|
considerationLevel: considerationLevelRef,
|
|
|
|
|
datewarn: datewarnRef,
|
|
|
|
|
receivecomplaints: receivecomplaintsRef,
|
|
|
|
|
petitioner: petitionerRef,
|
|
|
|
|
files: filesRef,
|
|
|
|
|
};
|
|
|
|
|
function validateForm() {
|
|
|
|
|
const hasError = [];
|
|
|
|
|
for (const key in objectComplaintsRef) {
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(objectComplaintsRef, key)) {
|
|
|
|
|
const property = objectComplaintsRef[key];
|
|
|
|
|
if (property.value && typeof property.value.validate === "function") {
|
|
|
|
|
const isValid = property.value.validate();
|
|
|
|
|
hasError.push(isValid);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (hasError.every((result) => result === true)) {
|
|
|
|
|
onSubmit();
|
|
|
|
|
} else {
|
|
|
|
|
console.log("ไม่ผ่าน ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// บันทึกข้อมูล
|
2023-10-17 17:49:31 +07:00
|
|
|
function onSubmit() {
|
|
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
async () => {},
|
|
|
|
|
"ยืนยันการบันทึกข้อมูล",
|
|
|
|
|
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
|
|
|
|
);
|
|
|
|
|
}
|
2023-10-16 18:07:42 +07:00
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="toptitle text-dark col-12 row items-center">
|
|
|
|
|
<q-btn
|
|
|
|
|
icon="mdi-arrow-left"
|
|
|
|
|
unelevated
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
flat
|
|
|
|
|
color="primary"
|
|
|
|
|
class="q-mr-sm"
|
|
|
|
|
@click="router.push(`/discipline/complaints`)"
|
|
|
|
|
/>
|
|
|
|
|
เพิ่มเรื่องร้องเรียน
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 q-mt-sm">
|
|
|
|
|
<q-card flat bordered>
|
2023-10-18 14:41:11 +07:00
|
|
|
<form @submit.prevent="validateForm">
|
2023-10-17 17:49:31 +07:00
|
|
|
<div class="col-12 row q-pa-md">
|
|
|
|
|
<div
|
|
|
|
|
class="col-xs-12 col-sm-12 row q-col-gutter-x-md q-col-gutter-y-xs"
|
|
|
|
|
>
|
|
|
|
|
<div class="col-xs-12 col-sm-2">
|
|
|
|
|
<q-select
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="complainantTypeRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="complainantType"
|
|
|
|
|
:options="complainstStore.complainantoptions"
|
|
|
|
|
label="ผู้ร้องเรียน"
|
|
|
|
|
option-value="id"
|
|
|
|
|
option-label="name"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
@update:model-value="selectComplainant(complainantType)"
|
|
|
|
|
use-input
|
|
|
|
|
@filter="(inputValue: any,
|
|
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'filtercomplainantType'
|
|
|
|
|
)"
|
2023-10-18 14:41:11 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
2023-10-17 17:49:31 +07:00
|
|
|
</div>
|
2023-10-18 14:41:11 +07:00
|
|
|
|
2023-10-17 17:49:31 +07:00
|
|
|
<div class="col-xs-12 col-sm-2" v-if="complainantType === '0'">
|
|
|
|
|
<q-select
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="complainantRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="complainant"
|
|
|
|
|
:options="complainstStore.optionListName"
|
2023-10-18 14:41:11 +07:00
|
|
|
label="รายชื่อจากทะเบียรประวัติ"
|
2023-10-17 17:49:31 +07:00
|
|
|
option-value="id"
|
|
|
|
|
option-label="name"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
2023-10-18 14:41:11 +07:00
|
|
|
:rules="[(val) => !!val || `${'กรุณาเลือกรายชื่อ'}`]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
use-input
|
|
|
|
|
@filter="(inputValue: any,
|
|
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'filtercomplainantOP'
|
|
|
|
|
)"
|
|
|
|
|
><template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
2023-10-17 17:49:31 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-2" v-if="complainantType === '1'">
|
2023-10-18 14:41:11 +07:00
|
|
|
<q-input
|
|
|
|
|
ref="officeRef"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="office"
|
|
|
|
|
label="เลือกสำนักงาน"
|
|
|
|
|
:rules="[(val) => !!val || `${'กรุณาเลือกสำนักงาน'}`]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
/>
|
2023-10-17 17:49:31 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-2">
|
|
|
|
|
<q-select
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="agencyRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="agency"
|
|
|
|
|
:options="complainstStore.agencytoptions"
|
|
|
|
|
label="หน่วยงานที่พิจารณา"
|
|
|
|
|
option-value="id"
|
|
|
|
|
option-label="name"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
:rules="[(val) => !!val || `${'กรุณาเลือกหน่วยงาน'}`]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
use-input
|
|
|
|
|
@filter="(inputValue: any,
|
|
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'filteragencytoptions'
|
|
|
|
|
)"
|
2023-10-18 14:41:11 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
2023-10-17 17:49:31 +07:00
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-12">
|
|
|
|
|
<q-input
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="topicComplaintRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="topicComplaint"
|
|
|
|
|
:rules="[(val) => !!val || 'กรุณาการข้อมูล']"
|
|
|
|
|
lazy-rules
|
|
|
|
|
label="เรื่องร้องเรียน"
|
|
|
|
|
type="textarea"
|
|
|
|
|
rows="5"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-12">
|
|
|
|
|
<q-input
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="detailRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="detail"
|
|
|
|
|
:rules="[(val) => !!val || 'กรุณาการข้อมูล']"
|
|
|
|
|
lazy-rules
|
|
|
|
|
label="รายละเอียดที่เกี่นวข้องกับเรื่องที่ต้องการจะข้อเรียน"
|
|
|
|
|
type="textarea"
|
|
|
|
|
rows="5"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-2">
|
|
|
|
|
<datepicker
|
|
|
|
|
menu-class-name="modalfix"
|
|
|
|
|
v-model="datereceive"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
borderless
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
week-start="0"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">
|
|
|
|
|
{{ year + 543 }}
|
|
|
|
|
</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">
|
|
|
|
|
{{ parseInt(value + 543) }}
|
|
|
|
|
</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="datereceiveRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
class="full-width datepicker"
|
|
|
|
|
:model-value="
|
|
|
|
|
datereceive != null ? date2Thai(datereceive) : null
|
|
|
|
|
"
|
|
|
|
|
label="วันที่รับเรื่อง"
|
|
|
|
|
:rules="[
|
|
|
|
|
(val) => !!val || `${'กรุณาเลือกวันที่รับเรื่อง'}`,
|
|
|
|
|
]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
>
|
|
|
|
|
<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-xs-12 col-sm-2">
|
|
|
|
|
<datepicker
|
|
|
|
|
menu-class-name="modalfix"
|
|
|
|
|
v-model="dateconsideration"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
borderless
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
week-start="0"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">
|
|
|
|
|
{{ year + 543 }}
|
|
|
|
|
</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">
|
|
|
|
|
{{ parseInt(value + 543) }}
|
|
|
|
|
</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="dateconsiderationRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
class="full-width datepicker"
|
|
|
|
|
:model-value="
|
|
|
|
|
dateconsideration != null
|
|
|
|
|
? date2Thai(dateconsideration)
|
|
|
|
|
: null
|
|
|
|
|
"
|
|
|
|
|
label="วันที่กำหนดวันพิจารณา"
|
|
|
|
|
:rules="[
|
|
|
|
|
(val) => !!val || `${'กรุณาเลือกวันที่กำหนดวันพิจารณา'}`,
|
|
|
|
|
]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
>
|
|
|
|
|
<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-xs-12 col-sm-2">
|
|
|
|
|
<q-select
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="offenseDescriptionRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="offenseDescription"
|
|
|
|
|
:options="offenseDescriptiontoptions"
|
|
|
|
|
label="ลักษณะความผิด"
|
|
|
|
|
option-value="id"
|
|
|
|
|
option-label="name"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
:rules="[(val) => !!val || `${'กรุณาเลือกลักษณะความผิด'}`]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-2">
|
|
|
|
|
<q-select
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="considerationLevelRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="considerationLevel"
|
|
|
|
|
:options="considerationLeveltoptions"
|
|
|
|
|
label="ระดับการพิจารณา"
|
|
|
|
|
option-value="id"
|
|
|
|
|
option-label="name"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
:rules="[(val) => !!val || `${'กรุณาเลือกระดับการพิจารณา'}`]"
|
|
|
|
|
lazy-rules
|
2023-10-18 10:09:11 +07:00
|
|
|
@update:model-value="selectLevel(considerationLevel)"
|
2023-10-17 17:49:31 +07:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-3"></div>
|
|
|
|
|
<div class="col-xs-12 col-sm-2">
|
|
|
|
|
<datepicker
|
|
|
|
|
menu-class-name="modalfix"
|
|
|
|
|
v-model="datewarn"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
borderless
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
week-start="0"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">
|
|
|
|
|
{{ year + 543 }}
|
|
|
|
|
</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">
|
|
|
|
|
{{ parseInt(value + 543) }}
|
|
|
|
|
</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="datewarnRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
class="full-width datepicker"
|
|
|
|
|
:model-value="datewarn != null ? date2Thai(datewarn) : null"
|
2023-10-18 10:09:11 +07:00
|
|
|
label="วันที่แจ้งเตือนล่วงหน้า"
|
2023-10-17 17:49:31 +07:00
|
|
|
:rules="[
|
|
|
|
|
(val) =>
|
2023-10-18 10:09:11 +07:00
|
|
|
!!val || `${'กรุณาเลือกวันที่แจ้งเตือนล่วงหน้า'}`,
|
2023-10-17 17:49:31 +07:00
|
|
|
]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
>
|
|
|
|
|
<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-xs-12 col-sm-2">
|
|
|
|
|
<q-select
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="receivecomplaintsRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="receivecomplaints"
|
|
|
|
|
:options="receivecomplaintstoptions"
|
|
|
|
|
label="รับเรื่องร้องเรียน"
|
|
|
|
|
option-value="id"
|
|
|
|
|
option-label="name"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
:rules="[(val) => !!val || `${'กรุณาเลือกรับเรื่องร้องเรียน'}`]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-6"></div>
|
|
|
|
|
<div class="col-xs-12 col-sm-4">
|
|
|
|
|
<q-input
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="petitionerRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="petitioner"
|
|
|
|
|
label="ผู้ร้องเรียน"
|
|
|
|
|
:rules="[(val) => !!val || `${'กรุณากรอกข้อมูล'}`]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-12 col-sm-4">
|
|
|
|
|
<q-file
|
2023-10-18 14:41:11 +07:00
|
|
|
ref="filesRef"
|
2023-10-17 17:49:31 +07:00
|
|
|
class="col-xs-12 col-sm-10"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
v-model="files"
|
|
|
|
|
@added="fileUploadDoc"
|
|
|
|
|
label="ไฟล์เอกสารหลักฐาน"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
lazy-rules
|
|
|
|
|
accept=".pdf,.xlsx,.doc"
|
|
|
|
|
clearable
|
2023-10-18 14:41:11 +07:00
|
|
|
:rules="[(val) => !!val || `${'กรุณาเพิ่มไฟล์เอกสารหลักฐาน'}`]"
|
2023-10-17 17:49:31 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:prepend>
|
|
|
|
|
<q-icon name="attach_file" />
|
|
|
|
|
</template>
|
|
|
|
|
</q-file>
|
|
|
|
|
</div>
|
2023-10-16 18:07:42 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-10-17 17:49:31 +07:00
|
|
|
<q-separator />
|
|
|
|
|
<div class="row col-12 q-pa-sm">
|
|
|
|
|
<q-space />
|
|
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="secondary"
|
|
|
|
|
icon="mdi-content-save-outline"
|
|
|
|
|
type="submit"
|
|
|
|
|
><q-tooltip>บับทึกข้อมูล</q-tooltip></q-btn
|
|
|
|
|
>
|
|
|
|
|
</div>
|
2023-10-18 14:41:11 +07:00
|
|
|
</form>
|
2023-10-16 18:07:42 +07:00
|
|
|
</q-card>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|