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

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

@ -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>