fix bug
This commit is contained in:
parent
5246a694d4
commit
53fc2493e3
9 changed files with 100 additions and 45 deletions
|
|
@ -344,8 +344,6 @@ async function getActive() {
|
|||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -898,37 +898,6 @@ onMounted(async () => {
|
|||
>
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||
<q-list dense style="min-width: 180px">
|
||||
<q-item
|
||||
v-if="
|
||||
roleAdmin &&
|
||||
props.row.draft !== 'ส่งตัวแล้ว' &&
|
||||
props.row.statusId !== 'DISCLAIM'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
openAppointModal(
|
||||
props.row.personalId,
|
||||
props.row,
|
||||
'APPOINTED'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="primary"
|
||||
size="xs"
|
||||
name="mdi-bookmark-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section
|
||||
>เลือกหน่วยงานที่รับบรรจุและแต่งตั้ง</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="
|
||||
props.row.nodeName !== null &&
|
||||
|
|
@ -1010,6 +979,38 @@ onMounted(async () => {
|
|||
<q-item-section>เลือกหน่วยงานที่รับแต่งตั้ง</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-if="
|
||||
roleAdmin &&
|
||||
props.row.draft !== 'ส่งตัวแล้ว' &&
|
||||
props.row.statusId !== 'DISCLAIM'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
openAppointModal(
|
||||
props.row.personalId,
|
||||
props.row,
|
||||
'APPOINTED'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="primary"
|
||||
size="xs"
|
||||
name="mdi-bookmark-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section
|
||||
>เลือกหน่วยงานที่รับบรรจุและแต่งตั้ง</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-if="
|
||||
props.row.bmaOfficer !== 'บุคคลภายนอก' &&
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||
return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -78,7 +78,11 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return row.positionTypeOld + " (" + row.positionLevelOld + ")";
|
||||
return row.positionTypeOld
|
||||
? `${row.positionTypeOld}${
|
||||
row.positionLevelOld ? `(${row.positionLevelOld})` : ""
|
||||
}`
|
||||
: "";
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -257,6 +261,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
|
||||
<div v-else>
|
||||
{{}}
|
||||
{{
|
||||
col.value == null ? "" : col.value == "" ? "-" : col.value
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ onMounted(async () => {
|
|||
<q-separator />
|
||||
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
||||
<q-select
|
||||
class="col-10"
|
||||
class="col-10 inputgreen"
|
||||
dense
|
||||
outlined
|
||||
v-model="roundInsig"
|
||||
|
|
@ -236,7 +236,7 @@ onMounted(async () => {
|
|||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="yearly"
|
||||
class="col-2"
|
||||
class="col-2 inputgreen"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
|
|
@ -271,7 +271,7 @@ onMounted(async () => {
|
|||
v-model="dateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
class="col-xs-12 col-sm-5"
|
||||
class="col-xs-12 col-sm-5 inputgreen"
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
|
|
@ -307,7 +307,7 @@ onMounted(async () => {
|
|||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateEnd"
|
||||
class="col-xs-12 col-sm-5"
|
||||
class="col-xs-12 col-sm-5 inputgreen"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
|
|
@ -344,7 +344,7 @@ onMounted(async () => {
|
|||
</datepicker>
|
||||
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-2"
|
||||
class="col-xs-12 col-sm-2 inputgreen"
|
||||
dense
|
||||
outlined
|
||||
v-model="datelast"
|
||||
|
|
@ -358,7 +358,7 @@ onMounted(async () => {
|
|||
/>
|
||||
|
||||
<q-file
|
||||
class="col-xs-12 col-sm-10"
|
||||
class="col-xs-12 col-sm-10 inputgreen"
|
||||
outlined
|
||||
dense
|
||||
v-model="files"
|
||||
|
|
|
|||
|
|
@ -922,6 +922,7 @@ onMounted(async () => {
|
|||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
:disable="DataStore.employeeClass === 'all'|| DataStore.typeinsignia === 'all'"
|
||||
size="md"
|
||||
icon="mdi-download"
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -90,6 +90,9 @@ async function fetchLeaveday(
|
|||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ interface dataPost {
|
|||
cardId: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
interface DataOption {
|
||||
|
|
|
|||
|
|
@ -127,6 +127,10 @@ export const useChangeRoundDataStore = defineStore(
|
|||
console.log(profileId);
|
||||
profileId.value = id;
|
||||
}
|
||||
|
||||
const maxPageMain = ref<number>(0);
|
||||
const totalListMain = ref<number>(0);
|
||||
|
||||
function fetchDataForCardId(dataDetail: any) {
|
||||
if (dataDetail) {
|
||||
showLoader();
|
||||
|
|
@ -141,6 +145,10 @@ export const useChangeRoundDataStore = defineStore(
|
|||
})
|
||||
.then((res) => {
|
||||
const apiData = res.data.result.data;
|
||||
totalListMain.value = res.data.result.total;
|
||||
maxPageMain.value = Math.ceil(
|
||||
totalListMain.value / dataDetail.pageSize
|
||||
);
|
||||
if (apiData.length > 0) {
|
||||
checkCilck.value = false;
|
||||
rows.value = apiData.map((e: any) => ({
|
||||
|
|
@ -238,6 +246,9 @@ export const useChangeRoundDataStore = defineStore(
|
|||
changePage,
|
||||
total,
|
||||
maxPage,
|
||||
|
||||
totalListMain,
|
||||
maxPageMain,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import { ref, watch, reactive } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -38,6 +38,8 @@ const formData = reactive<dataPost>({
|
|||
cardId: "",
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
@ -88,7 +90,7 @@ function closeDialog() {
|
|||
modalFix.value = false;
|
||||
}
|
||||
|
||||
function save() {
|
||||
function save() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -102,12 +104,28 @@ function save() {
|
|||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
closeDialog();
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function updatePagination
|
||||
* @param newPagination ข้อมูล Pagination ใหม่
|
||||
*/
|
||||
function updatePagination(newPagination: any) {
|
||||
formData.page = 1;
|
||||
formData.pageSize = newPagination.rowsPerPage;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => formData.pageSize,
|
||||
() => {
|
||||
searchData();
|
||||
}
|
||||
);
|
||||
|
||||
/** Function ค้นหาข้อมูล */
|
||||
function searchData() {
|
||||
if (formData.cardId || formData.firstName || formData.lastName) {
|
||||
|
|
@ -154,7 +172,7 @@ function searchData() {
|
|||
hide-bottom-space
|
||||
/>
|
||||
<q-btn
|
||||
@click="searchData"
|
||||
@click="(formData.page = 1), searchData()"
|
||||
for="#search"
|
||||
dense
|
||||
unelevated
|
||||
|
|
@ -185,6 +203,8 @@ function searchData() {
|
|||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="dataStore.visibleColumns"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
@update:pagination="updatePagination"
|
||||
>
|
||||
<!-- :paging="true" -->
|
||||
<template v-slot:header="props">
|
||||
|
|
@ -254,6 +274,20 @@ function searchData() {
|
|||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ dataStore.totalListMain }} รายการ
|
||||
<q-pagination
|
||||
v-model="formData.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="Number(dataStore.maxPageMain)"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
:max-pages="5"
|
||||
@update:model-value="dataStore.fetchDataForCardId(formData)"
|
||||
></q-pagination>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue