diff --git a/src/modules/09_leave/stores/LeaveStore.ts b/src/modules/09_leave/stores/LeaveStore.ts index 870b88074..ca74bf832 100644 --- a/src/modules/09_leave/stores/LeaveStore.ts +++ b/src/modules/09_leave/stores/LeaveStore.ts @@ -16,7 +16,7 @@ export const useLeavelistDataStore = defineStore("leave", () => { const mainData = ref([]) const rows = ref([]) const loadTable = ref(false) - async function fecthList(data: any) { + async function fetchList(data: any) { let datalist = data.map((e: any) => ({ leaveType: e.leaveType, name: e.name, @@ -161,7 +161,7 @@ export const useLeavelistDataStore = defineStore("leave", () => { amounttab2, //ข้อมูลในตาราง rows, - fecthList, + fetchList, loadTable, //filter table filterTable, diff --git a/src/modules/09_leave/stores/WorkStore.ts b/src/modules/09_leave/stores/WorkStore.ts index 9e7404dc0..9cbd2be96 100644 --- a/src/modules/09_leave/stores/WorkStore.ts +++ b/src/modules/09_leave/stores/WorkStore.ts @@ -8,7 +8,7 @@ export const useWorklistDataStore = defineStore("work", () => { // ข้อมูลในตาราง const rows = ref([]) const dataMain = ref([]) - function fecthList(data: any) { + function fetchList(data: any) { let datalist = data.map((e: any) => ({ fullName: e.fullName, timeIn: e.timeIn, @@ -86,7 +86,7 @@ export const useWorklistDataStore = defineStore("work", () => { return { //ข้อมูลในตาราง rows, - fecthList, + fetchList, //ค้นหาข้อมูล filterTable, selectDate, diff --git a/src/modules/09_leave/views/LeaveListMain.vue b/src/modules/09_leave/views/LeaveListMain.vue index 17dda82c2..aa5a93aed 100644 --- a/src/modules/09_leave/views/LeaveListMain.vue +++ b/src/modules/09_leave/views/LeaveListMain.vue @@ -6,7 +6,7 @@ import { useLeavelistDataStore } from "../stores/LeaveStore"; import TableList from "../components/2_Leave/TableList.vue"; const leaveStore = useLeavelistDataStore(); -const { fecthList, clearFilter } = leaveStore; +const { fetchList, clearFilter } = leaveStore; onMounted(() => { fecthLeaveList(); @@ -39,7 +39,7 @@ function fecthLeaveList() { status: "2", }, ]; - fecthList(data); // ส่งข้อมูลไป stores + fetchList(data); // ส่งข้อมูลไป stores } //เปลี่ยน Tab function changTab() { @@ -51,7 +51,7 @@ function changTab() {
รายการลา
- + - + { fecthWorkList(); @@ -66,7 +66,7 @@ function fecthWorkList() { status: "1", }, ]; - fecthList(listData); // ส่งข้อมูลไปยัง stores + fetchList(listData); // ส่งข้อมูลไปยัง stores } diff --git a/src/modules/11_discipline/interface/request/complaint.ts b/src/modules/11_discipline/interface/request/complaint.ts new file mode 100644 index 000000000..e2d9ebe94 --- /dev/null +++ b/src/modules/11_discipline/interface/request/complaint.ts @@ -0,0 +1,38 @@ +interface FormData { + complainantType: string + complainant: string + office: string + agency: string + topicComplaint: string + detail: string + datereceive: Date | null + dateconsideration: Date | null + offenseDescription: string + considerationLevel: string + datewarn: Date | null + receivecomplaints: string + petitioner: string + files: any | null +} + +interface MyObjectComplaintsRef { + complainantType: object | null; + complainant: object | null; + office: object | null; + agency: object | null; + topicComplaint: object | null; + datereceive: object | null; + dateconsideration: object | null; + offenseDescription: object | null; + considerationLevel: object | null; + datewarn: object | null; + receivecomplaints: object | null; + petitioner: object | null; + files: object | null; + [key: string]: any; +} + +export type { + FormData, + MyObjectComplaintsRef +} \ No newline at end of file diff --git a/src/modules/11_discipline/interface/request/order.ts b/src/modules/11_discipline/interface/request/order.ts new file mode 100644 index 000000000..e4c661416 --- /dev/null +++ b/src/modules/11_discipline/interface/request/order.ts @@ -0,0 +1,30 @@ +interface FormData { + orderType: string; + orderBy: string; + listInvestigation: string; + authority: string; + orderNumber: string; + dateYear: number; + date: Date | null; + authorityPosition: string + subject: string; + mistakeDetail: string +} +interface MyObjectRef { + orderType: object | null; + orderBy: object | null; + listInvestigation: object | null; + authority: object | null; + orderNumber: object | null; + dateYear: object | null; + date: object | null; + authorityPosition: object | null; + subject: object | null; + mistakeDetail: object | null; + [key: string]: any; +} + +export type { + FormData, + MyObjectRef +} \ No newline at end of file diff --git a/src/modules/11_discipline/interface/response/complaint.ts b/src/modules/11_discipline/interface/response/complaint.ts new file mode 100644 index 000000000..d90dbe5ef --- /dev/null +++ b/src/modules/11_discipline/interface/response/complaint.ts @@ -0,0 +1,15 @@ +interface DataList { + subject: string + detail: string + complainant: string + offenseDescription: string + creationDate: string + considerationLevel: string + considerationDeadlineDate: string +} + + + +export type { + DataList +} \ No newline at end of file diff --git a/src/modules/11_discipline/interface/response/order.ts b/src/modules/11_discipline/interface/response/order.ts new file mode 100644 index 000000000..56a046c52 --- /dev/null +++ b/src/modules/11_discipline/interface/response/order.ts @@ -0,0 +1,15 @@ +interface DataList { + subject: string + ordernumber: string + dateOrder: string + orderby: string + signer: string + statusorder: string + +} + + + +export type { + DataList +} \ No newline at end of file diff --git a/src/modules/11_discipline/store/ComplaintsStore.ts b/src/modules/11_discipline/store/ComplaintsStore.ts index 5c4520b65..b3080bc19 100644 --- a/src/modules/11_discipline/store/ComplaintsStore.ts +++ b/src/modules/11_discipline/store/ComplaintsStore.ts @@ -1,15 +1,14 @@ import { defineStore } from "pinia"; import { ref } from "vue"; -import type { DataOption } from "../interface/index/Main"; +import type { DataOption } from "@/modules/11_discipline/interface/index/Main"; +import type { DataList } from "@/modules/11_discipline/interface/response/complaint" + export const useComplainstDataStore = defineStore("DisciplineComplainst", () => { - const rows = ref([]) - - - - function fectComplainst(data: any) { - let datalist = data.map((e: any) => ({ + const rows = ref([]) + function fetchComplainst(data: DataList[]) { + let datalist = data.map((e: DataList) => ({ subject: e.subject, detail: e.detail, complainant: e.complainant, @@ -20,16 +19,13 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () => })) rows.value = datalist } - - - const complainantoptionsMain = ref() const complainantoptions = ref() const agencytoptionsMain = ref() const agencytoptions = ref() const optionListNameMain = ref([]) const optionListName = ref([]) - function fectOptioin(complainantoptions: any, agencytoptions: any) { + function fetchOptioin(complainantoptions: any, agencytoptions: any) { complainantoptionsMain.value = complainantoptions agencytoptionsMain.value = agencytoptions } @@ -37,7 +33,7 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () => optionListNameMain.value = list optionListName.value = list } - function filterSelector(val: any, update: Function, type: string) { + function filterSelector(val: string, update: Function, type: string) { update(() => { if (type === "filtercomplainantType" && complainantoptionsMain.value) { complainantoptions.value = complainantoptionsMain.value.filter( @@ -58,10 +54,10 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () => return { rows, optionListName, - fectComplainst, + fetchComplainst, selectComplainantTpye, filterSelector, - fectOptioin, + fetchOptioin, complainantoptions, agencytoptions, } diff --git a/src/modules/11_discipline/store/OrderStore.ts b/src/modules/11_discipline/store/OrderStore.ts index e7c5b77e7..56cfe7cd5 100644 --- a/src/modules/11_discipline/store/OrderStore.ts +++ b/src/modules/11_discipline/store/OrderStore.ts @@ -1,10 +1,12 @@ import { defineStore } from "pinia"; import { ref } from "vue"; +import type { DataList } from "@/modules/11_discipline/interface/response/order" + export const useOrderStore = defineStore("DisciplineOrder", () => { - const rows = ref([]) - async function fecthOrder(data: any) { - let datalist = data.map((e: any) => ({ + const rows = ref([]) + async function fetchOrder(data: DataList[]) { + let datalist = data.map((e: DataList) => ({ subject: e.subject, ordernumber: e.ordernumber, dateOrder: e.dateOrder, @@ -19,6 +21,6 @@ export const useOrderStore = defineStore("DisciplineOrder", () => { return { rows, - fecthOrder + fetchOrder } }) \ No newline at end of file