From c1f26bc764fc07265ed7b25dcdd86b5543820c35 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Thu, 14 Dec 2023 16:29:29 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AD=E0=B8=B8=E0=B8=97=E0=B8=98=E0=B8=A3?= =?UTF-8?q?=E0=B8=93=E0=B9=8C=E0=B8=A3=E0=B9=89=E0=B8=AD=E0=B8=87=E0=B8=97?= =?UTF-8?q?=E0=B8=B8=E0=B8=81=E0=B8=82=E0=B9=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/appeal/api.appeal.ts | 12 + src/app.config.ts | 4 +- .../07_appealComplain/interface/index/main.ts | 8 + .../interface/request/appeal.ts | 14 + .../interface/response/mainType.ts | 68 +++ src/modules/07_appealComplain/router.ts | 3 +- src/modules/07_appealComplain/store.ts | 91 +++- src/modules/07_appealComplain/views/Add.vue | 278 ++++------- src/modules/07_appealComplain/views/Edit.vue | 107 ++++ src/modules/07_appealComplain/views/Form.vue | 398 +++++++++++++++ src/modules/07_appealComplain/views/Main.vue | 462 ++++++++++++++---- src/stores/mixin.ts | 2 +- 12 files changed, 1139 insertions(+), 308 deletions(-) create mode 100644 src/api/appeal/api.appeal.ts create mode 100644 src/modules/07_appealComplain/interface/index/main.ts create mode 100644 src/modules/07_appealComplain/interface/request/appeal.ts create mode 100644 src/modules/07_appealComplain/interface/response/mainType.ts create mode 100644 src/modules/07_appealComplain/views/Edit.vue create mode 100644 src/modules/07_appealComplain/views/Form.vue diff --git a/src/api/appeal/api.appeal.ts b/src/api/appeal/api.appeal.ts new file mode 100644 index 0000000..8da5fff --- /dev/null +++ b/src/api/appeal/api.appeal.ts @@ -0,0 +1,12 @@ +import env from "../index" + +const appeal = `${env.API_URI}/discipline/complaint_appeal` +const profile = `${env.API_URI}/profile/keycloak` + +export default { + profileBykeycloak:()=>`${profile}`, + appealMainList:(status: string, type: string, year: number, page: number, pageSize: number, keyword: string)=>`${appeal}/user?status=${status}&type=${type}&year=${year}&page=${page}&pageSize=${pageSize}&keyword=${keyword}`, + appealAdd:()=>`${appeal}`, + + appealByID:(id:string)=>`${appeal}/${id}` +} diff --git a/src/app.config.ts b/src/app.config.ts index f585606..0a2fa88 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -4,6 +4,7 @@ import testtest from "./api/test/api.test" import retirementResign from "./api/leave/api.leave" import placementTransfer from "./api/transfer/api.transfer" +import appeal from "./api/appeal/api.appeal" import message from "./api/api.message" @@ -11,7 +12,8 @@ const API = { ...testtest, ...retirementResign, ...placementTransfer, - ...message + ...message, + ...appeal } export default { diff --git a/src/modules/07_appealComplain/interface/index/main.ts b/src/modules/07_appealComplain/interface/index/main.ts new file mode 100644 index 0000000..cf8152e --- /dev/null +++ b/src/modules/07_appealComplain/interface/index/main.ts @@ -0,0 +1,8 @@ +interface DataOption { + id:string + name:string +} + +export type { + DataOption +} \ No newline at end of file diff --git a/src/modules/07_appealComplain/interface/request/appeal.ts b/src/modules/07_appealComplain/interface/request/appeal.ts new file mode 100644 index 0000000..5c30bc9 --- /dev/null +++ b/src/modules/07_appealComplain/interface/request/appeal.ts @@ -0,0 +1,14 @@ +interface MyObjectAppealRef { + type: object | null; + title: object | null; + description: object | null; + caseType: object | null; + caseNumber: object | null; + + [key: string]: any; +} + + +export type { + MyObjectAppealRef +} \ No newline at end of file diff --git a/src/modules/07_appealComplain/interface/response/mainType.ts b/src/modules/07_appealComplain/interface/response/mainType.ts new file mode 100644 index 0000000..eb6dcd7 --- /dev/null +++ b/src/modules/07_appealComplain/interface/response/mainType.ts @@ -0,0 +1,68 @@ +interface FormType { + status: string + type: string + year: number +} + +interface RowList { + id: string + title: string + description: string + status: string + type: string + year: number + caseType: string + caseNumber: string + fullname: string + citizenId: string + profileId: string + lastUpdatedAt: string | null +} + +interface MainList { + id: string + title: string + description: string + status: string + type: string + year: number + caseType: string + caseNumber: string + fullname: string + citizenId: string + profileId: string + lastUpdatedAt: Date +} + +interface EditDataList { + id: string + title: string + description: string + status: string + type: string + year: number + caseType: string + caseNumber: string + fullname: string + citizenId: string + profileId: string + lastUpdatedAt: string + historyStatus: object | null + disciplineComplaint_Appeal_Docs: object | null +} + +interface HistoryStatusType { + status: string + createdAt: string +} +interface FileObType { + id: string + pathName: string + fileName: string +} + +export type { + FormType, RowList, MainList, EditDataList, + HistoryStatusType, + FileObType +} \ No newline at end of file diff --git a/src/modules/07_appealComplain/router.ts b/src/modules/07_appealComplain/router.ts index 41d9493..3a9305c 100644 --- a/src/modules/07_appealComplain/router.ts +++ b/src/modules/07_appealComplain/router.ts @@ -4,6 +4,7 @@ const mainPage = () => import("@/modules/07_appealComplain/views/Main.vue"); const addPage = () => import("@/modules/07_appealComplain/views/Add.vue"); +const editPage = () => import("@/modules/07_appealComplain/views/Edit.vue"); export default [ { @@ -27,7 +28,7 @@ export default [ { path: "/appeal-complain/:id", name: "appealComplainView", - component: addPage, + component: editPage, meta: { Auth: true, Key: [7], diff --git a/src/modules/07_appealComplain/store.ts b/src/modules/07_appealComplain/store.ts index 17af986..ca90ea4 100644 --- a/src/modules/07_appealComplain/store.ts +++ b/src/modules/07_appealComplain/store.ts @@ -1,5 +1,94 @@ import { defineStore } from "pinia"; +import { ref } from 'vue' +import { useCounterMixin } from "@/stores/mixin"; +import type { DataOption } from "@/modules/07_appealComplain/interface/index/main"; +import type { QTableProps } from "quasar"; +import type { RowList, MainList } from '@/modules/07_appealComplain/interface/response/mainType' export const useAppealComplainStore = defineStore("appealComplainStore", () => { - return {}; + + + const mixin = useCounterMixin() + const { date2Thai } = mixin + + const rows = ref([]); + const visibleColumns = ref([]); + const columns = ref([]); + + const typeOptions = ref([ + { id: "APPEAL", name: "อุทธรณ์" }, + { id: "COMPLAIN", name: "ร้องทุกข์" }, + ]); + + const statusOptions = ref([ + { id: "ALL", name: "ทั้งหมด" }, + { id: "NEW", name: "ใหม่" }, + { id: "RECEIVE_DOC", name: "ได้รับเอกสารแล้ว" }, + { id: "RECEIVE_APPEAL", name: "รับอุทธรณ์/ร้องทุกข์" }, + { id: "NO_RECEIVE_APPEAL", name: "ไม่รับอุทธรณ์/ร้องทุกข์" }, + { id: "DIAGNOSTIC", name: "ตั้งองค์คณะวินิจฉัย" }, + { id: "SUMMARY", name: "สรุปผลการพิจารณา" }, + { 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; + } + + + const typeConvert = (val: string) => { + switch (val) { + case "APPEAL": + return "อุทธรณ์"; + case "COMPLAIN": + return "ร้องทุกข์"; + default: + return "-"; + } + }; + + const 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 { + visibleColumns, + columns, + fetchAppealComplain, + rows, + typeOptions, + statusOptions + + }; }); diff --git a/src/modules/07_appealComplain/views/Add.vue b/src/modules/07_appealComplain/views/Add.vue index 30370b8..3ce3b26 100644 --- a/src/modules/07_appealComplain/views/Add.vue +++ b/src/modules/07_appealComplain/views/Add.vue @@ -1,205 +1,91 @@ diff --git a/src/modules/07_appealComplain/views/Edit.vue b/src/modules/07_appealComplain/views/Edit.vue new file mode 100644 index 0000000..edbc59b --- /dev/null +++ b/src/modules/07_appealComplain/views/Edit.vue @@ -0,0 +1,107 @@ + + + diff --git a/src/modules/07_appealComplain/views/Form.vue b/src/modules/07_appealComplain/views/Form.vue new file mode 100644 index 0000000..2915680 --- /dev/null +++ b/src/modules/07_appealComplain/views/Form.vue @@ -0,0 +1,398 @@ + + diff --git a/src/modules/07_appealComplain/views/Main.vue b/src/modules/07_appealComplain/views/Main.vue index 59f3605..4133f8b 100644 --- a/src/modules/07_appealComplain/views/Main.vue +++ b/src/modules/07_appealComplain/views/Main.vue @@ -1,42 +1,69 @@ +useA