แก้ไขเรื่องร้องเรียน, สืบสวน, สอบสวน
This commit is contained in:
parent
76594a2359
commit
f247167e9a
20 changed files with 1356 additions and 1714 deletions
|
|
@ -6,11 +6,12 @@ import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
|||
import type {
|
||||
DataList,
|
||||
DataListRow,
|
||||
DataAdd,
|
||||
ocListType,
|
||||
} from "@/modules/11_discipline/interface/response/complaint";
|
||||
import type { ArrayPerson } from "@/modules/11_discipline/interface/request/complaint";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store";
|
||||
const mainStore = useDisciplineMainStore();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
|
|
@ -19,27 +20,17 @@ export const useComplainstDataStore = defineStore(
|
|||
"DisciplineComplainst",
|
||||
() => {
|
||||
const rows = ref<DataListRow[]>([]);
|
||||
const rowsAdd = ref<ArrayPerson[]>([]);
|
||||
const visibleColumns = ref<string[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([]);
|
||||
|
||||
function fetchComplainstAdd(data: ArrayPerson[]) {
|
||||
rowsAdd.value = data;
|
||||
}
|
||||
|
||||
function addCommas(salaryString: string): string {
|
||||
const salaryNumber = parseFloat(salaryString.replace(/,/g, ""));
|
||||
return salaryNumber.toLocaleString();
|
||||
}
|
||||
|
||||
function fetchComplainst(data: DataList[]) {
|
||||
let dataList: DataListRow[] = data.map((e: DataList) => ({
|
||||
id: e.id,
|
||||
personId: e.personId,
|
||||
title: e.title,
|
||||
dateReceived: e.dateReceived ? date2Thai(e.dateReceived) : "-",
|
||||
respondentType: convertComplaintType(e.respondentType),
|
||||
offenseDetails: offenseDetailsTran(e.offenseDetails),
|
||||
respondentType: mainStore.convertComplaintType(e.respondentType),
|
||||
offenseDetails: mainStore.convertOffenseDetailst(e.offenseDetails),
|
||||
createdAt: date2Thai(e.createdAt)!,
|
||||
levelConsideration: levelConsiderationTran(e.levelConsideration),
|
||||
dateConsideration: e.dateConsideration
|
||||
|
|
@ -50,21 +41,9 @@ export const useComplainstDataStore = defineStore(
|
|||
rows.value = dataList;
|
||||
}
|
||||
|
||||
// filter options
|
||||
const complainantoptionsMain = ref<DataOption[]>([
|
||||
{ id: "PERSON", name: "บุคคล" },
|
||||
{ id: "ORGANIZATION", name: "หน่วยงาน" },
|
||||
{ id: "BANGKOK", name: "กรุงเทพมหานคร" },
|
||||
]);
|
||||
|
||||
function convertComplaintType(val: string) {
|
||||
const result = complainantoptionsMain.value.find(
|
||||
(x: any) => x.id == val
|
||||
)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
const complainantoptions = ref<DataOption[]>(complainantoptionsMain.value);
|
||||
const complainantoptions = ref<DataOption[]>(
|
||||
mainStore.complainantoptionsMain
|
||||
);
|
||||
const consideredAgencytoptions = ref<DataOption[]>([]);
|
||||
const organizationIdOp = ref<DataOption[]>([]);
|
||||
|
||||
|
|
@ -81,29 +60,17 @@ export const useComplainstDataStore = defineStore(
|
|||
}
|
||||
};
|
||||
|
||||
function offenseDetailsTran(val: string) {
|
||||
switch (val) {
|
||||
case "NOT_SPECIFIED":
|
||||
return "ยังไม่ระบุ";
|
||||
case "NOT_DEADLY":
|
||||
return "ร้ายแรง";
|
||||
case "DEADLY":
|
||||
return "ไม่ร้ายแรง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
const levelConsiderationtOptions = ref<DataOption[]>([
|
||||
{ id: "NORMAL", name: "ปกติ" },
|
||||
{ id: "URGENT", name: "ด่วน" },
|
||||
{ id: "VERY_URGENT", name: "ด่วนมาก" },
|
||||
]);
|
||||
|
||||
function levelConsiderationTran(val: string) {
|
||||
switch (val) {
|
||||
case "NORMAL":
|
||||
return "ปกติ";
|
||||
case "URGENT":
|
||||
return "ด่วน";
|
||||
case "VERT_URGENT":
|
||||
return "ด่วนมาก";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
return (
|
||||
levelConsiderationtOptions.value.find((v: any) => v.id === val)?.name ??
|
||||
"-"
|
||||
);
|
||||
}
|
||||
|
||||
const agencytoptions = ref<DataOption[]>(consideredAgencytoptions.value);
|
||||
|
|
@ -119,7 +86,7 @@ export const useComplainstDataStore = defineStore(
|
|||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
if (type === "filterrespondentType") {
|
||||
complainantoptions.value = complainantoptionsMain.value.filter(
|
||||
complainantoptions.value = mainStore.complainantoptionsMain.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (type === "filteragencytoptions") {
|
||||
|
|
@ -144,7 +111,6 @@ export const useComplainstDataStore = defineStore(
|
|||
}
|
||||
return {
|
||||
rows,
|
||||
rowsAdd,
|
||||
visibleColumns,
|
||||
columns,
|
||||
fetchComplainst,
|
||||
|
|
@ -153,9 +119,9 @@ export const useComplainstDataStore = defineStore(
|
|||
complainantoptions,
|
||||
consideredAgencytoptions,
|
||||
optionListName,
|
||||
fetchComplainstAdd,
|
||||
organizationIdOp,
|
||||
ocListFn,
|
||||
levelConsiderationtOptions,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,12 @@ import type {
|
|||
DataOption,
|
||||
DataNumberOption,
|
||||
} from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { ListData, ArrayPerson, ocListType } from "@/modules/11_discipline/interface/response/investigate";
|
||||
import type {
|
||||
ListData,
|
||||
ocListType,
|
||||
} from "@/modules/11_discipline/interface/response/investigate";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store";
|
||||
const mainStore = useDisciplineMainStore();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
|
|
@ -17,11 +22,10 @@ const consideredAgencytoptions = ref<DataOption[]>([]);
|
|||
function ocListFn(data: ocListType[]) {
|
||||
let dataList: DataOption[] = data.map((item: ocListType) => ({
|
||||
id: item.organizationId,
|
||||
name: item.organizationName
|
||||
}))
|
||||
consideredAgencytoptions.value = dataList
|
||||
organizationIdOp.value = dataList
|
||||
|
||||
name: item.organizationName,
|
||||
}));
|
||||
consideredAgencytoptions.value = dataList;
|
||||
organizationIdOp.value = dataList;
|
||||
}
|
||||
|
||||
/*** store ของข้อมูลสืบสวนข้อเท็จจริง */
|
||||
|
|
@ -37,40 +41,23 @@ export const useInvestigateFactStore = defineStore(
|
|||
{ id: 60, name: "60 วัน" },
|
||||
]);
|
||||
|
||||
const offenseDetailsOps = ref<DataOption[]>([
|
||||
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
|
||||
{ id: "NOT_DEADLY", name: "ไม่ร้ายแรง" },
|
||||
{ id: "DEADLY", name: "ร้ายแรง" },
|
||||
]);
|
||||
const investigationDetailOps = ref<DataOption[]>([
|
||||
{ id: "APPOINT_DIRECTORS", name: "แต่งตั้งกรรมการสืบสวน" },
|
||||
{ id: "SECRET_INVESTIGATION", name: "สืบสวนทางลับ" },
|
||||
{ id: "OTHER", name: "อื่นๆ" },
|
||||
]);
|
||||
|
||||
const faultOps = ref<DataOption[]>([
|
||||
{ id: "NEW", name: "กำลังสืบสวน" },
|
||||
{ id: "STOP", name: "ยุติเรื่อง" },
|
||||
{ id: "SEND_DISCIPLINARY", name: "ส่งไปสอบสวน" },
|
||||
{ id: "SEND_DISCIPLINARY", name: "ส่งไปสอบสวนแล้ว" },
|
||||
]);
|
||||
const investigationStatusResultOptions = ref<DataOption[]>([
|
||||
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
|
||||
{ id: "HAVE_CAUSE", name: "มีมูล" },
|
||||
{ id: "NO_CAUSE", name: "ไม่มีมูล" },
|
||||
]);
|
||||
const investigationCauseTextOptions = ref<DataOption[]>([
|
||||
{ id: "ร้ายแรง", name: "ร้ายแรง" },
|
||||
{ id: "ไม่ร้ายแรง", name: "ไม่ร้ายแรง" },
|
||||
]);
|
||||
const respondentTypeOp = ref<DataOption[]>([
|
||||
{ id: "PERSON", name: "บุคคล" },
|
||||
{ id: "ORGANIZATION", name: "หน่วยงาน" },
|
||||
{ id: "BANGKOK", name: "กรุงเทพมหานคร" },
|
||||
])
|
||||
|
||||
const daysExtendOp = ref<DataNumberOption[]>(daysExtendOps.value);
|
||||
const investigationDetailOp = ref<DataOption[]>(investigationDetailOps.value);
|
||||
const investigationDetailOp = ref<DataOption[]>(
|
||||
investigationDetailOps.value
|
||||
);
|
||||
const faultOp = ref<DataOption[]>(faultOps.value);
|
||||
const visibleColumnsPerson = ref<string[]>([]);
|
||||
const columnsPerson = ref<QTableProps["columns"]>([]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"title",
|
||||
|
|
@ -192,23 +179,19 @@ export const useInvestigateFactStore = defineStore(
|
|||
|
||||
const rows = ref<InvestigatefactsDataRowType[]>();
|
||||
|
||||
const rowsAdd = ref<ArrayPerson[]>([])
|
||||
function fetchInvestigateAdd(data: ArrayPerson[]) {
|
||||
rowsAdd.value = data
|
||||
}
|
||||
const respondentTypeOps = ref<DataOption[]>(respondentTypeOp.value)
|
||||
const respondentTypeOps = ref<DataOption[]>(
|
||||
mainStore.complainantoptionsMain
|
||||
);
|
||||
function filterSelector(val: string, update: Function, type: string) {
|
||||
console.log(val)
|
||||
console.log(val);
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
|
||||
if (type === "filtercomplainantType") {
|
||||
respondentTypeOps.value = respondentTypeOp.value.filter(
|
||||
respondentTypeOps.value = mainStore.complainantoptionsMain.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
async function fecthList(data: ListData[]) {
|
||||
|
|
@ -216,34 +199,29 @@ export const useInvestigateFactStore = defineStore(
|
|||
return {
|
||||
id: e.id,
|
||||
title: e.title,
|
||||
respondentType: convertRespondentType(e.respondentType),
|
||||
offenseDetails: convertOffenseDetails(
|
||||
e.offenseDetails
|
||||
),
|
||||
respondentType: mainStore.convertComplaintType(e.respondentType),
|
||||
offenseDetails: mainStore.convertOffenseDetailst(e.offenseDetails),
|
||||
investigationDetail: convertInvestigationDetail(
|
||||
e.investigationDetail
|
||||
),
|
||||
dateInvestigate:
|
||||
e.investigationDateStart && e.investigationDateEnd
|
||||
? `${date2Thai(e.investigationDateStart)} - ${date2Thai(e.investigationDateEnd)}`
|
||||
? `${date2Thai(e.investigationDateStart)} - ${date2Thai(
|
||||
e.investigationDateEnd
|
||||
)}`
|
||||
: "-",
|
||||
investigationStatusResult: activeStatusResult(e.investigationStatusResult),
|
||||
investigationStatusResult: mainStore.convertStatusResult(
|
||||
e.investigationStatusResult
|
||||
),
|
||||
status: convertStatus(e.status),
|
||||
};
|
||||
});
|
||||
}
|
||||
function convertRespondentType(val: string) {
|
||||
const result = respondentTypeOp.value.find((x: any) => x.id == val)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
function convertOffenseDetails(val: string) {
|
||||
const result = offenseDetailsOps.value.find((x: any) => x.id == val)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
function convertInvestigationDetail(val: string) {
|
||||
const result = investigationDetailOps.value.find((x: any) => x.id == val)?.name;
|
||||
const result = investigationDetailOps.value.find(
|
||||
(x: any) => x.id == val
|
||||
)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
|
|
@ -251,12 +229,6 @@ export const useInvestigateFactStore = defineStore(
|
|||
const result = faultOps.value.find((x: any) => x.id == val)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
function activeStatusResult(val: string) {
|
||||
const result = investigationStatusResultOptions.value.find(
|
||||
(x: any) => x.id == val
|
||||
)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
return {
|
||||
tabMenu,
|
||||
|
|
@ -271,18 +243,10 @@ export const useInvestigateFactStore = defineStore(
|
|||
investigationDetailOp,
|
||||
visibleColumns,
|
||||
columns,
|
||||
investigationStatusResultOptions,
|
||||
investigationCauseTextOptions,
|
||||
fetchInvestigateAdd,
|
||||
rowsAdd,
|
||||
respondentTypeOp,
|
||||
filterSelector,
|
||||
respondentTypeOps,
|
||||
organizationIdOp,
|
||||
ocListFn,
|
||||
columnsPerson,
|
||||
visibleColumnsPerson,
|
||||
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ import type {
|
|||
DataResultList,
|
||||
} from "@/modules/11_discipline/interface/response/result";
|
||||
|
||||
import { useStoreResultMain } from "@/modules/11_discipline/store";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
const mixin = useCounterMixin();
|
||||
const storeMain = useStoreResultMain();
|
||||
const storeMain = useDisciplineMainStore();
|
||||
const { date2Thai } = mixin;
|
||||
|
||||
export const useDisciplineResultStore = defineStore(
|
||||
|
|
@ -30,7 +30,7 @@ export const useDisciplineResultStore = defineStore(
|
|||
id: e.id,
|
||||
title: e.title,
|
||||
respondentType: e.respondentType
|
||||
? storeMain.convertRespondentType(e.respondentType)
|
||||
? storeMain.convertComplaintType(e.respondentType)
|
||||
: "-",
|
||||
offenseDetails: e.offenseDetails
|
||||
? storeMain.convertFault(e.offenseDetails)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue