Refactoring code module 08_KPI
This commit is contained in:
parent
3636f380fb
commit
67d117dcfc
48 changed files with 989 additions and 1140 deletions
|
|
@ -2,10 +2,13 @@
|
|||
import { ref, onMounted, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
DataOptions,
|
||||
Pagination,
|
||||
|
|
@ -18,9 +21,6 @@ import type {
|
|||
import TabAll from "@/modules/08_KPI/components/Evaluator/01_TabAll.vue";
|
||||
import TabOther from "@/modules/08_KPI/components/Evaluator/02_TabOther.vue";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const store = useKpiDataStore();
|
||||
|
|
@ -89,6 +89,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
const totalList = ref<number>(0);
|
||||
const maxPage = ref<number>(1);
|
||||
|
||||
/**
|
||||
* ดึงข้อมูลรายการขอรับประเมินผลการปฏิบัติราชการระดับบุคคล
|
||||
* @param type
|
||||
*/
|
||||
async function fetchRoundOption(type: boolean = false) {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -121,6 +125,7 @@ async function fetchRoundOption(type: boolean = false) {
|
|||
});
|
||||
}
|
||||
|
||||
/** ดึงข้อมูล list */
|
||||
async function fetchList() {
|
||||
showLoader();
|
||||
const body = {
|
||||
|
|
@ -157,6 +162,7 @@ async function fetchList() {
|
|||
});
|
||||
}
|
||||
|
||||
/** เลือกรอบการประเมิน */
|
||||
function changRound() {
|
||||
store.formQuery.page = 1;
|
||||
fetchList();
|
||||
|
|
@ -171,13 +177,7 @@ function updatePagination(newPagination: Pagination) {
|
|||
store.formQuery.pageSize = newPagination.rowsPerPage;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => store.formQuery.pageSize,
|
||||
() => {
|
||||
fetchList();
|
||||
}
|
||||
);
|
||||
|
||||
/** เปลี่ยน tab */
|
||||
async function onChangTab() {
|
||||
store.formQuery.page = 1;
|
||||
dataListMain.value = [];
|
||||
|
|
@ -185,6 +185,13 @@ async function onChangTab() {
|
|||
await fetchList();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => store.formQuery.pageSize,
|
||||
() => {
|
||||
fetchList();
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchRoundOption();
|
||||
});
|
||||
|
|
@ -313,19 +320,8 @@ onMounted(async () => {
|
|||
label="รออนุมัติแก้ไขข้อตกลง"
|
||||
@click="onChangTab"
|
||||
/>
|
||||
<!-- <q-tab
|
||||
name="4"
|
||||
label="อนุมัติเพื่อเริ่มประเมิน"
|
||||
@click="onChangTab"
|
||||
/> -->
|
||||
<q-tab name="5" label="รายงานผลสำเร็จ" @click="onChangTab" />
|
||||
<q-tab name="6" label="สรุปผลการประเมิน" @click="onChangTab" />
|
||||
<!-- <q-tab
|
||||
name="6"
|
||||
label="รายงานผลสำเร็จ"
|
||||
onChangTab
|
||||
@click="onChangTab"
|
||||
/> -->
|
||||
</q-tabs>
|
||||
<q-separator />
|
||||
|
||||
|
|
@ -369,19 +365,6 @@ onMounted(async () => {
|
|||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
<!-- <q-tab-panel name="4">
|
||||
<TabOther
|
||||
:columns="columns"
|
||||
:visibleColumns="visibleColumns"
|
||||
:rows="dataListMain"
|
||||
:formQuery="store.formQuery"
|
||||
:total="totalList"
|
||||
:maxPage="maxPage"
|
||||
:updatePagination="updatePagination"
|
||||
:fetchList="fetchList"
|
||||
/>
|
||||
</q-tab-panel> -->
|
||||
|
||||
<q-tab-panel name="5">
|
||||
<TabOther
|
||||
:columns="columns"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue