เรื่องร้องเรียน
This commit is contained in:
parent
e9b7cddf09
commit
7f3dfafe33
11 changed files with 539 additions and 342 deletions
|
|
@ -3,7 +3,7 @@ import { ref } from "vue";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { DataList, DataListRow,DataAdd,DataAddResponse } from "@/modules/11_discipline/interface/response/complaint"
|
||||
import type { DataList, DataListRow, DataAdd, DataAddResponse } from "@/modules/11_discipline/interface/response/complaint"
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
const mixin = useCounterMixin()
|
||||
|
|
@ -26,42 +26,58 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
|
|||
function fetchComplainstAdd(data: DataAddResponse[]) {
|
||||
let datalist = data.map((e: DataAddResponse) => ({
|
||||
id: e.id,
|
||||
cardId: e.cardId,
|
||||
fullName:`${e.prefix}${e.firstName} ${e.lastName}`,
|
||||
idcard: e.idcard,
|
||||
name: e.name,
|
||||
position: e.position,
|
||||
level: e.level,
|
||||
degree: e.degree,
|
||||
oc: e.oc,
|
||||
positionLevel: e.positionLevel,
|
||||
educationQualification: e.educationQualification,
|
||||
organization: e.organization,
|
||||
}))
|
||||
rowsAdd.value = datalist
|
||||
}
|
||||
|
||||
function fetchComplainst(data: DataList[]) {
|
||||
let datalist = data.map((e: DataList) => ({
|
||||
id: e.id,
|
||||
subject: e.subject,
|
||||
detail: e.detail,
|
||||
complainant: e.complainant,
|
||||
offenseDescription: e.offenseDescription,
|
||||
creationDate: date2Thai(e.creationDate),
|
||||
considerationLevel: e.considerationLevel,
|
||||
considerationDeadlineDate: date2Thai(e.considerationDeadlineDate),
|
||||
}))
|
||||
rows.value = datalist
|
||||
}
|
||||
let datalist: DataListRow[] = data.map((e: DataList) => ({
|
||||
id: e.id,
|
||||
title: e.title,
|
||||
description: e.description,
|
||||
respondent: e.respondent,
|
||||
descMistake: e.descMistake,
|
||||
createdAt: date2Thai(e.createdAt)!,
|
||||
devLevel: e.devLevel,
|
||||
considerationDate: date2Thai(e.considerationDate)!,
|
||||
complaintStatus: statusTothai(e.complaintStatus),
|
||||
}));
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
||||
// filter options
|
||||
const complainantoptionsMain = ref<DataOption[]>([
|
||||
{ id: "0", name: "บุคคล" },
|
||||
{ id: "1", name: "หน่วยงาน" },
|
||||
{ id: "2", name: "กรุงเทพมหานคร" },
|
||||
{ id: "PERSON", name: "บุคคล" },
|
||||
{ id: "ORGANIZATION", name: "หน่วยงาน" },
|
||||
{ id: "BANGKOK", name: "กรุงเทพมหานคร" },
|
||||
]);
|
||||
const complainantoptions = ref<DataOption[]>(complainantoptionsMain.value)
|
||||
const agencytoptionsMain = ref<DataOption[]>([
|
||||
const consideredAgencytoptions = ref<DataOption[]>([
|
||||
{ id: "0", name: "หน่ายงานเอ" },
|
||||
{ id: "1", name: "หน่ายงานบี" },
|
||||
{ id: "2", name: "หน่ายงานชี" },
|
||||
]);
|
||||
const agencytoptions = ref<DataOption[]>(agencytoptionsMain.value)
|
||||
const officeOp = ref<DataOption[]>([
|
||||
{ id: "0", name: "สำนักงาน1" },
|
||||
{ id: "1", name: "สำนักงาน2" },
|
||||
{ id: "2", name: "สำนักงาน3" },
|
||||
]);
|
||||
|
||||
const statusTothai = (val: string) => {
|
||||
switch (val) {
|
||||
case 'NEW': return "ใหม่";
|
||||
case 'STOP': return "ยุติเรื่อง";
|
||||
case 'SEND_INVESTIGATE': return "มีมูลส่งไปสืบสวนแล้ว";
|
||||
default: return "-";
|
||||
}
|
||||
};
|
||||
const agencytoptions = ref<DataOption[]>(consideredAgencytoptions.value)
|
||||
const optionListNameMain = ref<DataOption[]>([])
|
||||
const optionListName = ref<DataOption[]>([])
|
||||
|
||||
|
|
@ -79,7 +95,7 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
|
|||
);
|
||||
|
||||
} else if (type === "filteragencytoptions") {
|
||||
agencytoptions.value = agencytoptionsMain.value.filter(
|
||||
agencytoptions.value = consideredAgencytoptions.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (type === "filtercomplainantOP") {
|
||||
|
|
@ -100,9 +116,10 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
|
|||
selectComplainantTpye,
|
||||
filterSelector,
|
||||
complainantoptions,
|
||||
agencytoptions,
|
||||
consideredAgencytoptions,
|
||||
optionListName,
|
||||
fetchComplainstAdd
|
||||
fetchComplainstAdd,
|
||||
officeOp
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue