From 34cb5f6c8ec7c5d0d7d16ecf527ee195d86ecc33 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 19 Apr 2024 10:25:22 +0700 Subject: [PATCH 1/6] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=E0=B8=9D=E0=B8=B6=E0=B8=81=E0=B8=AD=E0=B8=9A?= =?UTF-8?q?=E0=B8=A3=E0=B8=A1/=E0=B8=94=E0=B8=B9=E0=B8=87=E0=B8=B2?= =?UTF-8?q?=E0=B8=99=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/history/AddPage.vue | 278 ++++----- .../components/historyEmployee/AddPage.vue | 535 ++++++++---------- .../15_development/views/EmployeeHistory.vue | 23 +- src/modules/15_development/views/History.vue | 1 + 4 files changed, 393 insertions(+), 444 deletions(-) diff --git a/src/modules/15_development/components/history/AddPage.vue b/src/modules/15_development/components/history/AddPage.vue index 824e7e155..1d30cec80 100644 --- a/src/modules/15_development/components/history/AddPage.vue +++ b/src/modules/15_development/components/history/AddPage.vue @@ -87,11 +87,13 @@ function fetchData() { formMainProject.trainingStart = data.dateStart ? data.dateStart : null; formMainProject.trainingEnd = data.dateEnd ? data.dateEnd : null; formMainProject.totalTraining = data.totalDate ? data.totalDate : null; - formMainProject.location = data.addressAcademic ? data.addressAcademic : null; + formMainProject.location = data.addressAcademic + ? data.addressAcademic + : null; formMainProject.topic = data.topicAcademic ? data.topicAcademic : null; // formMainProject.studyStart = data.dateStudyStart; // formMainProject.studyEnd = data.dateStudyEnd; - formMainProject.organizingTraining = data.org? data.org : null; + formMainProject.organizingTraining = data.org ? data.org : null; dateOrder.value = data.dateOrder; order.value = data.order; @@ -133,68 +135,76 @@ onMounted(() => { ข้อมูลข้าราชการฯ
-
-
-
- เลขประจําตัวประชาชน -
+
+
+
+
+
+ เลขประจําตัวประชาชน +
-
- {{ formMain.citizenId ?? "-" }} +
+ {{ formMain.citizenId ?? "-" }} +
+
+
+
+ ชื่อ - นามสกุล +
+ +
+ {{ formMain.name ?? "-" }} +
+
+
+
+ ตําแหน่ง +
+ +
+ {{ formMain.position ?? "-" }} +
+
+
+
+ ประเภทตําแหน่ง +
+ +
+ {{ formMain.type ?? "-" }} +
+
-
-
- ระดับตําแหน่ง -
+
+
+
+
+ ระดับตําแหน่ง +
-
- {{ formMain.level ?? "-" }} -
-
-
-
- ชื่อ - นามสกุล -
+
+ {{ formMain.level ?? "-" }} +
+
+
+
+ ตําแหน่งทางการบริหาร +
-
- {{ formMain.name ?? "-" }} -
-
-
-
- ตําแหน่งทางการบริหาร -
+
+ {{ formMain.positionSide ?? "-" }} +
+
+
+
+ หน่วยงานที่สังกัด +
-
- {{ formMain.positionSide ?? "-" }} -
-
-
-
- ตําแหน่ง -
- -
- {{ formMain.position ?? "-" }} -
-
-
-
- หน่วยงานที่สังกัด -
- -
- {{ formMain.oc ?? "-" }} -
-
-
-
- ประเภทตําแหน่ง -
- -
- {{ formMain.type ?? "-" }} +
+ {{ formMain.oc ?? "-" }} +
+
@@ -206,85 +216,93 @@ onMounted(() => { ข้อมูลโครงการ
-
-
-
- ชื่อโครงการ/หลักสูตรการฝึกอบรม -
+
+
+
+
+
+ ชื่อโครงการ/หลักสูตรการฝึกอบรม +
-
- {{ formMainProject.project ?? "-" }} +
+ {{ formMainProject.project ?? "-" }} +
+
+
+
+ ปีงบประมาณที่เข้ารับการฝึกอบรม/ศึกษาดูงาน +
+ +
+ {{ Number(formMainProject.year) + 543 ?? "-" }} +
+
+
+
+ หัวข้อการไปฝึกอบรม/ศึกษาดูงาน +
+ +
+ {{ formMainProject.topic ?? "-" }} +
+
+
+
+ สถานที่ไปฝึกอบรม/ศึกษาดูงาน +
+ +
+ {{ formMainProject.location ?? "-" }} +
+
-
-
- วันเริ่มต้นการฝึกอบรม/ศึกษาดูงาน -
+
+
+
+
+ วันเริ่มต้นการฝึกอบรม/ศึกษาดูงาน +
-
- {{ - formMainProject.trainingStart - ? date2Thai(formMainProject.trainingStart) - : "-" - }} -
-
-
-
- ปีงบประมาณที่เข้ารับการฝึกอบรม/ศึกษาดูงาน -
+
+ {{ + formMainProject.trainingStart + ? date2Thai(formMainProject.trainingStart) + : "-" + }} +
+
+
+
+ วันสิ้นสุดการฝึกอบรม/ศึกษาดูงาน +
-
- {{ formMainProject.year ?? "-" }} -
-
-
-
- วันสิ้นสุดการฝึกอบรม/ศึกษาดูงาน -
+
+ {{ + formMainProject.trainingEnd + ? date2Thai(formMainProject?.trainingEnd) + : "-" + }} +
+
+
+
+ รวมระยะเวลาในการฝึกอบรม/ศึกษาดูงาน +
-
- {{ - formMainProject.trainingEnd - ? date2Thai(formMainProject?.trainingEnd) - : "-" - }} -
-
-
-
- หัวข้อการไปฝึกอบรม/ศึกษาดูงาน -
+
+ {{ formMainProject.totalTraining ?? "-" }} +
+
+
+
+ หน่วยงานที่รับผิดชอบ +
-
- {{ formMainProject.topic ?? "-" }} -
-
-
-
- รวมระยะเวลาในการฝึกอบรม/ศึกษาดูงาน -
- -
- {{ formMainProject.totalTraining ?? "-" }} -
-
-
-
- สถานที่ไปฝึกอบรม/ศึกษาดูงาน -
- -
- {{ formMainProject.location ?? "-" }} -
-
-
-
- หน่วยงานที่รับผิดชอบ -
- -
- {{ formMainProject.organizingTraining ?? "-" }} +
+ {{ formMainProject.organizingTraining ?? "-" }} +
+
diff --git a/src/modules/15_development/components/historyEmployee/AddPage.vue b/src/modules/15_development/components/historyEmployee/AddPage.vue index bdc937a19..d2a96f87e 100644 --- a/src/modules/15_development/components/historyEmployee/AddPage.vue +++ b/src/modules/15_development/components/historyEmployee/AddPage.vue @@ -1,33 +1,27 @@ @@ -212,206 +131,234 @@ onMounted(() => { class="q-mr-sm" @click="router.go(-1)" /> - {{ - id - ? `แก้ไขประวัติฝึกอบรม/ดูงานลูกจ้าง` - : `เพิ่มประวัติฝึกอบรม/ดูงานลูกจ้าง` - }} + ประวัติฝึกอบรม/ดูงานลูกจ้าง
- - - -
- ข้อมูลลูกจ้าง - - -
-
-
-
-
-
- {{ - fieldLabels[field as keyof typeof fieldLabels] - }} + + + +
+ ข้อมูลลูกจ้าง +
+
+
+
+
+
+
+ เลขประจําตัวประชาชน
-
- {{ formMain[field] ? formMain[field] : "-" }} + +
+ {{ formMain.citizenId ?? "-" }}
-
- -
-
-
- {{ - fieldLabels[field as keyof typeof fieldLabels] - }} +
+
+ ชื่อ - นามสกุล
-
- {{ formMain[field] ? formMain[field] : "-" }} + +
+ {{ formMain.name ?? "-" }} +
+
+
+
+ ตำแหน่ง +
+ +
+ {{ formMain.position ?? "-" }} +
+
+
+
+ กลุ่มงาน +
+ +
+ {{ formMain.type ?? "-" }}
- - - -
- ข้อมูลโครงการ - -
-
-
-
-
-
- {{ - fieldLabelsProject[field as keyof typeof fieldLabelsProject] - }} +
+
+
+
+ ระดับชั้นงาน
-
- {{ - formMainProject[field] ? formMainProject[field] + 543 : "-" - }} - {{ - formMainProject[field] - ? date2Thai(formMainProject[field]) - : "-" - }} - {{ - formMainProject[field] ? formMainProject[field] : "-" - }} + +
+ {{ formMain.level ?? "-" }} +
+
+
+
+ หน่วยงานที่สังกัด +
+ +
+ {{ formMain.oc ?? "-" }}
- -
-
-
- {{ - fieldLabelsProject[field as keyof typeof fieldLabelsProject] - }} -
-
- {{ - formMainProject[field] ? formMainProject[field] : "-" - }} -
-
-
-
- - -
-
- -
-
- - - - -
- - - - + - - + + +
+ ข้อมูลโครงการ +
+
+
+
+
+
+
+ ชื่อโครงการ/หลักสูตรการฝึกอบรม +
+ +
+ {{ formMainProject.project ?? "-" }} +
+
+
+
+ ปีงบประมาณที่เข้ารับการฝึกอบรม/ศึกษาดูงาน +
+ +
+ {{ Number(formMainProject.year) + 543 ?? "-" }} +
+
+
+
+ หัวข้อการไปฝึกอบรม/ศึกษาดูงาน +
+ +
+ {{ formMainProject.topic ?? "-" }} +
+
+
+
+ สถานที่ไปฝึกอบรม/ศึกษาดูงาน +
+ +
+ {{ formMainProject.location ?? "-" }} +
+
+
+
+
+
+
+
+ วันเริ่มต้นการฝึกอบรม/ศึกษาดูงาน +
+ +
+ {{ + formMainProject.trainingStart + ? date2Thai(formMainProject.trainingStart) + : "-" + }} +
+
+
+
+ วันสิ้นสุดการฝึกอบรม/ศึกษาดูงาน +
+ +
+ {{ + formMainProject.trainingEnd + ? date2Thai(formMainProject?.trainingEnd) + : "-" + }} +
+
+
+
+ รวมระยะเวลาในการฝึกอบรม/ศึกษาดูงาน +
+ +
+ {{ formMainProject.totalTraining ?? "-" }} +
+
+
+
+ หน่วยงานที่รับผิดชอบ +
+ +
+ {{ formMainProject.organizingTraining ?? "-" }} +
+
+
+
+
+
+ +
+
+ +
+
+ + + + + +
+
+ + diff --git a/src/modules/15_development/views/EmployeeHistory.vue b/src/modules/15_development/views/EmployeeHistory.vue index 9e1305eac..105e6cf85 100644 --- a/src/modules/15_development/views/EmployeeHistory.vue +++ b/src/modules/15_development/views/EmployeeHistory.vue @@ -6,11 +6,6 @@ import config from "@/app.config"; import genReportXLSX from "@/plugins/genreportxlsx"; import { useRouter } from "vue-router"; -import type { - DataOption, - FormFilter, -} from "@/modules/15_development/interface/index/Main"; - /** importStore*/ import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore"; import { useCounterMixin } from "@/stores/mixin"; @@ -27,7 +22,7 @@ const pagination = ref({ }); const maxPage = ref(1); const formFilter = reactive({ - root: "", + root: null, page: 1, pageSize: 20, keyword: "", @@ -35,7 +30,6 @@ const formFilter = reactive({ }); const rows = ref([]); -const agency = ref(""); const agencyOp = ref<[]>([]); const visibleColumns = ref([ @@ -111,9 +105,10 @@ function fetchListOrg() { http .get(config.API.developmentHistoryListOrg("employee", formFilter.year)) .then((res) => { - formFilter.root = ""; + formFilter.root = null; rows.value = []; agencyOp.value = res.data.result; + getData(); }) .catch((err) => { messageError($q, err); @@ -148,14 +143,6 @@ function onEdit(id: string) { } function getData() { - let queryParams: any = { - page: formFilter.page, - pageSize: formFilter.pageSize, - keyword: formFilter.keyword, - year: formFilter.year, - root: formFilter.root, - }; - showLoader(); http .post(config.API.developmentHistoryList("employee"), formFilter) @@ -184,10 +171,6 @@ function getData() { }); } -function yearAll() { - formFilter.year = 0; - // getData(); -} onMounted(() => { fetchListOrg(); }); diff --git a/src/modules/15_development/views/History.vue b/src/modules/15_development/views/History.vue index 63d321182..033785c87 100644 --- a/src/modules/15_development/views/History.vue +++ b/src/modules/15_development/views/History.vue @@ -116,6 +116,7 @@ function fetchListOrg() { .get(config.API.developmentHistoryListOrg("officer", formFilter.year)) .then((res) => { formFilter.root = null; + rows.value = []; agencyOp.value = res.data.result; getData(); }) From cb76bf12c1801c3c52b473bb2d870142867cd75d Mon Sep 17 00:00:00 2001 From: oat_dev Date: Fri, 19 Apr 2024 10:58:23 +0700 Subject: [PATCH 2/6] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=95=E0=B8=B1=E0=B8=A7=E0=B8=8A=E0=B8=B5=E0=B9=89?= =?UTF-8?q?=E0=B8=A7=E0=B8=B1=E0=B8=94=E0=B8=95=E0=B8=B2=E0=B8=A1=E0=B9=81?= =?UTF-8?q?=E0=B8=9C=E0=B8=99=20(U)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indicatorByPlan/IndicatorByPlan.vue | 92 ++--- src/modules/14_KPI/views/indicatorByPlan.vue | 386 ++++++++++++------ 2 files changed, 296 insertions(+), 182 deletions(-) diff --git a/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue b/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue index 544128734..c57279515 100644 --- a/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue +++ b/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue @@ -101,11 +101,15 @@ function updateSelected(data: any) { planData.strategyChildPlannedId = data.id; planData.strategyChildPlannedNode = data.level; } +function updateSelectedAgency(data: any) { + planData.agencyId = data.orgTreeId; + planData.agencyLevel = data.orgLevel; +} -onMounted(() => { +onMounted(async () => { // fetchData(); - fetchTree(); - fetchOrganizationActive(); + await fetchTree(); + await fetchOrganizationActive(); setTimeout(async () => { store.activeId && (await fetchDataTree(store.activeId)); }, 200); @@ -116,38 +120,6 @@ onMounted(() => {
-
- -
-
- -
{
-
+
+ +
+
{
@@ -274,11 +266,11 @@ onMounted(() => {
@@ -291,11 +283,11 @@ onMounted(() => {
@@ -308,11 +300,11 @@ onMounted(() => {
@@ -325,11 +317,11 @@ onMounted(() => {
@@ -367,7 +359,7 @@ onMounted(() => {
- หน่วยงาน + หน่วยงาน/ส่วนราชการ
@@ -384,11 +376,12 @@ onMounted(() => { { ([]); @@ -42,6 +44,10 @@ const columns = ref([ style: "font-size: 14px", }, ]); +const node = ref([]); +const expanded = ref([]); +const filter = ref(""); +const filterMain = ref(""); const visibleColumns = ref([ "indicatorNo", "indicatorPass", @@ -66,6 +72,11 @@ const formFilter = reactive({ keyword: "", }); +const nodeData = reactive({ + node: null, + nodeId: null, +}); + function fetchList() { showLoader(); const data = [ @@ -101,8 +112,49 @@ function onClickDelete(id: number) { }); } +function fetchActive() { + showLoader(); + http + .get(config.API.activeOrganization) + .then((res) => { + const data = res.data.result; + fetchTree(data.activeId); + }) + .catch((err) => { + messageError($q, err); + hideLoader(); + }); +} + +async function fetchTree(id: string) { + showLoader(); + http + .get(config.API.orgByid(id.toString())) + .then((res) => { + const data = res.data.result; + node.value = data; + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + +function updateSelectedTreeMain(data: any) { + if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) { + nodeData.node = null; + nodeData.nodeId = null; + } else { + nodeData.node = data.orgLevel; + nodeData.nodeId = data.orgTreeId; + } +} + onMounted(() => { fetchList(); + fetchActive(); }); @@ -111,139 +163,207 @@ onMounted(() => { รายการตัวชี้วัดตามแผนฯ
- -
-
- -
-
- -
-
- - - เพิ่ม - - - - -
-
- - - -
-
- -
-
-
- -
- - - - +
+
+ +
+
+
+ +
+
+
+ +
+
+ + เพิ่ม + +
+
+ + + +
+
+ +
+
+
+ + + + +
+
- + From 2ffc8012cf6e04abb8c8b84bec357dfc69e1785e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 19 Apr 2024 11:19:37 +0700 Subject: [PATCH 3/6] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=A3=E0=B8=AD=E0=B8=9A=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A1=E0=B8=B4?= =?UTF-8?q?=E0=B8=99=E0=B8=9C=E0=B8=A5=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=9B?= =?UTF-8?q?=E0=B8=8F=E0=B8=B4=E0=B8=9A=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=AB?= =?UTF-8?q?=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/14_KPI/interface/request/Main.ts | 1 + src/modules/14_KPI/views/round.vue | 92 ++++++++++++++++++-- 2 files changed, 84 insertions(+), 9 deletions(-) diff --git a/src/modules/14_KPI/interface/request/Main.ts b/src/modules/14_KPI/interface/request/Main.ts index 4fd86ae77..ff17529bc 100644 --- a/src/modules/14_KPI/interface/request/Main.ts +++ b/src/modules/14_KPI/interface/request/Main.ts @@ -7,6 +7,7 @@ interface FormQueryRound { interface FormRound { durationKPI: string; + year: number | null; startDate: Date | null; endDate: Date | null; } diff --git a/src/modules/14_KPI/views/round.vue b/src/modules/14_KPI/views/round.vue index 75bd34406..5e9c22505 100644 --- a/src/modules/14_KPI/views/round.vue +++ b/src/modules/14_KPI/views/round.vue @@ -70,17 +70,32 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "isActive", + align: "left", + label: "สะถานะ", + sortable: true, + field: "isActive", + format: (val) => (val ? "เปืดรอบ" : "ปิดรอบ"), + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, +]); +const visibleColumns = ref([ + "durationKPI", + "startDate", + "endDate", + "isActive", ]); -const visibleColumns = ref(["durationKPI", "startDate", "endDate"]); /** itemMenu*/ const itemMenu = ref([ - { - label: "เปิดรอบ", - value: "open", - icon: "mdi-check", - color: "primary", - }, + // { + // label: "เปิดรอบ", + // value: "open", + // icon: "mdi-check", + // color: "primary", + // }, { label: "ปิดรอบ", value: "close", @@ -113,6 +128,7 @@ const formQuery = reactive({ const totalList = ref(1); const formData = reactive({ durationKPI: "", + year: null, startDate: null, endDate: null, }); @@ -172,6 +188,7 @@ function clearFormData() { formData.durationKPI = ""; formData.startDate = null; formData.endDate = null; + formData.year = null; } /** function บันทึกข้อมูลเพิ่มรอบการประเมิน*/ @@ -244,6 +261,7 @@ function onCloseRounde(id: string) { dialogConfirm( $q, () => { + showLoader() http .get(config.API.kpiPeriod + `/close/${id}`) .then(() => { @@ -336,7 +354,9 @@ onMounted(() => { dense lazy-rules outlined - :model-value="Number(formQuery.year) + 543" + :model-value=" + formQuery.year === 0 ? 'ทั้งหมด' : Number(formQuery.year) + 543 + " :label="`${'ปีงบประมาณ'}`" > + @@ -462,7 +491,9 @@ onMounted(() => { @@ -526,6 +557,49 @@ onMounted(() => { ]" />
+
+ + + + + +
+
Date: Fri, 19 Apr 2024 11:36:48 +0700 Subject: [PATCH 4/6] =?UTF-8?q?=E0=B8=95=E0=B9=88=E0=B8=ADAPI=20=E0=B8=81?= =?UTF-8?q?=E0=B8=A5=E0=B8=B8=E0=B9=88=E0=B8=A1=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/14_KPI/api.KPI.ts | 6 +- .../competency/02ListLinkPosition.vue | 191 +++++++++--------- .../14_KPI/interface/response/KpiGroup.ts | 7 + 3 files changed, 103 insertions(+), 101 deletions(-) create mode 100644 src/modules/14_KPI/interface/response/KpiGroup.ts diff --git a/src/api/14_KPI/api.KPI.ts b/src/api/14_KPI/api.KPI.ts index 2de431732..3e4aa0bdb 100644 --- a/src/api/14_KPI/api.KPI.ts +++ b/src/api/14_KPI/api.KPI.ts @@ -2,11 +2,13 @@ import env from "../index"; const KPI = `${env.API_URI}/kpi`; const kpiPeriod = `${env.API_URI}/kpi/period`; const kpiEvaluation = `${env.API_URI}/kpi/evaluation`; - +const kpiGroup = `${env.API_URI}/kpi/group`; export default { KPI, /** รอบการประเมินผล*/ kpiPeriod: `${kpiPeriod}`, kpiPeriodById: (id: string) => `${kpiPeriod}/${id}`, - kpiEvaluation + kpiEvaluation, + kpiGroup, + kpiGroupById: (id: string) => `${kpiGroup}/${id}` }; diff --git a/src/modules/14_KPI/components/competency/02ListLinkPosition.vue b/src/modules/14_KPI/components/competency/02ListLinkPosition.vue index 6d9c2e4f6..9deefd0b0 100644 --- a/src/modules/14_KPI/components/competency/02ListLinkPosition.vue +++ b/src/modules/14_KPI/components/competency/02ListLinkPosition.vue @@ -3,21 +3,19 @@ import { ref, onMounted } from "vue"; import type { QTableProps } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; -import { useRouter } from "vue-router"; -import Header from "@/components/DialogHeader.vue"; +import dialogHeader from "@/components/DialogHeader.vue"; import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; - +import type { ResponseObject } from "@/modules/14_KPI/interface/response/KpiGroup"; import http from "@/plugins/http"; import config from "@/app.config"; const modal = ref(false); -const router = useRouter(); -const rows = ref(); +const rows = ref([]); const groupName = ref(""); const editStatus = ref(false); - +const editId = ref(""); const competencyTypeOp = ref([ { id: "ID1", @@ -42,11 +40,11 @@ const competencyTypeOp = ref([ ]); const columns = ref([ { - name: "groupName", + name: "nameGroupKPI", align: "left", label: "รายการกลุ่มงาน", sortable: true, - field: "groupName", + field: "nameGroupKPI", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -56,71 +54,81 @@ const columns = ref([ const $q = useQuasar(); const mixin = useCounterMixin(); -const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin; - -const competencyType = ref("ID1"); +const { + dialogRemove, + dialogConfirm, + showLoader, + hideLoader, + messageError, + success, +} = mixin; const filterKeyword = ref(""); -const visibleColumns = ref(["groupName"]); +const visibleColumns = ref(["nameGroupKPI"]); /** ดึงข้อมูล */ -async function getData() { - const data = [ - { - id: "ID1", - groupName: "กลุ่มงาน 1", - }, - { - id: "ID2", - groupName: "กลุ่มงาน 2", - }, - ]; - rows.value = data; - // showLoader(); - // await http - // .get(config.API.orgPrefix) - // .then(async (res) => { - // }) - // .catch((err) => { - // messageError($q, err); - // }) - // .finally(() => { - // hideLoader(); - // }); +async function fetchData() { + showLoader(); + await http + .get(config.API.kpiGroup) + .then(async (res) => { + rows.value = res.data.result.data; + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + +async function addData() { + await http + .post(config.API.kpiGroup, { + nameGroupKPI: groupName.value, + }) + .then(() => { + fetchData(); + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); } async function editData(id: string) { - console.log(id); - // await http - // .put(config.API.orgPrefixId(id), { - // name: prefix.value, - // }) - // .then(() => { - // getData(); - // success($q, "บันทึกข้อมูลสำเร็จ"); - // }) - // .catch((err) => { - // messageError($q, err); - // }) - // .finally(() => { - // hideLoader(); - // }); + await http + .put(config.API.kpiGroupById(id), { + nameGroupKPI: groupName.value, + }) + .then(() => { + fetchData(); + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); } async function deleteData(id: string) { - console.log(id); - // await http - // .delete(config.API.orgPrefixId(id)) - // .then(() => { - // getData(); - // success($q, "ลบข้อมูลสำเร็จ"); - // }) - // .catch((err) => { - // messageError($q, err); - // }) - // .finally(() => { - // hideLoader();w - // }); + await http + .delete(config.API.kpiGroupById(id)) + .then(() => { + fetchData(); + success($q, "ลบข้อมูลสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); } /** เปลี่ยนเป็นหน้าเพิ่มข้อมูล */ @@ -128,42 +136,38 @@ function onAdd() { modal.value = true; } -function close() { +function closeDialog() { modal.value = false; editStatus.value = false; - groupName.value = '' + groupName.value = ""; } function onEdit(data: any) { modal.value = true; editStatus.value = true; - groupName.value = data.groupName + groupName.value = data.nameGroupKPI; + editId.value = data.id; } -function onSubmit() { - console.log("save"); - close() +async function onSubmit() { + dialogConfirm( + $q, + async () => { + editStatus.value ? editData(editId.value) : addData(); + closeDialog(); + }, + "ยืนยันการบันทึกข้อมูล", + "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" + ); } onMounted(async () => { - getData(); + fetchData(); }); diff --git a/src/modules/14_KPI/components/competency/Forms/Main.vue b/src/modules/14_KPI/components/competency/Forms/Main.vue new file mode 100644 index 000000000..f77c04c2d --- /dev/null +++ b/src/modules/14_KPI/components/competency/Forms/Main.vue @@ -0,0 +1,240 @@ +div + + + + + diff --git a/src/modules/14_KPI/store/KPIStore.ts b/src/modules/14_KPI/store/KPIStore.ts index 58894b277..5cc082e07 100644 --- a/src/modules/14_KPI/store/KPIStore.ts +++ b/src/modules/14_KPI/store/KPIStore.ts @@ -3,7 +3,7 @@ import { ref } from "vue"; // store export const useKPIDataStore = defineStore("KPIDataStore", () => { - const competencyType = ref("ID1"); + const competencyType = ref("HEAD"); return { competencyType }; }); From c6d53b22f3fe9c121e0870dccc41a4c1dd753e1c Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 19 Apr 2024 13:58:58 +0700 Subject: [PATCH 6/6] =?UTF-8?q?-=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=84=E0=B8=A7=E0=B8=B2?= =?UTF-8?q?=E0=B8=A1=20-=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=E0=B9=80=E0=B8=A1=E0=B8=99=E0=B8=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interface/request/main/main.ts | 189 +++---------- src/modules/14_KPI/views/round.vue | 6 +- .../15_development/components/Record.vue | 6 + .../15_development/views/Scholarship.vue | 255 ++++++++---------- src/views/MainLayout.vue | 62 +++-- 5 files changed, 201 insertions(+), 317 deletions(-) diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index 2c9f74d10..c667cd88a 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -52,7 +52,7 @@ const menuList = readonly([ role: "dashboard", }, { - key: 3, + key: 2, icon: "o_person", activeIcon: "person", label: "ข้อมูลหลัก (ใหม่)", @@ -60,43 +60,41 @@ const menuList = readonly([ role: "metadata", children: [ { - key: 3.1, + key: 2.0, label: "ข้อมูลเกี่ยวกับบุคคล", path: "masterPersonal", }, { - key: 3.2, + key: 2.0, label: "ข้อมูลตำแหน่งข้าราชการฯ", path: "masterPosition", }, { - key: 3.3, + key: 2.0, label: "ข้อมูลตำแหน่งลูกจ้างประจำ", path: "masterPositionEmployee", }, { - key: 3.4, + key: 2.0, label: "ข้อมูลปฏิทินวันหยุด", path: "masterCalendarWork", }, { - key: 3.5, + key: 2.0, label: "ข้อมูลเครื่องราชอิสริยาภรณ์", path: "masterInsignia", }, { - key: 3.6, + key: 2.1, label: "ตัวชี้วัด", role: "evaluateKPI", children: [ { - key: 3.61, label: "ตามแผน", path: "KPIIndicatorByPlan", role: "evaluateKPI", }, { - key: 3.62, label: "ตามตำแหน่ง", path: "KPIIndicatorByRole", role: "evaluateKPI", @@ -104,7 +102,7 @@ const menuList = readonly([ ], }, { - key: 3.7, + key: 2.0, label: "สมรรถนะ", path: "KPICompetency", role: "evaluateKPI", @@ -112,52 +110,15 @@ const menuList = readonly([ ], }, { - key: 4, + key: 3, icon: "o_groups", activeIcon: "groups", label: "โครงสร้างอัตรากำลัง (ใหม่)", path: "organizationalNew", role: "organization", - // children: [ - // { - // key: 3.1, - // label: "จัดการตำแหน่ง", - // path: "organizationalMapping", - // }, - // { - // key: 3.2, - // label: "แผนภูมิโครงสร้าง", - // path: "organizationalStructChart", - // }, - // { - // key: 3.3, - // label: "แผนภูมิองค์กร", - // path: "organizationalOrgChart", - // }, - // { - // key: 3.4, - // label: "ผังโครงสร้าง", - // path: "organizationalTree", - // }, - // { - // key: 3.5, - // label: "ผังโครงสร้างลูกจ้าง", - // path: "organizationalEmployee", - // }, - // { - // key: 3.6, - // label: "จัดการบัญชี 2", - // path: "manageReport2", - // }, - // { - // key: 3.7, - // label: "รายงานบัญชี", - // path: "organizationalReport", - // }, - // ], }, { - key: 4, + key: 3, icon: "o_groups", activeIcon: "groups", label: "อัตรากำลังลูกจ้างประจำฯ", @@ -173,7 +134,7 @@ const menuList = readonly([ role: "organization", }, { - key: 2, + key: 100, icon: "o_person", activeIcon: "person", label: "ข้อมูลหลัก", @@ -181,7 +142,7 @@ const menuList = readonly([ role: "metadata", }, { - key: 3, + key: 0, icon: "o_groups", activeIcon: "groups", label: "โครงสร้างอัตรากำลัง", @@ -242,7 +203,7 @@ const menuList = readonly([ role: "registryverify", }, { - key: 10, + key: 5, icon: "o_contact_page", activeIcon: "registry_employee_page", label: "ทะเบียนประวัติลูกจ้าง", @@ -250,7 +211,7 @@ const menuList = readonly([ role: "registryEmployee", }, { - key: 10, + key: 6, icon: "mdi-file-certificate-outline", activeIcon: "order", label: "ออกคำสั่ง", @@ -258,7 +219,7 @@ const menuList = readonly([ role: "order", }, { - key: 5, + key: 7, icon: "o_search", activeIcon: "search", label: "สรรหา", @@ -268,13 +229,13 @@ const menuList = readonly([ { label: "ตั้งค่าเว็บสรรหา", path: "editorweb", - key: 5.1, + key: 7.1, role: "recruit", }, { label: "สอบแข่งขัน", path: "", - key: 5.2, + key: 7.2, role: "recruit", children: [ { @@ -292,7 +253,7 @@ const menuList = readonly([ { label: "คัดเลือก", path: "", - key: 5.3, + key: 7.3, role: "recruit", children: [ { @@ -325,7 +286,7 @@ const menuList = readonly([ ], }, { - key: 6, + key: 8, path: "placement", icon: "how_to_reg", activeIcon: "how_to_reg", @@ -333,67 +294,46 @@ const menuList = readonly([ role: "placement", children: [ { - key: 6.1, label: "รายชื่อผู้สอบผ่าน", path: "placement", role: "placement", }, - // { - // key: 6.2, - // label: "ออกคำสั่ง", - // path: "Orderplacement", - // role: "placement", - // }, { - key: 6.3, label: "การทดลองปฏิบัติหน้าที่ราชการ", path: "probation", role: "probation", }, { - key: 6.4, label: "รายการขอโอน", path: "transfer", role: "placement", }, { - key: 6.5, label: "รายการรับโอน", path: "receive", role: "placement", }, { - key: 6.6, label: "รายการช่วยราชการ", path: "help-government", role: "placement", }, { - key: 6.7, label: "รายการส่งตัวกลับ", path: "repatriate", role: "placement", }, { - key: 6.8, label: "รายการแต่งตั้ง-เลื่อน-ย้าย", path: "appoint-promote", role: "placement", }, { - key: 6.8, label: "ปรับระดับชั้นงาน-ย้ายลูกจ้าง", path: "appoint-employee", role: "placement", }, - // { - // key: 6.9, - // label: "รายการย้าย", - // path: "relocation", - // role: "placement", - // }, { - key: 6.1, label: "รายการอื่นๆ", path: "other", role: "placement", @@ -401,7 +341,7 @@ const menuList = readonly([ ], }, { - key: 7, + key: 9, icon: "mdi-account-cancel-outline", activeIcon: "mdi-account-cancel", label: "พ้นจากราชการ", @@ -409,51 +349,34 @@ const menuList = readonly([ role: "retirement", children: [ { - key: 7.1, label: "ประกาศเกษียณ", path: "retirement", role: "retirement", }, { - key: 7.2, label: "รายการลาออก", path: "resign", role: "retirement", }, { - key: 7.3, label: "Exit interview", path: "exit-Interview", role: "retirement", }, { - key: 7.4, label: "รายการบันทึกการถึงแก่กรรม", path: "deceased", role: "retirement", }, { - key: 7.5, label: "รายการให้ออก", path: "dismiss-order", role: "retirement", }, - // { - // key: 7.6, - // label: "รายการปลดออก", - // path: "discharged", - // role: "retirement", - // }, - // { - // key: 7.7, - // label: "รายการไล่ออก", - // path: "expulsion", - // role: "retirement", - // }, ], }, { - key: 8, + key: 10, icon: "mdi-medal-outline", activeIcon: "mdi-medal", label: "เครื่องราชฯ", @@ -461,37 +384,31 @@ const menuList = readonly([ role: "insignia", children: [ { - key: 8.1, label: "รอบการเสนอขอ", path: "insigniaProposals", role: "insignia", }, { - key: 8.2, label: "จัดการคำขอ", path: "insigniaManage", role: "insignia", }, { - key: 8.3, label: "บันทึกผลการเสนอขอ", path: "insigniaRecord", role: "insignia", }, { - key: 8.4, label: "จัดสรรเครื่องราชฯ", path: "insigniaAllocate", role: "insignia", }, { - key: 8.6, label: "ยืม-คืนเครื่องราชฯ", path: "insigniaBorrow", role: "insignia", }, { - key: 8.5, label: "รายงาน", path: "insigniaReport", role: "insignia", @@ -499,7 +416,7 @@ const menuList = readonly([ ], }, { - key: 9, + key: 11, icon: "mdi-calendar", activeIcon: "mdi-calendar", label: "การลา", @@ -507,37 +424,31 @@ const menuList = readonly([ role: "leave", children: [ { - key: 9.1, label: "รอบการปฏิบัติงาน", path: "/round-time", role: "leave", }, { - key: 9.2, label: "แก้ไขรอบการปฎิบัติงานผู้ใช้งาน", path: "/change-round", role: "leave", }, { - key: 9.3, label: "รายการลงเวลาปฏิบัติงาน", path: "/work-list", role: "leave", }, { - key: 9.4, label: "ลงเวลากรณีพิเศษ", path: "/timestamp-special", role: "leave", }, { - key: 9.5, label: "รายการลา", path: "/leave", role: "leave", }, { - key: 9.6, label: "รายงานสถิติการลา", path: "/leave-report", role: "leave", @@ -545,56 +456,50 @@ const menuList = readonly([ ], }, { - key: 11, + key: 12, icon: "mdi-scale-balance", activeIcon: "mdi-scale-balance", label: "วินัย", role: "discipline", children: [ { - key: 11.1, + key: 12.0, label: "เรื่องร้องเรียน", path: "disciplineComplaints", role: "discipline", }, { - key: 11.2, + key: 12.0, label: "สืบสวนข้อเท็จจริง", path: "disciplineInvestigatefacts", role: "discipline", }, { - key: 11.3, + key: 12.0, label: "สอบสวนความผิดทางวินัย", path: "disciplineDisciplinary", role: "discipline", }, { - key: 11.4, + key: 12.0, label: "สรุปผลการพิจารณาความผิดทางวินัย", path: "disciplineResult", role: "discipline", }, { - key: 11.5, + key: 12.0, label: "รายชื่อผู้ถูกพักราชการ", path: "disciplineListSuspend", role: "discipline", }, - // { - // key: 11.5, - // label: "รายงาน", - // path: "disciplineReport", - // role: "discipline", - // }, { - key: 11.5, + key: 12.0, label: "อุทธรณ์/ร้องทุกข์", path: "appealComplain", role: "discipline", }, { - key: 11.5, + key: 12.0, label: "ออกคำสั่งลงโทษทางวินัย", path: "disciplineOrder", role: "discipline", @@ -602,7 +507,7 @@ const menuList = readonly([ { label: "ข้อมูลพื้นฐาน", path: "", - key: 11.7, + key: 12.1, role: "discipline", children: [ { @@ -620,14 +525,14 @@ const menuList = readonly([ ], }, { - key: 11, + key: 13, icon: "mdi-account-check", activeIcon: "mdi-account-check", label: "ประเมินบุคคล", role: "evaluate", children: [ { - key: 11.1, + key: 13.0, label: "คำขอประเมิน", path: "evaluate", role: "discipline", @@ -635,7 +540,7 @@ const menuList = readonly([ { label: "กรรมการและการประชุม", path: "", - key: 11.7, + key: 13.1, role: "evaluate", children: [ { @@ -653,44 +558,38 @@ const menuList = readonly([ ], }, { - key: 12, + key: 14, icon: "mdi-cash", activeIcon: "mdi-cash", label: "เงินเดือน/ค่าจ้าง", role: "salary", children: [ { - key: 12.1, label: "ผังบัญชีเงินเดือนข้าราชการฯ", path: "salaryChart", role: "salary", }, { - key: 12.2, label: "ผังบัญชีค่าจ้างลูกจ้างประจำ", path: "salaryEmployeeChart", role: "salary", }, { - key: 12.3, label: "รอบการขึ้นเงินเดือน", path: "salaryRound", role: "salary", }, { - key: 12.4, label: "เลื่อนเงินเดือนข้าราชการฯ", path: "salaryLists", role: "salary", }, { - key: 12.5, label: "เลื่อนค่าจ้างลูกจ้างประจำ", path: "salaryEmployeeLists", role: "salary", }, { - key: 12.6, label: "ออกคำสั่งเลื่อนเงินเดือน/ค่าจ้าง", path: "commandSalary", role: "salary", @@ -698,14 +597,13 @@ const menuList = readonly([ ], }, { - key: 13, + key: 15, icon: "mdi-account-star", activeIcon: "mdi-account-star", label: "ประเมินผลการปฏิบัติราชการระดับบุคคล", role: "evaluateKPI", children: [ { - key: 13.1, label: "รอบการประเมิน", path: "KPIRound", role: "evaluateKPI", @@ -713,52 +611,39 @@ const menuList = readonly([ ], }, { - key: 14, + key: 16, icon: "mdi-briefcase-account", activeIcon: "mdi-briefcase-account", label: "พัฒนาบุคลากร", role: "development", children: [ { - key: 14.1, label: "โครงการ/หลักสูตรการฝึกอบรม", path: "developmentMain", role: "development", }, { - key: 14.2, label: "ประวัติฝึกอบรม/ดูงาน ขรก.", path: "developmentHistory", role: "development", }, { - key: 14.3, label: "ประวัติฝึกอบรม/ดูงานลูกจ้าง", path: "developmentEmployeeHistory", role: "development", }, { - key: 14.4, label: "ทุนการศึกษา/ฝึกอบรม", path: "developmentScholarship", role: "development", }, { - key: 14.5, label: "ยุทธศาสตร์", path: "developmentStrategic", role: "development", }, ], }, - // { - // key: 99, - // icon: "mdi-chat", - // activeIcon: "mdi-chat", - // label: "ถาม-ตอบ", - // role: "support", - // path: "support", - // }, ]); const tabList = readonly([ diff --git a/src/modules/14_KPI/views/round.vue b/src/modules/14_KPI/views/round.vue index 5e9c22505..de68eacf6 100644 --- a/src/modules/14_KPI/views/round.vue +++ b/src/modules/14_KPI/views/round.vue @@ -73,10 +73,10 @@ const columns = ref([ { name: "isActive", align: "left", - label: "สะถานะ", + label: "สถานะ", sortable: true, field: "isActive", - format: (val) => (val ? "เปืดรอบ" : "ปิดรอบ"), + format: (val) => (val ? "เปิด" : "ปิดแล้ว"), headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -261,7 +261,7 @@ function onCloseRounde(id: string) { dialogConfirm( $q, () => { - showLoader() + showLoader(); http .get(config.API.kpiPeriod + `/close/${id}`) .then(() => { diff --git a/src/modules/15_development/components/Record.vue b/src/modules/15_development/components/Record.vue index fb79176b1..f8060c941 100644 --- a/src/modules/15_development/components/Record.vue +++ b/src/modules/15_development/components/Record.vue @@ -350,6 +350,7 @@ onMounted(() => { > - + diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index bd573aca9..1ef8f2137 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -733,15 +733,18 @@ watch( @click="link = menuItem.label" active-class="text-primary menuActiveMini text-weight-medium" v-if=" - menuItem.key == 3 || - menuItem.key == 5 || - menuItem.key == 6 || + menuItem.key == 2 || + menuItem.key == 0 || menuItem.key == 7 || menuItem.key == 8 || menuItem.key == 9 || + menuItem.key == 10 || menuItem.key == 11 || menuItem.key == 12 || - menuItem.key == 14 + menuItem.key == 13 || + menuItem.key == 14 || + menuItem.key == 15 || + menuItem.key == 16 " >
@@ -772,8 +775,24 @@ watch( :to="{ name: `${subMenu.path}` }" > -
- +
+ {{ subMenu.label }} @@ -898,16 +917,18 @@ watch( expand-icon="mdi-chevron-down" expanded-icon="mdi-chevron-up" v-if=" - menuItem.key == 3 || - menuItem.key == 5 || - menuItem.key == 6 || + menuItem.key == 2 || + menuItem.key == 0 || menuItem.key == 7 || menuItem.key == 8 || menuItem.key == 9 || + menuItem.key == 10 || menuItem.key == 11 || menuItem.key == 12 || menuItem.key == 13 || - menuItem.key == 14 + menuItem.key == 14 || + menuItem.key == 15 || + menuItem.key == 16 " >