Merge branch 'develop' into devTee
This commit is contained in:
commit
e7a078c76e
7 changed files with 288 additions and 158 deletions
|
|
@ -1,13 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import Form from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue";
|
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||||
|
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
||||||
import type { FormData } from "@/modules/11_discipline/interface/request/investigate";
|
import type { FormData } from "@/modules/11_discipline/interface/request/investigate";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
const store = useInvestigateFactStore();
|
||||||
const { dialogConfirm } = mixin;
|
const { dialogConfirm } = mixin;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
@ -149,7 +152,31 @@ onMounted(() => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<q-card flat bordered class="col-12">
|
||||||
|
<q-tabs
|
||||||
|
v-model="store.tabMenu"
|
||||||
|
dense
|
||||||
|
align="left"
|
||||||
|
inline-label
|
||||||
|
class="rounded-borders"
|
||||||
|
indicator-color="primary"
|
||||||
|
active-bg-color="teal-1"
|
||||||
|
active-class="text-primary"
|
||||||
|
>
|
||||||
|
<q-tab name="complaints" label="เรื่องร้องเรียน" />
|
||||||
|
<q-tab name="investigatefacts" label="สืบสวนข้อเท็จจริง" />
|
||||||
|
</q-tabs>
|
||||||
|
<q-separator />
|
||||||
|
<q-tab-panels v-model="store.tabMenu" animated>
|
||||||
|
<q-tab-panel name="complaints">
|
||||||
|
<FormComplaints :on-submit="onSubmit" />
|
||||||
|
</q-tab-panel>
|
||||||
|
<q-tab-panel name="investigatefacts">
|
||||||
|
<FormInvestigatefacts :on-submit="onSubmit" :data="data" />
|
||||||
|
</q-tab-panel>
|
||||||
|
</q-tab-panels>
|
||||||
|
</q-card>
|
||||||
|
|
||||||
<Form :on-submit="onSubmit" :data="data" />
|
<!-- <Form :on-submit="onSubmit" :data="data" /> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,29 @@ function calEndDate(val: string) {
|
||||||
formData.dateEnd = new Date(dateNew.setDate(date.getDate() + Number(val)));
|
formData.dateEnd = new Date(dateNew.setDate(date.getDate() + Number(val)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fetchDataDetail() {
|
||||||
|
if (props.data !== null) {
|
||||||
|
// isUpdate.value = true;
|
||||||
|
formData.complaint = props.data.complaint;
|
||||||
|
formData.complaintdetail = props.data.complaintdetail;
|
||||||
|
formData.detail = props.data.detail;
|
||||||
|
formData.fault = props.data.fault;
|
||||||
|
formData.other = props.data.other;
|
||||||
|
formData.evidenceFiles = props.data.evidenceFiles;
|
||||||
|
formData.fileComplaint = props.data.fileComplaint;
|
||||||
|
formData.clickTime = props.data.clickTime;
|
||||||
|
formData.date = props.data.date;
|
||||||
|
formData.dateEnd = props.data.dateEnd;
|
||||||
|
formData.investigation = props.data.investigation;
|
||||||
|
formData.daysExtend = props.data.daysExtend;
|
||||||
|
formData.statusResult = props.data.results;
|
||||||
|
formData.causeText = props.data.results;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onMounted(async () => {
|
||||||
|
await fetchDataDetail();
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* เช็คข้อมูลจาก props
|
* เช็คข้อมูลจาก props
|
||||||
* เมื่อมีข้อมูล
|
* เมื่อมีข้อมูล
|
||||||
|
|
@ -293,7 +316,6 @@ watch(props.data, async () => {
|
||||||
<div class="q-pa-sm">
|
<div class="q-pa-sm">
|
||||||
<div class="q-col-gutter-sm row">
|
<div class="q-col-gutter-sm row">
|
||||||
<div class="col-3" v-if="!formData.clickTime">
|
<div class="col-3" v-if="!formData.clickTime">
|
||||||
|
|
||||||
<datepicker
|
<datepicker
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
:readonly="isUpdate"
|
:readonly="isUpdate"
|
||||||
|
|
@ -372,7 +394,7 @@ watch(props.data, async () => {
|
||||||
</template>
|
</template>
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<datepicker
|
<datepicker
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import Form from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue";
|
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||||
|
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
||||||
|
import FormDisciplinary from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue"; // สอบสวนความผิดทางวินัย
|
||||||
import type { FormData } from "@/modules/11_discipline/interface/request/disciplinary";
|
import type { FormData } from "@/modules/11_discipline/interface/request/disciplinary";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
const store = useInvestigateDisStore();
|
||||||
const { dialogConfirm } = mixin;
|
const { dialogConfirm } = mixin;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
@ -33,7 +37,7 @@ const data = reactive<FormData>({
|
||||||
filesRecordAccuser: null,
|
filesRecordAccuser: null,
|
||||||
filesWitnesses: null,
|
filesWitnesses: null,
|
||||||
filesEtc: null,
|
filesEtc: null,
|
||||||
complaintStatus: 'NEW'
|
complaintStatus: "NEW",
|
||||||
});
|
});
|
||||||
|
|
||||||
/** จำลองข้อมูลจาก api */
|
/** จำลองข้อมูลจาก api */
|
||||||
|
|
@ -114,8 +118,8 @@ function confirmCancelInvestigate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
fetchData();
|
await fetchData();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -134,7 +138,12 @@ onMounted(() => {
|
||||||
<div class="q-ma-none">แก้ไขการสอบสวนความผิดทางวินัย {{ id }}#id</div>
|
<div class="q-ma-none">แก้ไขการสอบสวนความผิดทางวินัย {{ id }}#id</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="q-gutter-x-sm">
|
<div class="q-gutter-x-sm">
|
||||||
<q-btn v-if="data.complaintStatus === 'NEW'" label="ส่งไปออกคำสั่ง" color="public" @click="sentIssue" />
|
<q-btn
|
||||||
|
v-if="data.complaintStatus === 'NEW'"
|
||||||
|
label="ส่งไปออกคำสั่ง"
|
||||||
|
color="public"
|
||||||
|
@click="sentIssue"
|
||||||
|
/>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="data.complaintStatus === 'NEW'"
|
v-if="data.complaintStatus === 'NEW'"
|
||||||
label="ยุติเรื่อง"
|
label="ยุติเรื่อง"
|
||||||
|
|
@ -147,9 +156,36 @@ onMounted(() => {
|
||||||
color="red-7"
|
color="red-7"
|
||||||
@click="cancelInvestigate"
|
@click="cancelInvestigate"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Form :on-submit="onSubmit" :data="data" />
|
<q-card flat bordered class="col-12">
|
||||||
|
<q-tabs
|
||||||
|
v-model="store.tabMenu"
|
||||||
|
dense
|
||||||
|
align="left"
|
||||||
|
inline-label
|
||||||
|
class="rounded-borders"
|
||||||
|
indicator-color="primary"
|
||||||
|
active-bg-color="teal-1"
|
||||||
|
active-class="text-primary"
|
||||||
|
>
|
||||||
|
<q-tab name="complaints" label="เรื่องร้องเรียน" />
|
||||||
|
<q-tab name="investigatefacts" label="สืบสวนข้อเท็จจริง" />
|
||||||
|
<q-tab name="disciplinary" label="สอบสวนความผิดทางวินัย" />
|
||||||
|
</q-tabs>
|
||||||
|
<q-separator />
|
||||||
|
<q-tab-panels v-model="store.tabMenu" animated>
|
||||||
|
<q-tab-panel name="complaints">
|
||||||
|
<FormComplaints :on-submit="onSubmit" />
|
||||||
|
</q-tab-panel>
|
||||||
|
<q-tab-panel name="investigatefacts">
|
||||||
|
<FormInvestigatefacts :on-submit="onSubmit" />
|
||||||
|
</q-tab-panel>
|
||||||
|
<q-tab-panel name="disciplinary">
|
||||||
|
<FormDisciplinary :on-submit="onSubmit" :data="data" />
|
||||||
|
</q-tab-panel>
|
||||||
|
</q-tab-panels>
|
||||||
|
</q-card>
|
||||||
|
<!-- <Form :on-submit="onSubmit" :data="data" /> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -119,10 +119,10 @@ const objectdisciplinary: disciplinaryRef = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/** เปิด dialog */
|
/** เปิด dialog */
|
||||||
function popup(){
|
function popup() {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
filterKeyword2.value = "";
|
filterKeyword2.value = "";
|
||||||
};
|
}
|
||||||
|
|
||||||
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
|
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
|
||||||
function validateForm() {
|
function validateForm() {
|
||||||
|
|
@ -180,6 +180,29 @@ async function deleteData(id: string) {
|
||||||
console.log("delete");
|
console.log("delete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fetvhDatadetail() {
|
||||||
|
formData.complaint = props.data.complaint;
|
||||||
|
formData.dateInvestigate = props.data.dateInvestigate;
|
||||||
|
formData.dateAllegation = props.data.dateAllegation;
|
||||||
|
formData.dateEvident = props.data.dateEvident;
|
||||||
|
formData.casefault = props.data.casefault;
|
||||||
|
formData.typefault = props.data.typefault;
|
||||||
|
formData.faultLevel = props.data.faultLevel;
|
||||||
|
formData.refLaw = props.data.refLaw;
|
||||||
|
formData.detailComplaint = props.data.detailComplaint;
|
||||||
|
formData.whereInvestigate = props.data.whereInvestigate;
|
||||||
|
formData.trueDetail = props.data.trueDetail;
|
||||||
|
formData.evidence = props.data.evidence;
|
||||||
|
formData.recordAccuser = props.data.recordAccuser;
|
||||||
|
formData.witnesses = props.data.witnesses;
|
||||||
|
formData.InvestResults = props.data.InvestResults;
|
||||||
|
formData.filesEvidence = props.data.filesEvidence;
|
||||||
|
formData.filesRecordAccuser = props.data.filesRecordAccuser;
|
||||||
|
formData.filesWitnesses = props.data.filesWitnesses;
|
||||||
|
formData.filesEtc = props.data.filesEtc;
|
||||||
|
|
||||||
|
console.log(formData);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* เช็คข้อมูลจาก props
|
* เช็คข้อมูลจาก props
|
||||||
* เมื่อมีข้อมูล
|
* เมื่อมีข้อมูล
|
||||||
|
|
@ -207,10 +230,11 @@ watch(props.data, async () => {
|
||||||
formData.filesEtc = props.data.filesEtc;
|
formData.filesEtc = props.data.filesEtc;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**เมื่อเริ่มโหลดหน้า
|
/**เมื่อเริ่มโหลดหน้า
|
||||||
* ส่งข้อมูลจำลองไปยัง store
|
* ส่งข้อมูลจำลองไปยัง store
|
||||||
*/
|
*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
await fetvhDatadetail();
|
||||||
await fecthDirector([
|
await fecthDirector([
|
||||||
{
|
{
|
||||||
nameDirector: "นาง เกสินี เจียรสุมัย",
|
nameDirector: "นาง เกสินี เจียรสุมัย",
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ const router = useRouter();
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const dataInvestigateDis = useInvestigateDisStore();
|
const dataInvestigateDis = useInvestigateDisStore();
|
||||||
const { hideLoader } = mixin;
|
const { showLoader, hideLoader } = mixin;
|
||||||
const { fecthList } = dataInvestigateDis;
|
const { fecthList } = dataInvestigateDis;
|
||||||
|
|
||||||
const initialPagination = ref<Pagination>({
|
const initialPagination = ref<Pagination>({
|
||||||
|
|
@ -23,18 +23,19 @@ const initialPagination = ref<Pagination>({
|
||||||
* ไปหน้าแก้ไข
|
* ไปหน้าแก้ไข
|
||||||
* @param id ไอดีเฉพาะ รายบุคคล
|
* @param id ไอดีเฉพาะ รายบุคคล
|
||||||
*/
|
*/
|
||||||
function openEdit(id:string) {
|
function openEdit(id: string) {
|
||||||
console.log(id)
|
console.log(id);
|
||||||
router.push(`/discipline/disciplinary/${id}`)
|
router.push(`/discipline/disciplinary/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**เมื่อเริ่มโหลดหน้า
|
/**เมื่อเริ่มโหลดหน้า
|
||||||
* ส่งข้อมูลจำลองไปยัง store
|
* ส่งข้อมูลจำลองไปยัง store
|
||||||
*/
|
*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
showLoader();
|
||||||
fecthList([
|
fecthList([
|
||||||
{
|
{
|
||||||
id:'001',
|
id: "001",
|
||||||
subject: "ทุจริตในหน้าที่",
|
subject: "ทุจริตในหน้าที่",
|
||||||
interrogated: "ศิรินภา คงน้อยี่",
|
interrogated: "ศิรินภา คงน้อยี่",
|
||||||
fault: "1",
|
fault: "1",
|
||||||
|
|
@ -45,7 +46,7 @@ onMounted(async () => {
|
||||||
active: "2",
|
active: "2",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:'002',
|
id: "002",
|
||||||
subject: "ทุจริตในหน้าที่",
|
subject: "ทุจริตในหน้าที่",
|
||||||
interrogated: "ภัทรานุช คงน้อย",
|
interrogated: "ภัทรานุช คงน้อย",
|
||||||
fault: "1",
|
fault: "1",
|
||||||
|
|
@ -56,7 +57,7 @@ onMounted(async () => {
|
||||||
active: "0",
|
active: "0",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:'003',
|
id: "003",
|
||||||
subject: "กระทำทุจริตเงินกองทุน",
|
subject: "กระทำทุจริตเงินกองทุน",
|
||||||
interrogated: "ปรมาพร ศรีมี",
|
interrogated: "ปรมาพร ศรีมี",
|
||||||
fault: "2",
|
fault: "2",
|
||||||
|
|
@ -67,7 +68,7 @@ onMounted(async () => {
|
||||||
active: "1",
|
active: "1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:'004',
|
id: "004",
|
||||||
subject: "พูดจาไม่สุภาพ",
|
subject: "พูดจาไม่สุภาพ",
|
||||||
interrogated: "สมรัก ใจอารีย์",
|
interrogated: "สมรัก ใจอารีย์",
|
||||||
fault: "2",
|
fault: "2",
|
||||||
|
|
@ -103,7 +104,12 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<template #columns="props">
|
<template #columns="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props" @click="openEdit(props.row.id)">
|
<q-td
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
@click="openEdit(props.row.id)"
|
||||||
|
>
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ const { date2Thai } = mixin;
|
||||||
export const useInvestigateDisStore = defineStore(
|
export const useInvestigateDisStore = defineStore(
|
||||||
"DisciplineInvestigateDis",
|
"DisciplineInvestigateDis",
|
||||||
() => {
|
() => {
|
||||||
|
const tabMenu = ref<string>("disciplinary");
|
||||||
const rows = ref<investigateDisDataRowType[]>([]);
|
const rows = ref<investigateDisDataRowType[]>([]);
|
||||||
const rows2 = ref<directorType[]>([]);
|
const rows2 = ref<directorType[]>([]);
|
||||||
const selected = ref<directorType[]>([]);
|
const selected = ref<directorType[]>([]);
|
||||||
|
|
@ -32,7 +33,7 @@ export const useInvestigateDisStore = defineStore(
|
||||||
]);
|
]);
|
||||||
async function fecthList(data: investigateDisDataRowType[]) {
|
async function fecthList(data: investigateDisDataRowType[]) {
|
||||||
let datalist: investigateDisDataRowType[] = data.map((e: any) => ({
|
let datalist: investigateDisDataRowType[] = data.map((e: any) => ({
|
||||||
id:e.id,
|
id: e.id,
|
||||||
subject: e.subject,
|
subject: e.subject,
|
||||||
interrogated: e.interrogated,
|
interrogated: e.interrogated,
|
||||||
fault: convertFault(e.fault),
|
fault: convertFault(e.fault),
|
||||||
|
|
@ -273,6 +274,7 @@ export const useInvestigateDisStore = defineStore(
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
return {
|
return {
|
||||||
|
tabMenu,
|
||||||
fecthList,
|
fecthList,
|
||||||
rows,
|
rows,
|
||||||
rows2,
|
rows2,
|
||||||
|
|
|
||||||
|
|
@ -1,170 +1,183 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { investigatefactsDataRowType, DataOption, DataNumberOption } from '@/modules/11_discipline/interface/index/Main'
|
import type {
|
||||||
|
investigatefactsDataRowType,
|
||||||
|
DataOption,
|
||||||
|
DataNumberOption,
|
||||||
|
} from "@/modules/11_discipline/interface/index/Main";
|
||||||
|
|
||||||
/*** store ของข้อมูลสืบสวนข้อเท็จจริง */
|
/*** store ของข้อมูลสืบสวนข้อเท็จจริง */
|
||||||
export const useInvestigateFactStore = defineStore("DisciplineInvestigateFact", () => {
|
export const useInvestigateFactStore = defineStore(
|
||||||
const rows = ref<investigatefactsDataRowType[]>([])
|
"DisciplineInvestigateFact",
|
||||||
|
() => {
|
||||||
|
const tabMenu = ref<string>("investigatefacts");
|
||||||
|
const rows = ref<investigatefactsDataRowType[]>([]);
|
||||||
|
|
||||||
const daysExtendOps = ref<DataNumberOption[]>([
|
const daysExtendOps = ref<DataNumberOption[]>([
|
||||||
{ id: 15, name: "15 วัน" },
|
{ id: 15, name: "15 วัน" },
|
||||||
{ id: 30, name: "30 วัน" },
|
{ id: 30, name: "30 วัน" },
|
||||||
{ id: 45, name: "45 วัน" },
|
{ id: 45, name: "45 วัน" },
|
||||||
{ id: 60, name: "60 วัน" },
|
{ id: 60, name: "60 วัน" },
|
||||||
]);
|
]);
|
||||||
const investigationOps = ref<DataOption[]>([
|
const investigationOps = ref<DataOption[]>([
|
||||||
{ id: "001", name: "เเต่งตั้งการสืบสวน" },
|
{ id: "001", name: "เเต่งตั้งการสืบสวน" },
|
||||||
{ id: "002", name: "สืบสวนทางลับ" },
|
{ id: "002", name: "สืบสวนทางลับ" },
|
||||||
{ id: "003", name: "อื่นๆ" },
|
{ id: "003", name: "อื่นๆ" },
|
||||||
]);
|
]);
|
||||||
const faultOps = ref<DataOption[]>([
|
const faultOps = ref<DataOption[]>([
|
||||||
{ id: "001", name: "ยังไม่ระบุ" },
|
{ id: "001", name: "ยังไม่ระบุ" },
|
||||||
{ id: "002", name: "ไม่ร้ายเเรง" },
|
{ id: "002", name: "ไม่ร้ายเเรง" },
|
||||||
{ id: "003", name: "ร้ายเเรง" },
|
{ id: "003", name: "ร้ายเเรง" },
|
||||||
]);
|
]);
|
||||||
const statusResultOptions = ref<DataOption[]>([
|
const statusResultOptions = ref<DataOption[]>([
|
||||||
{ id: "not_specified", name: "ยังไม่ระบุ" },
|
{ id: "not_specified", name: "ยังไม่ระบุ" },
|
||||||
{ id: "have_cause", name: "มีมูล" },
|
{ id: "have_cause", name: "มีมูล" },
|
||||||
{ id: "no_cause", name: "ไม่มีมูล" },
|
{ id: "no_cause", name: "ไม่มีมูล" },
|
||||||
]);
|
]);
|
||||||
const causeTextOptions = ref<DataOption[]>([
|
const causeTextOptions = ref<DataOption[]>([
|
||||||
{ id: "ร้ายแรง", name: "ร้ายแรง" },
|
{ id: "ร้ายแรง", name: "ร้ายแรง" },
|
||||||
{ id: "ไม่ร้ายแรง", name: "ไม่ร้ายแรง" },
|
{ id: "ไม่ร้ายแรง", name: "ไม่ร้ายแรง" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const daysExtendOp = ref<DataNumberOption[]>(daysExtendOps.value);
|
const daysExtendOp = ref<DataNumberOption[]>(daysExtendOps.value);
|
||||||
const investigationOp = ref<DataOption[]>(investigationOps.value);
|
const investigationOp = ref<DataOption[]>(investigationOps.value);
|
||||||
const faultOp = ref<DataOption[]>(faultOps.value);
|
const faultOp = ref<DataOption[]>(faultOps.value);
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"no",
|
"no",
|
||||||
"subject",
|
"subject",
|
||||||
"interrogated",
|
"interrogated",
|
||||||
"fault",
|
"fault",
|
||||||
"status",
|
"status",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// หัวตาราง
|
// หัวตาราง
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "no",
|
name: "no",
|
||||||
align: "center",
|
align: "center",
|
||||||
label: "ลำดับ",
|
label: "ลำดับ",
|
||||||
sortable: false,
|
sortable: false,
|
||||||
field: "no",
|
field: "no",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "subject",
|
name: "subject",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "เรื่อง",
|
label: "เรื่อง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "subject",
|
field: "subject",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "interrogated",
|
name: "interrogated",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ผู้ถูกสอบสวน",
|
label: "ผู้ถูกสอบสวน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "interrogated",
|
field: "interrogated",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "fault",
|
name: "fault",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ลักษณะความผิด",
|
label: "ลักษณะความผิด",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "fault",
|
field: "fault",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "status",
|
name: "status",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สถานะ",
|
label: "สถานะ",
|
||||||
sortable: false,
|
sortable: false,
|
||||||
field: "status",
|
field: "status",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
function filterFnOptionsType(val: string | number, update: any, type: string) {
|
function filterFnOptionsType(
|
||||||
update(() => {
|
val: string | number,
|
||||||
if (type === "faultOp") {
|
update: any,
|
||||||
faultOp.value = faultOps.value.filter(
|
type: string
|
||||||
(v: any) => v.name.toLowerCase().indexOf(val) > -1
|
) {
|
||||||
);
|
update(() => {
|
||||||
|
if (type === "faultOp") {
|
||||||
} else if (type === "investigationOp") {
|
faultOp.value = faultOps.value.filter(
|
||||||
investigationOp.value = investigationOps.value.filter(
|
(v: any) => v.name.toLowerCase().indexOf(val) > -1
|
||||||
(v: any) => v.name.toLowerCase().indexOf(val) > -1
|
);
|
||||||
);
|
} else if (type === "investigationOp") {
|
||||||
} else if (type === "daysExtendOp") {
|
investigationOp.value = investigationOps.value.filter(
|
||||||
daysExtendOp.value = daysExtendOps.value.filter(
|
(v: any) => v.name.toLowerCase().indexOf(val) > -1
|
||||||
(v: any) => v.id.indexOf(val) > -1
|
);
|
||||||
);
|
} else if (type === "daysExtendOp") {
|
||||||
}
|
daysExtendOp.value = daysExtendOps.value.filter(
|
||||||
|
(v: any) => v.id.indexOf(val) > -1
|
||||||
});
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function fecthList(data: investigatefactsDataRowType[]) {
|
function fecthList(data: investigatefactsDataRowType[]) {
|
||||||
let datalist: investigatefactsDataRowType[] = data.map((e: investigatefactsDataRowType) => {
|
let datalist: investigatefactsDataRowType[] = data.map(
|
||||||
return {
|
(e: investigatefactsDataRowType) => {
|
||||||
id: e.id,
|
return {
|
||||||
subject: e.subject,
|
id: e.id,
|
||||||
interrogated: e.interrogated,
|
subject: e.subject,
|
||||||
fault: e.fault ? convertFault(e.fault) : '-',
|
interrogated: e.interrogated,
|
||||||
status: e.status ? convertSatatus(e.status) : '-',
|
fault: e.fault ? convertFault(e.fault) : "-",
|
||||||
active: e.active ? activeStatus(e.active) : '-'
|
status: e.status ? convertSatatus(e.status) : "-",
|
||||||
};
|
active: e.active ? activeStatus(e.active) : "-",
|
||||||
});
|
};
|
||||||
rows.value = datalist;
|
}
|
||||||
|
);
|
||||||
|
rows.value = datalist;
|
||||||
}
|
}
|
||||||
function convertFault(val: string) {
|
function convertFault(val: string) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "0":
|
case "0":
|
||||||
return "ความผิดวินัยไม่ร้ายแรง"
|
return "ความผิดวินัยไม่ร้ายแรง";
|
||||||
case "1":
|
case "1":
|
||||||
return "ความผิดวินัยร้ายแรง"
|
return "ความผิดวินัยร้ายแรง";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function convertSatatus(val: string) {
|
function convertSatatus(val: string) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "0":
|
case "0":
|
||||||
return "ยุติเรื่อง"
|
return "ยุติเรื่อง";
|
||||||
case "1":
|
case "1":
|
||||||
return "เสร็จสิ้นเเล้ว"
|
return "เสร็จสิ้นเเล้ว";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function activeStatus(val: string) {
|
function activeStatus(val: string) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "0":
|
case "0":
|
||||||
return "ยังไม่ได้ยืนยันผล"
|
return "ยังไม่ได้ยืนยันผล";
|
||||||
case "1":
|
case "1":
|
||||||
return "ยืนยันผลเเล้ว"
|
return "ยืนยันผลเเล้ว";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
fecthList,
|
tabMenu,
|
||||||
rows,
|
fecthList,
|
||||||
daysExtendOps,
|
rows,
|
||||||
investigationOps,
|
daysExtendOps,
|
||||||
faultOps,
|
investigationOps,
|
||||||
filterFnOptionsType,
|
faultOps,
|
||||||
faultOp,
|
filterFnOptionsType,
|
||||||
daysExtendOp,
|
faultOp,
|
||||||
investigationOp,
|
daysExtendOp,
|
||||||
visibleColumns,
|
investigationOp,
|
||||||
columns,
|
visibleColumns,
|
||||||
statusResultOptions,
|
columns,
|
||||||
causeTextOptions
|
statusResultOptions,
|
||||||
|
causeTextOptions,
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue