รายการเลื่อนเงินเดือนข้าราชการ ฯ => ปรับ 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,6 +67,7 @@ const nodeData = reactive<any>({
|
||||||
});
|
});
|
||||||
|
|
||||||
function fetchList() {
|
function fetchList() {
|
||||||
|
if (nodeData.nodeId) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.post(config.API.kpiPlan + `/search`, {
|
.post(config.API.kpiPlan + `/search`, {
|
||||||
|
|
@ -89,6 +91,7 @@ function fetchList() {
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
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,11 +225,10 @@ 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">
|
<div class="row q-gutter-sm no-wrap q-mb-sm">
|
||||||
<q-select
|
<q-select
|
||||||
dense
|
dense
|
||||||
:model-value="formFilter.position"
|
v-model="formFilter.position"
|
||||||
label="ตำแหน่ง"
|
label="ตำแหน่ง"
|
||||||
outlined
|
outlined
|
||||||
emit-value
|
emit-value
|
||||||
|
|
@ -261,21 +240,19 @@ onMounted(async () => {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
:options="positionOp"
|
:options="positionOp"
|
||||||
use-input
|
use-input
|
||||||
@input-value="setModel"
|
|
||||||
@filter="(inputValue:any,doneFn:Function) => filterOption(inputValue, doneFn) "
|
@filter="(inputValue:any,doneFn:Function) => filterOption(inputValue, doneFn) "
|
||||||
@update:model-value="fetchList"
|
@update:model-value="(formFilter.page = 1), fetchList()"
|
||||||
>
|
>
|
||||||
<template v-slot:no-option>
|
<template v-slot:no-option>
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="formFilter.position" v-slot:append>
|
<template v-if="formFilter.position !== ''" v-slot:append>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="cancel"
|
name="cancel"
|
||||||
@click.stop.prevent="
|
@click.stop.prevent="
|
||||||
formFilter.position = '';
|
(formFilter.position = ''), (formFilter.page = 1), fetchList()
|
||||||
fetchList();
|
|
||||||
"
|
"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
/>
|
/>
|
||||||
|
|
@ -338,13 +315,15 @@ onMounted(async () => {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
@update:model-value="fetchList"
|
@update:model-value="(formFilter.page = 1), fetchList()"
|
||||||
style="width: 160px"
|
style="width: 160px"
|
||||||
>
|
>
|
||||||
<template v-if="formFilter.round" v-slot:append>
|
<template v-if="formFilter.round !== ''" v-slot:append>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="cancel"
|
name="cancel"
|
||||||
@click.stop.prevent="(formFilter.round = ''), fetchList()"
|
@click.stop.prevent="
|
||||||
|
(formFilter.round = ''), (formFilter.page = 1), fetchList()
|
||||||
|
"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -370,7 +349,7 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
debounce="300"
|
debounce="300"
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
@keyup.enter="fetchList()"
|
@keyup.enter="(formFilter.page = 1), fetchList()"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
||||||
|
|
@ -399,7 +378,6 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<d-table
|
<d-table
|
||||||
for="table"
|
for="table"
|
||||||
|
|
|
||||||
|
|
@ -332,14 +332,21 @@ function onClickDownload(data: DataOption) {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (props.rootId && props.periodId) {
|
if (props.rootId && props.periodId) {
|
||||||
http
|
const url = config.API.salaryReportListsByid(
|
||||||
.get(
|
|
||||||
config.API.salaryReportListsByid(
|
|
||||||
data.id,
|
data.id,
|
||||||
props.rootId,
|
props.rootId,
|
||||||
props.periodId
|
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
|
||||||
|
.get(finalUrl)
|
||||||
.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