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 @@ -