From 619f36212a0f228a0d834715a03b70df251539c2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 13 Sep 2023 17:30:07 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CurruncyInput.vue | 2 +- .../04_registry/components/DialogHistory.vue | 2 +- .../components/Information/Government.vue | 18 +++- .../components/Information/Information.vue | 7 +- src/modules/04_registry/components/Leave.vue | 15 ++- src/modules/04_registry/components/Salary.vue | 57 ++++++++--- .../04_registry/components/SalaryEmployee.vue | 77 ++++++++++++--- .../components/SalaryEmployeeTemp.vue | 94 ++++++++++++++++--- src/modules/04_registry/store.ts | 2 + .../08_registryEmployee/views/Leave.vue | 18 ++-- .../views/SalaryEmployee.vue | 39 +++++--- 11 files changed, 257 insertions(+), 74 deletions(-) diff --git a/src/components/CurruncyInput.vue b/src/components/CurruncyInput.vue index b92c8e38f..8d535b1ce 100644 --- a/src/components/CurruncyInput.vue +++ b/src/components/CurruncyInput.vue @@ -39,7 +39,7 @@ const props = defineProps({ const { inputRef, formattedValue, setValue } = useCurrencyInput({ locale: "en-US", currency: "EUR", - currencyDisplay: "hidden", + // currencyDisplay: "hidden", hideCurrencySymbolOnFocus: true, hideGroupingSeparatorOnFocus: true, hideNegligibleDecimalDigitsOnFocus: true, diff --git a/src/modules/04_registry/components/DialogHistory.vue b/src/modules/04_registry/components/DialogHistory.vue index eeb90a358..34f8524cc 100644 --- a/src/modules/04_registry/components/DialogHistory.vue +++ b/src/modules/04_registry/components/DialogHistory.vue @@ -1,6 +1,6 @@ @@ -739,7 +738,10 @@ const fetchData = async () => { totalLeave: e.totalLeave, status: e.status, reason: e.reason, - typeLeaveId: e.typeLeaveId, + typeLeaveId: + e.typeLeaveId !== "00000000-0000-0000-0000-000000000000" + ? e.typeLeaveId + : "", }); }); }) @@ -794,7 +796,10 @@ const clickHistory = async (row: RequestItemsObject) => { totalLeave: e.totalLeave, status: e.status, reason: e.reason, - typeLeaveId: e.typeLeaveId, + typeLeaveId: + e.typeLeaveId !== "00000000-0000-0000-0000-000000000000" + ? e.typeLeaveId + : "", }); }); }) diff --git a/src/modules/04_registry/components/Salary.vue b/src/modules/04_registry/components/Salary.vue index 6225b1a57..0bd1a120c 100644 --- a/src/modules/04_registry/components/Salary.vue +++ b/src/modules/04_registry/components/Salary.vue @@ -388,9 +388,10 @@ :options="{ currency: 'THB', }" - :rules="[(val: string) => !!val || `${'กรุณากรอกเงินเดือน'}`]" :label="`${'เงินเดือน'}`" + :rules="[(val: number) => !!val || `${'กรุณากรอกเงินเดือน'}`]" /> +
- --> +
@@ -581,6 +590,7 @@ import HistoryTable from "@/components/TableHistory.vue"; import http from "@/plugins/http"; import config from "@/app.config"; import type { QTableProps } from "quasar"; +import CurrencyInput from "@/components/CurruncyInput.vue"; const props = defineProps({ statusEdit: { @@ -602,6 +612,7 @@ const { dialogMessage, showLoader, hideLoader, + dialogConfirm, } = mixin; const route = useRoute(); const id = ref(""); @@ -939,7 +950,7 @@ profileData.salary.columns.length == 0 "mouthSalaryAmount", "oc", "positionEmployeePosition", - "posNo", + "posNoEmployee", "positionEmployeePositionSide", "positionEmployeeLevel", "positionEmployeeGroup", @@ -1016,11 +1027,11 @@ const columns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "posNo", + name: "posNoEmployee", align: "left", label: "ตำแหน่งเลขที่", sortable: true, - field: "posNo", + field: "posNoEmployee", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -1481,9 +1492,9 @@ const fetchData = async () => { .get(config.API.profileSalaryEmployeeId(profileId.value)) .then((res) => { const data = res.data.result; - // console.log(data); + console.log(data); rows.value = []; - data.map((e: ResponseObjectEmployee) => { + data.map((e: any) => { rows.value.push({ id: e.id, date: new Date(e.date), @@ -1493,16 +1504,35 @@ const fetchData = async () => { oc: e.oc, ocId: e.ocId, posNo: e.posNo, - posNoId: e.posNoId, + posNoId: + e.posNoId !== "00000000-0000-0000-0000-000000000000" + ? e.posNoId + : "", posNoEmployee: e.posNoEmployee, positionEmployeeGroup: e.positionEmployeeGroup, - positionEmployeeGroupId: e.positionEmployeeGroupId, + positionEmployeeGroupId: + e.positionEmployeeGroupId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeeGroupId + : "", positionEmployeeLevel: e.positionEmployeeLevel, - positionEmployeeLevelId: e.positionEmployeeLevelId, + positionEmployeeLevelId: + e.positionEmployeeLevelId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeeLevelId + : "", positionEmployeePosition: e.positionEmployeePosition, - positionEmployeePositionId: e.positionEmployeePositionId, + positionEmployeePositionId: + e.positionEmployeePositionId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeePositionId + : "", positionEmployeePositionSide: e.positionEmployeePositionSide, - positionEmployeePositionSideId: e.positionEmployeePositionSideId, + positionEmployeePositionSideId: + e.positionEmployeePositionSideId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeePositionSideId + : "", salaryClass: e.salaryClass, salaryRef: e.salaryRef, refCommandNo: e.refCommandNo, @@ -1687,12 +1717,29 @@ const templateDetail = async () => { * กดบันทึกใน dialog */ const clickSave = async () => { + if (amount.value === 0) { + amount.value = null; + } myForm.value.validate().then(async (result: boolean) => { if (result) { if (modalEdit.value) { - await editData(); + dialogConfirm( + $q, + async () => { + await editData(); + }, + "ยืนยันการแก้ไขข้อมูล", + "ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?" + ); } else { - await saveData(); + dialogConfirm( + $q, + async () => { + await saveData(); + }, + "ยืนยันการเพิ่มข้อมูล", + "ต้องการยืนยันการเพิ่มข้อมูลนี้หรือไม่ ?" + ); } } }); @@ -1872,7 +1919,7 @@ const addData = () => { modal.value = true; edit.value = true; date.value = new Date(); - amount.value = null; + amount.value = 0; positionSalaryAmount.value = null; mouthSalaryAmount.value = null; @@ -1944,7 +1991,7 @@ const clickHistory = async (row: RequestItemsEmployee) => { modalHistory.value = true; showLoader(); await http - .get(config.API.profileSalaryHisId(row.id)) + .get(config.API.profileSalaryEmployeeHisId(row.id)) .then((res) => { const data = res.data.result; // console.log("clickHistory", data); diff --git a/src/modules/04_registry/components/SalaryEmployeeTemp.vue b/src/modules/04_registry/components/SalaryEmployeeTemp.vue index 373848dec..ab24a1127 100644 --- a/src/modules/04_registry/components/SalaryEmployeeTemp.vue +++ b/src/modules/04_registry/components/SalaryEmployeeTemp.vue @@ -306,7 +306,7 @@ />
-->
- --> +
@@ -556,6 +565,7 @@ import HistoryTable from "@/components/TableHistory.vue"; import http from "@/plugins/http"; import config from "@/app.config"; import type { QTableProps } from "quasar"; +import CurrencyInput from "@/components/CurruncyInput.vue"; const props = defineProps({ statusEdit: { @@ -577,6 +587,7 @@ const { dialogMessage, showLoader, hideLoader, + dialogConfirm, } = mixin; const route = useRoute(); const id = ref(""); @@ -1522,16 +1533,35 @@ const fetchData = async () => { oc: e.oc, ocId: e.ocId, posNo: e.posNo, - posNoId: e.posNoId, + posNoId: + e.posNoId !== "00000000-0000-0000-0000-000000000000" + ? e.posNoId + : "", posNoEmployee: e.posNoEmployee, positionEmployeeGroup: e.positionEmployeeGroup, - positionEmployeeGroupId: e.positionEmployeeGroupId, + positionEmployeeGroupId: + e.positionEmployeeGroupId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeeGroupId + : "", positionEmployeeLevel: e.positionEmployeeLevel, - positionEmployeeLevelId: e.positionEmployeeLevelId, + positionEmployeeLevelId: + e.positionEmployeeLevelId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeeLevelId + : "", positionEmployeePosition: e.positionEmployeePosition, - positionEmployeePositionId: e.positionEmployeePositionId, + positionEmployeePositionId: + e.positionEmployeePositionId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeePositionId + : "", positionEmployeePositionSide: e.positionEmployeePositionSide, - positionEmployeePositionSideId: e.positionEmployeePositionSideId, + positionEmployeePositionSideId: + e.positionEmployeePositionSideId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeePositionSideId + : "", salaryClass: e.salaryClass, salaryRef: e.salaryRef, refCommandNo: e.refCommandNo, @@ -1716,12 +1746,29 @@ const templateDetail = async () => { * กดบันทึกใน dialog */ const clickSave = async () => { + if (amount.value == 0) { + amount.value = null; + } myForm.value.validate().then(async (result: boolean) => { if (result) { if (modalEdit.value) { - await editData(); + dialogConfirm( + $q, + async () => { + await editData(); + }, + "ยืนยันการแก้ไขข้อมูล", + "ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?" + ); } else { - await saveData(); + dialogConfirm( + $q, + async () => { + await saveData(); + }, + "ยืนยันการเพิ่มข้อมูล", + "ต้องการยืนยันการเพิ่มข้อมูลนี้หรือไม่ ?" + ); } } }); @@ -1901,7 +1948,7 @@ const addData = () => { modal.value = true; edit.value = true; date.value = new Date(); - amount.value = null; + amount.value = 0; positionSalaryAmount.value = null; mouthSalaryAmount.value = null; @@ -1973,7 +2020,7 @@ const clickHistory = async (row: RequestItemsEmployee) => { modalHistory.value = true; showLoader(); await http - .get(config.API.profileSalaryHisId(row.id)) + .get(config.API.profileSalaryEmployeeHisId(row.id)) .then((res) => { const data = res.data.result; // console.log("clickHistory", data); @@ -1988,16 +2035,33 @@ const clickHistory = async (row: RequestItemsEmployee) => { oc: e.oc, ocId: e.ocId, posNo: e.posNo, - posNoId: e.posNoId, + posNoId: + e.posNoId !== "00000000-0000-0000-0000-000000000000" + ? e.posNoId + : "", posNoEmployee: e.posNoEmployee, positionEmployeeGroup: e.positionEmployeeGroup, - positionEmployeeGroupId: e.positionEmployeeGroupId, + positionEmployeeGroupId: + e.positionEmployeeGroupId !== "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeeGroupId + : "", positionEmployeeLevel: e.positionEmployeeLevel, - positionEmployeeLevelId: e.positionEmployeeLevelId, + positionEmployeeLevelId: + e.positionEmployeeLevelId !== "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeeLevelId + : "", positionEmployeePosition: e.positionEmployeePosition, - positionEmployeePositionId: e.positionEmployeePositionId, + positionEmployeePositionId: + e.positionEmployeePositionId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeePositionId + : "", positionEmployeePositionSide: e.positionEmployeePositionSide, - positionEmployeePositionSideId: e.positionEmployeePositionSideId, + positionEmployeePositionSideId: + e.positionEmployeePositionSideId !== + "00000000-0000-0000-0000-000000000000" + ? e.positionEmployeePositionSideId + : "", salaryClass: e.salaryClass, salaryRef: e.salaryRef, refCommandNo: e.refCommandNo, diff --git a/src/modules/04_registry/store.ts b/src/modules/04_registry/store.ts index 8b69ec17a..af09e0d0a 100644 --- a/src/modules/04_registry/store.ts +++ b/src/modules/04_registry/store.ts @@ -2,6 +2,7 @@ import { ref, computed } from "vue"; import { defineStore } from "pinia"; export const useProfileDataStore = defineStore("profile", () => { + const emplployeeClass = ref('') interface profile { main: { columns: String[] }; education: { columns: String[] }; @@ -79,5 +80,6 @@ export const useProfileDataStore = defineStore("profile", () => { changeBirth, retireText, changeRetireText, + emplployeeClass, }; }); diff --git a/src/modules/08_registryEmployee/views/Leave.vue b/src/modules/08_registryEmployee/views/Leave.vue index 6608958f3..f3c6517b5 100644 --- a/src/modules/08_registryEmployee/views/Leave.vue +++ b/src/modules/08_registryEmployee/views/Leave.vue @@ -390,7 +390,7 @@ const { dateToISO, showLoader, hideLoader, - dialogConfirm + dialogConfirm, } = mixin; const route = useRoute(); @@ -736,7 +736,10 @@ const fetchData = async () => { totalLeave: e.totalLeave, status: e.status, reason: e.reason, - typeLeaveId: e.typeLeaveId, + typeLeaveId: + e.typeLeaveId !== "00000000-0000-0000-0000-000000000000" + ? e.typeLeaveId + : "", }); }); }) @@ -791,7 +794,10 @@ const clickHistory = async (row: RequestItemsObject) => { totalLeave: e.totalLeave, status: e.status, reason: e.reason, - typeLeaveId: e.typeLeaveId, + typeLeaveId: + e.typeLeaveId !== "00000000-0000-0000-0000-000000000000" + ? e.typeLeaveId + : "", }); }); }) @@ -952,10 +958,10 @@ const clickCancel = async () => { // * กดบันทึกใน dialog // */ const clickSave = () => { - dialogConfirm($q,() => SaveData()) -} + dialogConfirm($q, () => SaveData()); +}; const SaveData = async () => { - await myFormAdd.value.validate().then(async (result: boolean) => { + await myFormAdd.value.validate().then(async (result: boolean) => { if (result) { if (modalEdit.value) { await editData(); diff --git a/src/modules/08_registryEmployee/views/SalaryEmployee.vue b/src/modules/08_registryEmployee/views/SalaryEmployee.vue index 8819beb13..f091f5739 100644 --- a/src/modules/08_registryEmployee/views/SalaryEmployee.vue +++ b/src/modules/08_registryEmployee/views/SalaryEmployee.vue @@ -1035,11 +1035,11 @@ const columns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "posNo", + name: "posNoEmployee", align: "left", label: "ตำแหน่งเลขที่", sortable: true, - field: "posNo", + field: "posNoEmployee", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -1286,7 +1286,7 @@ const visibleColumnsHistory = ref([ "mouthSalaryAmount", "oc", "positionEmployeePosition", - "posNo", + "posNoEmployee", "positionEmployeePositionSide", "positionEmployeeLevel", "positionEmployeeGroup", @@ -1710,18 +1710,33 @@ const templateDetail = async () => { /** * กดบันทึกใน dialog */ -const clickSave = () => { - dialogConfirm($q, () => SaveData()); -}; -const SaveData = async () => { +const clickSave = async () => { + // dialogConfirm($q, () => SaveData()); + if (amount.value == 0) { + amount.value = null; + } await myForm.value.validate().then(async (result: boolean) => { if (result && agencyId.value) { if (modalEdit.value) { - await editData(); + dialogConfirm( + $q, + async () => { + await editData(); + }, + "ยืนยันการแก้ไขข้อมูล", + "ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?" + ); } else { - await saveData(); + dialogConfirm( + $q, + async () => { + await saveData(); + }, + "ยืนยันการเพิ่มข้อมูล", + "ต้องการยืนยันการเพิ่มข้อมูลนี้หรือไม่ ?" + ); } - } else if (agencyId.value == "") { + } else if (result && agencyId.value == "") { dialogMessageNotify($q, "กรุณาเลือกหน่วยงาน"); } }); @@ -1903,7 +1918,7 @@ const addData = () => { modal.value = true; edit.value = true; date.value = new Date(); - amount.value = null; + amount.value = 0; positionSalaryAmount.value = null; mouthSalaryAmount.value = null; @@ -1975,7 +1990,7 @@ const clickHistory = async (row: RequestItemsEmployee) => { modalHistory.value = true; showLoader(); await http - .get(config.API.profileSalaryHisId(row.id)) + .get(config.API.profileSalaryEmployeeHisId(row.id)) .then((res) => { const data = res.data.result; console.log("clickHistory", data); From 1c8d11f20e0e03ac46d036109db9e9013c23aeb5 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Wed, 13 Sep 2023 17:38:27 +0700 Subject: [PATCH 2/2] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20pop-up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/4_Allocate/DialogEdit.vue | 17 +++-------------- .../components/4_Allocate/OrgAdd.vue | 13 ++++++++++--- .../components/5_Borrow/DialogForm.vue | 16 +++------------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/src/modules/07_insignia/components/4_Allocate/DialogEdit.vue b/src/modules/07_insignia/components/4_Allocate/DialogEdit.vue index cb095dcf7..384817beb 100644 --- a/src/modules/07_insignia/components/4_Allocate/DialogEdit.vue +++ b/src/modules/07_insignia/components/4_Allocate/DialogEdit.vue @@ -2,6 +2,7 @@ import { ref, watch } from "vue"; import { QForm, useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; +import DialogHeader from "@/components/DialogHeader.vue"; const mixin = useCounterMixin(); const { dialogConfirm } = mixin; @@ -58,23 +59,11 @@ const clickSave = () => {