{{ props.rowIndex + 1 }}
-
+
+ ดูข้อมูลในทะเบียนประวัติ
+
+ {{ col.value }}
+
+
{{ col.value }}
@@ -638,7 +633,7 @@ onMounted(() => {
v-model="formData.description"
:rules="[(val) => !!val || 'กรุณาการข้อมูล']"
lazy-rules
- label="รายละเอียดที่เกี่นวข้องกับเรื่องที่ต้องการจะข้อเรียน"
+ label="รายละเอียดเรื่องร้องเรียน"
type="textarea"
rows="5"
/>
diff --git a/src/modules/11_discipline/components/1_Complaint/MainPage.vue b/src/modules/11_discipline/components/1_Complaint/MainPage.vue
index e8e23f606..9c87d2eb4 100644
--- a/src/modules/11_discipline/components/1_Complaint/MainPage.vue
+++ b/src/modules/11_discipline/components/1_Complaint/MainPage.vue
@@ -3,8 +3,6 @@ import { ref, onMounted, watch } from "vue";
import { useRouter } from "vue-router";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
-// import type
-import type { DataList } from "@/modules/11_discipline/interface/response/complaint";
// importStroe
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
// impoet Components
@@ -29,10 +27,10 @@ const maxPage = ref
(1);
const page = ref(1);
const rowsPerPage = ref(10);
-async function updatePagingProp(rowPerpage:number,pageCurrent:number) {
- rowsPerPage.value = rowPerpage
- page.value = pageCurrent
- await getList()
+async function updatePagingProp(rowPerpage: number, pageCurrent: number) {
+ rowsPerPage.value = rowPerpage;
+ page.value = pageCurrent;
+ await getList();
}
async function getList() {
@@ -44,11 +42,10 @@ async function getList() {
rowsPerPage.value,
filterKeyword.value
)
-
)
- //
+ //
.then((res) => {
- maxPage.value = Math.ceil(res.data.result.total/ rowsPerPage.value);
+ maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
const data = res.data.result.data;
fetchComplainst(data);
})
@@ -62,7 +59,7 @@ async function getList() {
/** ไปยังหน้าเพิ่มข้อมูล */
function redirectToPageadd() {
- complainstStore.fetchComplainstAdd([])
+ complainstStore.fetchComplainstAdd([]);
router.push(`/discipline/complaints/add`);
}
diff --git a/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue b/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue
index bf454a350..2f721d1f5 100644
--- a/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue
+++ b/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue
@@ -45,27 +45,27 @@ const columns = ref([
{
name: "title",
align: "left",
- label: "เรื่อง",
+ label: "เรื่องร้องเรียน",
sortable: true,
field: "title",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
- name: "description",
+ name: "dateReceived",
align: "left",
- label: "รายละเอียด",
+ label: "วันที่รับเรื่อง",
sortable: true,
- field: "description",
+ field: "dateReceived",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
- name: "appellant",
+ name: "respondentType",
align: "left",
label: "ผู้ถูกร้องเรียน",
sortable: true,
- field: "appellant",
+ field: "respondentType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
@@ -78,15 +78,6 @@ const columns = ref([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
- {
- name: "createdAt",
- align: "left",
- label: "วันที่สร้างเรื่องร้องเรียน",
- sortable: true,
- field: "createdAt",
- headerStyle: "font-size: 14px",
- style: "font-size: 14px",
- },
{
name: "levelConsideration",
align: "left",
@@ -108,7 +99,7 @@ const columns = ref([
{
name: "status",
align: "left",
- label: "สถานะเรื่องร้องเรียน",
+ label: "สถานะ",
sortable: true,
field: "status",
headerStyle: "font-size: 14px",
@@ -120,8 +111,8 @@ const columns = ref([
const visibleColumns = ref([
"no",
"title",
- "description",
- "appellant",
+ "dateReceived",
+ "respondentType",
"offenseDetails",
"createdAt",
"levelConsideration",
@@ -216,11 +207,6 @@ watch(
{{ props.rowIndex + 1 }}
-
-
- {{ props.row.description }}
-
-
{{ col.value }}
diff --git a/src/modules/11_discipline/interface/response/complaint.ts b/src/modules/11_discipline/interface/response/complaint.ts
index 16f25dbb0..01cce00c8 100644
--- a/src/modules/11_discipline/interface/response/complaint.ts
+++ b/src/modules/11_discipline/interface/response/complaint.ts
@@ -1,55 +1,51 @@
interface DataListRow {
- id:string
- title: string
- description: string
- appellant: string
- offenseDetails: string
- createdAt: string
- levelConsideration: string
- dateConsideration: string
- status: string
+ id: string;
+ personId: string;
+ title: string;
+ dateReceived: Date | "-";
+ respondentType: string;
+ offenseDetails: string;
+ createdAt: string;
+ levelConsideration: string;
+ dateConsideration: string;
+ status: string;
}
interface DataAdd {
- id:string
- idcard:string
- name:string
- positionNo:string
- position:string
- positionLevel:string
- salary:string
- organization:string
+ id: string;
+ idcard: string;
+ name: string;
+ positionNo: string;
+ position: string;
+ positionLevel: string;
+ salary: string;
+ organization: string;
}
interface DataAddResponse {
- id:string
- idcard:string
- name:string
- positionNo:string
- position:string
- positionLevel:string
- salary:string
- organization:string
+ id: string;
+ idcard: string;
+ name: string;
+ positionNo: string;
+ position: string;
+ positionLevel: string;
+ salary: string;
+ organization: string;
}
interface DataList {
- id:string
- title: string
- description: string
- appellant: string
- offenseDetails: string
- createdAt: Date
- levelConsideration: string
- dateConsideration: Date
- status: string
+ id: string;
+ personId: string;
+ title: string;
+ dateReceived: Date | "-";
+ respondentType: string;
+ offenseDetails: string;
+ createdAt: Date;
+ levelConsideration: string;
+ dateConsideration: Date;
+ status: string;
}
-interface ocListType{
- organizationId:string
- organizationName:string
+interface ocListType {
+ organizationId: string;
+ organizationName: string;
}
-export type {
- DataList,
- DataListRow,
- DataAdd,
- DataAddResponse,
- ocListType
-}
\ No newline at end of file
+export type { DataList, DataListRow, DataAdd, DataAddResponse, ocListType };
diff --git a/src/modules/11_discipline/store/ComplaintsStore.ts b/src/modules/11_discipline/store/ComplaintsStore.ts
index b7ccca28b..ff13a70ac 100644
--- a/src/modules/11_discipline/store/ComplaintsStore.ts
+++ b/src/modules/11_discipline/store/ComplaintsStore.ts
@@ -3,140 +3,158 @@ import { ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
-import type { DataList, DataListRow, DataAdd, ArrayPerson,ocListType } from "@/modules/11_discipline/interface/response/complaint"
+import type {
+ DataList,
+ DataListRow,
+ DataAdd,
+ ArrayPerson,
+ ocListType,
+} from "@/modules/11_discipline/interface/response/complaint";
import type { QTableProps } from "quasar";
-const mixin = useCounterMixin()
-const { date2Thai } = mixin
+const mixin = useCounterMixin();
+const { date2Thai } = mixin;
-// id
-// cardId
-// prefix
-// firstName
-// lastName
-// position
-// level
-// oc
-export const useComplainstDataStore = defineStore("DisciplineComplainst", () => {
- const rows = ref([])
- const rowsAdd = ref([])
+export const useComplainstDataStore = defineStore(
+ "DisciplineComplainst",
+ () => {
+ const rows = ref([]);
+ const rowsAdd = ref([]);
const visibleColumns = ref([]);
const columns = ref([]);
function fetchComplainstAdd(data: ArrayPerson[]) {
- rowsAdd.value = data
+ rowsAdd.value = data;
}
function addCommas(salaryString: string): string {
- const salaryNumber = parseFloat(salaryString.replace(/,/g, ''));
- return salaryNumber.toLocaleString();
+ const salaryNumber = parseFloat(salaryString.replace(/,/g, ""));
+ return salaryNumber.toLocaleString();
}
function fetchComplainst(data: DataList[]) {
- let datalist: DataListRow[] = data.map((e: DataList) => ({
- id: e.id,
- title: e.title,
- description: e.description,
- appellant: e.appellant,
- offenseDetails: offenseDetailsTran(e.offenseDetails),
- createdAt: date2Thai(e.createdAt)!,
- levelConsideration: levelConsiderationTran(e.levelConsideration),
- dateConsideration: date2Thai(e.dateConsideration)!,
- status: statusTothai(e.status),
- }));
- rows.value = datalist;
- }
-
+ let datalist: DataListRow[] = data.map((e: DataList) => ({
+ id: e.id,
+ personId: e.personId,
+ title: e.title,
+ dateReceived: e.dateReceived ? e.dateReceived : "-",
+ respondentType: convertComplaintType(e.respondentType),
+ offenseDetails: offenseDetailsTran(e.offenseDetails),
+ createdAt: date2Thai(e.createdAt)!,
+ levelConsideration: levelConsiderationTran(e.levelConsideration),
+ dateConsideration: date2Thai(e.dateConsideration)!,
+ status: statusTothai(e.status),
+ }));
+ rows.value = datalist;
+ }
+
// filter options
const complainantoptionsMain = ref([
- { id: "PERSON", name: "บุคคล" },
- { id: "ORGANIZATION", name: "หน่วยงาน" },
- { id: "BANGKOK", name: "กรุงเทพมหานคร" },
+ { id: "PERSON", name: "บุคคล" },
+ { id: "ORGANIZATION", name: "หน่วยงาน" },
+ { id: "BANGKOK", name: "กรุงเทพมหานคร" },
]);
- const complainantoptions = ref(complainantoptionsMain.value)
+
+ function convertComplaintType(val: string) {
+ const result = complainantoptionsMain.value.find(
+ (x: any) => x.id == val
+ )?.name;
+ return result ? result : "-";
+ }
+
+ const complainantoptions = ref(complainantoptionsMain.value);
const consideredAgencytoptions = ref([]);
const organizationIdOp = ref([]);
const statusTothai = (val: string) => {
- switch (val) {
- case 'NEW': return "ใหม่";
- case 'STOP': return "ยุติเรื่อง";
- case 'SEND_INVESTIGATE': return "มีมูลส่งไปสืบสวนแล้ว";
- default: return "-";
- }
+ switch (val) {
+ case "NEW":
+ return "ใหม่";
+ case "STOP":
+ return "ยุติเรื่อง";
+ case "SEND_INVESTIGATE":
+ return "มีมูลส่งไปสืบสวนแล้ว";
+ default:
+ return "-";
+ }
};
- function offenseDetailsTran(val: string){
- switch (val) {
- case 'NOT_SPECIFIED': return "ยังไม่ระบุ";
- case 'NOT_DEADLY': return "ร้ายแรง";
- case 'DEADLY': return "ไม่ร้ายแรง";
- default: return "-";
- }
+ function offenseDetailsTran(val: string) {
+ switch (val) {
+ case "NOT_SPECIFIED":
+ return "ยังไม่ระบุ";
+ case "NOT_DEADLY":
+ return "ร้ายแรง";
+ case "DEADLY":
+ return "ไม่ร้ายแรง";
+ default:
+ return "-";
+ }
}
- function levelConsiderationTran(val: string){
- switch (val) {
- case 'NORMAL': return "ปกติ";
- case 'URGENT': return "ด่วน";
- case 'VERT_URGENT': return "ด่วนมาก";
- default: return "-";
- }
+ function levelConsiderationTran(val: string) {
+ switch (val) {
+ case "NORMAL":
+ return "ปกติ";
+ case "URGENT":
+ return "ด่วน";
+ case "VERT_URGENT":
+ return "ด่วนมาก";
+ default:
+ return "-";
+ }
}
- const agencytoptions = ref(consideredAgencytoptions.value)
- const optionListNameMain = ref([])
- const optionListName = ref([])
+ const agencytoptions = ref(consideredAgencytoptions.value);
+ const optionListNameMain = ref([]);
+ const optionListName = ref([]);
function selectComplainantTpye(list: any) {
- optionListNameMain.value = list
- optionListName.value = list
+ optionListNameMain.value = list;
+ optionListName.value = list;
}
+
function filterSelector(val: string, update: Function, type: string) {
- update(() => {
- const needle = val.toLowerCase();
+ update(() => {
+ const needle = val.toLowerCase();
- if (type === "filtercomplainantType") {
- complainantoptions.value = complainantoptionsMain.value.filter(
- (v: any) => v.name.toLowerCase().indexOf(needle) > -1
- );
-
- } else if (type === "filteragencytoptions") {
- agencytoptions.value = consideredAgencytoptions.value.filter(
- (v: any) => v.name.toLowerCase().indexOf(needle) > -1
- );
- } else if (type === "filtercomplainantOP") {
- optionListName.value = optionListNameMain.value.filter(
- (v: any) => v.name.toLowerCase().indexOf(needle) > -1
- );
- }
-
- });
+ if (type === "filtercomplainantType") {
+ complainantoptions.value = complainantoptionsMain.value.filter(
+ (v: any) => v.name.toLowerCase().indexOf(needle) > -1
+ );
+ } else if (type === "filteragencytoptions") {
+ agencytoptions.value = consideredAgencytoptions.value.filter(
+ (v: any) => v.name.toLowerCase().indexOf(needle) > -1
+ );
+ } else if (type === "filtercomplainantOP") {
+ optionListName.value = optionListNameMain.value.filter(
+ (v: any) => v.name.toLowerCase().indexOf(needle) > -1
+ );
+ }
+ });
}
- function ocListFn(data:ocListType[]){
- let dataList:DataOption[] = data.map((item:ocListType)=>({
- id:item.organizationId,
- name:item.organizationName
- }))
- consideredAgencytoptions.value = dataList
- organizationIdOp.value = dataList
-
+ function ocListFn(data: ocListType[]) {
+ let dataList: DataOption[] = data.map((item: ocListType) => ({
+ id: item.organizationId,
+ name: item.organizationName,
+ }));
+ consideredAgencytoptions.value = dataList;
+ organizationIdOp.value = dataList;
}
return {
- rows,
- rowsAdd,
- visibleColumns,
- columns,
- fetchComplainst,
- selectComplainantTpye,
- filterSelector,
- complainantoptions,
- consideredAgencytoptions,
- optionListName,
- fetchComplainstAdd,
- organizationIdOp,
- ocListFn
-
-
- }
-})
\ No newline at end of file
+ rows,
+ rowsAdd,
+ visibleColumns,
+ columns,
+ fetchComplainst,
+ selectComplainantTpye,
+ filterSelector,
+ complainantoptions,
+ consideredAgencytoptions,
+ optionListName,
+ fetchComplainstAdd,
+ organizationIdOp,
+ ocListFn,
+ };
+ }
+);