ผูก API สอบสวน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-11-27 16:30:14 +07:00
parent d3ec604478
commit b161f17a98
11 changed files with 708 additions and 882 deletions

View file

@ -1,6 +1,6 @@
import env from "../index"; import env from "../index";
const discipline = `${env.API_URI}/discipline`; const discipline = `${env.API_URI}/discipline`;
const investigate = `${env.API_URI}/discipline/investigate` const investigate = `${env.API_URI}/discipline/investigate`;
export default { export default {
directorList: (page: number, pageSize: number, keyword: string) => directorList: (page: number, pageSize: number, keyword: string) =>
@ -14,33 +14,34 @@ export default {
/** /**
* @param id type * @param id type
*/ */
complaintChannelbyId:(id:string) => `${discipline}/complaint_Channel/${id}`, complaintChannelbyId: (id: string) => `${discipline}/complaint_Channel/${id}`,
complaintAdd:() => `${discipline}/complaint`, complaintAdd: () => `${discipline}/complaint`,
complaintbyId:(id:string) => `${discipline}/complaint/${id}`, complaintbyId: (id: string) => `${discipline}/complaint/${id}`,
complaintReject:(id:string) => `${discipline}/complaint/reject/${id}`, complaintReject: (id: string) => `${discipline}/complaint/reject/${id}`,
complaintResume:(id:string) => `${discipline}/complaint/resume/${id}`, complaintResume: (id: string) => `${discipline}/complaint/resume/${id}`,
complaintList:(page:number,pageSize:number,keyword:string) => `${discipline}/complaint?page=${page}&pageSize=${pageSize}&keyword=${keyword}`, complaintList: (page: number, pageSize: number, keyword: string) =>
complaintFileUpload:(id:string) => `${discipline}/complaint/file/${id}`, `${discipline}/complaint?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
complaintFileDelete:(id:string,docId:string) => `${discipline}/complaint/file/${id}/${docId}`, complaintFileUpload: (id: string) => `${discipline}/complaint/file/${id}`,
complaintApprove:(id:string) => `${discipline}/complaint/approve/${id}`, complaintFileDelete: (id: string, docId: string) =>
`${discipline}/complaint/file/${id}/${docId}`,
complaintApprove: (id: string) => `${discipline}/complaint/approve/${id}`,
/** API สืบสวนข้อเท็จจริง*/ /** API สืบสวนข้อเท็จจริง*/
investigateMain:(page:number,pageSize:number,keyword:string) =>`${investigate}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`, investigateMain: (page: number, pageSize: number, keyword: string) =>
investigateById:(id:string) => `${investigate}/${id}`, `${investigate}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
investigateById: (id: string) => `${investigate}/${id}`,
investigateRelevantUploadFile: (id: string) =>
`${investigate}/relevant/file/${id}`,
investigateRelevantFileDelete: (id: string, docId: string) =>
`${investigate}/relevant/file/${id}/${docId}`,
investigateUploadFile: (id: string) => `${investigate}/file/${id}`,
investigateFileDelete: (id: string, docId: string) =>
`${investigate}/file/${id}/${docId}`,
investigateReject: (id: string) => `${investigate}/reject/${id}`,
investigateRelevantUploadFile:(id:string) => `${investigate}/relevant/file/${id}`, investigateResume: (id: string) => `${investigate}/resume/${id}`,
investigateRelevantFileDelete:(id:string,docId:string) => `${investigate}/relevant/file/${id}/${docId}`,
investigateUploadFile:(id:string) => `${investigate}/file/${id}`,
investigateFileDelete:(id:string,docId:string) => `${investigate}/file/${id}/${docId}`,
investigateReject:(id:string) => `${investigate}/reject/${id}`,
investigateResume:(id:string) => `${investigate}/resume/${id}`,
/** ระบบวินัยเรื่องสอบสวน */ /** ระบบวินัยเรื่องสอบสวน */
disciplineDisciplinary: () => `${discipline}/disciplinary`, disciplineDisciplinary: () => `${discipline}/disciplinary`,
@ -50,4 +51,5 @@ export default {
`${discipline}/disciplinary/investigate/${id}`, `${discipline}/disciplinary/investigate/${id}`,
disciplineComplaintsById: (id: string) => disciplineComplaintsById: (id: string) =>
`${discipline}/disciplinary/complaint/${id}`, `${discipline}/disciplinary/complaint/${id}`,
disciplineDirector: () => `${discipline}/director`,
}; };

View file

@ -1,13 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watchEffect, watch, onMounted } from "vue"; import { ref, computed, watchEffect, watch, onMounted } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { directorType } from "@/modules/11_discipline/interface/index/Main"; import type { directorType } from "@/modules/11_discipline/interface/index/Main";
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue"; import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar(); const $q = useQuasar();
const selected = ref<directorType[]>([]); const selected = ref<directorType[]>([]);
@ -60,17 +60,7 @@ const columns2 = ref<QTableProps["columns"]>([
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: "duty",
align: "left",
label: "หน้าที่",
sortable: true,
field: "duty",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{ {
name: "email", name: "email",
align: "left", align: "left",
@ -93,17 +83,6 @@ const columns2 = ref<QTableProps["columns"]>([
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: "role",
align: "left",
label: "จำนวนเรื่องสืบสวน",
sortable: true,
field: "role",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]); ]);
/** รับ props มาจากหน้าหลัก */ /** รับ props มาจากหน้าหลัก */
@ -139,7 +118,6 @@ const checkSelected = computed(() => {
if (selected.value.length === 0) { if (selected.value.length === 0) {
return true; return true;
} }
console.log(checkSelected.value);
}); });
/** popup ยืนยันส่งัว */ /** popup ยืนยันส่งัว */
@ -154,14 +132,14 @@ function saveDirector() {
/** ส่งไปออกคำสั่ง */ /** ส่งไปออกคำสั่ง */
async function DirectorSave() { async function DirectorSave() {
emit('returnDirector',selected.value); emit("returnDirector", selected.value);
} }
const emit = defineEmits([ const emit = defineEmits([
"update:filterKeyword2", "update:filterKeyword2",
"update:selected", "update:selected",
"update:pagination", "update:pagination",
"returnDirector" "returnDirector",
]); ]);
function updateInput(value: any) { function updateInput(value: any) {
@ -244,7 +222,17 @@ watch(
:visible-columns="visibleColumns2" :visible-columns="visibleColumns2"
selection="multiple" selection="multiple"
v-model:selected="selected" v-model:selected="selected"
:rows-per-page-options="[10, 25, 50, 100]"
v-model:pagination="pagination"
> >
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props" class="cursor-pointer">
<q-td> <q-td>

View file

@ -13,49 +13,53 @@ import { useQuasar } from "quasar";
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const store = useInvestigateDisStore(); const store = useInvestigateDisStore();
const { dialogConfirm } = mixin; const { dialogConfirm, success } = mixin;
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id as string); const id = ref<string>(route.params.id as string);
/** ข้อมูล v-model ของฟอร์ม */ /** ข้อมูล v-model ของฟอร์ม */
const data = reactive<FormData>({ // const data = reactive<FormData>({
complaint: "", // complaint: "",
respondentType: "", // respondentType: "",
dateInvestigate: null, // dateInvestigate: null,
dateAllegation: null, // dateAllegation: null,
dateEvident: null, // dateEvident: null,
casefault: "", // casefault: "",
typefault: "", // typefault: "",
faultLevel: "", // faultLevel: "",
refLaw: "", // refLaw: "",
detailComplaint: "", // detailComplaint: "",
whereInvestigate: "", // whereInvestigate: "",
trueDetail: "", // trueDetail: "",
evidence: "", // evidence: "",
recordAccuser: "", // recordAccuser: "",
witnesses: "", // witnesses: "",
InvestResults: "", // InvestResults: "",
filesEvidence: null, // filesEvidence: null,
filesRecordAccuser: null, // filesRecordAccuser: null,
filesWitnesses: null, // filesWitnesses: null,
filesEtc: null, // filesEtc: null,
complaintStatus: "NEW", // complaintStatus: "NEW",
organizationId: "", // organizationId: "",
consideredAgency: "", // consideredAgency: "",
}); // });
const data = ref<object>();
/** function fetchData สอบสวนคาวมผิดทางวินัย*/
async function fetchDetailDisciplinary() { async function fetchDetailDisciplinary() {
await http await http
.get(config.API.disciplineDisciplinaryById(id.value)) .get(config.API.disciplineDisciplinaryById(id.value))
.then((res) => { .then((res) => {
console.log(res); data.value = res.data.result;
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
} }
/** function fetchData สืบสวนข้อเท็จจริง*/
async function fetchDetailInvestigate() { async function fetchDetailInvestigate() {
await http await http
.get(config.API.disciplineInvestigateById(id.value)) .get(config.API.disciplineInvestigateById(id.value))
@ -67,6 +71,7 @@ async function fetchDetailInvestigate() {
}); });
} }
/** function fetchData เรื่องร้องเรียน*/
async function fetchDetailComplaints() { async function fetchDetailComplaints() {
await http await http
.get(config.API.disciplineComplaintsById(id.value)) .get(config.API.disciplineComplaintsById(id.value))
@ -78,28 +83,19 @@ async function fetchDetailComplaints() {
}); });
} }
/** จำลองข้อมูลจาก api */ async function onSubmitDisciplinary(data: any) {
const fetchData = async () => { console.log(data);
data.complaint = "test1";
data.dateInvestigate = new Date("2023-11-08T14:58:00"); await http
data.dateAllegation = new Date("2023-11-08T14:58:00"); .put(config.API.disciplineDisciplinaryById(id.value), data)
data.dateEvident = new Date("2023-11-08T14:58:00"); .then(() => {
data.casefault = "test1"; success($q, "บันทึกข้อมูลสำเร็จ");
data.typefault = "2"; })
data.faultLevel = "2"; .catch((err) => {})
data.refLaw = "test"; .finally(async () => {
data.detailComplaint = "รายละเอียด"; await fetchDetailDisciplinary();
data.whereInvestigate = "ที่ไหน"; });
data.trueDetail = "รายละเอียด"; }
data.evidence = "รายละเอียด";
data.recordAccuser = "รายละเอียด";
data.witnesses = "รายละเอียด";
data.InvestResults = "รายละเอียด";
data.filesEvidence = null;
data.filesRecordAccuser = null;
data.filesWitnesses = null;
data.filesEtc = null;
};
/** /**
* นทกขอมลทเเกไข * นทกขอมลทเเกไข
@ -157,7 +153,7 @@ function confirmCancelInvestigate() {
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */ /** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(async () => { onMounted(async () => {
store.tabMenu = 'disciplinary' store.tabMenu = "disciplinary";
await fetchDetailDisciplinary(); await fetchDetailDisciplinary();
}); });
@ -200,7 +196,7 @@ watch(
<div class="q-ma-none">แกไขการสอบสวนความผดทางว</div> <div class="q-ma-none">แกไขการสอบสวนความผดทางว</div>
<q-space /> <q-space />
<div class="q-gutter-x-sm"> <div class="q-gutter-x-sm">
<q-btn <!-- <q-btn
v-if="data.complaintStatus === 'NEW'" v-if="data.complaintStatus === 'NEW'"
label="ส่งไปสรุปผลการพิจารณา" label="ส่งไปสรุปผลการพิจารณา"
color="public" color="public"
@ -217,7 +213,7 @@ watch(
label="ยกเลิกการยุติเรื่อง" label="ยกเลิกการยุติเรื่อง"
color="red-7" color="red-7"
@click="cancelInvestigate" @click="cancelInvestigate"
/> /> -->
</div> </div>
</div> </div>
<q-card flat class="col-12"> <q-card flat class="col-12">
@ -244,7 +240,11 @@ watch(
<FormInvestigatefacts :on-submit="onSubmit" :data="data" /> <FormInvestigatefacts :on-submit="onSubmit" :data="data" />
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="disciplinary"> <q-tab-panel name="disciplinary">
<FormDisciplinary :on-submit="onSubmit" :data="data" /> <FormDisciplinary
:on-submit="onSubmit"
:data="data"
@submit:disciplinary="onSubmitDisciplinary"
/>
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
</q-card> </q-card>

View file

@ -40,7 +40,6 @@ async function fetchListDisciplinary() {
res.data.result.total / initialPagination.value.rowsPerPage res.data.result.total / initialPagination.value.rowsPerPage
); );
fetchList(data); fetchList(data);
console.log(data);
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);

View file

@ -34,6 +34,8 @@ const props = defineProps({
* ปโหลดหลกฐานสนบสนนขอกลาวหา * ปโหลดหลกฐานสนบสนนขอกลาวหา
*/ */
function uploadFile() { function uploadFile() {
console.log("test");
// const Data = new FormData(); // const Data = new FormData();
// Data.append("file", file.value); // Data.append("file", file.value);
// showLoader(); // showLoader();
@ -96,7 +98,7 @@ function removeFile(id: string) {
</div> </div>
</div> </div>
<div class="col-xs-12 q-pa-sm row"> <div class="col-xs-12 q-pa-sm row" v-if="props.files">
<q-list <q-list
v-if="props.files.length > 0" v-if="props.files.length > 0"
bordered bordered

View file

@ -9,14 +9,14 @@ interface DataNumberOption {
} }
interface InvestigatefactsDataRowType { interface InvestigatefactsDataRowType {
id:string, id: string;
title: string; title: string;
respondentType: string; respondentType: string;
offenseDetails: string, offenseDetails: string;
investigationDetail: string, investigationDetail: string;
dateInvestigate: string, dateInvestigate: string;
investigationStatusResult: string, investigationStatusResult: string;
status: string status: string;
} }
interface investigateDisDataRowType { interface investigateDisDataRowType {
@ -32,23 +32,29 @@ interface investigateDisDataRowType {
} }
interface directorType { interface directorType {
id:string id: string;
prefix:string directorId: string;
firstName:string prefix: string;
lastName:string firstName: string;
lastName: string;
position: string; position: string;
email: string; email: string;
phone: string; phone: string;
total: number;
duty: string;
} }
interface responseType { interface responseType {
id:string id: string;
name:string directorId: string;
prefix:string name: string;
firstName:string prefix: string;
lastName:string firstName: string;
position:string lastName: string;
email:string position: string;
phone:string email: string;
phone: string;
total: number;
duty: string;
} }
interface FileLists { interface FileLists {

View file

@ -1,50 +1,104 @@
interface Persons {
personId: string; //id อ้างอิง profile
idcard: string; //รหัสบัตรประชาชน
prefix: string; //คำนำหน้า
firstName: string; //ชื่อ
lastName: string; //นามสกุล
posNo: string; //เลขที่ตำแหน่ง
position: string; //ตำแหน่ง
positionLevel: string; //ระดับ
salary: number; //เงินเดือน
organization: string; //สังกัด
name: string;
}
interface Director {
directorId: string;
duty: string;
email: string;
firstName: string;
id: string;
lastName: string;
phone: string;
position: string;
prefix: string;
total: number;
}
// interface Persons {
// personId: string; //id อ้างอิง profile
// idcard: string; //รหัสบัตรประชาชน
// prefix: string; //คำนำหน้า
// firstName: string; //ชื่อ
// lastName: string; //นามสกุล
// posNo: string; //เลขที่ตำแหน่ง
// position: string; //ตำแหน่ง
// positionLevel: string; //ระดับ
// salary: number; //เงินเดือน
// organization: string; //สังกัด
// }
interface FormData { interface FormData {
complaint: string;
respondentType: string; respondentType: string;
dateInvestigate: Date | null;
dateAllegation: Date | null;
dateEvident: Date | null;
filesEvidence: File | null;
filesRecordAccuser: File | null;
filesWitnesses: File | null;
filesEtc: File | null;
casefault: string;
typefault: string;
faultLevel: string;
refLaw: string;
detailComplaint: string;
whereInvestigate: string;
trueDetail: string;
evidence: string;
recordAccuser: string;
witnesses: string;
InvestResults: string;
complaintStatus: string;
organizationId: string; organizationId: string;
consideredAgency: string; consideredAgency: string;
disciplinaryDateAllegation: Date | null;
disciplinaryDateEvident: Date | null;
disciplinaryCaseFault: string;
disciplinaryInvestigateAt: string;
disciplinaryFaultLevel: string;
disciplinaryRefLaw: string;
disciplinarySummaryEvidence: string;
disciplinaryRecordAccuser: string;
disciplinaryWitnesses: string;
result: string;
directors: Director[];
persons: Persons[];
// filesWitnesses: File | null;
// filesEtc: File | null;
// casefault: string;
// typefault: string;
// faultLevel: string;
// refLaw: string;
// detailComplaint: string;
// whereInvestigate: string;
// trueDetail: string;
// evidence: string;
// recordAccuser: string;
// witnesses: string;
// InvestResults: string;
// complaintStatus: string;
// consideredAgency: string;
} }
interface disciplinaryRef { interface DisciplinaryRef {
complaint: object | null; respondentType: object | null;
dateInvestigate: object | null; organizationId: object | null;
dateAllegation: object | null; disciplinaryDateAllegation: object | null;
dateEvident: object | null; disciplinaryDateEvident: object | null;
filesEvidence: object | null; disciplinaryCaseFault: object | null;
filesRecordAccuser: object | null; disciplinaryInvestigateAt: object | null;
filesWitnesses: object | null; disciplinaryFaultLevel: object | null;
filesEtc: object | null; disciplinaryRefLaw: object | null;
casefault: object | null; disciplinarySummaryEvidence: object | null;
typefault: object | null; disciplinaryRecordAccuser: object | null;
faultLevel: object | null; disciplinaryWitnesses: object | null;
refLaw: object | null; result: object | null;
detailComplaint: object | null; // filesRecordAccuser: object | null;
whereInvestigate: object | null; // filesWitnesses: object | null;
trueDetail: object | null; // filesEtc: object | null;
evidence: object | null; // casefault: object | null;
recordAccuser: object | null; // typefault: object | null;
witnesses: object | null; // faultLevel: object | null;
InvestResults: object | null; // refLaw: object | null;
// detailComplaint: object | null;
// whereInvestigate: object | null;
// trueDetail: object | null;
// evidence: object | null;
// recordAccuser: object | null;
// witnesses: object | null;
// InvestResults: object | null;
[key: string]: any; [key: string]: any;
} }
export type { FormData, disciplinaryRef }; export type { FormData, DisciplinaryRef, Persons, Director };

View file

@ -0,0 +1,6 @@
interface DataOptionRes {
organizationId: string;
organizationName: string;
}
export type { DataOptionRes };

View file

@ -9,7 +9,7 @@ import type {
DataAdd, DataAdd,
ocListType, ocListType,
} from "@/modules/11_discipline/interface/response/complaint"; } from "@/modules/11_discipline/interface/response/complaint";
import type { ArrayPerson } from '@/modules/11_discipline/interface/request/complaint' import type { ArrayPerson } from "@/modules/11_discipline/interface/request/complaint";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
const mixin = useCounterMixin(); const mixin = useCounterMixin();

View file

@ -5,7 +5,7 @@ import type {
investigateDisDataRowType, investigateDisDataRowType,
DataOption, DataOption,
directorType, directorType,
responseType responseType,
} from "@/modules/11_discipline/interface/index/Main"; } from "@/modules/11_discipline/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin(); const mixin = useCounterMixin();
@ -24,20 +24,20 @@ export const useInvestigateDisStore = defineStore(
{ id: "2", name: "ไม่ร้ายแรง" }, { id: "2", name: "ไม่ร้ายแรง" },
]); ]);
const optionsfaultLevel = ref<DataOption[]>([ const optionsfaultLevel = ref<DataOption[]>([
{ id: "0", name: "ไม่ร้ายแรง" }, // { id: "0", name: "ไม่ร้ายแรง" },
{ id: "1", name: "ภาคทัณฑ์" }, // { id: "1", name: "ภาคทัณฑ์" },
{ id: "2", name: "ตัดเงินเดือน" }, // { id: "2", name: "ตัดเงินเดือน" },
{ id: "3", name: "ลดขั้นเงินเดือน" }, // { id: "3", name: "ลดขั้นเงินเดือน" },
{ id: "4", name: "ร้ายแรง" }, // { id: "4", name: "ร้ายแรง" },
{ id: "5", name: "ปลดออก" }, // { id: "5", name: "ปลดออก" },
{ id: "6", name: "ไล่ออก" }, // { id: "6", name: "ไล่ออก" },
]); ]);
async function fetchList(data: investigateDisDataRowType[]) { async function fetchList(data: investigateDisDataRowType[]) {
let datalist: any[] = data.map((e: any) => ({ let datalist: any[] = data.map((e: any) => ({
id: e.id, id: e.id,
title: e.title, title: e.title,
respondentType: e.respondentType, respondentType: convertRespondentType(e.respondentType),
offenseDetails: e.offenseDetails, offenseDetails: convertFault(e.offenseDetails),
disciplinaryFaultLevel: e.disciplinaryFaultLevel, disciplinaryFaultLevel: e.disciplinaryFaultLevel,
disciplinaryCaseFault: e.disciplinaryCaseFault, disciplinaryCaseFault: e.disciplinaryCaseFault,
status: e.status, status: e.status,
@ -46,28 +46,40 @@ export const useInvestigateDisStore = defineStore(
rows.value = datalist; rows.value = datalist;
} }
async function fecthDirector(data: directorType[]) { // async function fecthDirector(data: directorType[]) {
let datalistDirector: responseType[] = data.map((e: directorType) => ({ // let datalistDirector: responseType[] = data.map((e: directorType) => ({
id: e.id, // id: e.id,
name: `${e.prefix}${e.firstName} ${e.lastName}`, // name: `${e.prefix}${e.firstName} ${e.lastName}`,
prefix:e.prefix, // prefix: e.prefix,
firstName:e.firstName, // firstName: e.firstName,
lastName:e.lastName, // lastName: e.lastName,
position: e.position, // position: e.position,
email: e.email, // email: e.email,
phone: e.phone, // phone: e.phone,
})); // }));
rows2.value = datalistDirector; // rows2.value = datalistDirector;
selected.value = rows2.value; // selected.value = rows2.value;
// console.log(rows2.value); // // console.log(rows2.value);
// }
function convertRespondentType(val: string) {
switch (val) {
case "PERSON":
return "บุคคล";
case "ORGANIZATION":
return "หน่วยงาน";
case "BANGKOK":
return "กรุงเทพมหานคร";
}
} }
function convertFault(val: string) { function convertFault(val: string) {
switch (val) { switch (val) {
case "0": case "NOT_SPECIFIED":
return "ความผิดวินัยยังไม่ระบุ"; return "ความผิดวินัยยังไม่ระบุ";
case "1": case "NOT_DEADLY":
return "ความผิดวินัยไม่ร้ายแรง"; return "ความผิดวินัยไม่ร้ายแรง";
case "2": case "DEADLY":
return "ความผิดวินัยร้ายแรง"; return "ความผิดวินัยร้ายแรง";
} }
} }
@ -208,8 +220,8 @@ export const useInvestigateDisStore = defineStore(
"position", "position",
"duty", "duty",
"email", "email",
"telephone", "phone",
"role", "total",
]); ]);
const columnsDirector = ref<QTableProps["columns"]>([ const columnsDirector = ref<QTableProps["columns"]>([
{ {
@ -258,24 +270,25 @@ export const useInvestigateDisStore = defineStore(
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "telephone", name: "phone",
align: "left", align: "left",
label: "เบอร์โทรศัพท์", label: "เบอร์โทรศัพท์",
sortable: true, sortable: true,
field: "telephone", field: "phone",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "role", name: "total",
align: "left", align: "left",
label: "จำนวนเรื่องสืบสวน", label: "จำนวนเรื่องสืบสวน",
sortable: true, sortable: true,
field: "role", field: "total",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
return { return {
tabMenu, tabMenu,
fetchList, fetchList,
@ -283,7 +296,7 @@ export const useInvestigateDisStore = defineStore(
rows2, rows2,
optionsTypefault, optionsTypefault,
optionsfaultLevel, optionsfaultLevel,
fecthDirector, // fecthDirector,
visibleColumns, visibleColumns,
columns, columns,
visibleColumnsDirector, visibleColumnsDirector,