API รายละเอียด สอบสวนความผิดทางวินัย

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-11-24 14:49:51 +07:00
parent e18386db65
commit 7b56868c1f
7 changed files with 462 additions and 182 deletions

View file

@ -31,18 +31,18 @@ export const useInvestigateDisStore = defineStore(
{ id: "5", name: "ปลดออก" },
{ id: "6", name: "ไล่ออก" },
]);
async function fecthList(data: investigateDisDataRowType[]) {
let datalist: investigateDisDataRowType[] = data.map((e: any) => ({
async function fetchList(data: investigateDisDataRowType[]) {
let datalist: any[] = data.map((e: any) => ({
id: e.id,
subject: e.subject,
interrogated: e.interrogated,
fault: convertFault(e.fault),
penaltyLevel: convertPenaltyLevel(e.penaltyLevel),
caseFault: e.caseFault,
dateInvestigate: date2Thai(new Date(e.dateInvestigate)),
status: convertSatatus(e.status),
active: activeStatus(e.active),
title: e.title,
respondentType: e.respondentType,
offenseDetails: e.offenseDetails,
disciplinaryFaultLevel: e.disciplinaryFaultLevel,
disciplinaryCaseFault: e.disciplinaryCaseFault,
status: e.status,
createdAt: date2Thai(e.createdAt),
}));
rows.value = datalist;
}
async function fecthDirector(data: directorType[]) {
@ -56,7 +56,7 @@ export const useInvestigateDisStore = defineStore(
}));
rows2.value = datalistDirector;
selected.value = rows2.value;
console.log(rows2.value);
// console.log(rows2.value);
}
function convertFault(val: string) {
switch (val) {
@ -107,12 +107,12 @@ export const useInvestigateDisStore = defineStore(
const visibleColumns = ref<String[]>([
"no",
"subject",
"interrogated",
"fault",
"penaltyLevel",
"caseFault",
"dateInvestigate",
"title",
"respondentType",
"offenseDetails",
"disciplinaryFaultLevel",
"disciplinaryCaseFault",
"createdAt",
"status",
]);
@ -127,64 +127,64 @@ export const useInvestigateDisStore = defineStore(
style: "font-size: 14px",
},
{
name: "subject",
name: "title",
align: "left",
label: "เรื่อง",
sortable: true,
field: "subject",
field: "title",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "interrogated",
name: "respondentType",
align: "left",
label: "ผู้ถูกสืบสวน",
sortable: true,
field: "interrogated",
field: "respondentType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fault",
name: "offenseDetails",
align: "left",
label: "ลักษณะความผิด",
sortable: true,
field: "fault",
field: "offenseDetails",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "penaltyLevel",
name: "disciplinaryFaultLevel",
align: "left",
label: "ระดับโทษความผิด",
sortable: true,
field: "penaltyLevel",
field: "disciplinaryFaultLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "caseFault",
name: "disciplinaryCaseFault",
align: "left",
label: "กรณีความผิด",
sortable: true,
field: "caseFault",
field: "disciplinaryCaseFault",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateInvestigate",
name: "createdAt",
align: "left",
label: "วันที่สอบสวน",
sortable: true,
field: "dateInvestigate",
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
@ -275,7 +275,7 @@ export const useInvestigateDisStore = defineStore(
]);
return {
tabMenu,
fecthList,
fetchList,
rows,
rows2,
optionsTypefault,