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/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"
>
{
- interface profile {
- main: { columns: String[] };
- education: { columns: String[] };
- certicate: { columns: String[] };
- train: { columns: String[] };
- insignia: { columns: String[] };
- coined: { columns: String[] };
- assessment: { columns: String[] };
- salary: { columns: String[] };
- discipline: { columns: String[] };
- leave: { columns: String[] };
- talent: { columns: String[] };
- work: { columns: String[] };
- record: { columns: String[] };
- other: { columns: String[] };
- document: { columns: String[] };
- }
+interface profile {
+ main: { columns: String[] };
+ education: { columns: String[] };
+ certicate: { columns: String[] };
+ train: { columns: String[] };
+ insignia: { columns: String[] };
+ coined: { columns: String[] };
+ assessment: { columns: String[] };
+ salary: { columns: String[] };
+ discipline: { columns: String[] };
+ leave: { columns: String[] };
+ talent: { columns: String[] };
+ work: { columns: String[] };
+ record: { columns: String[] };
+ other: { columns: String[] };
+ document: { columns: String[] };
+}
+export const useProfileDataStore = defineStore("profilePlacenent", () => {
const birthDate = ref(new Date());
const retireText = ref(null);
const changeRetireText = (val: string | null) => {
@@ -87,15 +87,15 @@ export const useProfileDataStore = defineStore("profilePlacenent", () => {
changeRetireText,
};
});
+interface placement {
+ mappingPosition: { columns: String[] };
+}
export const usePlacementDataStore = defineStore("placement", () => {
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
const tabsMain = ref("probation");
const isOfficer = ref(null);
const isStaff = ref(null);
const { hideLoader } = mixin;
- interface placement {
- mappingPosition: { columns: String[] };
- }
const placementData = ref({
mappingPosition: { columns: [] },
});
@@ -218,10 +218,10 @@ export const usePlacementDataStore = defineStore("placement", () => {
isStaff,
};
});
+interface placementOrder {
+ mappingPosition: { columns: String[] };
+}
export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
- interface placementOrder {
- mappingPosition: { columns: String[] };
- }
const placementOrderData = ref({
mappingPosition: { columns: [] },
});
@@ -369,6 +369,8 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
]);
const statusOp = ref(statusMainOp.value);
+ const statusDelete = ["REPORT", "WAITING", "DONE"];
+
const statusText = (val: string) => {
switch (val) {
case "WAITTING":
@@ -438,5 +440,6 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
statusOp,
statusMainOp,
filterOption,
+ statusDelete,
};
});
diff --git a/src/modules/05_placement/views/02_transferMain.vue b/src/modules/05_placement/views/02_transferMain.vue
index efd36dc90..181222caa 100644
--- a/src/modules/05_placement/views/02_transferMain.vue
+++ b/src/modules/05_placement/views/02_transferMain.vue
@@ -2,7 +2,7 @@
import { ref, onMounted, computed } from "vue";
import { useQuasar } from "quasar";
-import { useRouter } from "vue-router";
+import { useRouter, useRoute } from "vue-router";
import {
checkPermission,
checkPermissionList,
@@ -20,11 +20,19 @@ import DialogOrders from "@/modules/05_placement/components/Transfer/DialogOrder
const $q = useQuasar();
const router = useRouter();
+const route = useRoute();
const mixin = useCounterMixin();
const store = useTransferDataStore();
const { statusText, filterOption } = useTransferDataStore();
-const { date2Thai, messageError, showLoader, hideLoader, onSearchDataTable } =
- mixin;
+const {
+ date2Thai,
+ messageError,
+ showLoader,
+ hideLoader,
+ onSearchDataTable,
+ dialogRemove,
+ success,
+} = mixin;
const modal = ref(false); //ส่งไปออกคำสั่ง
const dataTransfer = ref([]); //ช่อมูลรายการขอโอน
@@ -141,6 +149,15 @@ const visibleColumns = ref([
"createdAt",
]);
+const isPermissionDelete = computed(() => {
+ return (status: string) => {
+ return (
+ checkPermission(route)?.attrOwnership === "OWNER" &&
+ !store.statusDelete.includes(status)
+ );
+ };
+});
+
/** ฟังก์ชันดึงข้อมูรายการขอโอน*/
async function fetchData() {
showLoader();
@@ -194,6 +211,21 @@ function onSearch() {
);
}
+function handleDelete(id: string) {
+ dialogRemove($q, async () => {
+ try {
+ showLoader();
+ await http.delete(config.API.transfer + `/admin/${id}`);
+ await fetchData();
+ success($q, "ลบข้อมูลสำเร็จ");
+ } catch (error) {
+ messageError($q, error);
+ } finally {
+ hideLoader();
+ }
+ });
+}
+
/**
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
* จะเรียกใช้ fetchData เพื่อดึงข้อมูลรายการขอโอน
@@ -337,6 +369,18 @@ onMounted(async () => {
>
รายละเอียด
+
+
+ ลบข้อมูล
+
diff --git a/src/modules/05_placement/views/03_receiveMain.vue b/src/modules/05_placement/views/03_receiveMain.vue
index ddfa21175..2541ce000 100644
--- a/src/modules/05_placement/views/03_receiveMain.vue
+++ b/src/modules/05_placement/views/03_receiveMain.vue
@@ -313,7 +313,7 @@ function openDelete(id: string) {
dialogRemove($q, async () => {
showLoader();
await http
- .delete(config.API.receiveDataId(id))
+ .delete(config.API.receiveData() + `/admin/${id}`)
.then(async () => {
await fecthlistRecevice();
await success($q, "ลบข้อมูลสำเร็จ");
@@ -606,8 +606,10 @@ onMounted(async () => {
{
+ try {
+ showLoader();
+ await http.delete(config.API.listResign() + `/admin/${id}`);
+ await fecthlist();
+ success($q, "ลบข้อมูลสำเร็จ");
+ } catch (error) {
+ messageError($q, error);
+ } finally {
+ hideLoader();
+ }
+ });
+}
+
/**Hook */
onMounted(async () => {
status.value = stroeResign.formQurey.status;
@@ -308,7 +324,11 @@ onMounted(async () => {
color="primary"
icon="mdi-account-arrow-right"
>
- {{ `ส่งไปออกคำสั่ง${stroeResign.mainTabs == '2'?"ยกเลิกการ":''}ลาออก` }}
+ {{
+ `ส่งไปออกคำสั่ง${
+ stroeResign.mainTabs == "2" ? "ยกเลิกการ" : ""
+ }ลาออก`
+ }}
@@ -393,6 +413,26 @@ onMounted(async () => {
>
แก้ไขข้อมูล
+
+
+ ลบข้อมูล
+
([]);
@@ -129,7 +136,7 @@ const columns = ref
([
sortable: true,
field: "status",
format(val, row) {
- return stroeResign.mainTabs === "1"
+ return stroeResign.mainTabsEMP === "1"
? statusText(row.status)
: statusText(row.status, "อนุญาต");
},
@@ -252,6 +259,21 @@ function onSearch() {
);
}
+function handleDelete(id: string) {
+ dialogRemove($q, async () => {
+ try {
+ showLoader();
+ await http.delete(config.API.listResignEMP() + `/admin/${id}`);
+ await fecthlist();
+ success($q, "ลบข้อมูลสำเร็จ");
+ } catch (error) {
+ messageError($q, error);
+ } finally {
+ hideLoader();
+ }
+ });
+}
+
/**Hook */
onMounted(async () => {
statusEMP.value = stroeResign.formQureyEMP.status;
@@ -391,6 +413,26 @@ onMounted(async () => {
>
แก้ไขข้อมูล
+
+
+ ลบข้อมูล
+
-import { ref, onMounted, watch } from "vue";
+import { ref, onMounted, computed } from "vue";
+import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
-import { useRouter } from "vue-router";
+import { useRouter, useRoute } from "vue-router";
import { checkPermission } from "@/utils/permissions";
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
+import { useCounterMixin } from "@/stores/mixin";
+import http from "@/plugins/http";
+import config from "@/app.config";
+const $q = useQuasar();
const leaveStore = useLeavelistDataStore();
+const route = useRoute();
const router = useRouter();
+const { showLoader, hideLoader, messageError, dialogRemove, success } =
+ useCounterMixin();
const total = defineModel
("total", { required: true });
const totalList = defineModel("totalList", { required: true });
const pagination = defineModel("pagination", { required: true });
+const props = defineProps({
+ getList: Function,
+ rows: {
+ type: Object,
+ require: true,
+ },
+ page: {
+ type: Number,
+ require: true,
+ },
+ rowsPerPage: {
+ type: Number,
+ require: true,
+ },
+ maxPage: {
+ type: Number,
+ require: true,
+ },
+ totalList: {
+ type: Number,
+ require: true,
+ },
+ dataToobar: Object,
+});
+
+const isPermissionDelete = computed(() => {
+ return (status: string) => {
+ return (
+ checkPermission(route)?.attrOwnership === "OWNER" &&
+ !leaveStore.statusDelete.includes(status) &&
+ leaveStore.tabMenu === "1"
+ );
+ };
+});
/** ข้อมูลหัวตาราง รายการลา */
const columnsLeave = ref([
@@ -212,31 +254,6 @@ const visibleReject = ref([
"status",
]);
-const props = defineProps({
- getList: Function,
- rows: {
- type: Object,
- require: true,
- },
- page: {
- type: Number,
- require: true,
- },
- rowsPerPage: {
- type: Number,
- require: true,
- },
- maxPage: {
- type: Number,
- require: true,
- },
- totalList: {
- type: Number,
- require: true,
- },
- dataToobar: Object,
-});
-
/** ไปหน้ารายละเอียด */
function redirectToDetail(id: string) {
const routePrefix = leaveStore.tabMenu === "1" ? "/leave" : "/leave-reject";
@@ -264,6 +281,21 @@ function getStatusColor(statusText: string) {
return statusMap[statusText.toUpperCase()] ?? "";
}
+function handleDelete(id: string) {
+ dialogRemove($q, async () => {
+ try {
+ showLoader();
+ await http.delete(config.API.leaveList() + `/${id}`);
+ await props.getList?.();
+ success($q, "ลบข้อมูลสำเร็จ");
+ } catch (error) {
+ messageError($q, error);
+ } finally {
+ hideLoader();
+ }
+ });
+}
+
/** Hook*/
onMounted(() => {
if (leaveStore.tabMenu === "1") {
@@ -313,6 +345,17 @@ onMounted(() => {
>
รายละเอียด
+
+ ลบข้อมูล
+
{
const leaveType = ref([]);
+ const statusDelete = ["APPROVE", "DELETING", "DELETE"];
+
/**
* ฟังก์ชั่น fetchListLeave
* @param data รับข้อมูลจาก Page
@@ -264,5 +266,6 @@ export const useLeavelistDataStore = defineStore("leave", () => {
leaveTypeOption,
leaveTypeList,
fetchKeycloakPosition,
+ statusDelete,
};
});
diff --git a/src/modules/13_salary/components/DialogInfoMain.vue b/src/modules/13_salary/components/DialogInfoMain.vue
index 3da947277..c5bfc6762 100644
--- a/src/modules/13_salary/components/DialogInfoMain.vue
+++ b/src/modules/13_salary/components/DialogInfoMain.vue
@@ -52,7 +52,7 @@ function fetchInformation() {
citizenId.value = data.citizenId;
if (data.avatarName) {
- await fetchProfile(data.id as string, data.avatarName);
+ fetchProfile(data.id as string, data.avatarName);
} else {
avatar.value = avatarMain;
}
@@ -70,11 +70,14 @@ function fetchInformation() {
* @param id profileId
* @param avatarName ชื้อไฟล์
*/
-async function fetchProfile(id: string, avatarName: string) {
+function fetchProfile(id: string, avatarName: string) {
http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName))
- .then(async (res) => {
+ .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/views/MainLayout.vue b/src/views/MainLayout.vue
index 3812a311d..33e733b0b 100644
--- a/src/views/MainLayout.vue
+++ b/src/views/MainLayout.vue
@@ -532,25 +532,29 @@ async function fetchKeycloakPosition() {
await http
.get(config.API.keycloakPosition())
.then(async (res) => {
- 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;
});
}