แก้ลูกจ้าง

This commit is contained in:
setthawutttty 2024-11-07 14:51:21 +07:00
parent aa65b8165d
commit 7d75535d15
25 changed files with 942 additions and 892 deletions

View file

@ -119,7 +119,9 @@ export default {
developmentUserByType: (type: string) => `${org}/profile${type}/development/user`, developmentUserByType: (type: string) => `${org}/profile${type}/development/user`,
upDateNumber: `${profileOrg}/updatePhoneNumber/user`, upDateNumber: `${profileOrg}/updatePhoneNumber/user`,
upDateNumberByType: (type: string) => `${org}/profile${type}/updatePhoneNumber/user`,
updateEmail: `${profileOrg}/updateEmail/user`, updateEmail: `${profileOrg}/updateEmail/user`,
updateEmailByType: (type: string) => `${org}/profile${type}/updateEmail/user`,
/** /**
* workflow * workflow
*/ */

View file

@ -10,6 +10,7 @@ import config from "@/app.config";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const store = useRegistryInFormationStore(); const store = useRegistryInFormationStore();
const dataStore = useDataStore(); const dataStore = useDataStore();
@ -243,7 +244,7 @@ function onHistory() {
async function getData() { async function getData() {
showLoader(); showLoader();
await http await http
.get(config.API.dataUserInformationByType(dataStore.officerLink)) .get(config.API.dataUserInformationByType(link.value))
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
formDataInformation.citizenId = data.citizenId; formDataInformation.citizenId = data.citizenId;
@ -318,7 +319,7 @@ function onSubmitEdit(type: string) {
/** บันทึกเบอร์โทร */ /** บันทึกเบอร์โทร */
async function onSavePhone() { async function onSavePhone() {
await http await http
.put(config.API.upDateNumber, { .put(config.API.upDateNumberByType(link.value), {
phone: formDataInformation.phone, phone: formDataInformation.phone,
}) })
.then(async (res) => { .then(async (res) => {
@ -335,7 +336,7 @@ async function onSavePhone() {
/** บันทึก email */ /** บันทึก email */
async function onSaveEmail() { async function onSaveEmail() {
await http await http
.put(config.API.updateEmail, { .put(config.API.updateEmailByType(link.value), {
email: formDataInformation.email + `@bangkok.go.th`, email: formDataInformation.email + `@bangkok.go.th`,
}) })
.then(async (res) => { .then(async (res) => {
@ -350,6 +351,7 @@ async function onSaveEmail() {
} }
onMounted(async () => { onMounted(async () => {
link.value = await dataStore.getProFileType();
await getData(); await getData();
}); });
</script> </script>

View file

@ -10,6 +10,7 @@ import config from "@/app.config";
import type { ChangNameRows } from "@/modules/10_registry/interface/response/01_Information"; import type { ChangNameRows } from "@/modules/10_registry/interface/response/01_Information";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const dataStore = useDataStore(); const dataStore = useDataStore();
@ -161,10 +162,10 @@ function onHistory(id: string) {
} }
/** get data */ /** get data */
function getData() { async function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserChangeNameByType(dataStore.officerLink)) .get(config.API.dataUserChangeNameByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -183,7 +184,10 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserChangeNameHistoryByType(dataStore.officerLink) + `/${idByrow.value}`) .get(
config.API.dataUserChangeNameHistoryByType(link.value) +
`/${idByrow.value}`
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -196,8 +200,9 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
getData(); link.value = await dataStore.getProFileType();
await getData();
}); });
</script> </script>
<template> <template>
@ -240,7 +245,6 @@ onMounted(() => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -254,7 +258,7 @@ onMounted(() => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"
@ -297,7 +301,6 @@ onMounted(() => {
</q-tr> </q-tr>
</template> </template>
<template v-else v-slot:item="props"> <template v-else v-slot:item="props">
<div class="q-mb-xs col-xs-12 col-sm-6 col-md-4 col-lg-3"> <div class="q-mb-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
<q-card bordered flat> <q-card bordered flat>
<q-list dense class="q-mt-lg relative-position"> <q-list dense class="q-mt-lg relative-position">

View file

@ -18,6 +18,7 @@ import type {
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const store = useRegistryInFormationStore(); const store = useRegistryInFormationStore();
const dataStore = useDataStore(); const dataStore = useDataStore();
const rowsHistory = ref<any[]>([]); const rowsHistory = ref<any[]>([]);
@ -226,10 +227,10 @@ function onHistory() {
} }
/** get data */ /** get data */
function getData() { async function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserAddressByType(dataStore.officerLink)) .get(config.API.dataUserAddressByType(link.value))
.then((res) => { .then((res) => {
const data: Address = res.data.result; const data: Address = res.data.result;
fetchDistrict(data.registrationProvinceId, "1"); fetchDistrict(data.registrationProvinceId, "1");
@ -371,6 +372,7 @@ function convertSubDistrictName(id: string, type: string) {
} }
onMounted(async () => { onMounted(async () => {
link.value = await dataStore.getProFileType();
await fetchProvince(); await fetchProvince();
await getData(); await getData();
}); });

View file

@ -12,6 +12,7 @@ import type { FormChildren } from "@/modules/10_registry/interface/index/Family"
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin; const { showLoader, hideLoader, messageError } = mixin;
@ -146,10 +147,10 @@ function onHistory(type: string, id: string) {
} }
/** get data */ /** get data */
function getData(type: string) { async function getData(type: string) {
showLoader(); showLoader();
http http
.get(config.API.dataUserFamilyByType(dataStore.officerLink,type)) .get(config.API.dataUserFamilyByType(link.value, type))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
if (data) { if (data) {
@ -233,7 +234,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
link.value = await dataStore.getProFileType();
getData("father"); getData("father");
getData("mother"); getData("mother");
getData("couple"); getData("couple");

View file

@ -12,6 +12,7 @@ import type { EducationProfile } from "@/modules/10_registry/interface/index/Mai
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const dataStore = useDataStore(); const dataStore = useDataStore();
@ -440,10 +441,10 @@ function onHistory(id: string) {
} }
/** get data */ /** get data */
function getData() { async function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserEducationsByType(dataStore.officerLink)) .get(config.API.dataUserEducationsByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -462,7 +463,7 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserEducationsHistoryByType(dataStore.officerLink,idByRow.value)) .get(config.API.dataUserEducationsHistoryByType(link.value, idByRow.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -475,8 +476,10 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
getData(); link.value = await dataStore.getProFileType();
await getData();
}); });
</script> </script>
<template> <template>
@ -519,7 +522,6 @@ onMounted(() => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -533,7 +535,7 @@ onMounted(() => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"
@ -611,8 +613,6 @@ onMounted(() => {
</div> </div>
</template> </template>
</d-table> </d-table>
</div> </div>
<DialogHistory <DialogHistory
v-model:modal="modalHistory" v-model:modal="modalHistory"

View file

@ -11,6 +11,7 @@ import type { AbilityRows } from "@/modules/10_registry/interface/index/Main";
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const rows = ref<AbilityRows[]>([]); const rows = ref<AbilityRows[]>([]);
const rowsHistory = ref<AbilityRows[]>([]); const rowsHistory = ref<AbilityRows[]>([]);
const idByRow = ref<string>(""); const idByRow = ref<string>("");
@ -162,10 +163,10 @@ function onHistory(id: string) {
} }
/** get data */ /** get data */
function getData() { async function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserAbilityByType(dataStore.officerLink)) .get(config.API.dataUserAbilityByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -184,7 +185,7 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserAbilityHistoryByType(dataStore.officerLink,idByRow.value)) .get(config.API.dataUserAbilityHistoryByType(link.value, idByRow.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -197,8 +198,9 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
getData(); link.value = await dataStore.getProFileType();
await getData();
}); });
</script> </script>
<template> <template>
@ -241,7 +243,6 @@ onMounted(() => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -255,7 +256,7 @@ onMounted(() => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"
@ -334,8 +335,6 @@ onMounted(() => {
</div> </div>
</template> </template>
</d-table> </d-table>
</div> </div>
<DialogHistory <DialogHistory
v-model:modal="modalHistory" v-model:modal="modalHistory"

View file

@ -16,6 +16,7 @@ import type {
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const dataPerson = useDataStore() const dataPerson = useDataStore()
@ -285,7 +286,7 @@ function onHistory() {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserGovernmentByType(dataPerson.officerLink)) .get(config.API.dataUserGovernmentByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
formData.org = data.org; formData.org = data.org;
@ -336,7 +337,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async() => {
link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
</script> </script>

View file

@ -11,6 +11,7 @@ import type { DisciplineDetail } from "@/modules/10_registry/interface/index/Mai
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const dataStore = useDataStore() const dataStore = useDataStore()
@ -140,7 +141,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserDisciplineByType(dataStore.officerLink)) .get(config.API.dataUserDisciplineByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -157,7 +158,7 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserDisciplineHistoryByType(dataStore.officerLink,idByRow.value)) .get(config.API.dataUserDisciplineHistoryByType(link.value,idByRow.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -170,7 +171,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async() => {
link.value = await dataStore.getProFileType();
getData(); getData();
}); });
</script> </script>

View file

@ -10,6 +10,7 @@ import { useDataStore } from "@/stores/data";
import type { LeaveFormType } from "@/modules/10_registry/interface/index/Main"; import type { LeaveFormType } from "@/modules/10_registry/interface/index/Main";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const dataStore = useDataStore() const dataStore = useDataStore()
@ -216,7 +217,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserLeaveByType(dataStore.officerLink)) .get(config.API.dataUserLeaveByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data.map((item: any) => ({ rows.value = data.map((item: any) => ({
@ -243,7 +244,7 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserLeaveHistoryByType(dataStore.officerLink,idByRow.value)) .get(config.API.dataUserLeaveHistoryByType(link.value,idByRow.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data.map((item: any) => ({ rowsHistory.value = data.map((item: any) => ({
@ -292,7 +293,8 @@ function dateThaiRange(val: [Date, Date]) {
} }
} }
onMounted(() => { onMounted(async() => {
link.value = await dataStore.getProFileType();
getData(); getData();
}); });
</script> </script>

View file

@ -11,6 +11,7 @@ import type { DutyFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const dataStore = useDataStore() const dataStore = useDataStore()
const idByRow = ref<string>(""); const idByRow = ref<string>("");
const rows = ref<DutyFormType[]>([]); const rows = ref<DutyFormType[]>([]);
@ -218,7 +219,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserDutyByType(dataStore.officerLink)) .get(config.API.dataUserDutyByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -235,7 +236,7 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserDutyHistoryByType(dataStore.officerLink,idByRow.value)) .get(config.API.dataUserDutyHistoryByType(link.value,idByRow.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -248,7 +249,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async() => {
link.value = await dataStore.getProFileType();
getData(); getData();
}); });
</script> </script>

View file

@ -12,6 +12,7 @@ import type { SalaryFormType } from "@/modules/10_registry/interface/index/Main"
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const dataPerson = useDataStore(); const dataPerson = useDataStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
@ -358,7 +359,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserSalaryByType(dataPerson.officerLink)) .get(config.API.dataUserSalaryByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -375,7 +376,7 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserSalaryHistoryByType(dataPerson.officerLink,idByRow.value)) .get(config.API.dataUserSalaryHistoryByType(link.value, idByRow.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -388,7 +389,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
</script> </script>

View file

@ -5,13 +5,14 @@ import { ref, onMounted } from "vue";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useDataStore } from "@/stores/data" import { useDataStore } from "@/stores/data";
import type { NopaidFormType } from "@/modules/10_registry/interface/index/Main"; import type { NopaidFormType } from "@/modules/10_registry/interface/index/Main";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const dataPerson = useDataStore() const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>(""); const idByRow = ref<string>("");
const rows = ref<NopaidFormType[]>([]); const rows = ref<NopaidFormType[]>([]);
const filter = ref<string>(""); const filter = ref<string>("");
@ -195,7 +196,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserNopaidByType(dataPerson.officerLink)) .get(config.API.dataUserNopaidByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -212,7 +213,9 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserSalaryNopaidHistoryByType(dataPerson.officerLink,idByRow.value)) .get(
config.API.dataUserSalaryNopaidHistoryByType(link.value, idByRow.value)
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -225,7 +228,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
</script> </script>
@ -269,7 +273,6 @@ onMounted(() => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -283,7 +286,7 @@ onMounted(() => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"
@ -323,9 +326,7 @@ onMounted(() => {
icon="mdi-history" icon="mdi-history"
@click="onHistory(props.row.id)" @click="onHistory(props.row.id)"
> >
<q-tooltip <q-tooltip>ประวแกไขบนทกวนทไมไดบเงนเดอนฯ</q-tooltip>
>ประวแกไขบนทกวนทไมไดบเงนเดอนฯ</q-tooltip
>
</q-btn> </q-btn>
</q-td> </q-td>
</q-tr> </q-tr>
@ -365,7 +366,6 @@ onMounted(() => {
</div> </div>
</template> </template>
</d-table> </d-table>
</div> </div>
<DialogHistory <DialogHistory
v-model:modal="modalHistory" v-model:modal="modalHistory"

View file

@ -7,14 +7,14 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useDataStore } from "@/stores/data"; import { useDataStore } from "@/stores/data";
import type { CertificateDetail } from "@/modules/10_registry/interface/index/Main"; import type { CertificateDetail } from "@/modules/10_registry/interface/index/Main";
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const dataPerson = useDataStore() const dataPerson = useDataStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai } = mixin;
@ -196,7 +196,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateByType(dataPerson.officerLink,"certificate")) .get(config.API.dataUserCertificateByType(link.value, "certificate"))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -213,7 +213,13 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateHistoryByType(dataPerson.officerLink,"certificate", idByRow.value)) .get(
config.API.dataUserCertificateHistoryByType(
link.value,
"certificate",
idByRow.value
)
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -226,7 +232,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
</script> </script>
@ -270,7 +277,6 @@ onMounted(() => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -284,7 +290,7 @@ onMounted(() => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"

View file

@ -12,7 +12,8 @@ import type { TrainingFormType } from "@/modules/10_registry/interface/index/Mai
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const dataPerson = useDataStore() const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>(""); const idByRow = ref<string>("");
const rows = ref<TrainingFormType[]>([]); const rows = ref<TrainingFormType[]>([]);
const filter = ref<string>(""); const filter = ref<string>("");
@ -322,7 +323,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateByType(dataPerson.officerLink,"training")) .get(config.API.dataUserCertificateByType(link.value, "training"))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -339,7 +340,13 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateHistoryByType(dataPerson.officerLink,"training", idByRow.value)) .get(
config.API.dataUserCertificateHistoryByType(
link.value,
"training",
idByRow.value
)
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -352,7 +359,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
</script> </script>
@ -396,7 +404,6 @@ onMounted(() => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -410,7 +417,7 @@ onMounted(() => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"

View file

@ -7,13 +7,13 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data"; import { useDataStore } from "@/stores/data";
import type { InsigniaFormType } from "@/modules/10_registry/interface/index/Main"; import type { InsigniaFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const dataPerson = useDataStore() const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>(""); const idByRow = ref<string>("");
const rows = ref<InsigniaFormType[]>([]); const rows = ref<InsigniaFormType[]>([]);
const filter = ref<string>(""); const filter = ref<string>("");
@ -400,7 +400,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateByType(dataPerson.officerLink,"insignia")) .get(config.API.dataUserCertificateByType(link.value, "insignia"))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -417,7 +417,13 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateHistoryByType(dataPerson.officerLink,"insignia", idByRow.value)) .get(
config.API.dataUserCertificateHistoryByType(
link.value,
"insignia",
idByRow.value
)
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -431,7 +437,8 @@ function getHistory() {
} }
onMounted(async () => { onMounted(async () => {
await getData(); link.value = await dataPerson.getProFileType();
getData();
}); });
</script> </script>
<template> <template>
@ -474,7 +481,6 @@ onMounted(async () => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -488,7 +494,7 @@ onMounted(async () => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"
@ -560,9 +566,7 @@ onMounted(async () => {
<q-item-section v-if="col.name == 'insignia'" class="fix_top"> <q-item-section v-if="col.name == 'insignia'" class="fix_top">
<q-item-label class="text-dark text-weight-medium" <q-item-label class="text-dark text-weight-medium"
>{{ >{{
props.row.insignia props.row.insignia ? `${props.row.insignia.name} ` : "-"
? `${props.row.insignia.name} `
: "-"
}}{{ }}{{
props.row.insignia.shortName props.row.insignia.shortName
? `(${props.row.insignia.shortName})` ? `(${props.row.insignia.shortName})`

View file

@ -13,7 +13,8 @@ import type { HonorFormData } from "@/modules/10_registry/interface/index/Main";
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const dataPerson = useDataStore() const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>(""); const idByRow = ref<string>("");
const store = useRegistryInFormationStore(); const store = useRegistryInFormationStore();
const rows = ref<HonorFormData[]>([]); const rows = ref<HonorFormData[]>([]);
@ -196,7 +197,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateByType(dataPerson.officerLink,"honor")) .get(config.API.dataUserCertificateByType(link.value, "honor"))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -230,7 +231,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
</script> </script>
@ -274,7 +276,6 @@ onMounted(() => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -288,7 +289,7 @@ onMounted(() => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"
@ -366,7 +367,6 @@ onMounted(() => {
</div> </div>
</template> </template>
</d-table> </d-table>
</div> </div>
<DialogHistory <DialogHistory
v-model:modal="modalHistory" v-model:modal="modalHistory"

View file

@ -12,7 +12,8 @@ import type { AssessmentsFormType } from "@/modules/10_registry/interface/index/
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const dataPerson = useDataStore() const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>(""); const idByRow = ref<string>("");
const rows = ref<AssessmentsFormType[]>([]); const rows = ref<AssessmentsFormType[]>([]);
const filter = ref<string>(""); const filter = ref<string>("");
@ -257,7 +258,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateByType(dataPerson.officerLink,"assessments")) .get(config.API.dataUserCertificateByType(link.value, "assessments"))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -274,7 +275,13 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateHistoryByType(dataPerson.officerLink,"assessments", idByRow.value)) .get(
config.API.dataUserCertificateHistoryByType(
link.value,
"assessments",
idByRow.value
)
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -307,7 +314,8 @@ function textPoint(val: number | undefined) {
else return "-"; else return "-";
} }
onMounted(() => { onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
</script> </script>
@ -351,7 +359,6 @@ onMounted(() => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -365,7 +372,7 @@ onMounted(() => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"
@ -424,9 +431,7 @@ onMounted(() => {
class="absolute_button" class="absolute_button"
@click="onHistory(props.row.id)" @click="onHistory(props.row.id)"
> >
<q-tooltip <q-tooltip>ประวแกไขผลการประเมนการปฏราชการ</q-tooltip>
>ประวแกไขผลการประเมนการปฏราชการ</q-tooltip
>
</q-btn> </q-btn>
<q-item v-for="col in props.cols" :key="col.name"> <q-item v-for="col in props.cols" :key="col.name">
<q-item-section class="fix_top"> <q-item-section class="fix_top">

View file

@ -12,7 +12,8 @@ import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import DialogDevelop from "@/modules/10_registry/Dialog/DialogDevelopmant.vue"; import DialogDevelop from "@/modules/10_registry/Dialog/DialogDevelopmant.vue";
const dataPerson = useDataStore() const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>(""); const idByRow = ref<string>("");
const rows = ref<any[]>([]); const rows = ref<any[]>([]);
const filter = ref<string>(""); const filter = ref<string>("");
@ -118,7 +119,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.developmentUserByType(dataPerson.officerLink)) .get(config.API.developmentUserByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -135,7 +136,13 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.dataUserCertificateHistoryByType(dataPerson.officerLink,"assessments", idByRow.value)) .get(
config.API.dataUserCertificateHistoryByType(
link.value,
"assessments",
idByRow.value
)
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -157,7 +164,8 @@ function openDialogDevelop(data: any) {
kpiDevelopmentId.value = data.kpiDevelopmentId; kpiDevelopmentId.value = data.kpiDevelopmentId;
} }
onMounted(() => { onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
</script> </script>
@ -201,7 +209,6 @@ onMounted(() => {
outlined outlined
emit-value emit-value
map-options map-options
options-dense options-dense
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
@ -215,7 +222,7 @@ onMounted(() => {
dense dense
bordered bordered
virtual-scroll virtual-scroll
:rows="rows.length !== 0 ? rows:[]" :rows="rows.length !== 0 ? rows : []"
:columns="columns" :columns="columns"
:grid="!mode" :grid="!mode"
:filter="filter" :filter="filter"
@ -339,7 +346,6 @@ onMounted(() => {
</div> </div>
</template> </template>
</d-table> </d-table>
</div> </div>
<DialogDevelop v-model:modal="modalDevelop" v-model:id="kpiDevelopmentId" /> <DialogDevelop v-model:modal="modalDevelop" v-model:id="kpiDevelopmentId" />

View file

@ -12,6 +12,7 @@ import type { OtherFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog //history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const dataPerson = useDataStore(); const dataPerson = useDataStore();
@ -113,7 +114,7 @@ function onHistory(id: string) {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.dataUserOtherByType(dataPerson.officerLink)) .get(config.API.dataUserOtherByType(link.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rows.value = data; rows.value = data;
@ -128,12 +129,7 @@ function getData() {
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get( .get(config.API.dataUserOtherHistoryByType(link.value, idByRow.value))
config.API.dataUserOtherHistoryByType(
dataPerson.officerLink,
idByRow.value
)
)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
rowsHistory.value = data; rowsHistory.value = data;
@ -146,7 +142,8 @@ function getHistory() {
}); });
} }
onMounted(() => { onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
</script> </script>

View file

@ -16,6 +16,7 @@ import { useCounterMixin } from "@/stores/mixin";
* use * use
*/ */
const $q = useQuasar(); const $q = useQuasar();
const link = ref<string>('')
const store = useRequestEditStore(); const store = useRequestEditStore();
const dataStore = useDataStore(); const dataStore = useDataStore();
const { dialogConfirm, showLoader, hideLoader, messageError, success } = const { dialogConfirm, showLoader, hideLoader, messageError, success } =
@ -55,7 +56,7 @@ function onSubmit() {
async () => { async () => {
showLoader(); showLoader();
await http await http
.post(config.API.requestsEditByType(dataStore.officerLink), { .post(config.API.requestsEditByType(link.value), {
topic: formData.topic, topic: formData.topic,
detail: formData.detail, detail: formData.detail,
[dataStore.officerType === "OFFICER" [dataStore.officerType === "OFFICER"
@ -191,8 +192,9 @@ function onInfo(val: string) {
watch( watch(
() => modal.value, () => modal.value,
() => { async () => {
modal.value && fetchProfile(); modal.value && fetchProfile();
link.value = await dataStore.getProFileType();
} }
); );
</script> </script>

View file

@ -14,6 +14,7 @@ import type { DataOption } from "@/modules/10_registry/interface/index/Main";
import Workflow from "@/components/Workflow/Main.vue"; import Workflow from "@/components/Workflow/Main.vue";
const $q = useQuasar(); const $q = useQuasar();
const link = ref<string>('')
const store = useRequestEditStore(); const store = useRequestEditStore();
const dataStore = useDataStore(); const dataStore = useDataStore();
const router = useRouter(); const router = useRouter();
@ -39,7 +40,7 @@ const statusOption = ref<DataOption[]>(statusOptionMain.value); //ตัวเ
async function fetchData() { async function fetchData() {
showLoader(); showLoader();
await http await http
.get(config.API.requestEditByType(dataStore.officerLink) + `${requestId.value}`) .get(config.API.requestEditByType(link.value) + `${requestId.value}`)
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
dataRequest.value = { dataRequest.value = {
@ -122,6 +123,7 @@ async function downloadUrl(id: string, fileName: string) {
} }
onMounted(async () => { onMounted(async () => {
link.value = await dataStore.getProFileType();
await fetchData(); await fetchData();
}); });
</script> </script>

View file

@ -33,6 +33,7 @@ import { useCounterMixin } from "@/stores/mixin";
*/ */
const $q = useQuasar(); const $q = useQuasar();
const store = useRequestEditStore(); const store = useRequestEditStore();
const link = ref<string>('')
const router = useRouter(); const router = useRouter();
const dataStore = useDataStore() const dataStore = useDataStore()
const { showLoader, hideLoader, messageError, dialogRemove, success } = const { showLoader, hideLoader, messageError, dialogRemove, success } =
@ -149,7 +150,7 @@ function fetchListRequset() {
}; };
showLoader(); showLoader();
http http
.get(config.API.requestEditByType(dataStore.officerLink) + `user`, { params: queryParams }) .get(config.API.requestEditByType(link.value) + `user`, { params: queryParams })
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
maxPage.value = Math.ceil(data.total / pageSize.value); maxPage.value = Math.ceil(data.total / pageSize.value);
@ -275,7 +276,8 @@ watch(
} }
); );
onMounted(() => { onMounted(async() => {
link.value = await dataStore.getProFileType();
fetchListRequset(); fetchListRequset();
}); });
</script> </script>

View file

@ -91,8 +91,7 @@ export const useDataStore = defineStore("data", () => {
async function getData(dataPerson: any) { async function getData(dataPerson: any) {
const data = await dataPerson; const data = await dataPerson;
isProbation.value = data.isProbation; isProbation.value = data.isProbation;
officerType.value = data.type;
officerLink.value = await convertEmType(data.type);
formData.prefix = data.prefix; formData.prefix = data.prefix;
formData.firstName = data.firstName; formData.firstName = data.firstName;
formData.lastName = data.lastName; formData.lastName = data.lastName;
@ -107,18 +106,19 @@ export const useDataStore = defineStore("data", () => {
} }
async function getProFileType() { async function getProFileType() {
http if (officerType.value == "") {
await http
.get(config.API.proFileType) .get(config.API.proFileType)
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = await res.data.result;
officerType.value = data.type; officerType.value = data;
officerLink.value = await convertEmType(data.type);
hideLoader();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}); });
} }
return convertEmType(officerType.value);
}
return { return {
count, count,

View file

@ -15,7 +15,6 @@ const route = useRoute();
const router = useRouter(); const router = useRouter();
const $q = useQuasar(); const $q = useQuasar();
const profileImg = ref<string>("");
const dataStore = useDataStore(); const dataStore = useDataStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
@ -52,10 +51,11 @@ async function checkUser() {
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
await dataStore.getData(data); await dataStore.getData(data);
await dataStore.getProFileType();
if (data.avatarName) { if (data.avatarName) {
await getImg(data.profileId, data.avatarName); await getImg(data.profileId, data.avatarName);
} else { } else {
profileImg.value = avatar;
dataStore.profileImg = avatar; dataStore.profileImg = avatar;
} }
}) })
@ -83,7 +83,6 @@ function getImg(id: string, pathName: string) {
http http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, pathName)) .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, pathName))
.then((res) => { .then((res) => {
profileImg.value = res.data.downloadUrl;
dataStore.profileImg = res.data.downloadUrl; dataStore.profileImg = res.data.downloadUrl;
}) })
.catch((e) => { .catch((e) => {
@ -471,7 +470,7 @@ function onInfo() {
<q-item dense v-close-popup class="q-pa-none q-pl-xs"> <q-item dense v-close-popup class="q-pa-none q-pl-xs">
<q-item-section avatar class="q-pa-none" style="min-width: 30px"> <q-item-section avatar class="q-pa-none" style="min-width: 30px">
<q-img <q-img
:src="profileImg" :src="dataStore.profileImg"
class="border-100" class="border-100"
spinner-color="white" spinner-color="white"
style="height: 30px; max-width: 30px" style="height: 30px; max-width: 30px"