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