From 7d75535d152f509f880d77b694e0594b9b91c4b1 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Thu, 7 Nov 2024 14:51:21 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=A5=E0=B8=B9?= =?UTF-8?q?=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/org/api.org.ts | 2 + .../01_Information/01_Information.vue | 8 +- .../01_Information/02_ChangeName.vue | 159 +++++------ .../10_registry/01_Information/03_Address.vue | 8 +- .../10_registry/01_Information/04_Family.vue | 10 +- .../01_Information/05_Educations.vue | 160 +++++------ .../10_registry/01_Information/06_Ability.vue | 161 ++++++----- .../02_Government/01_Government.vue | 6 +- .../02_Government/02_Discipline.vue | 8 +- .../10_registry/02_Government/03_Leave.vue | 8 +- .../10_registry/02_Government/04_Duty.vue | 8 +- .../10_registry/03_Salary/01_Salary.vue | 8 +- .../10_registry/03_Salary/02_Nopaid.vue | 162 ++++++------ .../04_Achievement/01_Certificate.vue | 162 ++++++------ .../04_Achievement/02_Training.vue | 145 +++++----- .../04_Achievement/03_Insignia.vue | 190 ++++++------- .../10_registry/04_Achievement/04_Honor.vue | 154 +++++------ .../04_Achievement/05_Assessments.vue | 163 ++++++------ .../04_Achievement/06_DevelopmentPlan.vue | 250 +++++++++--------- src/modules/10_registry/05_Other/01_Other.vue | 13 +- .../components/DialogAddRequestEdit.vue | 6 +- .../10_registry/views/requestEditDetail.vue | 4 +- .../10_registry/views/requestEditMain.vue | 6 +- src/stores/data.ts | 26 +- src/views/MainLayout.vue | 7 +- 25 files changed, 942 insertions(+), 892 deletions(-) diff --git a/src/api/org/api.org.ts b/src/api/org/api.org.ts index a3d62c7..e3f8c51 100644 --- a/src/api/org/api.org.ts +++ b/src/api/org/api.org.ts @@ -119,7 +119,9 @@ export default { developmentUserByType: (type: string) => `${org}/profile${type}/development/user`, upDateNumber: `${profileOrg}/updatePhoneNumber/user`, + upDateNumberByType: (type: string) => `${org}/profile${type}/updatePhoneNumber/user`, updateEmail: `${profileOrg}/updateEmail/user`, + updateEmailByType: (type: string) => `${org}/profile${type}/updateEmail/user`, /** * workflow */ diff --git a/src/modules/10_registry/01_Information/01_Information.vue b/src/modules/10_registry/01_Information/01_Information.vue index addbc32..76b3bad 100644 --- a/src/modules/10_registry/01_Information/01_Information.vue +++ b/src/modules/10_registry/01_Information/01_Information.vue @@ -10,6 +10,7 @@ import config from "@/app.config"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; +const link = ref(""); const $q = useQuasar(); const store = useRegistryInFormationStore(); const dataStore = useDataStore(); @@ -243,7 +244,7 @@ function onHistory() { async function getData() { showLoader(); await http - .get(config.API.dataUserInformationByType(dataStore.officerLink)) + .get(config.API.dataUserInformationByType(link.value)) .then(async (res) => { const data = await res.data.result; formDataInformation.citizenId = data.citizenId; @@ -318,7 +319,7 @@ function onSubmitEdit(type: string) { /** บันทึกเบอร์โทร */ async function onSavePhone() { await http - .put(config.API.upDateNumber, { + .put(config.API.upDateNumberByType(link.value), { phone: formDataInformation.phone, }) .then(async (res) => { @@ -335,7 +336,7 @@ async function onSavePhone() { /** บันทึก email */ async function onSaveEmail() { await http - .put(config.API.updateEmail, { + .put(config.API.updateEmailByType(link.value), { email: formDataInformation.email + `@bangkok.go.th`, }) .then(async (res) => { @@ -350,6 +351,7 @@ async function onSaveEmail() { } onMounted(async () => { + link.value = await dataStore.getProFileType(); await getData(); }); diff --git a/src/modules/10_registry/01_Information/02_ChangeName.vue b/src/modules/10_registry/01_Information/02_ChangeName.vue index 86c06bb..0cd835c 100644 --- a/src/modules/10_registry/01_Information/02_ChangeName.vue +++ b/src/modules/10_registry/01_Information/02_ChangeName.vue @@ -10,6 +10,7 @@ import config from "@/app.config"; import type { ChangNameRows } from "@/modules/10_registry/interface/response/01_Information"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; +const link = ref(""); const $q = useQuasar(); const mixin = useCounterMixin(); const dataStore = useDataStore(); @@ -161,10 +162,10 @@ function onHistory(id: string) { } /** get data */ -function getData() { +async function getData() { showLoader(); http - .get(config.API.dataUserChangeNameByType(dataStore.officerLink)) + .get(config.API.dataUserChangeNameByType(link.value)) .then((res) => { const data = res.data.result; rows.value = data; @@ -183,7 +184,10 @@ function getData() { function getHistory() { showLoader(); http - .get(config.API.dataUserChangeNameHistoryByType(dataStore.officerLink) + `/${idByrow.value}`) + .get( + config.API.dataUserChangeNameHistoryByType(link.value) + + `/${idByrow.value}` + ) .then((res) => { const data = res.data.result; rowsHistory.value = data; @@ -196,8 +200,9 @@ function getHistory() { }); } -onMounted(() => { - getData(); +onMounted(async () => { + link.value = await dataStore.getProFileType(); + await getData(); });