position
This commit is contained in:
parent
20f1e43259
commit
2f21c27121
1 changed files with 20 additions and 7 deletions
|
|
@ -508,6 +508,8 @@ function onSearch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchDataTenure() {
|
async function fetchDataTenure() {
|
||||||
|
console.log(link.value);
|
||||||
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.salaryTenurePosition(link.value))
|
.get(config.API.salaryTenurePosition(link.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
@ -521,18 +523,26 @@ async function fetchDataTenure() {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// แปลงข้อมูลจาก data
|
// แปลงข้อมูลจาก data
|
||||||
const position = formatData(data.position); //ระยะเวลาดำรงตำแหน่งในสายงาน
|
const position = data.position ? formatData(data.position) : []; //ระยะเวลาดำรงตำแหน่งในสายงาน
|
||||||
const posLevel = formatData(data.posLevel); //ระยะเวลาดำรงตำแหน่งตามระดับ
|
const posLevel = data.posLevel ? formatData(data.posLevel) : []; //ระยะเวลาดำรงตำแหน่งตามระดับ
|
||||||
const posExecutive = formatData(data.posExecutive); //ระยะเวลาดำรงตำแหน่งทางการบริหาร
|
const posExecutive = data.posExecutive
|
||||||
|
? formatData(data.posExecutive)
|
||||||
|
: []; //ระยะเวลาดำรงตำแหน่งทางการบริหาร
|
||||||
|
|
||||||
// นำข้อมูลไปใส่ใน cardData
|
// นำข้อมูลไปใส่ใน cardData
|
||||||
cardData.value[0].data = position;
|
cardData.value[0].data = position;
|
||||||
cardData.value[1].data = posLevel;
|
cardData.value[1].data = posLevel;
|
||||||
cardData.value[2].data = posExecutive;
|
if (link.value !== "-employee") {
|
||||||
|
cardData.value[2].data = posExecutive;
|
||||||
|
}
|
||||||
|
|
||||||
//เช็คค่า ระยะเวลาดำรงตำแหน่งทางการบริหาร ถ้าไม่มีให้ลบออกจาก cardData
|
//เช็คค่า ระยะเวลาดำรงตำแหน่งทางการบริหาร ถ้าไม่มีให้ลบออกจาก cardData
|
||||||
if (posExecutive.length === 0) {
|
if (
|
||||||
cardData.value.splice(2, 2);
|
posExecutive.length === 0 &&
|
||||||
|
link.value !== "-employee" &&
|
||||||
|
cardData.value.length > 2
|
||||||
|
) {
|
||||||
|
cardData.value.splice(2, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -543,6 +553,9 @@ async function fetchDataTenure() {
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
link.value = await dataPerson.getProFileType();
|
link.value = await dataPerson.getProFileType();
|
||||||
|
if (link.value === "-employee") {
|
||||||
|
cardData.value.splice(2, 1);
|
||||||
|
}
|
||||||
getData();
|
getData();
|
||||||
fetchDataTenure();
|
fetchDataTenure();
|
||||||
});
|
});
|
||||||
|
|
@ -555,7 +568,7 @@ onMounted(async () => {
|
||||||
<span class="text-blue-6 text-weight-bold text-body1">ตำแหน่ง</span>
|
<span class="text-blue-6 text-weight-bold text-body1">ตำแหน่ง</span>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm q-pb-sm" v-if="link === ''">
|
<div class="row q-col-gutter-sm q-pb-sm">
|
||||||
<div class="col" v-for="(item, index) in cardData" :key="index">
|
<div class="col" v-for="(item, index) in cardData" :key="index">
|
||||||
<q-card bordered class="col-12" style="border: 1px solid #d6dee1">
|
<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">
|
<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