diff --git a/src/components/TableHistory.vue b/src/components/TableHistory.vue index eddd27bfd..b1f91f903 100644 --- a/src/components/TableHistory.vue +++ b/src/components/TableHistory.vue @@ -161,11 +161,6 @@ const props = defineProps({ type: Boolean, defualt: false, }, - // optionsHistory: Array, - // updateHistory: { - // type: Function, - // default: () => console.log("not function"), - // }, }); const emit = defineEmits([ diff --git a/src/components/information/Document.vue b/src/components/information/Document.vue index ee4a9ead5..8e5ca1671 100644 --- a/src/components/information/Document.vue +++ b/src/components/information/Document.vue @@ -216,7 +216,6 @@ const uploadData = async () => { const formData = new FormData(); formData.append("avatar", newFile); formData.append("moss", "newFile"); - console.log(formData); showLoader(); await http .post(config.API.profilePaperId(profileId.value), formData) diff --git a/src/components/information/Image.vue b/src/components/information/Image.vue index 5291f27b8..b120f8fa1 100644 --- a/src/components/information/Image.vue +++ b/src/components/information/Image.vue @@ -332,7 +332,6 @@ const fetchData = async () => { .get(config.API.profileAvatarId(route.params.id.toString())) .then((res) => { const data = res.data.result; - // console.log(data); fullname.value = data.fullname; imageUrl.value = data.avatar; position.value = data.position; @@ -363,7 +362,6 @@ const fetchAvatarHistory = async () => { .get(config.API.profileAvatarHistoryId(route.params.id.toString())) .then((res) => { const data = res.data.result; - console.log(data); images.value = []; data.map((e: any) => { images.value.push({ diff --git a/src/components/information/Leave.vue b/src/components/information/Leave.vue index 13588c243..a92088bdc 100644 --- a/src/components/information/Leave.vue +++ b/src/components/information/Leave.vue @@ -723,7 +723,6 @@ const fetchData = async () => { .get(config.API.profileLeaveId(profileId.value)) .then((res) => { const data = res.data.result; - // console.log(data); data.map((e: ResponseObject) => { rows.value.push({ id: e.id, @@ -909,7 +908,6 @@ const clickAddLeave = async () => { numUsedLeave.value = 0; await clickTotal(); if (rowsTotal.value.length > 0) { - // console.log(rowsTotal.value); let data: DataOptionLeave[] = []; rowsTotal.value.map((e: ResponseTotalObject) => { data.push({ @@ -1131,7 +1129,6 @@ const selectData = async (props: DataProps) => { numUsedLeave.value = props.row.sumLeave; await clickTotal(); if (rowsTotal.value.length > 0) { - // console.log(rowsTotal.value); let data: DataOptionLeave[] = []; rowsTotal.value.map((e: ResponseTotalObject) => { data.push({ diff --git a/src/components/information/SalaryEmployee.vue b/src/components/information/SalaryEmployee.vue index 97856d8eb..8c1f0d1e1 100644 --- a/src/components/information/SalaryEmployee.vue +++ b/src/components/information/SalaryEmployee.vue @@ -1479,7 +1479,6 @@ const fetchData = async () => { .get(config.API.profileSalaryEmployeeId(profileId.value)) .then((res) => { const data = res.data.result; - // console.log(data); rows.value = []; data.map((e: ResponseObjectEmployee) => { rows.value.push({ @@ -1600,7 +1599,6 @@ const checkRowPage = () => { editRow.value = false; next.value = true; previous.value = true; - // console.log(rowIndex.value); if (rowIndex.value + 1 >= rows.value.length) { next.value = false; } @@ -1834,7 +1832,6 @@ const clickClose = async () => { * @param props ค่า props ใน row ที่เลือก */ const selectData = async (props: DataPropsEmployee) => { - // console.log(props.row); modalEdit.value = true; modal.value = true; edit.value = false; @@ -1945,7 +1942,6 @@ const clickHistory = async (row: RequestItemsEmployee) => { .get(config.API.profileSalaryHisId(row.id)) .then((res) => { const data = res.data.result; - // console.log("clickHistory", data); rowsHistory.value = []; data.map((e: ResponseObjectEmployee) => { rowsHistory.value.push({ diff --git a/src/components/information/SalaryEmployeeTemp.vue b/src/components/information/SalaryEmployeeTemp.vue index 7e2be28a6..19597676b 100644 --- a/src/components/information/SalaryEmployeeTemp.vue +++ b/src/components/information/SalaryEmployeeTemp.vue @@ -1509,7 +1509,6 @@ const fetchData = async () => { .get(config.API.profileSalaryEmployeeId(profileId.value)) .then((res) => { const data = res.data.result; - // console.log(data); rows.value = []; data.map((e: ResponseObjectEmployee) => { rows.value.push({ @@ -1630,7 +1629,6 @@ const checkRowPage = () => { editRow.value = false; next.value = true; previous.value = true; - // console.log(rowIndex.value); if (rowIndex.value + 1 >= rows.value.length) { next.value = false; } @@ -1864,7 +1862,6 @@ const clickClose = async () => { * @param props ค่า props ใน row ที่เลือก */ const selectData = async (props: DataPropsEmployee) => { - // console.log(props.row); modalEdit.value = true; modal.value = true; edit.value = false; @@ -1975,7 +1972,6 @@ const clickHistory = async (row: RequestItemsEmployee) => { .get(config.API.profileSalaryHisId(row.id)) .then((res) => { const data = res.data.result; - // console.log("clickHistory", data); rowsHistory.value = []; data.map((e: ResponseObjectEmployee) => { rowsHistory.value.push({ diff --git a/src/modules/02_organizational/components/AddMappingPositions.vue b/src/modules/02_organizational/components/AddMappingPositions.vue index 2f531fe58..405dcb92c 100644 --- a/src/modules/02_organizational/components/AddMappingPositions.vue +++ b/src/modules/02_organizational/components/AddMappingPositions.vue @@ -954,8 +954,6 @@ const fetchPosition = async () => { .get(config.API.position) .then((res) => { const data = res.data.result; - console.log(data.positionPaths); - let optionpositionpaths: DataOption[] = []; data.positionPaths.map((r: any) => { optionpositionpaths.push({ @@ -1394,7 +1392,6 @@ const clickHistory = async (row: RequestItemsObject) => { let data = res.data.result; rowsHistory.value = []; data.map((e: RequestItemsObject, index: number) => { - console.log(index); if (index != 0) { rowsHistory.value.push({ id: e.id, diff --git a/src/modules/02_organizational/components/Tree/MappingPositions.vue b/src/modules/02_organizational/components/Tree/MappingPositions.vue index a0ce10254..f2d74ca60 100644 --- a/src/modules/02_organizational/components/Tree/MappingPositions.vue +++ b/src/modules/02_organizational/components/Tree/MappingPositions.vue @@ -385,7 +385,7 @@ const ddNoResultMsg = defineAsyncComponent( ); //แสดงข้อความเมื่อ Dropdown Filter ไม่เจอข้อมูล const mixin = useCounterMixin(); -const { showLoader, hideLoader } = mixin; +const { showLoader, hideLoader, messageError } = mixin; const $q = useQuasar(); // show dialog const emit = defineEmits(["update:positions", "update:formprops"]); const props = defineProps({ @@ -405,8 +405,6 @@ watch(myForm, (form: QForm | null, prevForm: QForm | null) => { if (!props.isAddNew) { positions.value.push(JSON.parse(JSON.stringify(positionSet.value))); if (!props.editObj != null && !props.editObj != undefined) { - // console.log("position.value", position.value); - // console.log("props.editObj", props.editObj); positions.value[0].positionMasterId = props.editObj?.positionMasterId; positions.value[0].positionUserNote = props.editObj?.positionUserNote; positions.value[0].isActive = props.editObj?.isActive; @@ -442,7 +440,6 @@ const fetchPositionMaster = async () => { // .get(config.API.getPostionMasterDraft(false)) .get(config.API.getPostionMaster(false)) .then((res) => { - // console.log("psMaster:", res.data.result); res.data.result.map((e: any) => { positionFilter.value.push({ id: e.id, @@ -475,7 +472,7 @@ const fetchPositionMaster = async () => { }); }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -503,7 +500,6 @@ const filterFn = (val: string, update: any) => { (v: any) => v.positionPath != null && v.positionPath.indexOf(val) > -1 ); }); - // console.log(positions.value); }; /**Add new positionSet item into positions @@ -511,7 +507,6 @@ const filterFn = (val: string, update: any) => { *ข้อมูลไม่ครบแสดง Alert เตือนให้รู้เฉยๆ แล้วไม่ให้เพิ่ม */ const addPositionItem = () => { - // console.log(positions.value); myForm.value!.validate().then((result) => { if (result) { positions.value.push(JSON.parse(JSON.stringify(positionSet.value))); @@ -539,15 +534,15 @@ const deletePositionItem = (val: object) => { persistent: true, }) .onOk(() => { - // console.log(">>>> OK"); + positions.value = positions.value.filter((x: object) => x !== val); //คำสั่งลบ - // console.log(positions.value); + }) .onCancel(() => { - // console.log(">>>> Cancel"); + }) .onDismiss(() => { - // console.log("I am triggered on both OK and Cancel"); + }); } else { positions.value = positions.value.filter((x: object) => x !== val); @@ -560,11 +555,9 @@ const deletePositionItem = (val: object) => { * @param items Array of position */ const isEmptyPosition = (items: any[]) => { - console.log("items", items); const isEmpty = items.map((f: any) => !f.positionMasterId); // ถ้าว่างเป็น true // ถ้ามี data false - console.log("isEmpty", isEmpty[0]); return isEmpty[0]; }; diff --git a/src/modules/02_organizational/components/Tree/OrganizationDialog.vue b/src/modules/02_organizational/components/Tree/OrganizationDialog.vue index d85251de2..903076867 100644 --- a/src/modules/02_organizational/components/Tree/OrganizationDialog.vue +++ b/src/modules/02_organizational/components/Tree/OrganizationDialog.vue @@ -345,7 +345,7 @@ const props = defineProps({ const emit = defineEmits(["update:organizprops", "update:formprops"]); const mixin = useCounterMixin(); -const { showLoader, hideLoader } = mixin; +const { showLoader, hideLoader, messageError } = mixin; const $q = useQuasar(); // show dialog const myForm = ref(null); @@ -415,7 +415,7 @@ const fetchOrganizationOri = async () => { organizationOriFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -430,7 +430,6 @@ const fetchOrganizationAgencyCode = async () => { .get(config.API.organizationCode) .then((res) => { const data = res.data.result; - // console.log(data); let option: GovermentOption[] = []; data.map((r: any) => { option.push({ @@ -444,7 +443,7 @@ const fetchOrganizationAgencyCode = async () => { organizationAgencyCodeFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -459,7 +458,6 @@ const fetchOrganizationGovernmentCode = async () => { .get(config.API.organizationShortName) .then((res) => { const data = res.data.result; - // console.log(data); let option: GovermentOption[] = []; data.map((r: any) => { option.push({ @@ -473,7 +471,7 @@ const fetchOrganizationGovernmentCode = async () => { organizationGovernmentCodeFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -488,7 +486,6 @@ const fetchOrganizationGovernmentCode = async () => { // .get(config.API.organizationShortName) // .then((res) => { // const data = res.data.result; -// // console.log(data); // let option: GovermentOption[] = []; // data.map((r: any) => { // option.push({ @@ -502,7 +499,6 @@ const fetchOrganizationGovernmentCode = async () => { // organizationShortNameFilter.value = option; // }) // .catch((e) => { -// console.log(e); // }) // .finally(() => { // hideLoader(); @@ -528,7 +524,7 @@ const fetchOrganizationAgency = async () => { organizationAgencyFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -554,7 +550,7 @@ const fetchOrganizationGovernmentAgency = async () => { organizationGovernmentAgencyFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -577,7 +573,7 @@ const fetchOrganizationType = async () => { organizationTypeFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -600,7 +596,7 @@ const fetchOrganizationLevel = async () => { organizationLevelFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -623,7 +619,7 @@ const fetchOrganizationTelInternal = async () => { organizationTelInternalFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -646,7 +642,7 @@ const fetchOrganizationTelExternal = async () => { organizationTelExternalFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -669,7 +665,7 @@ const fetchOrganizationFax = async () => { organizationFaxFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -692,18 +688,12 @@ const deleteOrgItem = (val: OrganizaOption) => { persistent: true, }) .onOk(() => { - // console.log(">>>> OK"); organizations.value = organizations.value.filter( (x: object) => x !== val ); //คำสั่งลบ - // console.log(positions.value); }) - .onCancel(() => { - // console.log(">>>> Cancel"); - }) - .onDismiss(() => { - // console.log("I am triggered on both OK and Cancel"); - }); + .onCancel(() => {}) + .onDismiss(() => {}); } else { organizations.value = organizations.value.filter((x: object) => x !== val); } @@ -738,7 +728,6 @@ const isEmptyOrganization = (items: OrganizaOption[]) => { */ const addOrganizationItem = async () => { await myForm.value!.validate().then(async (result: boolean) => { - // console.log(result); if (result) { // organizations.value.push(JSON.parse(JSON.stringify(organizationSet))); organizations.value.push({ @@ -767,7 +756,6 @@ const addOrganizationItem = async () => { isActive: true, }); emit("update:organizprops", organizations.value); - // console.log(organizations); } }); }; @@ -791,7 +779,7 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => { // organizationAgencyCodeFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -818,7 +806,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { item.organizationGovernmentCodeOptionFilter = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); diff --git a/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue b/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue index caa3e01b7..eaf9e81f5 100644 --- a/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue +++ b/src/modules/02_organizational/components/Tree/OrganizationDialogAddEdit.vue @@ -316,7 +316,7 @@ import type { EnumStringMember } from "@babel/types"; import { useCounterMixin } from "@/stores/mixin"; const mixin = useCounterMixin(); -const { showLoader, hideLoader } = mixin; +const { showLoader, hideLoader, messageError } = mixin; const props = defineProps({ organizprops: Object as PropType, @@ -411,9 +411,7 @@ onMounted(async () => { await fetchOrganizationTelExternal(); await fetchOrganizationTelInternal(); await fetchOrganizationStatus(); - // console.log("Edit:organization.value", organization.value); - console.log("props.orgId", props.org); - console.log("props.orgId.organizationId", props.org.organizationId); + await fillOrgEdit(); // ต้องอยู่ตรงนี้ ไม่งั้น input shortName & shortCode ไม่มา }); @@ -434,7 +432,7 @@ const fillOrgEdit = async () => { .get(config.API.getOrgDraft(props.org.organizationId)) .then((res) => { //ใส่ข้อมูลลงใน objOrg ที่ได้จาก OrganizationDialogAddEdit.vue - console.log("ข้อมูลเดิม", res.data.result); + organization.value.organizationOrganizationId = res.data.result.organizationOrganizationId; organization.value.organizationShortNameId = @@ -498,12 +496,11 @@ const fillOrgEdit = async () => { emit("update:organizprops", organization.value); }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(async () => { hideLoader(); }); - console.log("success"); }; /** @@ -523,7 +520,7 @@ const fetchOrganizationOri = async () => { organizationOriFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -538,7 +535,7 @@ const fetchOrganizationAgencyCode = async () => { .get(config.API.organizationCode) .then((res) => { const data = res.data.result; - // console.log(data); + let option: GovermentOption[] = []; data.map((r: any) => { option.push({ @@ -552,7 +549,7 @@ const fetchOrganizationAgencyCode = async () => { organizationAgencyCodeFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -567,7 +564,6 @@ const fetchOrganizationGovernmentCode = async () => { .get(config.API.organizationShortName) .then((res) => { const data = res.data.result; - // console.log(data); let option: GovermentOption[] = []; data.map((r: any) => { option.push({ @@ -584,7 +580,7 @@ const fetchOrganizationGovernmentCode = async () => { emit("update:organizprops", organization.value); }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -599,7 +595,6 @@ const fetchOrganizationGovernmentCode = async () => { // .get(config.API.organizationShortName) // .then((res) => { // const data = res.data.result; -// // console.log(data); // let option: GovermentOption[] = []; // data.map((r: any) => { // option.push({ @@ -613,7 +608,7 @@ const fetchOrganizationGovernmentCode = async () => { // organizationShortNameFilter.value = option; // }) // .catch((e) => { -// console.log(e); +// messageError($q,e) // }) // .finally(() => { // hideLoader(); @@ -640,7 +635,7 @@ const fetchOrganizationAgency = async () => { organizationAgencyFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -657,7 +652,7 @@ const fetchOrganizationGovernmentAgency = async () => { .then((res) => { const data = res.data.result; let option: DataOption[] = []; - // console.log(data); + data.map((r: any) => { option.push({ id: r.organizationId.toString(), @@ -668,7 +663,7 @@ const fetchOrganizationGovernmentAgency = async () => { organizationGovernmentAgencyFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -691,7 +686,7 @@ const fetchOrganizationType = async () => { organizationTypeFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -715,7 +710,7 @@ const fetchOrganizationStatus = async () => { organizationStatusFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -739,7 +734,7 @@ const fetchOrganizationLevel = async () => { organizationLevelFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -762,7 +757,7 @@ const fetchOrganizationTelInternal = async () => { organizationTelInternalFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -785,7 +780,7 @@ const fetchOrganizationTelExternal = async () => { organizationTelExternalFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -808,7 +803,7 @@ const fetchOrganizationFax = async () => { organizationFaxFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -834,7 +829,7 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => { // organizationAgencyCodeFilter.value = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); @@ -861,7 +856,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => { item.organizationGovernmentCodeOptionFilter = option; }) .catch((e) => { - console.log(e); + messageError($q, e); }) .finally(() => { hideLoader(); diff --git a/src/modules/02_organizational/views/MainOrgChart.vue b/src/modules/02_organizational/views/MainOrgChart.vue index ffdd432d9..58e4af730 100644 --- a/src/modules/02_organizational/views/MainOrgChart.vue +++ b/src/modules/02_organizational/views/MainOrgChart.vue @@ -1,5 +1,6 @@ diff --git a/src/modules/02_organizational/views/MainStructChart.vue b/src/modules/02_organizational/views/MainStructChart.vue index faff8192b..60b1964fc 100644 --- a/src/modules/02_organizational/views/MainStructChart.vue +++ b/src/modules/02_organizational/views/MainStructChart.vue @@ -1,6 +1,7 @@