รายการเลื่อนเงินเดือนข้าราชการ ฯ => ปรับ API Report
This commit is contained in:
parent
0c3cd367c3
commit
cee77d4ac6
4 changed files with 196 additions and 209 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
divdivdivdivdivdivdiv
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { QForm, useQuasar } from "quasar";
|
import { QForm, useQuasar } from "quasar";
|
||||||
|
|
@ -273,6 +272,7 @@ onMounted(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ const filterMain = ref<string>("");
|
||||||
const visibleColumns = ref<string[]>(["including", "includingName"]);
|
const visibleColumns = ref<string[]>(["including", "includingName"]);
|
||||||
|
|
||||||
const roundOp = ref<DataOption[]>([
|
const roundOp = ref<DataOption[]>([
|
||||||
|
{ id: "", name: "ทั้งหมด" },
|
||||||
{ id: "APR", name: "รอบเมษายน" },
|
{ id: "APR", name: "รอบเมษายน" },
|
||||||
{ id: "OCT", name: "รอบตุลาคม" },
|
{ id: "OCT", name: "รอบตุลาคม" },
|
||||||
]);
|
]);
|
||||||
|
|
@ -66,29 +67,31 @@ const nodeData = reactive<any>({
|
||||||
});
|
});
|
||||||
|
|
||||||
function fetchList() {
|
function fetchList() {
|
||||||
showLoader();
|
if (nodeData.nodeId) {
|
||||||
http
|
showLoader();
|
||||||
.post(config.API.kpiPlan + `/search`, {
|
http
|
||||||
isAll: isAll.value,
|
.post(config.API.kpiPlan + `/search`, {
|
||||||
keyword: nodeData.keyword,
|
isAll: isAll.value,
|
||||||
node: nodeData.node ? nodeData.node : 0,
|
keyword: nodeData.keyword,
|
||||||
nodeId: nodeData.nodeId,
|
node: nodeData.node ? nodeData.node : 0,
|
||||||
period: nodeData.round,
|
nodeId: nodeData.nodeId,
|
||||||
year: year.value?.toString(),
|
period: nodeData.round,
|
||||||
pageSize: nodeData.pageSize,
|
year: year.value?.toString(),
|
||||||
page: nodeData.page,
|
pageSize: nodeData.pageSize,
|
||||||
})
|
page: nodeData.page,
|
||||||
.then((res) => {
|
})
|
||||||
const data = res.data.result.data;
|
.then((res) => {
|
||||||
totalList.value = Math.ceil(res.data.result.total / nodeData.pageSize);
|
const data = res.data.result.data;
|
||||||
rows.value = data;
|
totalList.value = Math.ceil(res.data.result.total / nodeData.pageSize);
|
||||||
})
|
rows.value = data;
|
||||||
.catch((err) => {
|
})
|
||||||
messageError($q, err);
|
.catch((err) => {
|
||||||
})
|
messageError($q, err);
|
||||||
.finally(() => {
|
})
|
||||||
hideLoader();
|
.finally(() => {
|
||||||
});
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClickAddOrView(status: boolean = false, id: string = "") {
|
function onClickAddOrView(status: boolean = false, id: string = "") {
|
||||||
|
|
@ -187,9 +190,8 @@ function onClickHistory(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(() => {
|
||||||
await fetchActive();
|
fetchActive();
|
||||||
// await fetchList();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,24 +25,14 @@ const router = useRouter();
|
||||||
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
||||||
useCounterMixin();
|
useCounterMixin();
|
||||||
|
|
||||||
const positionOp = ref<DataOption[]>([]);
|
const positionOp = ref<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
|
||||||
const positionMainOp = ref<DataOption[]>([]);
|
const positionMainOp = ref<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
|
||||||
|
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
const totalList = ref<number>(1); //จำนวนข้อมูลรายการ
|
|
||||||
|
|
||||||
/** หัวตาราง */
|
/** หัวตาราง */
|
||||||
const rows = ref<any>([]);
|
const rows = ref<any>([]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
// {
|
|
||||||
// name: "no",
|
|
||||||
// align: "left",
|
|
||||||
// label: "ลำดับตัวชี้วัด ",
|
|
||||||
// sortable: true,
|
|
||||||
// field: "no",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
name: "including",
|
name: "including",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -79,6 +69,7 @@ const pagination = ref({
|
||||||
|
|
||||||
/** Option รอบการประเมิน*/
|
/** Option รอบการประเมิน*/
|
||||||
const roundOp = ref<DataOption[]>([
|
const roundOp = ref<DataOption[]>([
|
||||||
|
{ id: "", name: "ทั้งหมด" },
|
||||||
{ id: "APR", name: "รอบเมษายน" },
|
{ id: "APR", name: "รอบเมษายน" },
|
||||||
{ id: "OCT", name: "รอบตุลาคม" },
|
{ id: "OCT", name: "รอบตุลาคม" },
|
||||||
]);
|
]);
|
||||||
|
|
@ -173,6 +164,7 @@ function getOptions() {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const dataOp = res.data.result;
|
const dataOp = res.data.result;
|
||||||
const uniqueNames = new Set();
|
const uniqueNames = new Set();
|
||||||
|
|
||||||
const filteredData = dataOp
|
const filteredData = dataOp
|
||||||
.filter((item: any) => {
|
.filter((item: any) => {
|
||||||
if (!uniqueNames.has(item.positionName)) {
|
if (!uniqueNames.has(item.positionName)) {
|
||||||
|
|
@ -186,7 +178,8 @@ function getOptions() {
|
||||||
name: item.positionName,
|
name: item.positionName,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
positionMainOp.value = filteredData;
|
positionMainOp.value.push(...filteredData);
|
||||||
|
positionOp.value.push(...filteredData);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -196,19 +189,6 @@ function getOptions() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function statusTothai(val: string) {
|
|
||||||
switch (val) {
|
|
||||||
case "SPECIAL":
|
|
||||||
return "รอบพิเศษ";
|
|
||||||
case "APR":
|
|
||||||
return "รอบเมษายน";
|
|
||||||
case "OCT":
|
|
||||||
return "รอบตุลาคม";
|
|
||||||
default:
|
|
||||||
return "-";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setModel(val: string) {
|
function setModel(val: string) {
|
||||||
formFilter.position = val;
|
formFilter.position = val;
|
||||||
}
|
}
|
||||||
|
|
@ -245,160 +225,158 @@ onMounted(async () => {
|
||||||
รายการตัวชี้วัดตามตำแหน่ง
|
รายการตัวชี้วัดตามตำแหน่ง
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="q-pa-md">
|
<q-card flat bordered class="q-pa-md">
|
||||||
|
<div class="row q-gutter-sm no-wrap q-mb-sm">
|
||||||
|
<q-select
|
||||||
|
dense
|
||||||
|
v-model="formFilter.position"
|
||||||
|
label="ตำแหน่ง"
|
||||||
|
outlined
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
fill-input
|
||||||
|
hide-selected
|
||||||
|
hide-bottom-space
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
:options="positionOp"
|
||||||
|
use-input
|
||||||
|
@filter="(inputValue:any,doneFn:Function) => filterOption(inputValue, doneFn) "
|
||||||
|
@update:model-value="(formFilter.page = 1), fetchList()"
|
||||||
|
>
|
||||||
|
<template v-slot:no-option>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
<template v-if="formFilter.position !== ''" v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
name="cancel"
|
||||||
|
@click.stop.prevent="
|
||||||
|
(formFilter.position = ''), (formFilter.page = 1), fetchList()
|
||||||
|
"
|
||||||
|
class="cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
|
|
||||||
<div class="row q-gutter-sm no-wrap q-mb-sm">
|
<datepicker
|
||||||
<q-select
|
style="width: 150px"
|
||||||
dense
|
menu-class-name="modalfix"
|
||||||
:model-value="formFilter.position"
|
v-model="formFilter.year"
|
||||||
label="ตำแหน่ง"
|
:locale="'th'"
|
||||||
outlined
|
autoApply
|
||||||
emit-value
|
year-picker
|
||||||
map-options
|
:enableTimePicker="false"
|
||||||
fill-input
|
@update:model-value="(formFilter.page = 1), fetchList()"
|
||||||
hide-selected
|
>
|
||||||
hide-bottom-space
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
option-label="name"
|
<template #year-overlay-value="{ value }">{{
|
||||||
option-value="id"
|
parseInt(value + 543)
|
||||||
:options="positionOp"
|
}}</template>
|
||||||
use-input
|
<template #trigger>
|
||||||
@input-value="setModel"
|
<q-input
|
||||||
@filter="(inputValue:any,doneFn:Function) => filterOption(inputValue, doneFn) "
|
dense
|
||||||
@update:model-value="fetchList"
|
outlined
|
||||||
>
|
:model-value="
|
||||||
<template v-slot:no-option>
|
formFilter.year === null
|
||||||
<q-item>
|
? 'ทั้งหมด'
|
||||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
: Number(formFilter.year) + 543
|
||||||
</q-item>
|
"
|
||||||
</template>
|
:label="`${'ปีงบประมาณ'}`"
|
||||||
<template v-if="formFilter.position" v-slot:append>
|
>
|
||||||
<q-icon
|
<template v-slot:prepend>
|
||||||
name="cancel"
|
<q-icon
|
||||||
@click.stop.prevent="
|
name="event"
|
||||||
formFilter.position = '';
|
class="cursor-pointer"
|
||||||
fetchList();
|
style="color: var(--q-primary)"
|
||||||
"
|
>
|
||||||
class="cursor-pointer"
|
</q-icon>
|
||||||
/>
|
</template>
|
||||||
</template>
|
<template v-if="formFilter.year" v-slot:append>
|
||||||
</q-select>
|
<q-icon
|
||||||
|
name="cancel"
|
||||||
|
@click.stop.prevent="
|
||||||
|
(formFilter.year = null), (formFilter.page = 1), fetchList()
|
||||||
|
"
|
||||||
|
class="cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
|
||||||
<datepicker
|
<q-select
|
||||||
style="width: 150px"
|
dense
|
||||||
menu-class-name="modalfix"
|
outlined
|
||||||
v-model="formFilter.year"
|
v-model="formFilter.round"
|
||||||
:locale="'th'"
|
:options="roundOp"
|
||||||
autoApply
|
label="รอบการประเมิน"
|
||||||
year-picker
|
option-label="name"
|
||||||
:enableTimePicker="false"
|
option-value="id"
|
||||||
@update:model-value="(formFilter.page = 1), fetchList()"
|
emit-value
|
||||||
>
|
map-options
|
||||||
<template #year="{ year }">{{ year + 543 }}</template>
|
@update:model-value="(formFilter.page = 1), fetchList()"
|
||||||
<template #year-overlay-value="{ value }">{{
|
style="width: 160px"
|
||||||
parseInt(value + 543)
|
>
|
||||||
}}</template>
|
<template v-if="formFilter.round !== ''" v-slot:append>
|
||||||
<template #trigger>
|
<q-icon
|
||||||
<q-input
|
name="cancel"
|
||||||
dense
|
@click.stop.prevent="
|
||||||
outlined
|
(formFilter.round = ''), (formFilter.page = 1), fetchList()
|
||||||
:model-value="
|
"
|
||||||
formFilter.year === null
|
class="cursor-pointer"
|
||||||
? 'ทั้งหมด'
|
/>
|
||||||
: Number(formFilter.year) + 543
|
</template>
|
||||||
"
|
</q-select>
|
||||||
:label="`${'ปีงบประมาณ'}`"
|
|
||||||
>
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<q-icon
|
|
||||||
name="event"
|
|
||||||
class="cursor-pointer"
|
|
||||||
style="color: var(--q-primary)"
|
|
||||||
>
|
|
||||||
</q-icon>
|
|
||||||
</template>
|
|
||||||
<template v-if="formFilter.year" v-slot:append>
|
|
||||||
<q-icon
|
|
||||||
name="cancel"
|
|
||||||
@click.stop.prevent="
|
|
||||||
(formFilter.year = null), (formFilter.page = 1), fetchList()
|
|
||||||
"
|
|
||||||
class="cursor-pointer"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
</template>
|
|
||||||
</datepicker>
|
|
||||||
|
|
||||||
<q-select
|
<q-btn
|
||||||
dense
|
flat
|
||||||
outlined
|
round
|
||||||
v-model="formFilter.round"
|
dense
|
||||||
:options="roundOp"
|
icon="add"
|
||||||
label="รอบการประเมิน"
|
color="primary"
|
||||||
option-label="name"
|
@click="onClickAddOrView()"
|
||||||
option-value="id"
|
>
|
||||||
emit-value
|
<q-tooltip>เพิ่ม</q-tooltip>
|
||||||
map-options
|
</q-btn>
|
||||||
@update:model-value="fetchList"
|
|
||||||
style="width: 160px"
|
|
||||||
>
|
|
||||||
<template v-if="formFilter.round" v-slot:append>
|
|
||||||
<q-icon
|
|
||||||
name="cancel"
|
|
||||||
@click.stop.prevent="(formFilter.round = ''), fetchList()"
|
|
||||||
class="cursor-pointer"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</q-select>
|
|
||||||
|
|
||||||
<q-btn
|
<q-space />
|
||||||
flat
|
<q-input
|
||||||
round
|
standout
|
||||||
dense
|
dense
|
||||||
icon="add"
|
v-model="formFilter.keyword"
|
||||||
color="primary"
|
ref="filterRef"
|
||||||
@click="onClickAddOrView()"
|
outlined
|
||||||
>
|
debounce="300"
|
||||||
<q-tooltip>เพิ่ม</q-tooltip>
|
placeholder="ค้นหา"
|
||||||
</q-btn>
|
@keyup.enter="(formFilter.page = 1), fetchList()"
|
||||||
|
>
|
||||||
<q-space />
|
<template v-slot:append>
|
||||||
<q-input
|
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
||||||
standout
|
<q-icon
|
||||||
dense
|
v-if="formFilter.keyword !== ''"
|
||||||
v-model="formFilter.keyword"
|
name="clear"
|
||||||
ref="filterRef"
|
class="cursor-pointer"
|
||||||
outlined
|
@click="formFilter.keyword = ''"
|
||||||
debounce="300"
|
/>
|
||||||
placeholder="ค้นหา"
|
</template>
|
||||||
@keyup.enter="fetchList()"
|
</q-input>
|
||||||
>
|
|
||||||
<template v-slot:append>
|
|
||||||
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
|
||||||
<q-icon
|
|
||||||
v-if="formFilter.keyword !== ''"
|
|
||||||
name="clear"
|
|
||||||
class="cursor-pointer"
|
|
||||||
@click="formFilter.keyword = ''"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
|
|
||||||
<q-select
|
|
||||||
v-model="visibleColumns"
|
|
||||||
multiple
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
options-dense
|
|
||||||
:display-value="$q.lang.table.columns"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
:options="columns"
|
|
||||||
option-value="name"
|
|
||||||
options-cover
|
|
||||||
style="min-width: 150px"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<q-select
|
||||||
|
v-model="visibleColumns"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
options-dense
|
||||||
|
:display-value="$q.lang.table.columns"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:options="columns"
|
||||||
|
option-value="name"
|
||||||
|
options-cover
|
||||||
|
style="min-width: 150px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<d-table
|
<d-table
|
||||||
|
|
|
||||||
|
|
@ -332,14 +332,21 @@ function onClickDownload(data: DataOption) {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (props.rootId && props.periodId) {
|
if (props.rootId && props.periodId) {
|
||||||
|
const url = config.API.salaryReportListsByid(
|
||||||
|
data.id,
|
||||||
|
props.rootId,
|
||||||
|
props.periodId
|
||||||
|
);
|
||||||
|
|
||||||
|
const isGovernmentId =
|
||||||
|
data.id === "gov-01" ||
|
||||||
|
data.id === "gov-04" ||
|
||||||
|
data.id === "gov-05" ||
|
||||||
|
data.id === "gov-07";
|
||||||
|
|
||||||
|
const finalUrl = isGovernmentId ? `${url}/${store.tabGroup}` : url;
|
||||||
http
|
http
|
||||||
.get(
|
.get(finalUrl)
|
||||||
config.API.salaryReportListsByid(
|
|
||||||
data.id,
|
|
||||||
props.rootId,
|
|
||||||
props.periodId
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const dataList = res.data.result;
|
const dataList = res.data.result;
|
||||||
genReportXLSX(dataList, data.name);
|
genReportXLSX(dataList, data.name);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue