รายการเลื่อน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-28 16:00:41 +07:00
parent 3b02120606
commit b76d93b734
7 changed files with 267 additions and 53 deletions

View file

@ -99,13 +99,34 @@ const itemsCardOCT = ref([
},
]);
const itemsCardSpeciel = ref([
{
lable: "จำนวนคนทั้งหมด",
name: "group1",
color: "secondary",
total: 0,
},
{
lable: "เลือกไปแล้ว",
name: "group2",
color: "primary",
total: 0,
},
{
lable: "สำรอง",
name: "group2",
color: "red-6",
total: 0,
},
]);
const itemsCard = computed(() => {
const items =
store.roundMainCode === "APR"
? itemsCardAPR.value
: store.roundMainCode === "OCT"
? itemsCardOCT.value
: [];
: itemsCardSpeciel.value;
return items;
});
@ -185,6 +206,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "currentAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
@ -195,6 +221,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "sixPercentAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
name: "spentAmount",
@ -204,6 +235,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "spentAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
name: "sixPercentSpentAmount",
@ -213,6 +249,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "sixPercentSpentAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
@ -223,6 +264,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "useAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
name: "remainingAmount",
@ -232,6 +278,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "remainingAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
name: "totalBackup",
@ -243,13 +294,54 @@ const columnsOCT = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
const columnsSpeciel = ref<QTableProps["columns"]>([
{
name: "org",
align: "left",
label: "หน่วยงาน",
sortable: true,
field: "org",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "total",
align: "left",
label: "จำนวนคนทั้งหมด",
sortable: true,
field: "total",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "chosen",
align: "left",
label: "เลือกไปแล้ว",
sortable: true,
field: "chosen",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "totalBackup",
align: "left",
label: "สำรอง",
sortable: true,
field: "totalBackup",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const columns = computed(() => {
const columnsss =
store.roundMainCode === "APR"
? columnsAPR.value
: store.roundMainCode === "OCT"
? columnsOCT.value
: [];
: columnsSpeciel.value;
return columnsss;
});
const visibleColumns = ref<string[]>(
@ -270,9 +362,10 @@ const visibleColumns = ref<string[]>(
);
function fetchDataDashboard() {
showLoader();
const formData = {
year: props?.year,
group: "",
group: "GROUP1",
period: props?.roundFilter?.id,
snapshot: props?.snapShot,
};
@ -294,10 +387,17 @@ function fetchDataDashboard() {
itemsCardOCT.value[5].total = quota.remainingAmount;
itemsCardOCT.value[6].total = quota.totalBackup;
itemsCardSpeciel.value[0].total = quota.total;
itemsCardSpeciel.value[1].total = quota.chosen;
itemsCardSpeciel.value[2].total = quota.totalBackup;
rows.value = res.data.result.salaryOrg;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
onMounted(() => {
@ -331,7 +431,16 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
</div>
<div :class="`text-${item.color} text-bold`">
{{ item.total ? item.total.toLocaleString() : 0 }}
{{
item.total
? store.roundMainCode === "OCT"
? item.total.toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})
: item.total
: 0
}}
</div>
</div>
</q-card-section>
@ -384,7 +493,7 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}
{{ col.value }}
</div>
</q-td>
</q-tr>

View file

@ -19,11 +19,11 @@ const props = defineProps({
roundFilter: Object,
});
const gruup = ref<string>("ALL");
const gruup = ref<string>("");
const options = ref([
{ id: "ALL", name: "ทั้งหมด" },
{ id: "group1", name: "กลุ่ม 1" },
{ id: "group2", name: "กลุ่ม 2" },
{ id: "", name: "ทั้งหมด" },
{ id: "GROUP1", name: "กลุ่ม 1" },
{ id: "GROUP2", name: "กลุ่ม 2" },
]);
/** itemsCard*/
@ -104,6 +104,26 @@ const itemsCardOCT = ref([
total: 0,
},
]);
const itemsCardSpeciel = ref([
{
lable: "จำนวนคนทั้งหมด",
name: "group1",
color: "secondary",
total: 0,
},
{
lable: "เลือกไปแล้ว",
name: "group2",
color: "primary",
total: 0,
},
{
lable: "สำรอง",
name: "group2",
color: "red-6",
total: 0,
},
]);
const itemsCard = computed(() => {
const items =
@ -111,7 +131,7 @@ const itemsCard = computed(() => {
? itemsCardAPR.value
: store.roundMainCode === "OCT"
? itemsCardOCT.value
: [];
: itemsCardSpeciel.value;
return items;
});
@ -191,6 +211,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "currentAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
@ -201,6 +226,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "sixPercentAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
name: "spentAmount",
@ -210,6 +240,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "spentAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
name: "sixPercentSpentAmount",
@ -219,6 +254,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "sixPercentSpentAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
@ -229,6 +269,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "useAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
name: "remainingAmount",
@ -238,6 +283,11 @@ const columnsOCT = ref<QTableProps["columns"]>([
field: "remainingAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) =>
Number(v).toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
},
{
name: "totalBackup",
@ -249,13 +299,54 @@ const columnsOCT = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
const columnsSpeciel = ref<QTableProps["columns"]>([
{
name: "org",
align: "left",
label: "หน่วยงาน",
sortable: true,
field: "org",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "total",
align: "left",
label: "จำนวนคนทั้งหมด",
sortable: true,
field: "total",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "chosen",
align: "left",
label: "เลือกไปแล้ว",
sortable: true,
field: "chosen",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "totalBackup",
align: "left",
label: "สำรอง",
sortable: true,
field: "totalBackup",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const columns = computed(() => {
const columnsss =
store.roundMainCode === "APR"
? columnsAPR.value
: store.roundMainCode === "OCT"
? columnsOCT.value
: [];
: columnsSpeciel.value;
return columnsss;
});
@ -277,6 +368,7 @@ const visibleColumns = ref<string[]>(
);
function fetchDataDashboard() {
showLoader();
const formData = {
year: props?.year,
group: gruup.value,
@ -284,7 +376,7 @@ function fetchDataDashboard() {
snapshot: props?.snapShot,
};
http
.post(config.API.salaryDashboardEmp, formData)
.post(config.API.salaryDashboard, formData)
.then((res) => {
const quota = res.data.result.dashboard;
itemsCardAPR.value[0].total = quota.total;
@ -301,10 +393,16 @@ function fetchDataDashboard() {
itemsCardOCT.value[5].total = quota.remainingAmount;
itemsCardOCT.value[6].total = quota.totalBackup;
itemsCardSpeciel.value[0].total = quota.total;
itemsCardSpeciel.value[1].total = quota.chosen;
itemsCardSpeciel.value[2].total = quota.totalBackup;
rows.value = res.data.result.salaryOrg;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
@ -353,7 +451,16 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
</div>
<div :class="`text-${item.color} text-bold`">
{{ item.total ? item.total.toLocaleString() : 0 }}
{{
item.total
? store.roundMainCode === "OCT"
? item.total.toLocaleString("en", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})
: item.total
: 0
}}
</div>
</div>
</q-card-section>
@ -405,7 +512,7 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}
{{ col.value }}
</div>
</q-td>
</q-tr>