Merge branch 'nice' into develop
This commit is contained in:
commit
d93063d291
1 changed files with 20 additions and 8 deletions
|
|
@ -789,18 +789,26 @@ async function fetchDataTenure() {
|
|||
}));
|
||||
|
||||
// แปลงข้อมูลจาก data
|
||||
const position = formatData(data.position); //ระยะเวลาดำรงตำแหน่งในสายงาน
|
||||
const posLevel = formatData(data.posLevel); //ระยะเวลาดำรงตำแหน่งตามระดับ
|
||||
const posExecutive = formatData(data.posExecutive); //ระยะเวลาดำรงตำแหน่งทางการบริหาร
|
||||
const position = data.position ? formatData(data.position) : []; //ระยะเวลาดำรงตำแหน่งในสายงาน
|
||||
const posLevel = data.posLevel ? formatData(data.posLevel) : []; //ระยะเวลาดำรงตำแหน่งตามระดับ
|
||||
const posExecutive = data.posExecutive
|
||||
? formatData(data.posExecutive)
|
||||
: []; //ระยะเวลาดำรงตำแหน่งทางการบริหาร
|
||||
|
||||
// นำข้อมูลไปใส่ใน cardData
|
||||
cardData.value[0].data = position;
|
||||
cardData.value[1].data = posLevel;
|
||||
cardData.value[2].data = posExecutive;
|
||||
if (empType.value !== "-employee") {
|
||||
cardData.value[2].data = posExecutive;
|
||||
}
|
||||
|
||||
//เช็คค่า ระยะเวลาดำรงตำแหน่งทางการบริหาร ถ้าไม่มีให้ลบออกจาก cardData
|
||||
if (posExecutive.length === 0) {
|
||||
cardData.value.splice(2, 2);
|
||||
if (
|
||||
posExecutive.length === 0 &&
|
||||
empType.value !== "-employee" &&
|
||||
cardData.value.length > 2
|
||||
) {
|
||||
cardData.value.splice(2, 1);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -813,9 +821,13 @@ async function fetchDataTenure() {
|
|||
onMounted(async () => {
|
||||
try {
|
||||
showLoader();
|
||||
if (empType.value === "-employee") {
|
||||
cardData.value.splice(2, 1);
|
||||
}
|
||||
await Promise.all([
|
||||
fetchListSalary(),
|
||||
empType.value === "" ? fetchDataTenure() : Promise.resolve(),
|
||||
fetchDataTenure(),
|
||||
// empType.value === "" ? : Promise.resolve(),
|
||||
]);
|
||||
} finally {
|
||||
hideLoader();
|
||||
|
|
@ -824,7 +836,7 @@ onMounted(async () => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="row q-col-gutter-sm q-pb-sm" v-if="empType === ''">
|
||||
<div class="row q-col-gutter-sm q-pb-sm">
|
||||
<div class="col" v-for="(item, index) in cardData" :key="index">
|
||||
<q-card bordered class="col-12" style="border: 1px solid #d6dee1">
|
||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue