รายการเลื่อน
This commit is contained in:
parent
3b02120606
commit
b76d93b734
7 changed files with 267 additions and 53 deletions
|
|
@ -36,6 +36,7 @@ export default {
|
|||
salaryReportListsByid: (type: string, rootId: string, periodId: string) =>
|
||||
`${salary}/report/${type}/${rootId}/${periodId}`,
|
||||
salaryProperty: (id: string) => `${salaryPeriod}/org/property/${id}`,
|
||||
salaryDashboard: `${salaryPeriod}/summary/all`,
|
||||
|
||||
/** รายการเงินเดือนลูกจ้างประจำ*/
|
||||
salaryEmployeeChart: `${salary}/employee`,
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ export default {
|
|||
profileListSalaryNew: (id: string) => `${salaryNew}/${id}`,
|
||||
profileListSalaryHistoryNew: (profileId: string) =>
|
||||
`${salaryNew}/history/${profileId}`,
|
||||
profileSalarySwapNew: (type: string, id: string) =>
|
||||
`${salaryNew}/swap/${type}/${id}`,
|
||||
|
||||
// ประวัติการเปลี่ยนชื่อ-นามสกุล
|
||||
profileNewChangeName: `${registryNew}changeName`,
|
||||
|
|
@ -159,8 +161,4 @@ export default {
|
|||
`${registryNew}changeName/${changeNameId}`,
|
||||
profileNewChangeNameHisByChangeNameId: (changeNameId: string) =>
|
||||
`${registryNew}changeName/history/${changeNameId}`,
|
||||
profileSalaryNew: `${salaryNew}`,
|
||||
profileListSalaryNew: (id: string) => `${salaryNew}/${id}`,
|
||||
profileListSalaryHistoryNew: (profileId: string) =>
|
||||
`${salaryNew}/history/${profileId}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -147,41 +147,7 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const rows = ref<any>([
|
||||
// {
|
||||
// date: new Date(),
|
||||
// amount: 20000,
|
||||
// positionSalaryAmount: 20000,
|
||||
// mouthSalaryAmount: 20000,
|
||||
// posNo: "1",
|
||||
// postionTypeName: "คำแหน่งประเภท",
|
||||
// positionLevelName: "ระดับ",
|
||||
// salaryRef: "เอกสารอ้างอิง",
|
||||
// refCommandNo: "เลขที่คำสั่ง",
|
||||
// },
|
||||
// {
|
||||
// date: new Date(),
|
||||
// amount: 20000,
|
||||
// positionSalaryAmount: 20000,
|
||||
// mouthSalaryAmount: 20000,
|
||||
// posNo: "1",
|
||||
// postionTypeName: "คำแหน่งประเภท",
|
||||
// positionLevelName: "ระดับ",
|
||||
// salaryRef: "เอกสารอ้างอิง",
|
||||
// refCommandNo: "เลขที่คำสั่ง",
|
||||
// },
|
||||
// {
|
||||
// date: new Date(),
|
||||
// amount: 20000,
|
||||
// positionSalaryAmount: 20000,
|
||||
// mouthSalaryAmount: 20000,
|
||||
// posNo: "1",
|
||||
// postionTypeName: "คำแหน่งประเภท",
|
||||
// positionLevelName: "ระดับ",
|
||||
// salaryRef: "เอกสารอ้างอิง",
|
||||
// refCommandNo: "เลขที่คำสั่ง",
|
||||
// },
|
||||
]);
|
||||
const rows = ref<any>([]);
|
||||
|
||||
const formDataSalary = reactive<FormSalaryNew>({
|
||||
date: null,
|
||||
|
|
@ -392,6 +358,35 @@ async function submit() {
|
|||
}
|
||||
}
|
||||
|
||||
function onSwapUp(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.profileSalarySwapNew("up", id))
|
||||
.then(() => {
|
||||
fetchListSalary();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
function onSwapDown(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.profileSalarySwapNew("down", id))
|
||||
.then(() => {
|
||||
fetchListSalary();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
const modalHistory = ref<boolean>(false);
|
||||
function onClikcHistory(id: string) {
|
||||
salaryId.value = id;
|
||||
|
|
@ -476,6 +471,7 @@ onMounted(() => {
|
|||
:color="props.rowIndex + 1 == 1 ? 'grey' : 'green'"
|
||||
:disable="props.rowIndex + 1 == 1"
|
||||
icon="mdi-arrow-up-bold"
|
||||
@click="onSwapUp(props.row.id)"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับขึ้น</q-tooltip> -->
|
||||
</q-btn>
|
||||
|
|
@ -489,6 +485,7 @@ onMounted(() => {
|
|||
:color="rows.length == props.rowIndex + 1 ? 'grey' : 'red'"
|
||||
:disable="rows.length == props.rowIndex + 1"
|
||||
icon="mdi-arrow-down-bold"
|
||||
@click="onSwapDown(props.row.id)"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับลง</q-tooltip> -->
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -455,6 +455,7 @@ onMounted(() => {
|
|||
class="row col-12 q-mt-xs"
|
||||
>
|
||||
<ProcessStep
|
||||
v-if="agencyFilter !== 'ALL'"
|
||||
:periodId="roundFilter.id"
|
||||
:rootId="agencyFilter"
|
||||
:get-data="getQuota"
|
||||
|
|
|
|||
|
|
@ -497,6 +497,7 @@ onMounted(async () => {
|
|||
class="row col-12 q-mt-xs"
|
||||
>
|
||||
<ProcessStep
|
||||
v-if="agencyFilter !== 'ALL'"
|
||||
:periodId="roundFilter.id"
|
||||
:rootId="agencyFilter"
|
||||
:get-data="getQuota"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue