diff --git a/src/modules/09_leave/components/2_Leave/DetailLeave.vue b/src/modules/09_leave/components/2_Leave/DetailLeave.vue
index ce15fafa9..7ca1e4557 100644
--- a/src/modules/09_leave/components/2_Leave/DetailLeave.vue
+++ b/src/modules/09_leave/components/2_Leave/DetailLeave.vue
@@ -581,7 +581,7 @@ function formattedNumber(x: number) {
ประเภทการลา
- {{ formData.leaveTypeName }}
+ {{ checkForm !== 'FormUpasom' && checkForm !== 'FormHajj' ? formData.leaveTypeName:(formData.hajjDayStatus ? 'ลาประกอบพิธีฮัจญ์':'ลาอุปสมบท') }}
@@ -640,7 +640,7 @@ function formattedNumber(x: number) {
-
+
diff --git a/src/modules/09_leave/components/2_Leave/Tab1.vue b/src/modules/09_leave/components/2_Leave/Tab1.vue
index 9723b991e..55496d3b3 100644
--- a/src/modules/09_leave/components/2_Leave/Tab1.vue
+++ b/src/modules/09_leave/components/2_Leave/Tab1.vue
@@ -21,7 +21,7 @@ import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
const $q = useQuasar(); //ใช้ noti quasar
const mixin = useCounterMixin();
const leaveStore = useLeavelistDataStore();
-
+const dataToobar = ref
([]);
const { showLoader, hideLoader, messageError } = mixin;
const querySting = reactive({
@@ -86,7 +86,23 @@ async function updatePaging(
await fecthLeaveList();
}
+/** function เรียกข้อมูลสถานะ*/
+async function fetchOption() {
+ await http
+ .get(config.API.leaveType())
+ .then((res) => {
+ dataToobar.value = res.data.result;
+ })
+ .catch((err) => {
+ messageError($q, err);
+ })
+ .finally(() => {
+
+ });
+}
+
onMounted(async () => {
+ await fetchOption();
await fecthLeaveList();
});
@@ -140,6 +156,7 @@ watch(
diff --git a/src/modules/09_leave/components/2_Leave/Tab2.vue b/src/modules/09_leave/components/2_Leave/Tab2.vue
index 722afc7b2..e5d3de559 100644
--- a/src/modules/09_leave/components/2_Leave/Tab2.vue
+++ b/src/modules/09_leave/components/2_Leave/Tab2.vue
@@ -21,7 +21,7 @@ const mixin = useCounterMixin();
const leaveStore = useLeavelistDataStore();
const { showLoader, hideLoader, messageError } = mixin;
const { fetchListLeaveReject } = leaveStore;
-
+const dataToobar = ref
([]);
const $q = useQuasar(); //ใช้ noti quasar
const querySting = reactive({
@@ -85,7 +85,21 @@ async function updatePaging(
await fecthLeaveList();
}
+/** function เรียกข้อมูลสถานะ*/
+async function fetchOption() {
+ await http
+ .get(config.API.leaveType())
+ .then((res) => {
+ dataToobar.value = res.data.result;
+ })
+ .catch((err) => {
+ messageError($q, err);
+ })
+ .finally(() => {});
+}
+
onMounted(async () => {
+ await fetchOption();
await fecthLeaveList();
});
@@ -93,6 +107,7 @@ onMounted(async () => {
{
:maxPage="maxPage"
:totalList="totalList"
@update:querySting="updatePaging"
+ :dataToobar="dataToobar"
/>
diff --git a/src/modules/09_leave/components/2_Leave/TableList.vue b/src/modules/09_leave/components/2_Leave/TableList.vue
index b063e013a..ed1c0edce 100644
--- a/src/modules/09_leave/components/2_Leave/TableList.vue
+++ b/src/modules/09_leave/components/2_Leave/TableList.vue
@@ -8,7 +8,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
const mixin = useCounterMixin();
const leaveStore = useLeavelistDataStore();
-
+const checkForm = ref("");
const router = useRouter();
/** เรียน funtion จาก stores*/
@@ -206,6 +206,7 @@ const props = defineProps({
type: Number,
require: true,
},
+ dataToobar: Object,
});
const emit = defineEmits(["update:querySting"]);
@@ -237,8 +238,22 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
updateQuerySting(currentPage.value, pagination.value.rowsPerPage);
});
+function convert(val: any) {
+ const filtertype = props.dataToobar?.find(
+ (e: any) => e.id === val.leaveTypeId
+ );
+ const type = filtertype?.code;
+if(type == 'LV-006'&&val.hajjDayStatus == false){
+ return 'ลาอุปสมบท'
+}else if(type == 'LV-006'&&val.hajjDayStatus == true){
+ return 'ลาประกอบพิธีฮัจญ์'
+}else{
+ return val.leaveTypeName
+}
+}
/** Hook*/
onMounted(() => {
+
if (leaveStore.tabMenu === "1") {
leaveStore.visibleColumns = visibleColumnsLeave.value;
leaveStore.columns = columnsLeave.value;
@@ -287,6 +302,9 @@ onMounted(() => {
1
}}
+
+ {{ convert(props.row) }}
+
{{ col.value }}
diff --git a/src/modules/09_leave/components/2_Leave/ToolBarLeave.vue b/src/modules/09_leave/components/2_Leave/ToolBarLeave.vue
index 2c783866e..a14910dc4 100644
--- a/src/modules/09_leave/components/2_Leave/ToolBarLeave.vue
+++ b/src/modules/09_leave/components/2_Leave/ToolBarLeave.vue
@@ -1,5 +1,5 @@
@@ -210,11 +206,19 @@ onMounted(async () => {
ไม่มีข้อมูล
-
+
@@ -249,13 +253,14 @@ onMounted(async () => {
-
+
diff --git a/src/modules/09_leave/components/2_Leave/formDetail/formMain.vue b/src/modules/09_leave/components/2_Leave/formDetail/formMain.vue
index 0e381680b..b3e8749a1 100644
--- a/src/modules/09_leave/components/2_Leave/formDetail/formMain.vue
+++ b/src/modules/09_leave/components/2_Leave/formDetail/formMain.vue
@@ -4,8 +4,8 @@ const props = defineProps({
type: Object,
required: true,
},
+ checkForm: String,
});
-console.log(props.data);
@@ -16,7 +16,16 @@ console.log(props.data);
เรื่อง
-
{{ props.data.leaveTypeName }}
+
+
+ {{
+ props.checkForm !== "FormUpasom" && props.checkForm !== "FormHajj"
+ ? props.data.leaveTypeName
+ : props.data.hajjDayStatus
+ ? "ลาประกอบพิธีฮัจญ์"
+ : "ลาอุปสมบท"
+ }}
+
เรียน
diff --git a/src/modules/09_leave/interface/response/leave.ts b/src/modules/09_leave/interface/response/leave.ts
index 461582e46..38d0b0e6f 100644
--- a/src/modules/09_leave/interface/response/leave.ts
+++ b/src/modules/09_leave/interface/response/leave.ts
@@ -20,6 +20,7 @@ interface ListLeave {
org?: string;
position?: string;
level?: string;
+ hajjDayStatus?: boolean;
}
interface FormData {
id: string;
diff --git a/src/modules/09_leave/stores/LeaveStore.ts b/src/modules/09_leave/stores/LeaveStore.ts
index 9cd9c3cb8..a45356c19 100644
--- a/src/modules/09_leave/stores/LeaveStore.ts
+++ b/src/modules/09_leave/stores/LeaveStore.ts
@@ -57,6 +57,7 @@ export const useLeavelistDataStore = defineStore("leave", () => {
org: e.org !== undefined && e.org !== null && e.org !== "" ? e.org : "-",
position: e.position ?? "-",
level: e.level ?? "-",
+ hajjDayStatus: e.hajjDayStatus ,
dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave),
dateLeave:
e.leaveStartDate && e.leaveEndDate