แก้ไขลา
This commit is contained in:
parent
754618ebe6
commit
2b9ee64d04
3 changed files with 44 additions and 42 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, computed } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
|
|
@ -49,18 +49,18 @@ const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const paramsId = route.params.id.toString();
|
const paramsId = route.params.id.toString();
|
||||||
|
|
||||||
const keycloakId = ref<string>("");
|
const myProfileId = ref<string>("");
|
||||||
const typeDocx = ref<string>("docx");
|
const typeDocx = ref<string>("docx");
|
||||||
const typePdf = ref<string>("pdf");
|
const typePdf = ref<string>("pdf");
|
||||||
const modalApprove = ref(false);
|
const modalApprove = ref(false);
|
||||||
const dialogTitle = ref<string>("อนุญาต");
|
const dialogTitle = ref<string>("อนุญาต");
|
||||||
const approveCheck = computed(() => {
|
// const approveCheck = computed(() => {
|
||||||
return (
|
// return (
|
||||||
rows.value?.commanders?.every(
|
// rows.value?.commanders?.every(
|
||||||
(commander) => commander.approveStatus === "APPROVE"
|
// (commander) => commander.approveStatus === "APPROVE"
|
||||||
) ?? false
|
// ) ?? false
|
||||||
);
|
// );
|
||||||
});
|
// });
|
||||||
|
|
||||||
/** ฟังก์ชั่น อัปโหลด
|
/** ฟังก์ชั่น อัปโหลด
|
||||||
* consolelog ไว้ก่อน
|
* consolelog ไว้ก่อน
|
||||||
|
|
@ -470,12 +470,12 @@ async function checkOfficer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchKeycloakPosition() {
|
async function fetchKeycloakPosition() {
|
||||||
if (keycloakId.value == "") {
|
if (myProfileId.value == "") {
|
||||||
await http
|
await http
|
||||||
.get(config.API.keycloakPosition())
|
.get(config.API.keycloakPosition())
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = await res.data.result;
|
const data = await res.data.result;
|
||||||
keycloakId.value = data.profileId;
|
myProfileId.value = data.profileId;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -830,23 +830,17 @@ async function fetchKeycloakPosition() {
|
||||||
</div>
|
</div>
|
||||||
<q-separator
|
<q-separator
|
||||||
v-if="
|
v-if="
|
||||||
checkPermission($route)?.attrIsUpdate &&
|
|
||||||
formData.reasonOligarch === '-' &&
|
|
||||||
rows &&
|
rows &&
|
||||||
rows.approvers[0]?.profileId == keycloakId &&
|
rows.approvers[0]?.profileId == myProfileId &&
|
||||||
rows.approvers[0]?.approveStatus == 'PENDING' &&
|
rows.approvers[0]?.approveStatus == 'PENDING'
|
||||||
approveCheck
|
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="row q-pa-md q-gutter-sm justify-end"
|
class="row q-pa-md q-gutter-sm justify-end"
|
||||||
v-if="
|
v-if="
|
||||||
checkPermission($route)?.attrIsUpdate &&
|
|
||||||
formData.reasonOligarch === '-' &&
|
|
||||||
rows &&
|
rows &&
|
||||||
rows.approvers[0]?.profileId == keycloakId &&
|
rows.approvers[0]?.profileId == myProfileId &&
|
||||||
rows.approvers[0]?.approveStatus == 'PENDING' &&
|
rows.approvers[0]?.approveStatus == 'PENDING'
|
||||||
approveCheck
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
|
||||||
|
|
@ -238,24 +238,6 @@ function updatePagination(newPagination: any) {
|
||||||
pagination.value.rowsPerPage = newPagination.rowsPerPage;
|
pagination.value.rowsPerPage = newPagination.rowsPerPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* แปลง สถานะ เป็น text
|
|
||||||
* @param val
|
|
||||||
*/
|
|
||||||
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*/
|
/** Hook*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (leaveStore.tabMenu === "1") {
|
if (leaveStore.tabMenu === "1") {
|
||||||
|
|
@ -306,7 +288,23 @@ onMounted(() => {
|
||||||
<q-tooltip>รายละเอียด</q-tooltip>
|
<q-tooltip>รายละเอียด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props" :class="props.row.statusText == 'REJECT' || props.row.statusText == 'DELETE' ? 'text-red':props.row.statusText == 'PENDING' ? 'text-orange':props.row.statusText == 'APPROVE' ? 'text-green':''">
|
<q-td
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
:class="
|
||||||
|
props.row.statusText == 'REJECT'
|
||||||
|
? 'text-red'
|
||||||
|
: props.row.statusText == 'NEW'
|
||||||
|
? 'text-blue'
|
||||||
|
: props.row.statusText == 'PENDING'
|
||||||
|
? 'text-warning'
|
||||||
|
: props.row.statusText == 'DELETE' ||
|
||||||
|
props.row.statusText == 'DELETING'
|
||||||
|
? 'text-orange'
|
||||||
|
: ''
|
||||||
|
"
|
||||||
|
>
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{
|
{{
|
||||||
(pagination.page - 1) * pagination.rowsPerPage +
|
(pagination.page - 1) * pagination.rowsPerPage +
|
||||||
|
|
@ -315,7 +313,15 @@ onMounted(() => {
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'leaveTypeName'">
|
<div v-else-if="col.name == 'leaveTypeName'">
|
||||||
{{ props.row.leaveTypeName ? `${props.row.leaveTypeName} ${props.row.leaveSubTypeName ? `(${props.row.leaveSubTypeName})`:''}`: '-' }}
|
{{
|
||||||
|
props.row.leaveTypeName
|
||||||
|
? `${props.row.leaveTypeName} ${
|
||||||
|
props.row.leaveSubTypeName
|
||||||
|
? `(${props.row.leaveSubTypeName})`
|
||||||
|
: ""
|
||||||
|
}`
|
||||||
|
: "-"
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'profileType'">
|
<div v-else-if="col.name == 'profileType'">
|
||||||
{{
|
{{
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,10 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
||||||
return "อนุญาต";
|
return "อนุญาต";
|
||||||
case "REJECT":
|
case "REJECT":
|
||||||
return "ไม่อนุญาต";
|
return "ไม่อนุญาต";
|
||||||
|
case "DELETING":
|
||||||
|
return "กำลังดำเนินการยกเลิก";
|
||||||
case "DELETE":
|
case "DELETE":
|
||||||
return "ยกเลิก";
|
return "ยกเลิกสำเร็จ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue