(1);
-function fetchRoundOption() {
+function fetchRoundOption(type: boolean = false) {
showLoader();
http
.get(
config.API.kpiPeriod +
- `?page=${1}&pageSize=${10}&keyword=${""}&year=${year.value}`
+ `?page=${1}&pageSize=${10}&keyword=${""}&year=${store.yearRound}`
)
.then((res) => {
const data = res.data.result.data;
@@ -108,7 +103,9 @@ function fetchRoundOption() {
: "",
}));
roundOp.value = list;
- round.value = "";
+ if (type) {
+ store.formQuery.round = "";
+ }
fetchList();
})
.catch((err) => {
@@ -121,15 +118,44 @@ function fetchRoundOption() {
function fetchList() {
showLoader();
+ const formTab1 = {
+ page: store.formQuery.page,
+ pageSize: store.formQuery.pageSize,
+ kpiPeriodId: store.formQuery.round,
+ keyword: store.formQuery.keyword,
+ };
+ const formTab2 = {
+ page: store.formQuery.page,
+ pageSize: store.formQuery.pageSize,
+ kpiPeriodId: store.formQuery.round,
+ keyword: store.formQuery.keyword,
+ status: "NEW_EVALUATOR",
+ };
+
+ const formTab3 = {
+ page: store.formQuery.page,
+ pageSize: store.formQuery.pageSize,
+ kpiPeriodId: store.formQuery.round,
+ keyword: store.formQuery.keyword,
+ reqedit: "EVALUATOR",
+ };
+
+ const body =
+ store.tabMainevaluator === "1"
+ ? formTab1
+ : store.tabMainevaluator === "2"
+ ? formTab2
+ : store.tabMainevaluator === "3"
+ ? formTab3
+ : "";
+
http
- .get(
- config.API.kpiEvaluation +
- `/admin?page=${formQuery.page}&pageSize=${formQuery.pageSize}&kpiPeriodId=${round.value}&keyword=${filterKeyword.value}`
- )
+ .post(config.API.kpiEvaluation + `/admin`, body)
.then((res) => {
const data = res.data.result;
- totalList.value = Math.ceil(data.total / formQuery.pageSize);
- rows.value = data.data;
+ maxPage.value = Math.ceil(data.total / store.formQuery.pageSize);
+ totalList.value = data.total;
+ dataListMain.value = data.data;
})
.catch((err) => {
messageError($q, err);
@@ -140,37 +166,31 @@ function fetchList() {
}
function changRound() {
- formQuery.page = 1;
+ store.formQuery.page = 1;
fetchList();
}
-function redirectViewDetail(id: string) {
- router.push(`/KPI-evaluator/${id}`);
-}
-
/**
* function updatePagination
* @param newPagination ข้อมูล Pagination ใหม่
*/
function updatePagination(newPagination: any) {
- formQuery.page = 1;
- formQuery.pageSize = newPagination.rowsPerPage;
+ store.formQuery.page = 1;
+ store.formQuery.pageSize = newPagination.rowsPerPage;
}
-const pagination = ref({
- sortBy: "desc",
- descending: false,
- page: 1,
- rowsPerPage: 10,
-});
-
watch(
- () => formQuery.pageSize,
+ () => store.formQuery.pageSize,
() => {
fetchList();
}
);
+function onChangTab() {
+ store.formQuery.page = 1;
+ fetchList();
+}
+
onMounted(async () => {
fetchRoundOption();
});
@@ -198,12 +218,12 @@ onMounted(async () => {
{{ year + 543 }}
{{
@@ -214,9 +234,10 @@ onMounted(async () => {
dense
lazy-rules
outlined
- class="inputgreen"
hide-bottom-space
- :model-value="!!year ? year + 543 : null"
+ :model-value="
+ !!store.yearRound ? store.yearRound + 543 : null
+ "
:label="`${'ปีงบประมาณ'}`"
>
@@ -232,7 +253,7 @@ onMounted(async () => {
{
@@ -282,7 +303,75 @@ onMounted(async () => {
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -351,45 +440,4 @@ onMounted(async () => {
.icon-color {
color: #4154b3;
}
-
-.custom-table2 {
- max-height: 64vh;
-
- .q-table tr:nth-child(odd) td {
- background: white;
- }
-
- .q-table tr:nth-child(even) td {
- background: #f8f8f8;
- }
-
- .q-table thead tr {
- background: #ecebeb;
- }
-
- .q-table thead tr th {
- position: sticky;
- }
-
- .q-table td:nth-of-type(2) {
- z-index: 3 !important;
- }
-
- .q-table th:nth-of-type(2),
- .q-table td:nth-of-type(2) {
- position: sticky;
- left: 0;
- z-index: 1;
- }
-
- /* this will be the loading indicator */
- .q-table thead tr:last-child th {
- /* height of all previous header rows */
- top: 48px;
- }
-
- .q-table thead tr:first-child th {
- top: 0;
- }
-}