diff --git a/src/components/CardProfile.vue b/src/components/CardProfile.vue
index 72fe7aad0..2b90d2468 100644
--- a/src/components/CardProfile.vue
+++ b/src/components/CardProfile.vue
@@ -8,6 +8,7 @@ import config from "@/app.config";
import type { PropType } from "vue";
import type { FormProfile } from "@/interface/main";
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
+import avatarMain from "@/assets/avatar_user.jpg";
/** importComponents*/
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
@@ -91,8 +92,11 @@ function fetchProfile(id: string, name: string) {
if (profile.avatar === "") {
http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `${name}`))
- .then(async (res) => {
+ .then((res) => {
profile.avatar = res.data.downloadUrl;
+ })
+ .catch(() => {
+ profile.avatar = avatarMain;
});
}
}
diff --git a/src/components/DialogHeader.vue b/src/components/DialogHeader.vue
index 77d936c93..19ee3f536 100644
--- a/src/components/DialogHeader.vue
+++ b/src/components/DialogHeader.vue
@@ -9,6 +9,8 @@
round
dense
@click="close"
+ @keydown.enter.prevent
+ @keydown.space.prevent
style="color: #ff8080; background-color: #ffdede"
/>
diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue
index 1b17f7efd..ffc275ee7 100644
--- a/src/components/Dialogs/PopupPersonalNew.vue
+++ b/src/components/Dialogs/PopupPersonalNew.vue
@@ -14,6 +14,7 @@ import type {
GovermentEmpTemp,
} from "@/components/information/interface/response/Government";
import type { Avatar } from "@/components/information/interface/response/avatar";
+import avatarMain from "@/assets/avatar_user.jpg";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
@@ -167,9 +168,9 @@ async function fetchInformation(id: string) {
avatar.position = data.position ? data.position : "-";
//ถ้ามีรูปเรียก Function fetchProfile เรียกข้อมูลรูปโปรไฟล์
if (data.avatarName) {
- await fetchProfile(data.id as string, data.avatarName);
+ fetchProfile(data.id as string, data.avatarName);
} else {
- avatar.avatar = "";
+ avatar.avatar = avatarMain;
}
if (props.id) {
@@ -260,11 +261,14 @@ async function fetchProfileGovTemp(id: string) {
* @param id profileID
* @param avatarName ชื่อไฟล์
*/
-async function fetchProfile(id: string, avatarName: string) {
- await http
+function fetchProfile(id: string, avatarName: string) {
+ http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName))
- .then(async (res) => {
- avatar.avatar = await res.data.downloadUrl;
+ .then((res) => {
+ avatar.avatar = res.data.downloadUrl;
+ })
+ .catch(() => {
+ avatar.avatar = avatarMain;
});
}
diff --git a/src/modules/02_organization/components/DialogHistoryPos.vue b/src/modules/02_organization/components/DialogHistoryPos.vue
index 4b9651bcf..eed16a660 100644
--- a/src/modules/02_organization/components/DialogHistoryPos.vue
+++ b/src/modules/02_organization/components/DialogHistoryPos.vue
@@ -213,7 +213,9 @@ function formatHistoryOwnerData(data: HistoryPos[]) {
return data.map((item) => ({
...item,
fullname: item.firstName
- ? `${item.prefix}${item.firstName} ${item.lastName}`.trim()
+ ? `${item.prefix || ""}${item.firstName || ""} ${
+ item.lastName || ""
+ }`.trim()
: "ว่าง",
}));
}
@@ -275,7 +277,7 @@ watch(
(store.typeOrganizational === "draft" ||
store.typeOrganizational === "old")
? "2 (ปัจจุบัน)"
- : props.rowIndex + 1
+ : props.rowIndex + 1
}}
diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue
index c97cbb2c3..71a7e3bd5 100644
--- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue
+++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue
@@ -866,7 +866,8 @@ onMounted(() => {
outlined
dense
:model-value="date2Thai(formData.dateEnd)"
- :rules="[(val:string) => !!val || `${'กรุณาเลือก วันที่สิ้นสุด'}`]"
+ clearable
+ @clear="formData.dateEnd = null"
hide-bottom-space
:label="`${'วันที่สิ้นสุด'}`"
>
diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue
index 7730029f7..1d686dfe8 100644
--- a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue
+++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue
@@ -408,7 +408,8 @@ function calculateMinDate() {
function prefixRankRule() {
return [
- () => !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ",
+ () =>
+ !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ",
];
}
@@ -588,6 +589,7 @@ onMounted(() => {
{
option-value="name"
v-model="formData.prefix"
clearable
- class="inputgreen"
:options="store.Ops.prefixOps"
:label="dataLabel.prefix"
:rules="prefixRankRule()"
@@ -640,24 +641,24 @@ onMounted(() => {
@@ -721,6 +722,7 @@ onMounted(() => {
{
option-label="name"
option-value="name"
v-model="formData.gender"
- class="inputgreen"
:options="store.Ops.genderOps"
:label="dataLabel.gender"
@filter="(inputValue: string,
diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue
index 33ca37200..4fdec72a9 100644
--- a/src/modules/04_registryPerson/views/detailView.vue
+++ b/src/modules/04_registryPerson/views/detailView.vue
@@ -323,10 +323,10 @@ async function uploadFileURL(uploadUrl: string, file: any) {
* ฟังก์ชันดึงข้อมูลรูปโปรไฟล์
* @param id โปรไฟล์
*/
-async function fetchProfile(id: string) {
- await http
+function fetchProfile(id: string) {
+ http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value))
- .then(async (res) => {
+ .then((res) => {
profilePicture.value = res.data.downloadUrl;
})
.catch(() => {
@@ -403,7 +403,7 @@ async function fetchDataPersonal() {
fileName.value = res.data.result.avatarName;
if (formDetail.value?.avatarName) {
- await fetchProfile(profileId.value);
+ fetchProfile(profileId.value);
} else {
profilePicture.value = avatar;
}
diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue
index b85f00bb9..da180ac32 100644
--- a/src/modules/04_registryPerson/views/edit/components/Table.vue
+++ b/src/modules/04_registryPerson/views/edit/components/Table.vue
@@ -889,8 +889,8 @@ function handleSortByDate() {
hideLoader();
}
},
- "ยืนยันการเรียงลำดับข้อมูล",
- "ต้องการยืนยันการเรียงลำดับข้อมูลนี้ใช่หรือไม่?"
+ "ยืนยันการจัดลำดับ",
+ "ต้องการยืนยันการจัดลำดับข้อมูลตามวันที่คำสั่งมีผลใช่หรือไม่?"
);
}
@@ -941,10 +941,10 @@ onMounted(async () => {
flat
dense
color="indigo-5"
- icon="mdi-sort-alphabetical-descending"
+ icon="mdi-calendar-export"
@click="handleSortByDate()"
>
- เรียงลำดับข้อมูล
+ จัดลำดับตามวันที่คำสั่งมีผล
diff --git a/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue b/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue
index ce4a0284b..dd8d3ba5f 100644
--- a/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue
+++ b/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue
@@ -316,9 +316,10 @@ onMounted(() => {
:model-value="
dateEnd !== null ? date2Thai(dateEnd) : null
"
- :rules="edit ? [(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]:[]"
hide-bottom-space
:label="`${'ถึงวันที่'}`"
+ clearable
+ @clear="dateEnd = null"
>
{
+ .then((res) => {
avatar.value = res.data.downloadUrl;
+ })
+ .catch(() => {
+ avatar.value = avatarMain;
});
}
diff --git a/src/modules/14_KPI/views/detail.vue b/src/modules/14_KPI/views/detail.vue
index aede8c187..81d3df41a 100644
--- a/src/modules/14_KPI/views/detail.vue
+++ b/src/modules/14_KPI/views/detail.vue
@@ -8,6 +8,7 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/14_KPI/store";
+import avatar from "@/assets/avatar_user.jpg";
import DialogHeader from "@/components/DialogHeader.vue";
import type { FormProfile } from "@/modules/14_KPI/interface/request/index";
@@ -65,7 +66,7 @@ async function fetchEvaluation() {
await store.checkCompetency();
await store.checkCompetencyDefaultCompetencyLevel();
- await fetchProfile(data.profileId);
+ fetchProfile(data.profileId);
plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint;
rolePoint.value = data.rolePoint == null ? "" : data.rolePoint;
@@ -81,8 +82,8 @@ async function fetchEvaluation() {
// });
}
-async function fetchProfile(id: string) {
- await http
+function fetchProfile(id: string) {
+ http
.get(
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
)
@@ -90,6 +91,7 @@ async function fetchProfile(id: string) {
store.dataEvaluation.avartar = res.data.downloadUrl;
})
.catch(() => {
+ store.dataEvaluation.avartar = avatar;
// profilePicture.value = avatar;
});
}
diff --git a/src/modules/16_positionEmployee/components/DialogMovePos.vue b/src/modules/16_positionEmployee/components/DialogMovePos.vue
index 97fd67813..96539fc61 100644
--- a/src/modules/16_positionEmployee/components/DialogMovePos.vue
+++ b/src/modules/16_positionEmployee/components/DialogMovePos.vue
@@ -50,7 +50,7 @@ const modal = defineModel("modal", { required: true });
let reqMaster = defineModel("reqMaster", { required: true });
const totalPage = defineModel("totalPage", { required: true });
const nodeTree = defineModel("nodeTree", { required: true });
-const columns = defineModel("columns", {});
+const columns = defineModel("columns", { required: true });
const rows = defineModel("rows", { required: true });
const props = defineProps({
fetchDataTree: {
diff --git a/src/modules/16_positionEmployee/components/TableMain.vue b/src/modules/16_positionEmployee/components/TableMain.vue
index f56a0ab4e..8943c2423 100644
--- a/src/modules/16_positionEmployee/components/TableMain.vue
+++ b/src/modules/16_positionEmployee/components/TableMain.vue
@@ -777,7 +777,7 @@ watch(
{
- const data = await res.data.result;
+ const data = res.data.result;
usePositionKeycloakStore().setPositionKeycloak(data);
if (data.avatarName) {
- await getImg(data.profileId, data.avatarName);
+ getImg(data.profileId, data.avatarName);
} else {
profileImg.value = avatar;
}
})
.catch((err) => {
messageError($q, err);
+ profileImg.value = avatar;
});
}
const profileImg = ref("");
-async function getImg(id: string, pathName: string) {
- await http
+function getImg(id: string, pathName: string) {
+ http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, pathName))
.then((res) => {
profileImg.value = res.data.downloadUrl;
+ })
+ .catch((err) => {
+ profileImg.value = avatar;
});
}