2023-11-06 17:50:19 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { onMounted, reactive, ref } from "vue";
|
|
|
|
|
import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue";
|
|
|
|
|
import { useRouter, useRoute } from "vue-router";
|
2023-11-21 10:29:11 +07:00
|
|
|
import { useQuasar } from "quasar";
|
2023-11-16 16:02:18 +07:00
|
|
|
import type {
|
|
|
|
|
FormData,
|
|
|
|
|
ArrayPerson,
|
|
|
|
|
} from "@/modules/11_discipline/interface/request/complaint";
|
2023-11-21 10:29:11 +07:00
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2023-11-06 17:50:19 +07:00
|
|
|
|
2023-11-21 10:29:11 +07:00
|
|
|
const $q = useQuasar();
|
|
|
|
|
const mixin = useCounterMixin()
|
|
|
|
|
const { dialogConfirm } = mixin
|
2023-11-06 17:50:19 +07:00
|
|
|
const router = useRouter();
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
const id = ref<string>(route.params.id as string);
|
|
|
|
|
|
2023-11-10 13:12:34 +07:00
|
|
|
/** ข้อมูล v-model ของฟอร์ม */
|
2023-11-16 16:02:18 +07:00
|
|
|
const personOj = reactive<ArrayPerson>({
|
|
|
|
|
idcard: "",
|
|
|
|
|
name: "",
|
|
|
|
|
position: "",
|
|
|
|
|
positionLevel: "",
|
2023-11-22 12:03:33 +07:00
|
|
|
salary: "",
|
2023-11-16 16:02:18 +07:00
|
|
|
organization: "",
|
|
|
|
|
});
|
2023-11-06 17:50:19 +07:00
|
|
|
const data = reactive<FormData>({
|
2023-11-16 16:02:18 +07:00
|
|
|
respondentType: "",
|
2023-11-06 17:50:19 +07:00
|
|
|
office: "",
|
2023-11-16 16:02:18 +07:00
|
|
|
consideredAgency: "",
|
|
|
|
|
title: "",
|
|
|
|
|
description: "",
|
|
|
|
|
dateReceived: null,
|
|
|
|
|
dateConsideration: null,
|
|
|
|
|
offenseDetails: "",
|
|
|
|
|
levelConsideration: "",
|
|
|
|
|
dateNotification: null,
|
|
|
|
|
complaintFrom: "",
|
|
|
|
|
appellant: "",
|
|
|
|
|
documentFile: null,
|
|
|
|
|
complaintStatus: "",
|
|
|
|
|
organizationId: "",
|
|
|
|
|
persons: [personOj],
|
|
|
|
|
personId:[],
|
|
|
|
|
respondentId:[]
|
2023-11-06 17:50:19 +07:00
|
|
|
});
|
2023-11-10 13:12:34 +07:00
|
|
|
|
|
|
|
|
/** ดึงค่าจาก api */
|
2023-11-06 17:50:19 +07:00
|
|
|
const fetchData = async () => {
|
2023-11-16 16:02:18 +07:00
|
|
|
data.respondentType = "PERSON";
|
|
|
|
|
data.office = "0";
|
|
|
|
|
data.consideredAgency = "2";
|
|
|
|
|
data.title = "ทุจริตในหน้าที่";
|
|
|
|
|
data.description = "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน";
|
|
|
|
|
data.dateReceived = new Date("2023-11-05");
|
|
|
|
|
data.dateConsideration = new Date("2023-11-07T14:58:00");
|
|
|
|
|
data.offenseDetails = "NOT_SPECIFIED";
|
|
|
|
|
data.levelConsideration = "NORMAL";
|
|
|
|
|
data.dateNotification = new Date("2023-11-07T14:58:00");
|
|
|
|
|
data.complaintFrom = "สตง";
|
|
|
|
|
data.appellant = "สมศรี สุขใจ";
|
|
|
|
|
data.documentFile = "";
|
|
|
|
|
data.complaintStatus = "NEW";
|
|
|
|
|
data.persons = [
|
|
|
|
|
{
|
|
|
|
|
idcard: "1529900022223",
|
|
|
|
|
name: "นางศิรินภา คงน้อย",
|
|
|
|
|
position: "ธุรการ",
|
|
|
|
|
positionLevel: "ต้น",
|
2023-11-22 12:03:33 +07:00
|
|
|
salary: "10000",
|
2023-11-16 16:02:18 +07:00
|
|
|
organization: "สกจ.",
|
|
|
|
|
},
|
|
|
|
|
]
|
2023-11-06 17:50:19 +07:00
|
|
|
};
|
|
|
|
|
|
2023-11-10 13:12:34 +07:00
|
|
|
/** ฟังชั่น แก้ไข */
|
|
|
|
|
async function onSubmit() {
|
2023-11-06 17:50:19 +07:00
|
|
|
console.log("edit");
|
|
|
|
|
router.push(`/discipline/complaints`);
|
2023-11-16 16:02:18 +07:00
|
|
|
}
|
2023-11-10 13:12:34 +07:00
|
|
|
|
2023-11-21 10:29:11 +07:00
|
|
|
/** ยืนยัน มีมูลส่งไปสืบสวน */
|
|
|
|
|
function sentInvestigate(){
|
|
|
|
|
dialogConfirm($q,()=> confirmSentInvestigate(),'ยืนยันส่งไปสืบสวน','ต้องการยืนยันส่งไปสืบสวนใช่หรือไม่?')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ยืนยัน ยุติเรื่อง */
|
|
|
|
|
function endInvestigate(){
|
|
|
|
|
dialogConfirm($q,()=> confirmEndInvestigate(),'ยืนยันยุติเรื่อง','ต้องการยืนยันยุติเรื่องใช่หรือไม่?')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ยืนยัน ยกเลิกการยุติเรื่อง */
|
|
|
|
|
function cancelInvestigate(){
|
|
|
|
|
dialogConfirm($q,()=> confirmCancelInvestigate(),'ยืนยันยกเลิกการยุติเรื่อง','ต้องการยืนยันยกเลิกการยุติเรื่องใช่หรือไม่?')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ฟังชั่น มีมูลส่งไปสืบสวน*/
|
|
|
|
|
function confirmSentInvestigate(){
|
|
|
|
|
console.log('sent')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ฟังชั่น ยุติเรื่อง*/
|
|
|
|
|
function confirmEndInvestigate(){
|
|
|
|
|
console.log('sent')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ฟังชั่น ยกเลิกการยุติเรื่อง*/
|
|
|
|
|
function confirmCancelInvestigate(){
|
|
|
|
|
console.log('sent')
|
|
|
|
|
}
|
2023-11-10 13:12:34 +07:00
|
|
|
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
|
|
|
|
onMounted(() => {
|
2023-11-16 16:02:18 +07:00
|
|
|
console.log(data);
|
2023-11-10 13:12:34 +07:00
|
|
|
fetchData();
|
|
|
|
|
});
|
2023-11-06 17:50:19 +07:00
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="col-xs-12 col-sm-12 col-md-11">
|
2023-11-16 16:02:18 +07:00
|
|
|
<div class="toptitle col-12 row items-end">
|
2023-11-06 17:50:19 +07:00
|
|
|
<q-btn
|
|
|
|
|
icon="mdi-arrow-left"
|
|
|
|
|
unelevated
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
flat
|
|
|
|
|
color="primary"
|
|
|
|
|
class="q-mr-sm"
|
|
|
|
|
@click="$router.push(`/discipline/complaints`)"
|
|
|
|
|
/>
|
2023-11-16 16:02:18 +07:00
|
|
|
<div class="q-ma-none">แก้ไขเรื่องร้องเรียน {{ id }}#id</div>
|
|
|
|
|
<q-space />
|
|
|
|
|
<div class="q-gutter-x-sm">
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="data.complaintStatus === 'NEW'"
|
|
|
|
|
label="มีมูลส่งไปสืบสวน"
|
|
|
|
|
color="public"
|
2023-11-21 10:29:11 +07:00
|
|
|
@click="sentInvestigate"
|
2023-11-16 16:02:18 +07:00
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="data.complaintStatus === 'NEW'"
|
|
|
|
|
label="ยุติเรื่อง"
|
|
|
|
|
color="red-7"
|
2023-11-21 10:29:11 +07:00
|
|
|
@click="endInvestigate"
|
2023-11-16 16:02:18 +07:00
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="data.complaintStatus === 'STOP'"
|
|
|
|
|
label="ยกเลิกการยุติเรื่อง"
|
|
|
|
|
color="red-7"
|
2023-11-21 10:29:11 +07:00
|
|
|
@click="cancelInvestigate"
|
2023-11-16 16:02:18 +07:00
|
|
|
/>
|
|
|
|
|
</div>
|
2023-11-06 17:50:19 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Form :on-submit="onSubmit" :data="data" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|