diff --git a/src/modules/02_organizationalNew/interface/response/Main.ts b/src/modules/02_organizationalNew/interface/response/Main.ts new file mode 100644 index 000000000..696a5b0f7 --- /dev/null +++ b/src/modules/02_organizationalNew/interface/response/Main.ts @@ -0,0 +1,17 @@ +interface DataPosType { + id: string; + posLevels: DataLevel[]; + posTypeName: string; + posTypeRank: number; + posTypeShortName: string; +} + +interface DataLevel { + id: string; + posLevelName: number; + posTypeName: string; + posTypeId: string; + posLevelAuthority: string; +} + +export type { DataPosType }; diff --git a/src/modules/02_organizationalNew/router.ts b/src/modules/02_organizationalNew/router.ts index 22793bd7f..32b16995e 100644 --- a/src/modules/02_organizationalNew/router.ts +++ b/src/modules/02_organizationalNew/router.ts @@ -1,5 +1,4 @@ const mainPage = () => import("@/modules/02_organizationalNew/views/main.vue"); -const testPage = () => import("@/modules/02_organizationalNew/views/ExampleSearchTree.vue"); export default [ { @@ -12,15 +11,4 @@ export default [ Role: "organization", }, }, - { - path: "/organization-new/test", - name: "organizationalNewTest", - component: testPage, - meta: { - Auth: true, - Key: [7], - Role: "organization", - }, - }, - ]; diff --git a/src/modules/02_organizationalNew/views/main.vue b/src/modules/02_organizationalNew/views/main.vue index 8cc395034..967ac8447 100644 --- a/src/modules/02_organizationalNew/views/main.vue +++ b/src/modules/02_organizationalNew/views/main.vue @@ -4,34 +4,49 @@ import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; -/** importType*/ +/** + * importType + */ import type { DataOption } from "@/modules/02_organizationalNew/interface/index/Main"; import type { OrgRevision } from "@/modules/02_organizationalNew/interface/response/organizational"; -/** importComponents*/ +/** + * importComponents + */ import TreeView from "@/modules/02_organizationalNew/components/TreeView.vue"; import StructureView from "@/modules/02_organizationalNew/components/StructureMain.vue"; import DialogFormNewStructure from "@/modules/02_organizationalNew/components/DialogNewStructure.vue"; import DialogDateTime from "@/modules/02_organizationalNew/components/DialogFormDateTime.vue"; -/** importStore*/ +/** + * importStore + */ import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational"; import { useCounterMixin } from "@/stores/mixin"; -/** use*/ +/** + * use + */ const $q = useQuasar(); const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin(); const store = useOrganizational(); -/** modalDialog*/ +/** + * ตัวแปร + */ const modalNewStructure = ref(false); // เพิ่มโครงสร้าง const modalDateTime = ref(false); // ตั้งเวลาเผยแพร่ - -/** สถานะ*/ const isStatusData = ref(false); // แสดงตั้งเวลาเผยแพร่ -// const ishasActive = ref(false); // สถานะการทำงาน -// const ishasDraft = ref(false); // สถานะแบบร่าง -/** List เพิ่มโครงสร้าง*/ +const typeStructure = ref(""); // ประเภทการเพิ่มโครงสร้าง +/** ประวัติโครงสร้าง*/ +const itemHistory = ref([]); // List ประวัติโครงสร้าง +const historyId = ref(""); // ID ประวัติโครงสร้าง +const labelHistory = ref("ประวัติโครงสร้าง"); // ชื่อประวัติโครงสร้าง +const count = ref(0); + +/** + * List เพิ่มโครงสร้าง + */ const itemStructure = ref([ { id: "NEW", @@ -50,18 +65,13 @@ const itemStructure = ref([ name: "ทำสำเนาโครงสร้าง ตำแหน่งและคนครอง", }, ]); -const typeStructure = ref(""); // ประเภทการเพิ่มโครงสร้าง -/** ประวัติโครงสร้าง*/ -const itemHistory = ref([]); // List ประวัติโครงสร้าง -const historyId = ref(""); // ID ประวัติโครงสร้าง -const labelHistory = ref("ประวัติโครงสร้าง"); // ชื่อประวัติโครงสร้าง -const count = ref(0); - -/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/ -async function fetchOrganizationActive() { +/** + * function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง + */ +function fetchOrganizationActive() { showLoader(); - await http + http .get(config.API.activeOrganization) .then((res) => { const data = res.data.result; @@ -73,10 +83,8 @@ async function fetchOrganizationActive() { isStatusData.value = true; if (isStatusData.value) { if (data.activeName === null) { - // ishasActive.value = true; store.typeOrganizational = "draft"; } else if (data.draftName === null) { - // ishasDraft.value = true; store.typeOrganizational = "current"; } } @@ -89,9 +97,11 @@ async function fetchOrganizationActive() { }); } -/** function เรียกข้อมูลประวัติโครงสร้าง*/ -async function fetchHistory() { - await http +/** + * function เรียกข้อมูลประวัติโครงสร้าง + */ +function fetchHistory() { + http .get(config.API.organizationHistoryNew) .then((res) => { const data = res.data.result; @@ -118,7 +128,9 @@ function ocClickAddStructure(type: string) { typeStructure.value = type; } -/** function openPopup ตั้งเวลาเผยแพร่*/ +/** + * function openPopup ตั้งเวลาเผยแพร่ + */ function onClickDateTime() { modalDateTime.value = !modalDateTime.value; } @@ -135,7 +147,9 @@ function onClickHistory(id: string, name: string) { count.value++; } -/** lifecycleHook */ +/** + * lifecycleHook + */ onMounted(async () => { store.typeOrganizational = "current"; await fetchOrganizationActive(); diff --git a/src/modules/14_KPI/components/results/tableIndividual.vue b/src/modules/14_KPI/components/results/tableIndividual.vue index 2771eef7e..6e61863f4 100644 --- a/src/modules/14_KPI/components/results/tableIndividual.vue +++ b/src/modules/14_KPI/components/results/tableIndividual.vue @@ -144,6 +144,12 @@ const pagination = ref({ rowsPerPage: pageSize.value, }); +/** + * ตัวแปร + */ +const year = ref(new Date().getFullYear()); //ปีงบประมาณ +const roundOp = ref([]); // รายการรอบการประเมิน + /** * function fetch รายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง */ @@ -158,8 +164,6 @@ function fetcDataList() { }) .then((res) => { const data = res.data.result; - console.log(data); - rows.value = data.data; total.value = data.total; maxPage.value = Math.ceil(total.value / pageSize.value); @@ -172,8 +176,6 @@ function fetcDataList() { }); } -const year = ref(new Date().getFullYear()); -const roundOp = ref([]); /** * function fetch รอบการประเมิน */ @@ -205,6 +207,7 @@ function fetchRoundOption() { } else { roundOp.value = []; store.formQuery.round = ""; + rows.value = []; } }) .catch((err) => { @@ -215,6 +218,9 @@ function fetchRoundOption() { }); } +/** + * function เปลี่ยนรอบการประเมิน และ เรียกข้อมูลรายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง + */ function changRound() { store.formQuery.page = 1; fetcDataList(); @@ -228,12 +234,6 @@ function onSearchData() { fetcDataList(); } -function clearYear() { - year.value = null; - store.formQuery.round = ""; - roundOp.value = []; - fetcDataList(); -} /** * ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า */ @@ -251,6 +251,9 @@ function onClickView(id: string) { devId.value = id; } +/** + * HookLifecycle + */ onMounted(() => { store.formQuery.round = ""; fetchRoundOption(); diff --git a/src/modules/14_KPI/components/results/tableResults.vue b/src/modules/14_KPI/components/results/tableResults.vue index ea4558b5d..d024bf2e4 100644 --- a/src/modules/14_KPI/components/results/tableResults.vue +++ b/src/modules/14_KPI/components/results/tableResults.vue @@ -46,12 +46,13 @@ const maxPage = defineModel("maxPage", { required: true }); const total = defineModel("total", { required: true }); const keyword = defineModel("keyword", { required: true }); const porps = defineProps({ - fetchData: { type: Function, required: true }, + fetchData: { type: Function, required: true }, // function เรีนกข้อมูลประกาศผล }); /** * Table */ +const selected = ref([]); const columns = ref([ { name: "no", @@ -172,7 +173,12 @@ const pagination = ref({ page: page.value, rowsPerPage: pageSize.value, }); -const selected = ref([]); + +/** + * ตัวแปร + */ +const year = ref(new Date().getFullYear()); //ปีงบประมาณ +const roundOp = ref([]); // รายการรอบการประเมิน /** * function บันทึกการประกาศผล @@ -202,8 +208,6 @@ function onAnnounce() { ); } -const year = ref(new Date().getFullYear()); -const roundOp = ref([]); /** * function fetch รอบการประเมิน */ @@ -233,6 +237,7 @@ function fetchRoundOption() { } else { roundOp.value = []; store.formQuery.round = ""; + rows.value = []; } }) .catch((err) => { @@ -243,6 +248,9 @@ function fetchRoundOption() { }); } +/** + * function เปลี่ยนรอบการประเมิน และ เรียกข้อมูลรายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง + */ function changRound() { store.formQuery.page = 1; porps.fetchData(); @@ -256,12 +264,6 @@ function onSearchData() { porps.fetchData(); } -// function clearYear() { -// year.value = null; -// store.formQuery.round = ""; -// roundOp.value = []; -// porps.fetchData(); -// } /** * ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า */ @@ -270,6 +272,9 @@ watch(pagination, () => { pageSize.value = pagination.value.rowsPerPage; }); +/** + * ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า + */ onMounted(() => { store.formQuery.round = ""; fetchRoundOption(); diff --git a/src/modules/14_KPI/views/report.vue b/src/modules/14_KPI/views/report.vue index d0723ce21..ed1dc1026 100644 --- a/src/modules/14_KPI/views/report.vue +++ b/src/modules/14_KPI/views/report.vue @@ -86,7 +86,7 @@ const listReportMain = ref([ name: "จัดทำประกาศผู้มีผลการปฏิบัติราชการระดับดีเด่นและดีมาก", }, ]); -const listReport = ref([]); +const listReport = ref([]); // รายการรายงานทั้งหมด /** * funtion fetchข้อมูลรอบการประเมิน @@ -335,7 +335,6 @@ const formFilter = reactive({ }); const maxPage = ref(1); const total = ref(0); - const roundRef = ref(null); const rowsPerson = ref([]); diff --git a/src/modules/14_KPI/views/resultsMain.vue b/src/modules/14_KPI/views/resultsMain.vue index 5d29c4d7a..45d313d83 100644 --- a/src/modules/14_KPI/views/resultsMain.vue +++ b/src/modules/14_KPI/views/resultsMain.vue @@ -1,5 +1,5 @@