From 0b9504e589ced45e36094aa135e5822700e27a65 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Fri, 22 Sep 2023 09:07:44 +0700 Subject: [PATCH 1/3] =?UTF-8?q?refactor=20=E0=B8=84=E0=B8=B3=E0=B8=AA?= =?UTF-8?q?=E0=B8=B1=E0=B9=88=E0=B8=87=20(=E0=B8=A2=E0=B8=B1=E0=B8=87?= =?UTF-8?q?=E0=B9=84=E0=B8=A1=E0=B9=88=E0=B9=80=E0=B8=AA=E0=B8=A3=E0=B9=87?= =?UTF-8?q?=E0=B8=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/10_order/components/Main.vue | 566 ------------------ .../10_order/components/step/step04.vue | 4 +- src/modules/10_order/router.ts | 2 +- src/modules/10_order/views/Main.vue | 519 +++++++++++++++- 4 files changed, 519 insertions(+), 572 deletions(-) delete mode 100644 src/modules/10_order/components/Main.vue diff --git a/src/modules/10_order/components/Main.vue b/src/modules/10_order/components/Main.vue deleted file mode 100644 index 270f95849..000000000 --- a/src/modules/10_order/components/Main.vue +++ /dev/null @@ -1,566 +0,0 @@ - - - - - diff --git a/src/modules/10_order/components/step/step04.vue b/src/modules/10_order/components/step/step04.vue index d2c1d305f..7ea3fc69c 100644 --- a/src/modules/10_order/components/step/step04.vue +++ b/src/modules/10_order/components/step/step04.vue @@ -562,7 +562,7 @@ const viewFileUpload = async (url: string) => { @click="viewFileUpload(OrderPDFUpload)"> ดูไฟล์คำสั่ง - ดาวน์โหลดไฟล์คำสั่ง @@ -590,7 +590,7 @@ const viewFileUpload = async (url: string) => { @click="viewFileUpload(TailerPDFUpload)"> ดูเอกสารแนบท้าย - ดาวน์โหลดเอกสารแนบท้าย diff --git a/src/modules/10_order/router.ts b/src/modules/10_order/router.ts index b037ac2af..34b147be8 100644 --- a/src/modules/10_order/router.ts +++ b/src/modules/10_order/router.ts @@ -1,4 +1,4 @@ -const MainOrder = () => import("@/modules/10_order/components/Main.vue"); +const MainOrder = () => import("@/modules/10_order/views/Main.vue"); const DetailPage = () => import("@/modules/10_order/components/Detail.vue"); export default [ diff --git a/src/modules/10_order/views/Main.vue b/src/modules/10_order/views/Main.vue index dc47857b9..51c527d70 100644 --- a/src/modules/10_order/views/Main.vue +++ b/src/modules/10_order/views/Main.vue @@ -1,7 +1,520 @@ + \ No newline at end of file + + + \ No newline at end of file From ce11307a77a039a2f7c466ad712b5ebe39b49d18 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Fri, 22 Sep 2023 09:35:10 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=E0=B8=AA=E0=B8=AD=E0=B8=9A=E0=B8=84?= =?UTF-8?q?=E0=B8=B1=E0=B8=94=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=96=E0=B9=89=E0=B8=B2=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=8A=E0=B8=B3=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=9B=E0=B9=87=E0=B8=990=20=E0=B9=80?= =?UTF-8?q?=E0=B8=84=E0=B8=A5=E0=B8=B5=E0=B8=A2=E0=B8=A3=E0=B8=84=E0=B9=88?= =?UTF-8?q?=E0=B8=B2=20=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=A7=E0=B8=B4=E0=B8=98=E0=B8=B5=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=8A=E0=B8=B3=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=87=E0=B8=B4?= =?UTF-8?q?=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../03_recruiting/views/02_qualify/PeriodAdd.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue index 58d81888c..55f4aaf49 100644 --- a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue @@ -469,7 +469,7 @@
- เลือกวีธีการชำระเงิน + เลือกวิธีการชำระเงิน
@@ -479,6 +479,7 @@ val="payment1" color="blue" class="q-mr-md" + :disable="fee <= 0" /> @@ -500,6 +501,7 @@ val="payment2" color="blue" class="q-mr-md" + :disable="fee <= 0" /> @@ -1129,14 +1131,20 @@ const columnsPosition = ref([ }, ]); -watch(organizationShortName, (count: DataOption, prevCount: DataOption) => { +watch(organizationShortName, (count: any, prevCount: any) => { organizationNameOptions.value = []; }); -watch(organizationName, (count: DataOption, prevCount: DataOption) => { +watch(organizationName, (count: any, prevCount: any) => { positionPathOptions.value = []; }); +watch(fee, (count: any, prevCount: any) => { + if (fee.value <= 0) { + pay.value = ""; + } +}); + onMounted(async () => { hideLoader(); if (route.params.id != undefined) { From 6104ca99bba7f6c7c105a1b2ee06dcbb90c07de5 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 22 Sep 2023 10:05:48 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=20interface=20=E0=B9=83=E0=B8=AB=E0=B9=89=20row=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=AD?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=99=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../05_placement/components/Other/Detail.vue | 3 -- .../05_placement/components/Other/Main.vue | 49 ++++++++--------- .../interface/response/OhterMain.ts | 54 +++++++++++++++++++ 3 files changed, 79 insertions(+), 27 deletions(-) create mode 100644 src/modules/05_placement/interface/response/OhterMain.ts diff --git a/src/modules/05_placement/components/Other/Detail.vue b/src/modules/05_placement/components/Other/Detail.vue index 63ea51135..7f3eab35d 100644 --- a/src/modules/05_placement/components/Other/Detail.vue +++ b/src/modules/05_placement/components/Other/Detail.vue @@ -77,7 +77,6 @@ const fecthOther = async () => { title.value.organizationPositionOld = data.organizationPositionOld ?? "-"; title.value.positionLevelOld = data.positionLevelOld ?? "-"; title.value.positionTypeOld = data.positionTypeOld ?? "-"; - responseData.value.profileId = data.profileId; responseData.value.createdAt = data.createdAt; responseData.value.date = data.date !== null ? new Date(data.date) : new Date(); @@ -141,7 +140,6 @@ const saveOther = async () => { }) .catch((e) => { messageError($q, e); - console.log(e); }) .finally(async () => { await fecthOther(); @@ -156,7 +154,6 @@ const getClass = (val: boolean) => { onMounted(async () => { if (keycloak.tokenParsed != null) { roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1"); - console.log("roleAdmin===>", roleAdmin.value); } await fecthOther(); }); diff --git a/src/modules/05_placement/components/Other/Main.vue b/src/modules/05_placement/components/Other/Main.vue index 2daf16387..708960ee9 100644 --- a/src/modules/05_placement/components/Other/Main.vue +++ b/src/modules/05_placement/components/Other/Main.vue @@ -5,6 +5,7 @@ import { useRouter } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; import { useTransferDataStore } from "@/modules/05_placement/store" import type { QTableProps } from "quasar"; +import type { listMain,listMainAPI,OpType } from "@/modules/05_placement/interface/response/OhterMain" import http from "@/plugins/http"; import config from "@/app.config"; @@ -18,11 +19,11 @@ const { showLoader, hideLoader, success, messageError, date2Thai, dialogRemove } const $q = useQuasar(); const router = useRouter(); -const optionsType = ref([]); +const optionsType = ref([]); const type = ref(""); const modal = ref(false); -const rows = ref([]); -const rows2 = ref([]); +const rows = ref([]); +const rows2 = ref([]); const filterKeyword = ref(""); const filterKeyword2 = ref(""); @@ -108,31 +109,31 @@ const fecthlistOthet = async () => { .get(config.API.otherMain()) .then((res) => { let response = res.data.result; - rows.value = response.map((r: any) => ({ + rows.value = response.map((r: listMainAPI) => ({ createdAt: date2Thai(r.createdAt), date: new Date(), - firstName: r.firstname ?? "", - personalId: r.id ?? "", + firstName: r.firstname ?? "-", + personalId: r.id ?? "-", isActive: r.isActive ? r.isActive : false, - lastName: r.lastname ?? "", - organization: r.organization ?? "", - organizationPositionOld: r.organizationPositionOld ?? "", - posNo: r.posNo ?? "", - position: r.position ?? "", - positionLevel: r.positionLevel ?? "", - positionLevelOld: r.positionLevelOld ?? "", - positionNumberOld: r.positionNumberOld ?? "", - positionTypeOld: r.positionTypeOld ?? "", - prefix: r.prefix ?? "", - reason: r.reason ?? "", + lastName: r.lastname ?? "-", + organization: r.organization ?? "-", + organizationPositionOld: r.organizationPositionOld ?? "-", + posNo: r.posNo ?? "-", + position: r.position ?? "-", + positionLevel: r.positionLevel ?? "-", + positionLevelOld: r.positionLevelOld ?? "-", + positionNumberOld: r.positionNumberOld ?? "-", + positionTypeOld: r.positionTypeOld ?? "-", + prefix: r.prefix ?? "-", + reason: r.reason ?? "-", salary: r.salary ? r.salary : 0, - status: r.status ?? "", + status: r.status ?? "-", statustext: statusText(r.status ?? ""), fullname: `${r.prefix ?? ""}${r.firstname ?? ""} ${r.lastname ?? ""}`, })); rows2.value = rows.value.filter( - (e: any) => - e.orgName !== null && e.status !== "REPORT" && e.status !== "DONE" + (e: listMain) => + e.status !== "REPORT" && e.status !== "DONE" ); }) .catch((e) => { @@ -150,7 +151,7 @@ const fecthTypeOption = async () => { .get(config.API.typeOrder()) .then((res) => { optionsType.value = res.data.result.filter( - (e: any) => e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09" + (e: OpType) => e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09" ); }) .catch((e) => { @@ -203,9 +204,9 @@ const clickDelete = (id: string) => { dialogRemove($q, () => deleteOther(id)); }; //----(เปิดหน้าถัดไป)------// -const nextPage = (row: any) => { +const nextPage = (id: string) => { router.push({ - path: `/other/detail/${row.personalId}`, + path: `/other/detail/${id}`, }); }; @@ -276,7 +277,7 @@ onMounted(() => { {{ props.rowIndex + 1 }} diff --git a/src/modules/05_placement/interface/response/OhterMain.ts b/src/modules/05_placement/interface/response/OhterMain.ts new file mode 100644 index 000000000..118176efe --- /dev/null +++ b/src/modules/05_placement/interface/response/OhterMain.ts @@ -0,0 +1,54 @@ +// ข้อมูลที่เก็บ +interface listMain { + personalId:string + fullname:string + prefix:string + firstName:string + lastName:string + date:Date + isActive:boolean + organization:string + organizationPositionOld:string + posNo:string + position:string + positionLevel:string + positionLevelOld:string + positionNumberOld:string + positionTypeOld:string + reason:string + salary:number + status:string + statustext:string + createdAt:Date +} +//ข้อมูลจาก api +interface listMainAPI { + id:string + firstname:string + prefix:string + firstName:string + lastname:string + date:Date + isActive:boolean + organization:string + organizationPositionOld:string + posNo:string + position:string + positionLevel:string + positionLevelOld:string + positionNumberOld:string + positionTypeOld:string + reason:string + salary:number + status:string + statustext:string + createdAt:Date +} +interface OpType { + commandCode:string +} +export type { + listMain, + listMainAPI, + OpType +} \ No newline at end of file