diff --git a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
index e94acbda9..f19d2a111 100644
--- a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
+++ b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
@@ -105,6 +105,10 @@ const checkSelected = computed(() => {
}
});
+const type = ref
("");
+//----(ดึงข้อมูลประเภทคำสั่ง)------//
+const optionsType = ref<[]>([]);
+
//popup ยืนยันส่งัว
function saveOrder() {
dialogConfirm(
@@ -132,10 +136,7 @@ function Reset() {
emit("update:filterKeyword2", "");
}
-const type = ref("");
-//----(ดึงข้อมูลประเภทคำสั่ง)------//
-const optionsType = ref<[]>([]);
-const fecthTypeOption = async () => {
+async function fecthTypeOption(){
showLoader();
await http
.get(config.API.typeOrder())
@@ -153,12 +154,6 @@ const fecthTypeOption = async () => {
});
};
-// watch([()=>props.modal],() => {
-// selected.value = props.modal ? [] : [];
-// if (props.modal === true) {
-// selected.value = props.rows2;
-// }
-// });
onMounted(() => {
fecthTypeOption();
});
diff --git a/src/modules/11_discipline/components/8_AppealComplain/MainPage.vue b/src/modules/11_discipline/components/8_AppealComplain/MainPage.vue
index c64d6cdcc..8fd646596 100644
--- a/src/modules/11_discipline/components/8_AppealComplain/MainPage.vue
+++ b/src/modules/11_discipline/components/8_AppealComplain/MainPage.vue
@@ -175,30 +175,6 @@ watch(
}
);
-// async function getList() {
-// showLoader();
-// await http
-// .get(
-// config.API.complaintList(
-// page.value,
-// rowsPerPage.value,
-// filterKeyword.value
-// )
-// )
-// //
-// .then((res) => {
-// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
-// const data = res.data.result.data;
-// fetchAppealComplain(data);
-// })
-// .catch((e) => {
-// messageError($q, e);
-// })
-// .finally(() => {
-// hideLoader();
-// });
-// }
-
/** ไปยังหน้าเพิ่มข้อมูล */
function redirectToPageadd() {
dataStore.rowsAdd = [];
@@ -213,11 +189,6 @@ function filterFn() {
console.log("enter", filterKeyword.value);
}
-function openEditStatus(data: RowList[]) {
- modalStatusEdit.value = true;
- dataRow.value = data;
-}
-
function close() {
modalStatusEdit.value = false;
}
@@ -229,6 +200,7 @@ function editStatusReturn(data: any) {
});
}
+/** ดึงข้อมูลเริ่มต้น */
function getData() {
showLoader();
http
@@ -254,10 +226,12 @@ function getData() {
});
}
+/** update status */
function dataUpdate() {
getData();
}
+/** set ปี ทั้งหมด */
function yearAll() {
formData.year = 0;
getData();
@@ -265,7 +239,6 @@ function yearAll() {
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
onMounted(async () => {
getData();
- // await getList();
dataStore.visibleColumns = visibleColumns.value;
dataStore.columns = columns.value;
});
diff --git a/src/modules/11_discipline/components/DialogDuty.vue b/src/modules/11_discipline/components/DialogDuty.vue
index 696091eba..759447503 100644
--- a/src/modules/11_discipline/components/DialogDuty.vue
+++ b/src/modules/11_discipline/components/DialogDuty.vue
@@ -36,7 +36,7 @@ const myForm = ref(null);
/**
* ฟังก์ชั่น Save
*/
-const submit = async () => {
+async function submit(){
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
if (success) {
diff --git a/src/modules/11_discipline/store/AppealComplainStore.ts b/src/modules/11_discipline/store/AppealComplainStore.ts
index 7bd3c8623..b2b329734 100644
--- a/src/modules/11_discipline/store/AppealComplainStore.ts
+++ b/src/modules/11_discipline/store/AppealComplainStore.ts
@@ -3,7 +3,7 @@ import { ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { DataOption } from '@/modules/11_discipline/interface/index/Main'
-import type { MainList, RowList,RowAddList } from '@/modules/11_discipline/interface/response/appealComplain'
+import type { MainList, RowList, RowAddList } from '@/modules/11_discipline/interface/response/appealComplain'
export const useAppealComplainStore = defineStore(
"AppealComplainStore",
@@ -15,48 +15,6 @@ export const useAppealComplainStore = defineStore(
const mixin = useCounterMixin()
const { date2Thai } = mixin
- function fetchAppealComplain(data: MainList[]) {
- let dataList: RowList[] = data.map((e: MainList) => ({
- id: e.id,
- profileId: e.profileId,
- type: typeConvert(e.type),
- title: e.title,
- description: e.description,
- year: e.year,
- fullname: e.fullname,
- citizenId: e.citizenId,
- caseType: e.caseType,
- caseNumber: e.caseNumber,
- lastUpdatedAt: date2Thai(e.lastUpdatedAt),
- status: statusTothai(e.status)
- }));
- rows.value = dataList;
- }
- function getRow(data:RowAddList[]){
- if(data){
- rowsAdd.value = data
- }
- }
- function statusTothai(val: string){
- switch (val) {
- case "NEW":
- return "ใหม่";
- case "RECEIVE_DOC":
- return "ได้รับเอกสารแล้ว";
- case "RECEIVE_APPEAL":
- return "รับอุทธรณ์/ร้องทุกข์";
- case "NO_RECEIVE_APPEAL":
- return "ไม่รับอุทธรณ์/ร้องทุกข์";
- case "DIAGNOSTIC":
- return "ตั้งองค์คณะวินิจฉัย";
- case "SUMMARY":
- return "สรุปผลการพิจารณา";
- case "DONE":
- return "ปิดคำร้อง";
- default:
- return "-";
- }
- };
const typeConvert = (val: string) => {
switch (val) {
case "APPEAL":
@@ -96,6 +54,50 @@ export const useAppealComplainStore = defineStore(
{ id: "DONE", name: "ปิดคำร้อง" },
]);
+ function fetchAppealComplain(data: MainList[]) {
+ let dataList: RowList[] = data.map((e: MainList) => ({
+ id: e.id,
+ profileId: e.profileId,
+ type: typeConvert(e.type),
+ title: e.title,
+ description: e.description,
+ year: e.year,
+ fullname: e.fullname,
+ citizenId: e.citizenId,
+ caseType: e.caseType,
+ caseNumber: e.caseNumber,
+ lastUpdatedAt: date2Thai(e.lastUpdatedAt),
+ status: statusTothai(e.status)
+ }));
+ rows.value = dataList;
+ }
+ function getRow(data: RowAddList[]) {
+ if (data) {
+ rowsAdd.value = data
+ }
+ }
+ function statusTothai(val: string) {
+ switch (val) {
+ case "NEW":
+ return "ใหม่";
+ case "RECEIVE_DOC":
+ return "ได้รับเอกสารแล้ว";
+ case "RECEIVE_APPEAL":
+ return "รับอุทธรณ์/ร้องทุกข์";
+ case "NO_RECEIVE_APPEAL":
+ return "ไม่รับอุทธรณ์/ร้องทุกข์";
+ case "DIAGNOSTIC":
+ return "ตั้งองค์คณะวินิจฉัย";
+ case "SUMMARY":
+ return "สรุปผลการพิจารณา";
+ case "DONE":
+ return "ปิดคำร้อง";
+ default:
+ return "-";
+ }
+ };
+
+
return {
rows,
diff --git a/src/modules/11_discipline/store/ComplaintsStore.ts b/src/modules/11_discipline/store/ComplaintsStore.ts
index 00b8d11d3..9af3721a2 100644
--- a/src/modules/11_discipline/store/ComplaintsStore.ts
+++ b/src/modules/11_discipline/store/ComplaintsStore.ts
@@ -65,7 +65,11 @@ export const useComplainstDataStore = defineStore(
{ id: "URGENT", name: "ด่วน" },
{ id: "VERY_URGENT", name: "ด่วนมาก" },
]);
-
+
+ const agencytoptions = ref(consideredAgencytoptions.value);
+ const optionListNameMain = ref([]);
+ const optionListName = ref([]);
+
function levelConsiderationTran(val: string) {
return (
levelConsiderationtOptions.value.find((v: any) => v.id === val)?.name ??
@@ -73,10 +77,6 @@ export const useComplainstDataStore = defineStore(
);
}
- const agencytoptions = ref(consideredAgencytoptions.value);
- const optionListNameMain = ref([]);
- const optionListName = ref([]);
-
function selectComplainantTpye(list: any) {
optionListNameMain.value = list;
optionListName.value = list;
diff --git a/src/modules/11_discipline/store/DirectorStore.ts b/src/modules/11_discipline/store/DirectorStore.ts
index 9f0fd466a..71983f729 100644
--- a/src/modules/11_discipline/store/DirectorStore.ts
+++ b/src/modules/11_discipline/store/DirectorStore.ts
@@ -11,6 +11,7 @@ export const useDisciplineDirectorDataStore = defineStore(
"disciplineDirector",
() => {
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
+ const rows = ref([]);
const visibleColumns = ref([
"no",
"fullName",
@@ -89,7 +90,6 @@ export const useDisciplineDirectorDataStore = defineStore(
]);
// ข้อมูลในตาราง
- const rows = ref([]);
function fetchData(data: DirectorRows[]) {
const dataList: DirectorRowsResponse[] = data.map(
(item: DirectorRows) => ({
diff --git a/src/modules/11_discipline/store/InvestigateDisStore.ts b/src/modules/11_discipline/store/InvestigateDisStore.ts
index 2281449f2..1b3678720 100644
--- a/src/modules/11_discipline/store/InvestigateDisStore.ts
+++ b/src/modules/11_discipline/store/InvestigateDisStore.ts
@@ -67,66 +67,6 @@ export const useInvestigateDisStore = defineStore(
{ id: "ไม่ร้ายแรง", name: "ไม่ร้ายแรง" },
]);
- function convertStatus(val: string) {
- const result = statusOps.value.find((x: any) => x.id == val)?.name;
- return result ? result : "-";
- }
-
- async function fetchList(data: investigateDisDataRowType[]) {
- let datalist: any[] = data.map((e: any) => ({
- id: e.id,
- title: e.title,
- respondentType: convertRespondentType(e.respondentType),
- offenseDetails: convertFault(e.offenseDetails),
- disciplinaryFaultLevel: e.disciplinaryFaultLevel ?? "-",
- disciplinaryCaseFault: e.disciplinaryCaseFault ?? "-",
- status: convertStatus(e.status) ?? "-",
- createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
- }));
-
- 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);
- }
-
- function convertRespondentType(val: string) {
- switch (val) {
- case "PERSON":
- return "บุคคล";
- case "ORGANIZATION":
- return "หน่วยงาน";
- case "BANGKOK":
- return "กรุงเทพมหานคร";
- }
- }
-
- function convertFault(val: string) {
- switch (val) {
- case "NOT_SPECIFIED":
- return "ความผิดวินัยยังไม่ระบุ";
- case "NOT_DEADLY":
- return "ความผิดวินัยไม่ร้ายแรง";
- case "DEADLY":
- return "ความผิดวินัยร้ายแรง";
- default:
- return "-";
- }
- }
-
const visibleColumns = ref([
"no",
"title",
@@ -284,18 +224,69 @@ export const useInvestigateDisStore = defineStore(
field: "phone",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
- },
- // {
- // name: "total",
- // align: "left",
- // label: "จำนวนเรื่องสืบสวน",
- // sortable: true,
- // field: "total",
- // headerStyle: "font-size: 14px",
- // style: "font-size: 14px",
- // },
+ }
]);
+ function convertStatus(val: string) {
+ const result = statusOps.value.find((x: any) => x.id == val)?.name;
+ return result ? result : "-";
+ }
+
+ async function fetchList(data: investigateDisDataRowType[]) {
+ let datalist: any[] = data.map((e: any) => ({
+ id: e.id,
+ title: e.title,
+ respondentType: convertRespondentType(e.respondentType),
+ offenseDetails: convertFault(e.offenseDetails),
+ disciplinaryFaultLevel: e.disciplinaryFaultLevel ?? "-",
+ disciplinaryCaseFault: e.disciplinaryCaseFault ?? "-",
+ status: convertStatus(e.status) ?? "-",
+ createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
+ }));
+
+ 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);
+ }
+
+ function convertRespondentType(val: string) {
+ switch (val) {
+ case "PERSON":
+ return "บุคคล";
+ case "ORGANIZATION":
+ return "หน่วยงาน";
+ case "BANGKOK":
+ return "กรุงเทพมหานคร";
+ }
+ }
+
+ function convertFault(val: string) {
+ switch (val) {
+ case "NOT_SPECIFIED":
+ return "ความผิดวินัยยังไม่ระบุ";
+ case "NOT_DEADLY":
+ return "ความผิดวินัยไม่ร้ายแรง";
+ case "DEADLY":
+ return "ความผิดวินัยร้ายแรง";
+ default:
+ return "-";
+ }
+ }
+
function filterFnOptionsType(
val: string | number,
update: any,
diff --git a/src/modules/11_discipline/store/InvestigateFactStore.ts b/src/modules/11_discipline/store/InvestigateFactStore.ts
index db1ada674..1cda291d9 100644
--- a/src/modules/11_discipline/store/InvestigateFactStore.ts
+++ b/src/modules/11_discipline/store/InvestigateFactStore.ts
@@ -33,6 +33,10 @@ export const useInvestigateFactStore = defineStore(
"DisciplineInvestigateFact",
() => {
const tabMenu = ref("investigatefacts");
+ const rows = ref();
+ const respondentTypeOps = ref(
+ mainStore.complainantoptionsMain
+ );
const daysExtendOps = ref([
{ id: 15, name: "15 วัน" },
@@ -189,11 +193,7 @@ export const useInvestigateFactStore = defineStore(
});
}
- const rows = ref();
- const respondentTypeOps = ref(
- mainStore.complainantoptionsMain
- );
function filterSelector(val: string, update: Function, type: string) {
console.log(val);
update(() => {
@@ -206,6 +206,7 @@ export const useInvestigateFactStore = defineStore(
}
});
}
+
async function fecthList(data: ListData[]) {
rows.value = await data.map((e: ListData) => {
return {
@@ -219,8 +220,8 @@ export const useInvestigateFactStore = defineStore(
dateInvestigate:
e.investigationDateStart && e.investigationDateEnd
? `${date2Thai(e.investigationDateStart)} - ${date2Thai(
- e.investigationDateEnd
- )}`
+ e.investigationDateEnd
+ )}`
: "-",
investigationStatusResult: mainStore.convertStatusResult(
e.investigationStatusResult
diff --git a/src/modules/11_discipline/store/ResultStore.ts b/src/modules/11_discipline/store/ResultStore.ts
index 53e0be2c4..9fc577e0c 100644
--- a/src/modules/11_discipline/store/ResultStore.ts
+++ b/src/modules/11_discipline/store/ResultStore.ts
@@ -28,56 +28,6 @@ export const useDisciplineResultStore = defineStore(
storeMain.complainantoptionsMain
);
- function filterSelector(val: string, update: Function, type: string) {
- update(() => {
- const needle = val.toLowerCase();
- if (type === "filterrespondentType") {
- complainantoptions.value = storeMain.complainantoptionsMain.filter(
- (v: any) => v.name.toLowerCase().indexOf(needle) > -1
- );
- }
- });
- }
-
- async function fetchList(data: DataResult[]) {
- const datalist: DataResultList[] = data.map((e: DataResult) => ({
- id: e.id,
- title: e.title,
- respondentType: e.respondentType
- ? storeMain.convertComplaintType(e.respondentType)
- : "-",
- offenseDetails: e.offenseDetails
- ? storeMain.convertFault(e.offenseDetails)
- : "-",
- disciplinaryFaultLevel: e.disciplinaryFaultLevel
- ? e.disciplinaryFaultLevel
- : "-",
- disciplinaryCaseFault: e.disciplinaryCaseFault
- ? e.disciplinaryCaseFault
- : "-",
- status: e.status && convertStatus(e.status),
- createdAt: e.createdAt && date2Thai(e.createdAt),
- disciplineType: e.disciplineType ? e.disciplineType:'-' ,
- titleType: e.titleType ? e.titleType:'-' ,
- oc: e.oc ? e.oc:'-'
- }));
- rows.value = datalist;
- }
-
- /** function สถานะ*/
- function convertStatus(val: string) {
- switch (val) {
- // case "NEW":
- // return "กำลังสรุปผลการพิจารณา";
- // case "STOP":
- // return "ยุติเรื่อง";
- case "DONE":
- return "กำลังสรุปผลการพิจารณา";
- case "REPORT":
- return "ส่งไปออกคำสั่ง";
- }
- }
-
const visibleColumns = ref([
"no",
"title",
@@ -211,6 +161,7 @@ export const useDisciplineResultStore = defineStore(
"telephone",
"role",
]);
+
const columnsDirector = ref([
{
name: "no",
@@ -276,6 +227,53 @@ export const useDisciplineResultStore = defineStore(
style: "font-size: 14px",
},
]);
+
+ function filterSelector(val: string, update: Function, type: string) {
+ update(() => {
+ const needle = val.toLowerCase();
+ if (type === "filterrespondentType") {
+ complainantoptions.value = storeMain.complainantoptionsMain.filter(
+ (v: any) => v.name.toLowerCase().indexOf(needle) > -1
+ );
+ }
+ });
+ }
+
+ async function fetchList(data: DataResult[]) {
+ const datalist: DataResultList[] = data.map((e: DataResult) => ({
+ id: e.id,
+ title: e.title,
+ respondentType: e.respondentType
+ ? storeMain.convertComplaintType(e.respondentType)
+ : "-",
+ offenseDetails: e.offenseDetails
+ ? storeMain.convertFault(e.offenseDetails)
+ : "-",
+ disciplinaryFaultLevel: e.disciplinaryFaultLevel
+ ? e.disciplinaryFaultLevel
+ : "-",
+ disciplinaryCaseFault: e.disciplinaryCaseFault
+ ? e.disciplinaryCaseFault
+ : "-",
+ status: e.status && convertStatus(e.status),
+ createdAt: e.createdAt && date2Thai(e.createdAt),
+ disciplineType: e.disciplineType ? e.disciplineType:'-' ,
+ titleType: e.titleType ? e.titleType:'-' ,
+ oc: e.oc ? e.oc:'-'
+ }));
+ rows.value = datalist;
+ }
+
+ /** function สถานะ*/
+ function convertStatus(val: string) {
+ switch (val) {
+ case "DONE":
+ return "กำลังสรุปผลการพิจารณา";
+ case "REPORT":
+ return "ส่งไปออกคำสั่ง";
+ }
+ }
+
return {
tabMenu,
fetchList,
diff --git a/src/modules/11_discipline/store/SuspendStore.ts b/src/modules/11_discipline/store/SuspendStore.ts
index 7a4b646c0..74d399480 100644
--- a/src/modules/11_discipline/store/SuspendStore.ts
+++ b/src/modules/11_discipline/store/SuspendStore.ts
@@ -1,6 +1,6 @@
import { defineStore } from "pinia";
import { ref } from 'vue'
-import type { listData, dataType ,DataOption} from '@/modules/11_discipline/interface/response/suspend'
+import type { listData, dataType, DataOption } from '@/modules/11_discipline/interface/response/suspend'
import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
@@ -13,7 +13,7 @@ export const useDisciplineSuspendStore = defineStore(
const mixin = useCounterMixin()
const { date2Thai } = mixin
-
+
const offenseDetailsOps = ref([
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
{ id: "NOT_DEADLY", name: "ไม่ร้ายแรง" },
@@ -22,7 +22,7 @@ export const useDisciplineSuspendStore = defineStore(
function getData(data: listData[]) {
console.log(data)
- const dataList: dataType[] = data.map((item: listData) => ({
+ const dataList: dataType[] = data.map((item: listData) => ({
id: item.id,
citizenId: item.citizenId,
name: `${item.prefix}${item.firstName} ${item.lastName}`,
@@ -37,7 +37,7 @@ export const useDisciplineSuspendStore = defineStore(
status: statusTothai(item.status),
statusEn: item.status,
descriptionSuspend: item.descriptionSuspend,
- dateTotal:item.startDateSuspend && item.endDateSuspend ? `${date2Thai(item.startDateSuspend)} - ${date2Thai(item.endDateSuspend)}`:'-',
+ dateTotal: item.startDateSuspend && item.endDateSuspend ? `${date2Thai(item.startDateSuspend)} - ${date2Thai(item.endDateSuspend)}` : '-',
startDateSuspend: item.startDateSuspend,
endDateSuspend: item.endDateSuspend,
title: item.title,
@@ -63,7 +63,7 @@ export const useDisciplineSuspendStore = defineStore(
return "ส่งรายชื่อไปออกคำสั่ง";
case "DONE":
return "ออกคำสั่งเสร็จแล้ว";
-
+
default:
return "-";
}
diff --git a/src/modules/11_discipline/store/main.ts b/src/modules/11_discipline/store/main.ts
index bb65b1d46..e44aca775 100644
--- a/src/modules/11_discipline/store/main.ts
+++ b/src/modules/11_discipline/store/main.ts
@@ -12,41 +12,6 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
{ id: "BANGKOK", name: "กรุงเทพมหานคร" },
]);
- function convertComplaintType(val: string) {
- const result = complainantoptionsMain.value.find(
- (x: any) => x.id == val
- )?.name;
- return result ? result : "-";
- }
-
- /** function ลักษณะความผิด*/
- function convertFault(val: string) {
- switch (val) {
- case "NOT_SPECIFIED":
- return "ความผิดวินัยยังไม่ระบุ";
- case "NOT_DEADLY":
- return "ความผิดวินัยไม่ร้ายแรง";
- case "DEADLY":
- return "ความผิดวินัยร้ายแรง";
- default:
- return "-";
- }
- }
-
- /** function สถานะ*/
- function convertStatus(val: string) {
- switch (val) {
- case "NEW":
- return "กำลังสอบสวน";
- case "STOP":
- return "ยุติเรื่อง";
- case "SEND_DISCIPLINARY":
- return "ส่งไปสอบสวน";
- case "DONE":
- return "ส่งไปสรุปผลการพิจารณาความผิดทางวินัย";
- }
- }
-
/** option ลักษณะความผิด */
const offenseDetailstOptions = ref([
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
@@ -54,29 +19,18 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
{ id: "DEADLY", name: "ร้ายแรง" },
]);
- function convertOffenseDetailst(val: string) {
- return (
- offenseDetailstOptions.value.find((x: any) => x.id == val)?.name ?? "-"
- );
- }
-
const statusResultOptions = ref([
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
{ id: "HAVE_CAUSE", name: "มีมูล" },
{ id: "NO_CAUSE", name: "ไม่มีมูล" },
]);
- function convertStatusResult(val: string) {
- const result = statusResultOptions.value.find(
- (x: any) => x.id == val
- )?.name;
- return result ? result : "-";
- }
const causeTextOptions = ref([
{ id: "ร้ายแรง", name: "ร้ายแรง" },
{ id: "ไม่ร้ายแรง", name: "ไม่ร้ายแรง" },
]);
-
+ const rowsAdd = ref([]);
+ const rowsCheck = ref([]);
/** หัวตารางผู้ถูกร้องเรียน */
const columnsRespondent = ref([
{
@@ -273,8 +227,55 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
"organization",
]);
- const rowsAdd = ref([]);
- const rowsCheck = ref([]);
+ function convertComplaintType(val: string) {
+ const result = complainantoptionsMain.value.find(
+ (x: any) => x.id == val
+ )?.name;
+ return result ? result : "-";
+ }
+
+ /** function ลักษณะความผิด*/
+ function convertFault(val: string) {
+ switch (val) {
+ case "NOT_SPECIFIED":
+ return "ความผิดวินัยยังไม่ระบุ";
+ case "NOT_DEADLY":
+ return "ความผิดวินัยไม่ร้ายแรง";
+ case "DEADLY":
+ return "ความผิดวินัยร้ายแรง";
+ default:
+ return "-";
+ }
+ }
+
+ /** function สถานะ*/
+ function convertStatus(val: string) {
+ switch (val) {
+ case "NEW":
+ return "กำลังสอบสวน";
+ case "STOP":
+ return "ยุติเรื่อง";
+ case "SEND_DISCIPLINARY":
+ return "ส่งไปสอบสวน";
+ case "DONE":
+ return "ส่งไปสรุปผลการพิจารณาความผิดทางวินัย";
+ }
+ }
+
+ function convertOffenseDetailst(val: string) {
+ return (
+ offenseDetailstOptions.value.find((x: any) => x.id == val)?.name ?? "-"
+ );
+ }
+
+ function convertStatusResult(val: string) {
+ const result = statusResultOptions.value.find(
+ (x: any) => x.id == val
+ )?.name;
+ return result ? result : "-";
+ }
+
+
function fetchData(data: ArrayPersonAdd[]) {
rowsAdd.value = data;
}