เลื่อนเงืนเดือน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-27 17:16:17 +07:00
parent 62b5651911
commit 1e25bfc4b6
6 changed files with 185 additions and 166 deletions

View file

@ -87,20 +87,20 @@ const columns = ref<QTableProps["columns"]>([
}, },
{ {
name: "postionTypeName", name: "positionType",
align: "left", align: "left",
label: "ตำแหน่งประเภท", label: "ตำแหน่งประเภท",
sortable: true, sortable: true,
field: "postionTypeName", field: "positionType",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "positionLevelName", name: "positionLevel",
align: "left", align: "left",
label: "ระดับ", label: "ระดับ",
sortable: true, sortable: true,
field: "positionLevelName", field: "positionLevel",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
@ -130,8 +130,8 @@ const visibleColumns = ref<string[]>([
"positionSalaryAmount", "positionSalaryAmount",
"mouthSalaryAmount", "mouthSalaryAmount",
"posNo", "posNo",
"postionTypeName", "positionType",
"positionLevelName", "positionLevel",
"templateDoc", "templateDoc",
"refCommandNo", "refCommandNo",
]); ]);
@ -247,7 +247,9 @@ function fetchType() {
} }
async function updateSelectType(val: string, status: boolean = false) { async function updateSelectType(val: string, status: boolean = false) {
const listLevel = await dataLevel.value.find((e: any) => e.id === val); const listLevel = await dataLevel.value.find(
(e: any) => e.posTypeName === val
);
if (listLevel) { if (listLevel) {
posLevelOptionMain.value = listLevel.posLevels.map((e: any) => ({ posLevelOptionMain.value = listLevel.posLevels.map((e: any) => ({
id: e.id, id: e.id,
@ -630,7 +632,15 @@ onMounted(() => {
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-select <q-input
outlined
dense
lazy-rules
v-model="formDataSalary.positionLine"
hide-bottom-space
:label="`${'สายงาน'}`"
/>
<!-- <q-select
outlined outlined
dense dense
lazy-rules lazy-rules
@ -648,7 +658,7 @@ onMounted(() => {
@filter="(inputValue: any, @filter="(inputValue: any,
doneFn: Function) => filterSelector(inputValue, doneFn, 'positionLine' doneFn: Function) => filterSelector(inputValue, doneFn, 'positionLine'
)" )"
/> /> -->
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
@ -687,7 +697,7 @@ onMounted(() => {
map-options map-options
option-label="name" option-label="name"
:options="posTypeOptions" :options="posTypeOptions"
option-value="id" option-value="name"
hide-bottom-space hide-bottom-space
use-input use-input
input-debounce="0" input-debounce="0"
@ -713,7 +723,7 @@ onMounted(() => {
map-options map-options
option-label="name" option-label="name"
:options="posLevelOption" :options="posLevelOption"
option-value="id" option-value="name"
hide-bottom-space hide-bottom-space
use-input use-input
input-debounce="0" input-debounce="0"

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, reactive, computed } from "vue"; import { ref, watch, onMounted, reactive, computed } from "vue";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore"; import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
@ -238,7 +238,6 @@ const columns = computed(() => {
: []; : [];
return columnsss; return columnsss;
}); });
const visibleColumns = ref<string[]>( const visibleColumns = ref<string[]>(
store.roundMainCode === "APR" store.roundMainCode === "APR"
? ["org", "total", "fifteenPercent", "chosen", "remaining", "totalBackup"] ? ["org", "total", "fifteenPercent", "chosen", "remaining", "totalBackup"]
@ -256,22 +255,22 @@ const visibleColumns = ref<string[]>(
: [] : []
); );
const gruup = ref<string>("กลุ่ม 1"); const isLoad = ref<boolean>(true);
const options = ref(["ทั้งหมด", "กลุ่ม 1", "กลุ่ม 2"]); watch(
() => store.roundMainCode,
() => {
isLoad.value = false;
setTimeout(() => {
isLoad.value = true;
}, 200);
}
);
</script> </script>
<template> <template>
<!-- Card โควต --> <!-- Card โควต -->
<q-toolbar class="q-pa-md">
<q-select <div v-if="isLoad">
dense
outlined
v-model="gruup"
:options="options"
label="กลุ่ม"
style="width: 150px"
/>
</q-toolbar>
<div class="row col-12 q-pa-md bg-grey-2"> <div class="row col-12 q-pa-md bg-grey-2">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div <div
@ -327,12 +326,11 @@ const options = ref(["ทั้งหมด", "กลุ่ม 1", "กลุ่
ref="table" ref="table"
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
row-key="subject" row-key="id"
flat flat
bordered bordered
dense dense
class="custom-header-table" class="custom-header-table"
:visible-columns="visibleColumns"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
@ -352,6 +350,7 @@ const options = ref(["ทั้งหมด", "กลุ่ม 1", "กลุ่
</template> </template>
</d-table> </d-table>
</div> </div>
</div>
</template> </template>
<style scoped></style> <style scoped></style>

View file

@ -256,7 +256,7 @@ const visibleColumns = ref<string[]>(
: [] : []
); );
const gruup = ref<string>("กลุ่ม 1"); const gruup = ref<string>("ทั้งหมด");
const options = ref(["ทั้งหมด", "กลุ่ม 1", "กลุ่ม 2"]); const options = ref(["ทั้งหมด", "กลุ่ม 1", "กลุ่ม 2"]);
</script> </script>
@ -327,12 +327,10 @@ const options = ref(["ทั้งหมด", "กลุ่ม 1", "กลุ่
ref="table" ref="table"
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
row-key="subject" row-key="id"
flat flat
bordered bordered
dense dense
class="custom-header-table"
:visible-columns="visibleColumns"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">

View file

@ -471,7 +471,7 @@ const updateIsShowRetire = async () => {
/> />
</q-tabs> </q-tabs>
<q-separator /> <q-separator />
<q-tab-panels v-model="store.tabGroup" animated class="bg-grey-1"> <q-tab-panels v-model="store.tabGroup" animated class="bg-grey-1 q-pt-md">
<q-tab-panel <q-tab-panel
style="padding: 0px" style="padding: 0px"
v-for="(item, index) in itemsTabGroup" v-for="(item, index) in itemsTabGroup"

View file

@ -206,6 +206,7 @@ async function getAgencyPosition(id: string) {
* @param snap id รอบ * @param snap id รอบ
*/ */
function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) { function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) {
if (rootId !== "ALL") {
showLoader(); showLoader();
isLoad.value = false; isLoad.value = false;
const body = { const body = {
@ -230,6 +231,7 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) {
hideLoader(); hideLoader();
}, 800); }, 800);
}); });
}
} }
/** function เปลี่ยนรอบการขั้นเงินเดือน*/ /** function เปลี่ยนรอบการขั้นเงินเดือน*/
@ -238,9 +240,14 @@ async function onChangeRound() {
store.isClosedRound = roundFilter.value.isClose; store.isClosedRound = roundFilter.value.isClose;
await getSnap(roundFilter.value.shortCode); await getSnap(roundFilter.value.shortCode);
await getAgency(roundFilter.value.revisionId); // await getAgency(roundFilter.value.revisionId);
await getAgencyPosition(roundFilter.value.revisionId); // await getAgencyPosition(roundFilter.value.revisionId);
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
fetchSalalyPeriod(
agencyFilter.value,
roundFilter.value.id,
snapFilter.value
);
store.tabType = "PENDING"; store.tabType = "PENDING";
store.roundMainCode = roundFilter.value.shortCode; store.roundMainCode = roundFilter.value.shortCode;
} else { } else {

View file

@ -206,6 +206,7 @@ async function getAgencyPosition(id: string) {
* @param snap id รอบ * @param snap id รอบ
*/ */
function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) { function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) {
if (rootId !== "ALL") {
showLoader(); showLoader();
isLoad.value = false; isLoad.value = false;
const body = { const body = {
@ -218,6 +219,9 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) {
.post(config.API.salaryListPeriodLatest, body) .post(config.API.salaryListPeriodLatest, body)
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
console.log(roundFilter.value.shortCode);
if (roundFilter.value.shortCode !== "SPECIAL") { if (roundFilter.value.shortCode !== "SPECIAL") {
if (Object.values(data).includes(null)) { if (Object.values(data).includes(null)) {
isLoad.value = false; isLoad.value = false;
@ -240,6 +244,7 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) {
hideLoader(); hideLoader();
}, 800); }, 800);
}); });
}
} }
/** function เปลี่ยนรอบการขั้นเงินเดือน*/ /** function เปลี่ยนรอบการขั้นเงินเดือน*/
@ -249,15 +254,15 @@ async function onChangeRound() {
if (roundFilter.value.shortCode === "SPECIAL") { if (roundFilter.value.shortCode === "SPECIAL") {
store.tabGroup = "group1"; store.tabGroup = "group1";
} }
await getSnap(roundFilter.value.shortCode); getSnap(roundFilter.value.shortCode);
await getAgency(roundFilter.value.revisionId); // await getAgency(roundFilter.value.revisionId);
await getAgencyPosition(roundFilter.value.revisionId); // await getAgencyPosition(roundFilter.value.revisionId);
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
// await fetchSalalyPeriod( fetchSalalyPeriod(
// agencyFilter.value, agencyFilter.value,
// roundFilter.value.id, roundFilter.value.id,
// snapFilter.value snapFilter.value
// ); );
store.tabType = "PENDING"; store.tabType = "PENDING";
store.roundMainCode = roundFilter.value.shortCode; store.roundMainCode = roundFilter.value.shortCode;
store.roundYear = roundFilter.value.year; store.roundYear = roundFilter.value.year;