no message

This commit is contained in:
STW_TTTY\stwtt 2024-05-21 13:29:53 +07:00
parent fb2b9b4c30
commit 6a763e819b
4 changed files with 18 additions and 10 deletions

View file

@ -86,5 +86,5 @@ export default {
orgProfileEmp: `${orgEmployeePos}/profile`,
orgSearchProfileEmp: `${orgProfile}-employee/search`,
orgProfileById:(id:string)=>`${orgProfile}/${id}`
orgProfileById:(id:string,type:string)=>`${orgProfile}${type}/${id}`
};

View file

@ -3,7 +3,7 @@ import { ref, reactive, watch, onMounted } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useRouter } from "vue-router";
import { useRouter,useRoute } from "vue-router";
/** importType*/
import type { PersonalImformation } from "@/components/information/interface/response/Information";
@ -14,13 +14,16 @@ import type { Avatar } from "@/components/information/interface/response/avatar"
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const route = useRoute()
const mixin = useCounterMixin();
const router = useRouter();
const $q = useQuasar();
const retireDate = ref<Date>();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const fileName = ref<string>("");
const empType = ref<string>(
route.name !== "appoint-employee-detail" ? "" : "-employee"
);
/** props*/
const props = defineProps({
id: {
@ -101,7 +104,7 @@ function calculateAge(birthDate: Date | null) {
async function fetchInformation(id: string) {
showLoader();
await http
.get(config.API.orgProfileById(id))
.get(config.API.orgProfileById(id,empType.value))
.then((res) => {
const data = res.data.result;
imformation.prefix = data.prefix ? data.prefix : "-";
@ -115,6 +118,11 @@ async function fetchInformation(id: string) {
avatar.fullname = `${data.prefix}${data.firstName} ${data.lastName}`;
avatar.position = data.position ? data.position : "-";
if(data.avatarName){
fetchProfile(data.id as string)
}else{
statusLoad.value.val = true;
}
})
.catch((err) => {
messageError($q, err);
@ -132,7 +140,7 @@ async function fetchInformation(id: string) {
async function fetchProfileGov(id: string) {
showLoader();
await http
.get(config.API.profileNewGovernmentById(id, ""))
.get(config.API.profileNewGovernmentById(id, empType.value))
.then((res) => {
const data = res.data.result;
goverment.oc = data.org !== "" ? data.org : "-";
@ -179,7 +187,7 @@ watch(
fetchInformation(props.id);
fetchProfileGov(props.id);
fileName.value = `profile-${props.id}`;
fetchProfile(props.id as string);
// fetchProfile(props.id as string);
}
}
}

View file

@ -72,8 +72,8 @@ const fecthappointmentByid = async () => {
const data = res.data.result;
appointment.value = data;
profileId.value = data.profileId;
title.value.fullname = `${data.prefix}${data.firstname ?? "-"} ${
data.lastname ?? "-"
title.value.fullname = `${data.prefix}${data.firstName ?? "-"} ${
data.lastName ?? "-"
}`;
title.value.organizationPositionOld = data.organizationPositionOld ?? "-";
title.value.positionLevelOld = data.positionLevelOld ?? "-";

View file

@ -92,8 +92,8 @@ interface ResponseData {
citizenId: string;
profileId: string;
prefix: string;
firstname: string;
lastname: string;
firstName: string;
lastName: string;
organizationPositionOld: string;
positionLevelOld: string;
positionTypeOld: string;