fix loading Skeleton

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-08-05 15:15:49 +07:00
parent ff6101067e
commit 016132096e
63 changed files with 3468 additions and 3452 deletions

View file

@ -1,19 +1,20 @@
<script setup lang="ts">
import { ref, reactive, onMounted, computed } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar, type QTableColumn, type QTableProps } from "quasar";
import { is, useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
/** import Type */
import type { InformationData } from "@/interface/Main";
const link = ref<string>("");
/** import Component */
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const $q = useQuasar();
const dataStore = useDataStore();
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
@ -21,16 +22,23 @@ const {
date2Thai,
dialogConfirm,
success,
} = mixin;
const editPhone = ref<boolean>(false);
const editEmail = ref<boolean>(false);
const rowsHistory = ref<any[]>([]);
const rowsHistoryData = ref<any[]>([]);
const modalHistory = ref<boolean>(false);
const phone = ref<string>("");
const email = ref<string>("");
} = useCounterMixin();
const link = ref<string>(""); // link
const editPhone = ref<boolean>(false); //
const editEmail = ref<boolean>(false); //
const rowsHistory = ref<any[]>([]); //
const rowsHistoryData = ref<any[]>([]); // ( filter)
const modalHistory = ref<boolean>(false); // modal
const phone = ref<string>(""); //
const email = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const mainEmail = ref<string>(""); //
const mainPhone = ref<string>(""); //
const isValidPhone = ref<boolean>(true); // validate
const isValidEmail = ref<boolean>(true); // validate
const emailVerify = ref<string | null>(null); //
/** ตัวแปรข้อมูล */
const formDataInformation = reactive<InformationData>({
rank: "", //
@ -48,8 +56,6 @@ const formDataInformation = reactive<InformationData>({
phone: "", //
email: "",
});
const emailVerify = ref<string | null>(null);
const visibleColumnsHistory = ref<string[]>([
"citizenId",
"prefix",
@ -237,27 +243,19 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
function onHistory() {
modalHistory.value = true;
}
const mainEmail = ref<string>("");
const mainPhone = ref<string>("");
/** ตรวจสอบอีเมล */
const isCheckEmail = computed(() => {
return mainEmail.value === formDataInformation.email ? true : false;
});
/** ตรวจสอบเบอร์โทร */
const isCheckPhone = computed(() => {
console.log("mainPhone", mainPhone.value);
console.log("formDataInformation", formDataInformation.phone);
return mainPhone.value === formDataInformation.phone ? true : false;
});
/** get data */
/** ฟังก์ชันดึงข้อมูลประวัติส่วนตัว */
async function getData() {
showLoader();
isLoading.value = true;
await http
.get(config.API.dataUserInformationByType(link.value))
.then(async (res) => {
@ -285,24 +283,27 @@ async function getData() {
phone.value = data.phone;
emailVerify.value = data.statusEmail;
hideLoader();
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
.finally(() => {
isLoading.value = false;
});
}
/** get history */
function getHistory() {
/** ฟังก์ชันดึงข้อมูลประวัติการแก้ไข */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
const url =
dataStore.officerType == "OFFICER"
? config.API.dataUserInformatioHistory("")
: config.API.dataUserInformatioHistory("-employee");
showLoader();
http
await http
.get(url)
.then((res) => {
const data = res.data.result;
@ -313,14 +314,16 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
const isValidPhone = ref<boolean>(true); // validate
const isValidEmail = ref<boolean>(true); // validate
/** ฟังก์ชันเปิด modal ประวัติการแก้ไขข้อมูลส่วนตัว */
function onHistory() {
modalHistory.value = true;
}
/** บันทึกเบอร์โทร */
/** ฟังก์ชันบันทึกเบอร์โทร */
async function onSavePhone() {
if (!formDataInformation.phone || formDataInformation.phone.length != 10) {
isValidPhone.value = false;
@ -353,7 +356,7 @@ async function onSavePhone() {
}
}
/** บันทึก email */
/** ฟังก์ชันบันทึก email */
async function onSaveEmail() {
if (!formDataInformation.email) {
isValidEmail.value = false;
@ -388,6 +391,7 @@ onMounted(async () => {
await getData();
});
</script>
<template>
<div class="col-12">
<q-toolbar class="q-px-none">
@ -402,13 +406,17 @@ onMounted(async () => {
dense
round
size="14px"
:loading="isLoading"
@click="onHistory"
>
<q-tooltip>ประวแกไขขอมลสวนต</q-tooltip>
</q-btn>
</q-toolbar>
<q-card bordered class="bg-grey-1 q-pa-md">
<div class="row">
<div v-if="isLoading">
<q-skeleton height="160px" />
</div>
<div v-else class="row">
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<div class="row">
<div class="col-4 text-grey-6 text-weight-medium">
@ -670,5 +678,6 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>

View file

@ -1,33 +1,29 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import http from "@/plugins/http";
import config from "@/app.config";
/** import type*/
import { useQuasar, type QTableProps } from "quasar";
import type { ChangNameRows } from "@/modules/10_registry/interface/response/01_Information";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
/** import component */
import SkeletonTable from "@/components/SkeletonTable.vue";
const $q = useQuasar();
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const rows = ref<ChangNameRows[]>([]);
const rowsData = ref<ChangNameRows[]>([]);
const idByrow = ref<string>("");
const filter = ref<string>("");
const rowsHistory = ref<ChangNameRows[]>([]);
const rowsHistoryData = ref<ChangNameRows[]>([]);
const mode = ref<boolean>($q.screen.gt.xs);
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
useCounterMixin();
const mode = ref<boolean>($q.screen.gt.xs); // true = desktop mode, false = mobile mode
const isLoading = ref<boolean>(false); //
const link = ref<string>(""); // -
const rows = ref<ChangNameRows[]>([]); // -
const rowsData = ref<ChangNameRows[]>([]); // -
const filter = ref<string>(""); //
const visibleColumns = ref<string[]>([
"prefix",
"firstName",
@ -98,93 +94,10 @@ const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"prefix",
"firstName",
"lastName",
"status",
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columnsHistory = ref<QTableProps["columns"]>([
{
name: "prefix",
align: "left",
label: "คำนำหน้าชื่อ",
sortable: true,
field: "prefix",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "firstName",
align: "left",
label: "ชื่อ",
sortable: true,
field: "firstName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastName",
align: "left",
label: "นามสกุล",
sortable: true,
field: "lastName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "status",
align: "left",
label: "สถานะการเปลี่ยนชื่อ",
sortable: true,
field: "status",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
format: (v) => date2Thai(v),
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
function onHistory(id: string) {
modalHistory.value = true;
idByrow.value = id;
}
/** get data */
/** ฟังก์ชันดึงข้อมูลประวัติการเปลี่ยนชื่อ */
async function getData() {
showLoader();
http
isLoading.value = true;
await http
.get(config.API.dataUserChangeNameByType(link.value))
.then((res) => {
const data = res.data.result;
@ -195,33 +108,11 @@ async function getData() {
messageError($q, e);
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 2000);
});
}
/** get history */
function getHistory() {
showLoader();
http
.get(
config.API.dataUserChangeNameHistoryByType(link.value) +
`/${idByrow.value}`
)
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** ฟังก์ชันค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -230,9 +121,10 @@ function onSearch() {
);
}
/**
* งกโหลไฟลเอกสารหลกฐาน
/***
* งกดาวนโหลไฟลเอกสารหลกฐาน
* @param id รายการทองการโหลด
* @param profileId รหสโปรไฟลของผใช
*/
async function onDownloadFile(id: string, profileId: string) {
showLoader();
@ -263,8 +155,8 @@ onMounted(async () => {
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1"
@ -301,97 +193,96 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<d-table
flat
dense
bordered
virtual-scroll
:rows="rows.length !== 0 ? rows : []"
:columns="columns"
:grid="!mode"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-if="mode" v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="(col, index) in props.cols" :key="col.name">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
color="green"
flat
dense
round
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
<template v-else v-slot:item="props">
<div class="q-mb-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
<q-card bordered flat>
<q-list dense class="q-mt-lg relative-position">
<q-td auto-width>
<q-btn
color="green"
flat
dense
round
class="absolute_button"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
<q-item v-for="col in props.cols" :key="col.name">
<q-item-section>
<q-item-label class="text-grey-6 text-weight-medium">{{
col.label
}}</q-item-label>
</q-item-section>
<q-item-section>
<q-item-label class="text-dark text-weight-medium">{{
col.value ? col.value : "-"
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</template>
</d-table>
<div v-if="isLoading">
<SkeletonTable :columns="columns" />
</div>
<div class="col-12" v-else>
<d-table
flat
dense
bordered
virtual-scroll
:rows="rows.length !== 0 ? rows : []"
:columns="columns"
:grid="!mode"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-if="mode" v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="(col, index) in props.cols" :key="col.name">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
color="green"
flat
dense
round
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
<template v-else v-slot:item="props">
<div class="q-mb-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
<q-card bordered flat>
<q-list dense class="q-mt-lg relative-position">
<q-td auto-width>
<q-btn
color="green"
flat
dense
round
class="absolute_button"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
<q-item v-for="col in props.cols" :key="col.name">
<q-item-section>
<q-item-label class="text-grey-6 text-weight-medium">{{
col.label
}}</q-item-label>
</q-item-section>
<q-item-section>
<q-item-label class="text-dark text-weight-medium">{{
col.value ? col.value : "-"
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</template>
</d-table>
</div>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขการเปลี่ยนชื่อ-นามสกุล'"
:getData="getHistory"
:rows="rowsHistory"
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
/>
</template>
<style scoped>
.absolute_button {
position: absolute;

View file

@ -6,8 +6,8 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
/** import type */
import type {
Address,
Provinces,
@ -15,28 +15,26 @@ import type {
SubDistricts,
} from "@/modules/10_registry/interface/response/01_Information";
//history dialog
/** import component */
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonAddress from "@/modules/10_registry/components/skeleton/Address.vue";
const link = ref<string>("");
const store = useRegistryInFormationStore();
const dataStore = useDataStore();
const rowsHistory = ref<any[]>([]);
const rowsHistoryData = ref<any[]>([]);
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const dataStore = useDataStore();
const { messageError, date2Thai } = useCounterMixin();
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const link = ref<string>(""); //
const rowsHistory = ref<any[]>([]); //
const rowsHistoryData = ref<any[]>([]); //
const modalHistory = ref<boolean>(false); //
const formData = reactive({
registrationAddress: "", //
registrationProvince: "", //
registrationDistrict: "", // /
registrationSubDistrict: "", // /
registrationZipCode: "", //
currentAddress: "", //
currentProvince: "", //
currentDistrict: "", // /
@ -44,11 +42,11 @@ const formData = reactive({
currentZipCode: "", //
});
const provinceData = ref<Provinces[]>([]);
const districtRegistration = ref<Districts[]>([]);
const districtCurrent = ref<Districts[]>([]);
const subDistrictRegistration = ref<SubDistricts[]>([]);
const subDistrictCurrent = ref<SubDistricts[]>([]);
const provinceData = ref<Provinces[]>([]); //
const districtRegistration = ref<Districts[]>([]); // /
const districtCurrent = ref<Districts[]>([]); // /
const subDistrictRegistration = ref<SubDistricts[]>([]); // /
const subDistrictCurrent = ref<SubDistricts[]>([]); // /
const visibleColumnsHistory = ref<string[]>([
"currentAddress",
@ -65,7 +63,6 @@ const visibleColumnsHistory = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columnsHistory = ref<QTableProps["columns"]>([
{
name: "registrationAddress",
@ -217,21 +214,18 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
function onHistory() {
modalHistory.value = true;
}
/** get data */
/** ฟังก์ชันดึงข้อมูลที่อยู่ */
async function getData() {
showLoader();
http
await http
.get(config.API.dataUserAddressByType(link.value))
.then((res) => {
.then(async (res) => {
const data: Address = res.data.result;
fetchDistrict(data.registrationProvinceId, "1");
fetchDistrict(data.currentProvinceId, "2");
fetchSubDistrict(data.registrationDistrictId, "1");
fetchSubDistrict(data.currentDistrictId, "2");
await Promise.all([
fetchDistrict(data.registrationProvinceId, "1"),
fetchDistrict(data.currentProvinceId, "2"),
fetchSubDistrict(data.registrationDistrictId, "1"),
fetchSubDistrict(data.currentDistrictId, "2"),
]);
formData.registrationAddress = data.registrationAddress;
formData.registrationProvince = data.registrationProvinceId;
@ -247,42 +241,41 @@ async function getData() {
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 2000);
});
}
/** get history */
function getHistory() {
/** ฟังก์ชันดึงข้อมูลประวัติที่อยู่ */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
const url =
dataStore.officerType == "OFFICER"
? config.API.dataUserHistory("")
: config.API.dataUserHistory("-employee");
showLoader();
http
await http
.get(url)
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
console.log("🚀 ~ .then ~ data:", data);
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
*function fetch อมลจงหว
*/
function fetchProvince() {
http
function onHistory() {
modalHistory.value = true;
}
/** ฟังก์ชันดึงข้อมูลจังหวัด */
async function fetchProvince() {
await http
.get(config.API.profileNewProvince)
.then((res) => {
const data = res.data.result;
@ -294,13 +287,13 @@ function fetchProvince() {
}
/**
* function fetch อมลอำเภอ
* งกนดอมลอำเภอ
* @param id งหว
* @param position อยตามทะเบยนบาน,อยจจ
*/
function fetchDistrict(id: string | null, position: string) {
async function fetchDistrict(id: string | null, position: string) {
if (!id) return;
http
await http
.get(config.API.profileNewDistrictByPId(id))
.then((res) => {
const data = res.data.result.districts;
@ -316,13 +309,13 @@ function fetchDistrict(id: string | null, position: string) {
}
/**
* function fetch อมลอำเภ
* งกนดอมลอำเภ
* @param id อำเภอ
* @param position อยตามทะเบยนบาน,อยจจ
*/
function fetchSubDistrict(id: string | null, position: string) {
async function fetchSubDistrict(id: string | null, position: string) {
if (!id) return;
http
await http
.get(config.API.profileNewSubDistrictByDId(id))
.then((res) => {
const data = res.data.result.subDistricts;
@ -338,8 +331,8 @@ function fetchSubDistrict(id: string | null, position: string) {
}
/**
* function แปลงชอจงหว
* @param id
* งกแปลงชอจงหว
* @param id รหสจงหว
*/
function convertProvinceName(id: string) {
const province = provinceData.value.find((e: Provinces) => e.id === id);
@ -347,8 +340,8 @@ function convertProvinceName(id: string) {
}
/**
* function แปลงชออำเภอ
* @param id
* งกแปลงชออำเภอ
* @param id รหสอำเภอ
*/
function convertDistrictName(id: string, type: string) {
const data =
@ -358,8 +351,8 @@ function convertDistrictName(id: string, type: string) {
}
/**
* function แปลงชอตำบล
* @param id
* งก แปลงชอตำบล
* @param id รหสตำบล
*/
function convertSubDistrictName(id: string, type: string) {
const data =
@ -369,9 +362,14 @@ function convertSubDistrictName(id: string, type: string) {
}
onMounted(async () => {
isLoading.value = true;
link.value = await dataStore.getProFileType();
await fetchProvince();
await getData();
try {
await fetchProvince();
await getData();
} finally {
isLoading.value = false;
}
});
</script>
<template>
@ -386,6 +384,7 @@ onMounted(async () => {
dense
round
size="14px"
:loading="isLoading"
@click="onHistory"
>
<q-tooltip>ประวอมลทอย</q-tooltip>
@ -402,7 +401,8 @@ onMounted(async () => {
</q-item>
<q-separator />
<q-card-section>
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<SkeletonAddress v-if="isLoading" />
<div v-else class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">
อยตามทะเบยนบาน
@ -481,7 +481,8 @@ onMounted(async () => {
</q-item>
<q-separator />
<q-card-section>
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<SkeletonAddress v-if="isLoading" />
<div v-else class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">
อยจจ
@ -547,5 +548,6 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>

View file

@ -1,33 +1,28 @@
<script setup lang="ts">
import { useQuasar, type QTableProps } from "quasar";
import { ref, reactive, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
import type { FormChildren } from "@/modules/10_registry/interface/index/Family";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonFamily from "@/modules/10_registry/components/skeleton/Family.vue";
const link = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const idFamily = ref<string>("");
const store = useRegistryInFormationStore();
const dataStore = useDataStore();
const rowsHistory = ref<any[]>([]);
const rowsHistoryData = ref<any[]>([]);
const { messageError, date2Thai } = useCounterMixin();
const typeForm = ref<string>("");
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const fatherData = reactive<any>({
const link = ref<string>(""); //
const idFamily = ref<string>(""); // ID
const rowsHistory = ref<any[]>([]); //
const rowsHistoryData = ref<any[]>([]); //
const typeForm = ref<string>(""); // (father, mother, couple, children)
const modalHistory = ref<boolean>(false); //
const fatherData = reactive({
isLive: null,
citizenId: "",
prefix: "",
@ -36,7 +31,7 @@ const fatherData = reactive<any>({
job: "",
profileId: "",
});
const motherData = reactive<any>({
const motherData = reactive({
isLive: null,
citizenId: "",
prefix: "",
@ -45,7 +40,7 @@ const motherData = reactive<any>({
job: "",
profileId: "",
});
const coupleData = reactive<any>({
const coupleData = reactive({
isLive: null,
citizenId: "",
prefix: "",
@ -56,7 +51,6 @@ const coupleData = reactive<any>({
statusMarital: "",
profileId: "",
});
const childData = ref<FormChildren[]>([]);
const visibleColumnsHistory = ref<string[]>([
@ -161,21 +155,26 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
const checkFatherData = ref<boolean>(false);
const checkMotherData = ref<boolean>(false);
const checkCoupleData = ref<boolean>(false);
const checkChildData = ref<boolean>(false);
const checkFatherData = ref<boolean>(false); //
const checkMotherData = ref<boolean>(false); //
const checkCoupleData = ref<boolean>(false); //
const checkChildData = ref<boolean>(false); //
function onHistory(type: string, id: string) {
modalHistory.value = true;
typeForm.value = type;
idFamily.value = id ? id : "user";
}
const isLoadingHistory = ref<boolean>(false); //
const isLoading = reactive({
father: false,
mother: false,
couple: false,
});
/** get data */
/**
* งกนดงขอมลสมาชกในครอบคร
* @param type ประเภทขอม (father, mother, couple, children)
*/
async function getData(type: string) {
showLoader();
http
(isLoading as any)[type] = true;
await http
.get(config.API.dataUserFamilyByType(link.value, type))
.then((res) => {
const data = res.data.result;
@ -219,14 +218,24 @@ async function getData(type: string) {
messageError($q, e);
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 2000);
(isLoading as any)[type] = false;
});
}
/** get history */
function getHistory() {
/**
* งกนเปดประวการแกไขขอม
* @param type ประเภทขอม (father, mother, couple, children)
* @param id ID ของครอบคร (ใชสำหรบบตร)
*/
function onHistory(type: string, id: string) {
modalHistory.value = true;
typeForm.value = type;
idFamily.value = id ? id : "user";
}
/** ฟังก์ชันดึงประวัติการแก้ไขข้อมูล */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
const url =
@ -238,8 +247,7 @@ function getHistory() {
idFamily.value
);
showLoader();
http
await http
.get(url)
.then((res) => {
const data = res.data.result;
@ -261,7 +269,7 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
@ -292,12 +300,14 @@ onMounted(async () => {
flat
dense
round
:isLoading="isLoading.father"
size="14px"
@click="onHistory('father', '')"
>
<q-tooltip>ประวการแกไขขอมลบดา</q-tooltip>
</q-btn>
<div class="col-12">
<SkeletonFamily v-if="isLoading.father" :type="'father'" />
<div class="col-12" v-else>
<q-card bordered class="bg-grey-1 q-pa-sm">
<div class="row">
<div class="col-12 col-sm-12 col-md-12 q-gutter-y-sm">
@ -366,11 +376,13 @@ onMounted(async () => {
dense
round
size="14px"
:isLoading="isLoading.mother"
@click="onHistory('mother', '')"
>
<q-tooltip>ประวการแกไขขอมลมารดา</q-tooltip>
</q-btn>
<div class="col-12">
<SkeletonFamily v-if="isLoading.mother" :type="'mother'" />
<div v-else class="col-12">
<q-card bordered class="bg-grey-1 q-pa-sm">
<div class="row">
<div class="col-12 col-sm-12 col-md-12 q-gutter-y-sm">
@ -441,12 +453,14 @@ onMounted(async () => {
flat
dense
round
:isLoading="isLoading.couple"
size="14px"
@click="onHistory('couple', '')"
>
<q-tooltip>ประวการแกไขขอมลคสมรส</q-tooltip>
</q-btn>
<div class="col-12">
<SkeletonFamily v-if="isLoading.couple" :type="'couple'" />
<div v-else class="col-12">
<q-card bordered class="bg-grey-1 q-pa-sm">
<div class="row">
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
@ -632,6 +646,7 @@ onMounted(async () => {
? columnsHistory
: columnsHistory?.filter((e) => e.name !== 'lastNameOld')
"
:is-loading="isLoadingHistory"
/>
</template>

View file

@ -1,35 +1,33 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useDataStore } from "@/stores/data";
//history dialog
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
import type { EducationProfile } from "@/modules/10_registry/interface/index/Main";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const rows = ref<EducationProfile[]>([]);
const rowsData = ref<EducationProfile[]>([]);
const rowsHistory = ref<EducationProfile[]>([]);
const rowsHistoryData = ref<EducationProfile[]>([]);
const idByRow = ref<string>("");
const filter = ref<string>("");
const mode = ref<boolean>($q.screen.gt.xs);
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const { messageError, date2Thai, onSearchDataTable } = mixin;
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<EducationProfile[]>([]); //
const rowsData = ref<EducationProfile[]>([]); //
const rowsHistory = ref<EducationProfile[]>([]); //
const rowsHistoryData = ref<EducationProfile[]>([]); //
const idByRow = ref<string>(""); // ID
const filter = ref<string>(""); //
const mode = ref<boolean>($q.screen.gt.xs); // true = desktop mode, false = mobile mode
const modalHistory = ref<boolean>(false); //
const visibleColumns = ref<string[]>([
"educationLevel",
"institute",
@ -266,10 +264,26 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const pagination = ref({
// sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"educationLevel",
"institute",
"degree",
"field",
"gpa",
"country",
"duration",
"durationYear",
"other",
"fundName",
"isEducation",
"isHigh",
"endDate",
"startDate",
"finishDate",
"note",
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columnsHistory = ref<QTableProps["columns"]>([
{
name: "educationLevel",
@ -486,37 +500,11 @@ const columnsHistory = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const visibleColumnsHistory = ref<string[]>([
"educationLevel",
"institute",
"degree",
"field",
"gpa",
"country",
"duration",
"durationYear",
"other",
"fundName",
"isEducation",
"isHigh",
"endDate",
"startDate",
"finishDate",
"note",
"lastUpdateFullName",
"lastUpdatedAt",
]);
/** เปิด dialog ประวัติ */
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
/** ฟังก์ชันดึงข้อมูลการศึกษา */
async function getData() {
showLoader();
http
isLoading.value = true;
await http
.get(config.API.dataUserEducationsByType(link.value))
.then((res) => {
const data = res.data.result;
@ -527,16 +515,25 @@ async function getData() {
messageError($q, e);
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 2000);
isLoading.value = false;
});
}
/**
* เป dialog ประวการศกษา
* @param id ID ของแถวทกเลอกสำหรบดประว
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get history */
function getHistory() {
showLoader();
http
async function getHistory() {
isLoadingHistory.value = true
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(config.API.dataUserEducationsHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
@ -547,10 +544,11 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/** ฟังก์ชันค้นหาข้อมูลการศึกษา */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -561,7 +559,6 @@ function onSearch() {
onMounted(async () => {
link.value = await dataStore.getProFileType();
await getData();
});
</script>
@ -603,7 +600,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -614,7 +614,6 @@ onMounted(async () => {
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
@ -687,6 +686,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขประวัติการศึกษา'"
@ -695,6 +695,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>

View file

@ -1,33 +1,35 @@
<script setup lang="ts">
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
/** import type */
import type { AbilityRows } from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const rows = ref<AbilityRows[]>([]);
const rowsData = ref<AbilityRows[]>([]);
const rowsHistory = ref<AbilityRows[]>([]);
const rowsHistoryData = ref<AbilityRows[]>([]);
const idByRow = ref<string>("");
const filter = ref<string>("");
/** import components */
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const $q = useQuasar();
const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
useCounterMixin();
const mode = ref<boolean>($q.screen.gt.xs); // true = desktop mode, false = mobile mode
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<AbilityRows[]>([]); //
const rowsData = ref<AbilityRows[]>([]); //
const rowsHistory = ref<AbilityRows[]>([]); //
const rowsHistoryData = ref<AbilityRows[]>([]); //
const idByRow = ref<string>(""); // id
const filter = ref<string>(""); //
const modalHistory = ref<boolean>(false); // modal
const visibleColumns = ref<string[]>([
"field",
"detail",
@ -187,14 +189,9 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
/** ฟังก์ชันดึงข้อมูล */
async function getData() {
showLoader();
isLoading.value = true;
http
.get(config.API.dataUserAbilityByType(link.value))
.then((res) => {
@ -206,16 +203,25 @@ async function getData() {
messageError($q, e);
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 2000);
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* งกนเป modal ประวการแกไขความสามารถพเศษ
* @param id ID ของแถวทองการดประว
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันดึงข้อมูลประวัติการแก้ไขความสามารถพิเศษ */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(config.API.dataUserAbilityHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
@ -226,10 +232,11 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/** ฟังก์ชันค้นหาข้อมูล */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -241,6 +248,7 @@ function onSearch() {
/**
* งกนโหลไฟลเอกสารหลกฐาน
* @param id รายการทองการโหลด
* @param profileId ID ของโปรไฟลองการโหลด
*/
async function onDownloadFile(id: string, profileId: string) {
showLoader();
@ -272,7 +280,6 @@ onMounted(async () => {
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1"
@ -309,7 +316,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -422,6 +432,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขความสามารถพิเศษ'"
@ -430,8 +441,10 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>
.absolute_button {
position: absolute;

View file

@ -7,30 +7,26 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
import type {
ProfileAppointment,
FormDataGovernment,
} from "@/modules/10_registry/interface/index/Main";
//history dialog
/** import components */
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import GovernmentSkeleton from "@/modules/10_registry/components/skeleton/Government.vue";
const link = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const dataPerson = useDataStore();
const checkType = ref<boolean>(
dataPerson.officerType == "OFFICER" ? true : false
);
const store = useRegistryInFormationStore();
const { showLoader, hideLoader, messageError, date2Thai, dateToISO } = mixin;
const { messageError, date2Thai, dateToISO } = useCounterMixin();
const rowsHistory = ref<ProfileAppointment[]>([]);
const rowsHistoryData = ref<ProfileAppointment[]>([]);
const modalHistory = ref<boolean>(false);
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rowsHistory = ref<ProfileAppointment[]>([]); //
const rowsHistoryData = ref<ProfileAppointment[]>([]); //
const modalHistory = ref<boolean>(false); // modal
/** ตัวแปรข้อมูล */
const formData = reactive<FormDataGovernment>({
org: "",
positionField: "",
@ -138,7 +134,6 @@ const columnsHistory = ref<QTableProps["columns"]>([
]);
/** ไม่เเน่ใจ ใช้เเบบไหน คอมเม้นไว้ก่อน */
// const columnsHistory = ref<QTableProps["columns"]>([
// {
// name: "oc",
@ -343,15 +338,14 @@ const columnsHistory = ref<QTableProps["columns"]>([
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
// ]);
const checkType = ref<boolean>(
dataPerson.officerType == "OFFICER" ? true : false
);
function onHistory() {
modalHistory.value = true;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันดึงข้อมูล */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserGovernmentByType(link.value))
.then((res) => {
const data = res.data.result;
@ -378,18 +372,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
/** ฟังก์ชันเปิด modal ประวัติข้อมูล */
function onHistory() {
modalHistory.value = true;
}
/** ฟังก์ชันดึงประวัติข้อมูลราชการ */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
const url =
dataPerson.officerType == "OFFICER"
? config.API.dataUserGovernmentHistory("")
: config.API.dataUserGovernmentHistory("-employee");
showLoader();
http
await http
.get(url)
.then((res) => {
const data = res.data.result;
@ -400,13 +401,13 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData();
await getData();
});
</script>
<template>
@ -421,12 +422,15 @@ onMounted(async () => {
dense
round
size="14px"
:isLoading="isLoading"
@click="onHistory"
>
<q-tooltip>ประวอมลราชการ</q-tooltip>
</q-btn>
</q-toolbar>
<q-card bordered class="bg-grey-1 q-pa-md">
<GovernmentSkeleton v-if="isLoading" />
<q-card v-else bordered class="bg-grey-1 q-pa-md">
<div class="row q-col-gutter-y-sm">
<div class="col-12 col-sm-12 col-md-6">
<div class="row q-col-gutter-y-sm">
@ -584,5 +588,6 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>

View file

@ -1,38 +1,36 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { DisciplineDetail } from "@/modules/10_registry/interface/index/Main";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { getPathUploadFlie } = useRegistryDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
useCounterMixin();
const rows = ref<DisciplineDetail[]>([]);
const rowsData = ref<DisciplineDetail[]>([]);
const idByRow = ref<string>("");
const filter = ref<string>("");
const rowsHistory = ref<DisciplineDetail[]>([]);
const rowsHistoryData = ref<DisciplineDetail[]>([]);
const mode = ref<boolean>($q.screen.gt.xs);
const fileGroup = ref<string>("เอกสารวินัย");
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); // ;
const rows = ref<DisciplineDetail[]>([]); //
const rowsData = ref<DisciplineDetail[]>([]); //
const idByRow = ref<string>(""); // ID
const filter = ref<string>(""); //
const rowsHistory = ref<DisciplineDetail[]>([]); //
const rowsHistoryData = ref<DisciplineDetail[]>([]); //
const fileGroup = ref<string>("เอกสารวินัย"); //
const modalHistory = ref<boolean>(false); // / modal
const visibleColumns = ref<string[]>([
"level",
"detail",
@ -142,15 +140,10 @@ const pagination = ref({
sortBy: "lastUpdatedAt",
});
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันสำหรับดึงข้อมูลวินัย */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserDisciplineByType(link.value))
.then((res) => {
const data = res.data.result;
@ -161,14 +154,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* เป modal ประวการแกไข
* @param id ID ของแถวทองการดประว
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันสำหรับดึงข้อมูลประวัติการแก้ไข */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(config.API.dataUserDisciplineHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
@ -179,15 +183,28 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
* งกนดาวนโหลดไฟลเอกสารหลกฐาน
* @param id ID ของไฟลองการดาวนโหลด
* @param profileId ID ของโปรไฟล
*/
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
showLoader();
try {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
} catch (e) {
messageError($q, e);
} finally {
hideLoader();
}
}
/** ฟังก์ชันค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -198,7 +215,7 @@ function onSearch() {
onMounted(async () => {
link.value = await dataStore.getProFileType();
getData();
await getData();
});
</script>
<template>
@ -237,7 +254,9 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -349,6 +368,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขวินัย'"
@ -357,6 +377,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumns"
:columns="columns"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>

View file

@ -1,34 +1,32 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import type { LeaveFormType } from "@/modules/10_registry/interface/index/Main";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const idByRow = ref<string>("");
const rows = ref<LeaveFormType[]>([]);
const rowsData = ref<LeaveFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<any[]>([]);
const rowsHistoryData = ref<any[]>([]);
const { messageError, date2Thai, onSearchDataTable } = useCounterMixin();
const mode = ref<boolean>($q.screen.gt.xs);
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<LeaveFormType[]>([]); //
const rowsData = ref<LeaveFormType[]>([]); // ()
const filter = ref<string>(""); //
const idByRow = ref<string>(""); // id
const rowsHistory = ref<LeaveFormType[]>([]); //
const rowsHistoryData = ref<LeaveFormType[]>([]); // ()
const modalHistory = ref<boolean>(false); // modal
const visibleColumns = ref<string[]>([
"no",
"typeLeave",
@ -39,7 +37,6 @@ const visibleColumns = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -136,7 +133,6 @@ const columns = ref<QTableProps["columns"]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"no",
"typeLeave",
@ -243,15 +239,10 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันสำหรับดึงข้อมูลการลา */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserLeaveByType(link.value))
.then((res) => {
const data = res.data.result;
@ -275,14 +266,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* งกนสำหรบเป modal ประวการลา
* @param id ID ของการลา
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันสำหรับดึงข้อมูลประวัติการลา */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(config.API.dataUserLeaveHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
@ -306,10 +308,15 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
* งกนสำหรบแสดงสถานะการลา
* @param val าสถานะการลา
* @return สถานะการลาในรปแบบขอความ
*/
function statusLeave(val: string) {
switch (val) {
case "waitting":
@ -325,6 +332,11 @@ function statusLeave(val: string) {
}
}
/**
* งกนสำหรบแปลงชวงวนทเปนรปแบบไทย
* @param val วงวนทองการแปลงเปนรปแบบไทย
* @return วงวนทในรปแบบไทย
*/
function dateThaiRange(val: [Date, Date]) {
if (val === null) {
} else if (date2Thai(val[0]) === date2Thai(val[1])) {
@ -334,6 +346,7 @@ function dateThaiRange(val: [Date, Date]) {
}
}
/** ฟังก์ชันสำหรับค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -344,11 +357,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataStore.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1">การลา</span>
@ -383,7 +395,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -494,6 +509,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขการลา'"
@ -503,6 +519,7 @@ onMounted(async () => {
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:type="'Leave'"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>

View file

@ -1,35 +1,36 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { DutyFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const dataStore = useDataStore();
const idByRow = ref<string>("");
const rows = ref<DutyFormType[]>([]);
const rowsData = ref<DutyFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<DutyFormType[]>([]);
const rowsHistoryData = ref<DutyFormType[]>([]);
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const $q = useQuasar();
const mode = ref<any>($q.screen.gt.xs);
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { getPathUploadFlie } = useRegistryDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
useCounterMixin();
const mode = ref<any>($q.screen.gt.xs); // true = desktop, false = mobile
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<DutyFormType[]>([]); //
const rowsData = ref<DutyFormType[]>([]); //
const filter = ref<string>(""); //
const idByRow = ref<string>(""); // id
const rowsHistory = ref<DutyFormType[]>([]); //
const rowsHistoryData = ref<DutyFormType[]>([]); //
const modalHistory = ref<boolean>(false); // / modal
const fileGroup = ref<string>("เอกสารปฏิบัติราชการพิเศษ"); //
const visibleColumns = ref<string[]>([
"dateStart",
"dateEnd",
@ -137,7 +138,6 @@ const columns = ref<QTableProps["columns"]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"dateStart",
"dateEnd",
@ -243,17 +243,10 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
const fileGroup = ref<string>("เอกสารปฏิบัติราชการพิเศษ");
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันสำหรับดึงข้อมูลปฏิบัติราชการ */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserDutyByType(link.value))
.then((res) => {
const data = res.data.result;
@ -264,14 +257,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* งกนสำหรบเป modal ประวการแกไข
* @param id ID ของแถวทเลอก
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันสำหรับดึงข้อมูลประวัติการแก้ไข */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(config.API.dataUserDutyHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
@ -282,15 +286,28 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
* งกนสำหรบดาวนโหลดไฟล
* @param id ID ของแถวทเลอก
* @param profileId ID ของโปรไฟลเลอก
*/
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
showLoader();
try {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
} catch (e) {
messageError($q, e);
} finally {
hideLoader();
}
}
/** ฟังก์ชันสำหรับค้นหาข้อมูลในตาราง*/
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -301,11 +318,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataStore.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1"
@ -342,7 +358,9 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -464,6 +482,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>

View file

@ -1,36 +1,36 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import type { DutyFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog
/** import components */
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const dataStore = useDataStore();
const idByRow = ref<string>("");
const rows = ref<DutyFormType[]>([]);
const rowsData = ref<DutyFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<DutyFormType[]>([]);
const rowsHistoryData = ref<DutyFormType[]>([]);
const $q = useQuasar();
const mode = ref<any>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const dataStore = useDataStore();
const { messageError, date2Thai, onSearchDataTable } = useCounterMixin();
const modalHistory = ref<boolean>(false);
const mode = ref<boolean>($q.screen.gt.xs); // true if screen is larger than xs
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<DutyFormType[]>([]); //
const rowsData = ref<DutyFormType[]>([]); //
const filter = ref<string>(""); //
const idByRow = ref<string>(""); // id
const rowsHistory = ref<DutyFormType[]>([]); //
const rowsHistoryData = ref<DutyFormType[]>([]); //
const modalHistory = ref<boolean>(false); // modal
const checkType = ref<boolean>(
dataStore.officerType == "OFFICER" ? true : false
);
/** ตัวแปรข้อมูล */
const visibleColumns = ref<String[]>([
"dateStart",
"dateEnd",
@ -103,10 +103,6 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"dateStart",
"dateEnd",
@ -116,7 +112,6 @@ const visibleColumnsHistory = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columnsHistory = ref<QTableProps["columns"]>([
{
name: "dateStart",
@ -188,16 +183,14 @@ const columnsHistory = ref<QTableProps["columns"]>([
format: (v) => date2Thai(v, false, true),
},
]);
const pagination = ref({
sortBy: "lastUpdatedAt",
});
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันสำหรับดึงข้อมูล */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserActpositionByType(link.value))
.then((res) => {
const data = res.data.result;
@ -208,14 +201,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* เป modal ประวการแกไข
* @param id ID ของแถวทองการดประว
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันสำหรับดึงข้อมูลประวัติ */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(config.API.dataUserActpositionHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
@ -226,10 +230,11 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/** ฟังก์ชันสำหรับค้นหาข้อมูล */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -240,12 +245,11 @@ function onSearch() {
onMounted(async () => {
link.value = await dataStore.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1"
@ -282,7 +286,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -363,6 +370,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขรักษาการในตำแหน่ง'"
@ -371,6 +379,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>

View file

@ -1,33 +1,35 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import type { DutyFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog
/** import components */
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const $q = useQuasar();
const link = ref<string>("");
const dataStore = useDataStore();
const idByRow = ref<string>("");
const rows = ref<DutyFormType[]>([]);
const rowsData = ref<DutyFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<DutyFormType[]>([]);
const rowsHistoryData = ref<DutyFormType[]>([]);
const $q = useQuasar();
const mode = ref<any>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
useCounterMixin();
const mode = ref<boolean>($q.screen.gt.xs); // false;
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<DutyFormType[]>([]); //
const rowsData = ref<DutyFormType[]>([]); //
const filter = ref<string>(""); //
const idByRow = ref<string>(""); // id
const rowsHistory = ref<DutyFormType[]>([]); //
const rowsHistoryData = ref<DutyFormType[]>([]); //
const modalHistory = ref<boolean>(false); // modal
const visibleColumns = ref<string[]>([
"commandName",
"agency",
@ -135,7 +137,6 @@ const columns = ref<QTableProps["columns"]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"commandName",
"agency",
@ -241,15 +242,10 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันดึงข้อมูลช่วยราชการ */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserAssistanceByType(link.value))
.then((res) => {
const data = res.data.result;
@ -260,14 +256,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* งกนเป modal ประวการแกไข
* @param id ID ของแถวทองการดประว
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันดึงข้อมูลประวัติการแก้ไข */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(config.API.dataUserAssistanceHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
@ -278,13 +285,14 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
* งกนโหลไฟลเอกสารหลกฐาน
* @param id รายการทองการโหลด
* @param profileId ID ของโปรไฟล
*/
async function onDownloadFile(id: string, profileId: string) {
showLoader();
@ -310,6 +318,7 @@ async function onDownloadFile(id: string, profileId: string) {
});
}
/** ฟังก์ชันค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -320,11 +329,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataStore.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1">วยราชการ</span>
@ -359,7 +367,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -469,6 +480,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขรายการช่วยราชการ'"
@ -477,6 +489,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>

View file

@ -1,49 +1,49 @@
<script setup lang="ts">
import { useQuasar, type QTableColumn } from "quasar";
import { ref, onMounted, computed } from "vue";
import { ref, onMounted, computed, reactive } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useGovernmentPosDataStore } from "@/modules/10_registry/store/Position";
import type {
SalaryFormType,
CardDataPos,
} from "@/modules/10_registry/interface/index/Main";
import type { DataCommandCode } from "@/modules/10_registry/interface/response/Main";
//history dialog
/**import components*/
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const $q = useQuasar();
const dataPerson = useDataStore();
const store = useGovernmentPosDataStore();
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
date2Thai,
onSearchDataTable,
formatDatePosition,
findOrgName,
findOrgNameHtml,
} = mixin;
} = useCounterMixin();
const idByRow = ref<string>("");
const rows = ref<SalaryFormType[]>([]);
const rowsData = ref<SalaryFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<SalaryFormType[]>([]);
const rowsHistoryData = ref<SalaryFormType[]>([]);
const mode = ref<boolean>($q.screen.gt.xs);
const checkType = ref<boolean>(
dataPerson.officerType == "OFFICER" ? true : false
);
const modalHistory = ref<boolean>(false);
); //
const mode = ref<boolean>($q.screen.gt.xs); // xs
const isLoading = reactive({
position: false, //
tenure: false, //
});
const isLoadingHistory = ref<boolean>(false); //
const link = ref<string>(""); // link
const rows = ref<SalaryFormType[]>([]); //
const rowsData = ref<SalaryFormType[]>([]); //
const idByRow = ref<string>(""); // id
const filter = ref<string>(""); // input
const rowsHistory = ref<SalaryFormType[]>([]); //
const rowsHistoryData = ref<SalaryFormType[]>([]); //
const modalHistory = ref<boolean>(false); // dialog
const cardData = ref<CardDataPos[]>([
{
label: "ระยะเวลาดำรงตำแหน่งในสายงาน",
@ -58,7 +58,6 @@ const cardData = ref<CardDataPos[]>([
data: [],
},
]);
const baseColumns = ref<QTableColumn[]>([
{
name: "commandDateAffect",
@ -315,7 +314,6 @@ const baseVisibleColumns = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columns = computed<QTableColumn[]>(() => {
if (!checkType.value) {
if (baseColumns.value) {
@ -349,59 +347,9 @@ const columnsHistory = computed<QTableColumn[]>(() => {
});
const visibleColumnsHistory = ref<string[]>(baseVisibleColumns.value);
/** เปิด dialog ประวัติ*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
.get(config.API.dataUserPosition(link.value))
.then((res) => {
const data = res.data.result;
rows.value = data;
rowsData.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/** get history */
function getHistory() {
showLoader();
http
.get(config.API.dataUserSalaryHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/** ฟังก์ชันดึงข้อมูลระยะเวลาดำรงตำแหน่ง */
async function fetchDataTenure() {
console.log(link.value);
isLoading.tenure = true;
await http
.get(config.API.salaryTenurePosition(link.value))
.then((res) => {
@ -440,40 +388,78 @@ async function fetchDataTenure() {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
isLoading.tenure = false;
});
}
/** function fetch ข้อมูลประเภทคำสั่ง*/
async function fetchDataCommandCode() {
if (store.commandCodeData.length > 0) return false;
/** ฟังก์ชันดึงข้อมูล */
async function getData() {
isLoading.position = true;
await http
.get(config.API.orgCommandCode)
.get(config.API.dataUserPosition(link.value))
.then((res) => {
const data = res.data.result;
const DataCommandCode = data.filter((e: DataCommandCode) =>
store.positionCode.includes(e.code)
);
const options = DataCommandCode.map((e: DataCommandCode) => ({
id: e.code.toString(),
name: e.name,
}));
store.commandCodeData = options;
rows.value = data;
rowsData.value = data;
})
.catch((err) => {
messageError($q, err);
.catch((e) => {
messageError($q, e);
})
.finally(() => {
isLoading.position = false;
});
}
/**
* เป dialog ประว
* @param id id ของแถวทองการดประว
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันดึงข้อมูลประวัติ */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(config.API.dataUserSalaryHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
isLoadingHistory.value = false;
});
}
/** ฟังก์ชันค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
onMounted(async () => {
link.value = await dataPerson.getProFileType();
if (link.value === "-employee") {
cardData.value.splice(2, 1);
try {
link.value = await dataPerson.getProFileType();
if (link.value === "-employee") {
cardData.value.splice(2, 1);
}
await Promise.all([getData(), fetchDataTenure()]);
} catch (error) {
messageError($q, error);
}
getData();
fetchDataTenure();
fetchDataCommandCode();
});
</script>
@ -492,7 +478,15 @@ onMounted(async () => {
</div>
<div class="col-12"><q-separator /></div>
<q-card-section class="q-pt-none" style="min-height: 200px">
<li v-for="data in item.data">{{ data.name }} {{ data.time }}</li>
<q-skeleton
v-if="isLoading.tenure"
type="text"
class="q-mb-sm"
style="width: 100%"
/>
<li v-else v-for="data in item.data">
{{ data.name }} {{ data.time }}
</li>
</q-card-section>
</q-card>
</div>
@ -532,7 +526,9 @@ onMounted(async () => {
</div>
<div class="col-12 q-mt-sm">
<SkeletonTable v-if="isLoading.position" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -664,6 +660,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>

View file

@ -1,6 +1,6 @@
<script setup lang="ts">
import { useQuasar, type QTableColumn } from "quasar";
import { ref, onMounted, computed } from "vue";
import { useQuasar, type QTableColumn } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -9,40 +9,33 @@ import { useDataStore } from "@/stores/data";
import type { SalaryFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const $q = useQuasar();
const dataPerson = useDataStore();
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
date2Thai,
onSearchDataTable,
findOrgName,
findOrgNameHtml,
} = mixin;
const idByRow = ref<string>("");
const rows = ref<SalaryFormType[]>([]);
const rowsData = ref<SalaryFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<SalaryFormType[]>([]);
const rowsHistoryData = ref<SalaryFormType[]>([]);
const mode = ref<boolean>($q.screen.gt.xs);
const checkType = ref<boolean>(
dataPerson.officerType == "OFFICER" ? true : false
);
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
} = useCounterMixin();
const mode = ref<boolean>($q.screen.gt.xs); //
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<SalaryFormType[]>([]); //
const rowsData = ref<SalaryFormType[]>([]); // ()
const filter = ref<string>(""); //
const idByRow = ref<string>(""); //id
const rowsHistory = ref<SalaryFormType[]>([]); //
const rowsHistoryData = ref<SalaryFormType[]>([]); // ()
const modalHistory = ref<boolean>(false); // dialog
const salaryText = computed(() => {
return link.value == "" ? "เงินเดือน" : "ค่าจ้าง";
});
const baseColumns = ref<QTableColumn[]>([
{
name: "commandDateAffect",
@ -330,20 +323,6 @@ const visibleColumns = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columns = computed(() => {
if (link.value === "-employee") {
if (baseColumns.value) {
return baseColumns.value.filter(
(column) =>
column.name !== "positionSalaryAmount" &&
column.name !== "mouthSalaryAmount"
);
}
}
return baseColumns.value;
});
const visibleColumnsHistory = ref<string[]>([
"commandDateAffect",
"posNumCodeSit",
@ -363,20 +342,6 @@ const visibleColumnsHistory = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columnsHistory = computed(() => {
if (link.value === "-employee") {
if (baseColumnsHistory.value) {
return baseColumnsHistory.value.filter(
(column: QTableColumn) =>
column.name !== "positionSalaryAmount" &&
column.name !== "mouthSalaryAmount"
);
}
}
return baseColumns.value;
});
const baseColumnsHistory = ref<QTableColumn[]>([
{
name: "commandDateAffect",
@ -639,16 +604,36 @@ const baseColumnsHistory = ref<QTableColumn[]>([
},
]);
/** เปิด dialog ประวัติ*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
const columns = computed(() => {
if (link.value === "-employee") {
if (baseColumns.value) {
return baseColumns.value.filter(
(column) =>
column.name !== "positionSalaryAmount" &&
column.name !== "mouthSalaryAmount"
);
}
}
return baseColumns.value;
});
/** get data */
function getData() {
showLoader();
http
const columnsHistory = computed(() => {
if (link.value === "-employee") {
if (baseColumnsHistory.value) {
return baseColumnsHistory.value.filter(
(column: QTableColumn) =>
column.name !== "positionSalaryAmount" &&
column.name !== "mouthSalaryAmount"
);
}
}
return baseColumns.value;
});
/*** ฟังก์ชันสำหรับดึงข้อมูล */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserSalaryByType(link.value))
.then((res) => {
const data = res.data.result;
@ -659,13 +644,24 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
/**
* งกนสำหรบเป dialog ประวการแกไข
* @param id id ของแถวทเลอก
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันสำหรับดึงข้อมูลประวัติการแก้ไข */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
http
.get(config.API.dataUserSalaryHistoryByType(link.value, idByRow.value))
.then((res) => {
@ -677,10 +673,11 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/** ฟังก์ชันสำหรับค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -691,11 +688,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none">
<span class="text-blue-6 text-weight-bold text-body1">{{
@ -732,7 +728,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -851,6 +850,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="`ประวัติแก้ไข${salaryText}`"
@ -859,8 +859,10 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>
.absolute_button {
position: absolute;

View file

@ -1,37 +1,39 @@
<script setup lang="ts">
import { ref, onMounted, computed } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { NopaidFormType } from "@/modules/10_registry/interface/index/Main";
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>("");
const rows = ref<NopaidFormType[]>([]);
const rowsData = ref<NopaidFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<NopaidFormType[]>([]);
const rowsHistoryData = ref<NopaidFormType[]>([]);
const $q = useQuasar();
const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const dataPerson = useDataStore();
const { getPathUploadFlie } = useRegistryDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
useCounterMixin();
const modalHistory = ref<boolean>(false);
const mode = ref<boolean>($q.screen.gt.xs); //
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<NopaidFormType[]>([]); //
const rowsData = ref<NopaidFormType[]>([]); //
const filter = ref<string>(""); //
const idByRow = ref<string>(""); //
const rowsHistory = ref<NopaidFormType[]>([]); //
const rowsHistoryData = ref<NopaidFormType[]>([]); //
const modalHistory = ref<boolean>(false); //
//
const salaryText = computed(() => {
return link.value == "" ? "เงินเดือน" : "ค่าจ้าง";
});
const visibleColumns = ref<string[]>([
"date",
"detail",
@ -41,7 +43,6 @@ const visibleColumns = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columns = ref<QTableProps["columns"]>([
{
name: "date",
@ -128,7 +129,6 @@ const columns = ref<QTableProps["columns"]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"date",
"reference",
@ -138,7 +138,6 @@ const visibleColumnsHistory = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columnsHistory = ref<QTableProps["columns"]>([
{
name: "date",
@ -221,18 +220,12 @@ const columnsHistory = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const fileGroup = ref<string>(`เอกสารบันทึกวันที่ไม่ได้รับ${salaryText.value}`); //
const fileGroup = ref<string>(`เอกสารบันทึกวันที่ไม่ได้รับ${salaryText.value}`);
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันสำหรับดึงข้อมูล */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserNopaidByType(link.value))
.then((res) => {
const data = res.data.result;
@ -243,14 +236,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* งกนสำหรบเปดประวการแกไข
* @param id รหสของแถวทกเลอกสำหรบประว
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันสำหรับดึงข้อมูลประวัติการแก้ไข */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(
config.API.dataUserSalaryNopaidHistoryByType(link.value, idByRow.value)
)
@ -263,15 +267,28 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
* งกนสำหรบดาวนโหลดไฟล
* @param id รหสของแถวทกเลอกสำหรบดาวนโหลด
* @param profileId รหสโปรไฟลของผใช
*/
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
showLoader();
try {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
} catch (e) {
messageError($q, e);
} finally {
hideLoader();
}
}
/** ฟังก์ชันสำหรับค้นหาข้อมูล */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -282,11 +299,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1">{{
@ -323,7 +339,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -448,6 +467,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>

View file

@ -1,37 +1,35 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { CertificateDetail } from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const $q = useQuasar();
const dataPerson = useDataStore();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const { getPathUploadFlie } = useRegistryDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
useCounterMixin();
const idByRow = ref<string>("");
const rows = ref<CertificateDetail[]>([]);
const rowsData = ref<CertificateDetail[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<CertificateDetail[]>([]);
const rowsHistoryData = ref<CertificateDetail[]>([]);
const mode = ref<boolean>($q.screen.gt.xs);
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const mode = ref<boolean>($q.screen.gt.xs); //
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<CertificateDetail[]>([]); //
const rowsData = ref<CertificateDetail[]>([]); //
const filter = ref<string>(""); //
const idByRow = ref<string>(""); // id
const rowsHistory = ref<CertificateDetail[]>([]); //
const rowsHistoryData = ref<CertificateDetail[]>([]); //
const modalHistory = ref<boolean>(false); /// modal
const visibleColumns = ref<string[]>([
"certificateType",
"issuer",
@ -126,7 +124,6 @@ const columns = ref<QTableProps["columns"]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"certificateType",
"issuer",
@ -218,18 +215,12 @@ const columnsHistory = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const fileGroup = ref<string>("เอกสารใบอนุญาตประกอบวิชาชีพ"); //
const fileGroup = ref<string>("เอกสารใบอนุญาตประกอบวิชาชีพ");
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันสำหรับดึงข้อมูลใบอนุญาตประกอบวิชาชีพ */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserCertificateByType(link.value, "certificate"))
.then((res) => {
const data = res.data.result;
@ -240,14 +231,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* งกนสำหรบเป modal แสดงประวการแกไขใบอนญาต
* @param id ID ของแถวทเลอก
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันสำหรับดึงข้อมูลประวัติการแก้ไขใบอนุญาต */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(
config.API.dataUserCertificateHistoryByType(
link.value,
@ -264,15 +266,28 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
* งกนสำหรบดาวนโหลดไฟล
* @param id ID ของไฟลองการดาวนโหลด
* @param profileId ID ของโปรไฟล
*/
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
showLoader();
try {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
}
/** ฟังก์ชันสำหรับค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -283,11 +298,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none">
<span class="text-blue-6 text-weight-bold text-body1"
@ -324,7 +338,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -445,6 +462,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>

View file

@ -1,34 +1,33 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
import type { TrainingFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>("");
const rows = ref<TrainingFormType[]>([]);
const rowsData = ref<TrainingFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<TrainingFormType[]>([]);
const rowsHistoryData = ref<TrainingFormType[]>([]);
const $q = useQuasar();
const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const dataPerson = useDataStore();
const { messageError, date2Thai, onSearchDataTable } = useCounterMixin();
const mode = ref<boolean>($q.screen.gt.xs); //
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<TrainingFormType[]>([]); // /
const rowsData = ref<TrainingFormType[]>([]); // /
const filter = ref<string>(""); //
const idByRow = ref<string>(""); // id
const rowsHistory = ref<TrainingFormType[]>([]); // /
const rowsHistoryData = ref<TrainingFormType[]>([]); // /
const modalHistory = ref<boolean>(false); // / modal /
const visibleColumns = ref<string[]>([
"name", //
"topic", //
@ -187,7 +186,6 @@ const columns = ref<QTableProps["columns"]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"name", //
"topic", //
@ -343,15 +341,11 @@ const columnsHistory = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserCertificateByType(link.value, "training"))
.then((res) => {
const data = res.data.result;
@ -362,14 +356,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* เป modal แสดงประวการแกไขการฝกอบรม/งาน
* @param id ID ของแถวทเลอก
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันสำหรับดึงข้อมูลประวัติการแก้ไขการฝึกอบรม/ดูงาน */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(
config.API.dataUserCertificateHistoryByType(
link.value,
@ -386,10 +391,11 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/** ฟังก์ชันสำหรับค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -400,11 +406,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1"
@ -441,7 +446,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -517,6 +525,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขการฝึกอบรม/ดูงาน'"
@ -525,8 +534,10 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>
.absolute_button {
position: absolute;

View file

@ -1,6 +1,6 @@
<script setup lang="ts">
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -10,27 +10,26 @@ import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { InsigniaFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>("");
const rows = ref<InsigniaFormType[]>([]);
const rowsData = ref<InsigniaFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<InsigniaFormType[]>([]);
const rowsHistoryData = ref<InsigniaFormType[]>([]);
const $q = useQuasar();
const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const dataPerson = useDataStore();
const { getPathUploadFlie } = useRegistryDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
useCounterMixin();
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const mode = ref<boolean>($q.screen.gt.xs); //
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const idByRow = ref<string>(""); // id
const rows = ref<InsigniaFormType[]>([]); //
const rowsData = ref<InsigniaFormType[]>([]); //
const filter = ref<string>(""); //
const rowsHistory = ref<InsigniaFormType[]>([]); //
const rowsHistoryData = ref<InsigniaFormType[]>([]); //
const modalHistory = ref<boolean>(false); // / modal
const visibleColumns = ref<String[]>([
"insignia",
"insigniaType",
@ -239,7 +238,6 @@ const columns = ref<QTableProps["columns"]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"insignia",
"insigniaType",
@ -433,18 +431,12 @@ const columnsHistory = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const fileGroup = ref<string>("เครื่องราชฯ"); //
const fileGroup = ref<string>("เครื่องราชฯ");
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันสำหรับดึงข้อมูลเครื่องราชฯ */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserCertificateByType(link.value, "insignia"))
.then((res) => {
const data = res.data.result;
@ -455,14 +447,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* งกนสำหรบเป modal ประวการแกไขเครองราชฯ
* @param id ID ของแถวทเลอก
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันสำหรับดึงข้อมูลประวัติการแก้ไขเครื่องราชฯ */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(
config.API.dataUserCertificateHistoryByType(
link.value,
@ -479,15 +482,28 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
* งกนสำหรบดาวนโหลดไฟล
* @param id ID ของไฟลองการดาวนโหลด
* @param profileId ID ของโปรไฟล
*/
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
showLoader();
try {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
}
/** ฟังก์ชันสำหรับค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -498,11 +514,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1"
@ -539,7 +554,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -674,8 +692,10 @@ onMounted(async () => {
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:type="'insignia'"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>
.absolute_button {
position: absolute;

View file

@ -1,38 +1,36 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { HonorFormData } from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>("");
const store = useRegistryInFormationStore();
const rows = ref<HonorFormData[]>([]);
const rowsData = ref<HonorFormData[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<HonorFormData[]>([]);
const rowsHistoryData = ref<HonorFormData[]>([]);
const $q = useQuasar();
const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const dataPerson = useDataStore();
const { getPathUploadFlie } = useRegistryDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
useCounterMixin();
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const mode = ref<boolean>($q.screen.gt.xs); //
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const rows = ref<HonorFormData[]>([]); //
const rowsData = ref<HonorFormData[]>([]); //
const filter = ref<string>(""); //
const idByRow = ref<string>(""); // id
const rowsHistory = ref<HonorFormData[]>([]); //
const rowsHistoryData = ref<HonorFormData[]>([]); //
const modalHistory = ref<boolean>(false); // / modal
const visibleColumns = ref<String[]>([
"issuer",
"detail",
@ -127,7 +125,6 @@ const columns = ref<QTableProps["columns"]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"issuer",
"detail",
@ -219,18 +216,12 @@ const columnsHistory = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const fileGroup = ref<string>("ประกาศเกียรติคุณ"); //
const fileGroup = ref<string>("ประกาศเกียรติคุณ");
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันสำหรับดึงข้อมูลประกาศเกียรติคุณ */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserCertificateByType(link.value, "honor"))
.then((res) => {
const data = res.data.result;
@ -241,18 +232,30 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/**
* เป modal ประวการแกไข
* @param id ID ของแถวทเลอก
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get history */
function getHistory() {
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
const url =
dataPerson.officerType == "OFFICER"
? config.API.dataUserHonorHistory("honor", "", idByRow.value)
: config.API.dataUserHonorHistory("honor", "-employee", idByRow.value);
showLoader();
http
await http
.get(url)
.then((res) => {
const data = res.data.result;
@ -263,15 +266,28 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
* งกนสำหรบดาวนโหลดไฟล
* @param id ID ของไฟลองการดาวนโหลด
* @param profileId id ของโปรไฟล
*/
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
showLoader();
try {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
}
/** ฟังก์ชันสำหรับค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -282,11 +298,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1"
@ -323,7 +338,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -445,6 +463,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>

View file

@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
@ -12,31 +12,28 @@ import type {
DataOption,
} from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>("");
const rows = ref<AssessmentsFormType[]>([]);
const rowsData = ref<AssessmentsFormType[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<AssessmentsFormType[]>([]);
const rowsHistoryData = ref<AssessmentsFormType[]>([]);
const $q = useQuasar();
const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const dataPerson = useDataStore();
const { messageError, date2Thai, onSearchDataTable } = useCounterMixin();
const mode = ref<boolean>($q.screen.gt.xs); //
const link = ref<string>(""); //
const rows = ref<AssessmentsFormType[]>([]); //
const rowsData = ref<AssessmentsFormType[]>([]); //
const filter = ref<string>(""); //
const idByRow = ref<string>(""); // id
const rowsHistory = ref<AssessmentsFormType[]>([]); //
const rowsHistoryData = ref<AssessmentsFormType[]>([]); //
const isLoading = ref<boolean>(false); //
const isLoadingHistory = ref<boolean>(false); //
const periodOp = ref<DataOption[]>([
{ id: "OCT", name: "ตุลาคม" },
{ id: "APR", name: "เมษายน" },
]);
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const modalHistory = ref<boolean>(false); // modal
const columns = ref<QTableProps["columns"]>([
{
name: "date",
@ -328,7 +325,6 @@ const visibleColumnsHistory = ref<string[]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumns = ref<string[]>([
"point1Total",
"year",
@ -344,15 +340,10 @@ const visibleColumns = ref<string[]>([
"lastUpdatedAt",
]);
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันดึงข้อมูล */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserCertificateByType(link.value, "assessments"))
.then((res) => {
const data = res.data.result;
@ -363,14 +354,25 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* งกนเป modal ประวการแกไข
* @param id - id ของแถวทเลอก
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันดึงข้อมูลประวัติการแก้ไข */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(
config.API.dataUserCertificateHistoryByType(
link.value,
@ -387,10 +389,14 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/**
* งกนตรวจสอบชวงคะแนน
* @param val - าทองการตรวจสอบ
*/
function textRangePoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val < 60.0) return "(คะแนนต่ำกว่าร้อยละ 60.00)";
@ -401,6 +407,10 @@ function textRangePoint(val: number | undefined) {
else return "";
}
/**
* งกนตรวจสอบคะแนน
* @param val - าทองการตรวจสอบ
*/
function textPoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val < 60.0) return "ต้องปรับปรุง";
@ -440,6 +450,7 @@ onMounted(async () => {
v-model="filter"
label="ค้นหา"
style="max-width: 200px"
@keydown.enter.prevent="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -461,7 +472,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -545,6 +559,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขผลการประเมินการปฏิบัติราชการ'"
@ -553,8 +568,10 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>
.absolute_button {
position: absolute;

View file

@ -1,34 +1,28 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { ref, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import DialogDevelop from "@/modules/10_registry/Dialog/DialogDevelopmant.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const typeIDP = ref<string>("");
const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>("");
const rows = ref<any[]>([]);
const rowsData = ref<any[]>([]);
const filter = ref<string>("");
const rowsHistory = ref<any[]>([]);
const rowsHistoryData = ref<any[]>([]);
const $q = useQuasar();
const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const modalDevelop = ref<boolean>(false);
const kpiDevelopmentId = ref<string>("");
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const dataPerson = useDataStore();
const { messageError, date2Thai, onSearchDataTable } = useCounterMixin();
const mode = ref<boolean>($q.screen.gt.xs); //
const typeIDP = ref<string>(""); //
const link = ref<string>(""); //
const isLoading = ref<boolean>(false); //
const rows = ref<any[]>([]); //
const rowsData = ref<any[]>([]); //
const filter = ref<string>(""); //
const modalDevelop = ref<boolean>(false); // / Dialog
const kpiDevelopmentId = ref<string>(""); // ID
const visibleColumns = ref<string[]>([
"no",
"name",
@ -39,7 +33,6 @@ const visibleColumns = ref<string[]>([
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -130,21 +123,15 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const paginationPlan = ref({
page: 1,
rowsPerPage: 10,
});
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันดึงข้อมูล */
async function getData() {
isLoading.value = true;
await http
.get(config.API.developmentUserByType(link.value))
.then((res) => {
const data = res.data.result;
@ -155,31 +142,7 @@ function getData() {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/** get history */
function getHistory() {
showLoader();
http
.get(
config.API.dataUserCertificateHistoryByType(
link.value,
"assessments",
idByRow.value
)
)
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
@ -193,6 +156,7 @@ function openDialogDevelop(data: any) {
typeIDP.value = data.type;
}
/** ฟังก์ชันค้นหาข้อมูล */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -203,7 +167,7 @@ function onSearch() {
onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData();
await getData();
});
</script>
<template>
@ -244,7 +208,9 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { useQuasar, type QTableProps } from "quasar";
import { is, useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import http from "@/plugins/http";
@ -9,16 +9,16 @@ import { useDataStore } from "@/stores/data";
import type { OtherFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const $q = useQuasar();
const dataPerson = useDataStore();
const { messageError, date2Thai, onSearchDataTable } = useCounterMixin();
const link = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const dataPerson = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const isLoading = ref<boolean>(false);
const isLoadingHistory = ref<boolean>(false);
const idByRow = ref<string>("");
const rows = ref<OtherFormType[]>([]);
const rowsData = ref<OtherFormType[]>([]);
@ -26,10 +26,7 @@ const filter = ref<string>("");
const rowsHistory = ref<OtherFormType[]>([]);
const rowsHistoryData = ref<OtherFormType[]>([]);
const mode = ref<boolean>($q.screen.gt.xs);
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const visibleColumns = ref<string[]>([
"date",
"detail",
@ -85,7 +82,6 @@ const columns = ref<QTableProps["columns"]>([
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const visibleColumnsHistory = ref<string[]>([
"date",
"detail",
@ -139,15 +135,10 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันดึงข้อมูล */
async function getData() {
isLoading.value = true;
await http
.get(config.API.dataUserOtherByType(link.value))
.then((res) => {
const data = res.data.result;
@ -156,14 +147,27 @@ function getData() {
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {
isLoading.value = false;
});
}
/** get history */
function getHistory() {
showLoader();
http
/**
* งกนเปดโมดลดประว
* @param id ID ของแถวทองการดประว
*/
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
}
/** ฟังก์ชันดึงประวัติการแก้ไขข้อมูลอื่นๆ */
async function getHistory() {
isLoadingHistory.value = true;
rowsHistory.value = [];
rowsHistoryData.value = [];
await http
.get(config.API.dataUserOtherHistoryByType(link.value, idByRow.value))
.then((res) => {
const data = res.data.result;
@ -174,10 +178,11 @@ function getHistory() {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoadingHistory.value = false;
});
}
/** ฟังก์ชันค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -188,11 +193,10 @@ function onSearch() {
onMounted(async () => {
link.value = await dataPerson.getProFileType();
getData();
await getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none">
<span class="text-blue-6 text-weight-bold text-body1">อมลอนๆ</span>
@ -227,7 +231,10 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
flat
dense
bordered
@ -310,6 +317,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขข้อมูลอื่นๆ'"
@ -318,6 +326,7 @@ onMounted(async () => {
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
:is-loading="isLoadingHistory"
/>
</template>
<style scoped>

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import { ref, reactive, onMounted } from "vue";
import { is, useQuasar } from "quasar";
import { ref, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
@ -9,23 +9,17 @@ import { useRegistryInFormationStore } from "@/modules/10_registry/store/registr
import type { FileFormType } from "@/modules/10_registry/interface/index/Main";
const fileList = ref<FileFormType[]>([]);
const store = useRegistryInFormationStore();
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const store = useRegistryInFormationStore();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const isLoading = ref<boolean>(false);
const fileList = ref<FileFormType[]>([]);
function onHistory() {
modalHistory.value = true;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันดึงข้อมูลไฟล์ */
async function getData() {
isLoading.value = true;
await http
.get(
config.API.fileByFileUser(
"ระบบทะเบียนประวัติ",
@ -41,9 +35,7 @@ function getData() {
messageError($q, e);
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 1500);
isLoading.value = false;
});
}
@ -51,9 +43,9 @@ function getData() {
* ดาวนโหลดลงคไฟล
* @param fileName file name
*/
function downloadFile(fileName: string) {
async function downloadFile(fileName: string) {
showLoader();
http
await http
.get(
config.API.fileByFile(
"ระบบทะเบียนประวัติ",
@ -69,7 +61,7 @@ function downloadFile(fileName: string) {
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
.finally(() => {
hideLoader();
});
}
@ -78,8 +70,8 @@ onMounted(() => {
getData();
});
</script>
<template>
<!-- v-if="mode" -->
<div class="col-12">
<q-toolbar class="q-px-none q-mt-md">
<span class="text-blue-6 text-weight-bold text-body1">เอกสารหลกฐาน</span>
@ -89,7 +81,12 @@ onMounted(() => {
ไฟลเอกสารหลกฐาน
</div>
<div class="col-12"><q-separator /></div>
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
<div v-if="isLoading" class="col-12 q-pa-sm">
<q-skeleton type="QSlider" />
</div>
<div v-else class="row col-12 q-col-gutter-y-sm q-pa-sm">
<div v-if="fileList.length > 0" class="col-xs-12 row">
<q-list class="full-width rounded-borders" bordered separator>
<q-item
@ -124,6 +121,7 @@ onMounted(() => {
</q-card>
</div>
</template>
<style scoped>
.absolute_button {
position: absolute;

View file

@ -9,23 +9,17 @@ import { useRegistryInFormationStore } from "@/modules/10_registry/store/registr
import type { FileFormType } from "@/modules/10_registry/interface/index/Main";
const fileList = ref<FileFormType[]>([]);
const store = useRegistryInFormationStore();
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const store = useRegistryInFormationStore();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const isLoading = ref<boolean>(false);
const fileList = ref<FileFormType[]>([]);
function onHistory() {
modalHistory.value = true;
}
/** get data */
function getData() {
showLoader();
http
/** ฟังก์ชันดึงข้อมูลไฟล์ */
async function getData() {
isLoading.value = true;
await http
.get(
config.API.fileByFileUser(
"ระบบทะเบียนประวัติ",
@ -41,9 +35,7 @@ function getData() {
messageError($q, e);
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 1500);
isLoading.value = false;
});
}
@ -51,9 +43,9 @@ function getData() {
* ดาวนโหลดลงคไฟล
* @param fileName file name
*/
function downloadFile(fileName: string) {
async function downloadFile(fileName: string) {
showLoader();
http
await http
.get(
config.API.fileByFile(
"ระบบทะเบียนประวัติ",
@ -69,7 +61,7 @@ function downloadFile(fileName: string) {
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
.finally(() => {
hideLoader();
});
}
@ -89,7 +81,11 @@ onMounted(() => {
ไฟลเอกสาร ..7
</div>
<div class="col-12"><q-separator /></div>
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
<div v-if="isLoading" class="col-12 q-pa-sm">
<q-skeleton type="QSlider" />
</div>
<div v-else class="row col-12 q-col-gutter-y-sm q-pa-sm">
<div v-if="fileList.length > 0" class="col-xs-12 row">
<q-list class="full-width rounded-borders" bordered separator>
<q-item

View file

@ -1,35 +1,48 @@
<script setup lang="ts">
import { ref, watch } from "vue";
import DialogHeader from "@/components/DialogHeader.vue";
import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
const type = ref<string>("");
const mixin = useCounterMixin();
const { date2Thai, onSearchDataTable, findOrgNameHtml } = mixin;
const modal = defineModel<boolean>("modal", { required: true });
const title = defineModel<string>("title", { required: true });
/** import type */
import type { QTableProps } from "quasar";
const filter = ref<string>("");
/** import component */
import DialogHeader from "@/components/DialogHeader.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
const rows = defineModel<any>("rows");
const rowsData = defineModel<any>("rowsData");
const columns = defineModel<QTableProps["columns"]>("columns");
const visibleColumns = defineModel<string[]>("visibleColumns");
const { date2Thai, onSearchDataTable, findOrgNameHtml } = useCounterMixin();
/** define model */
const modal = defineModel<boolean>("modal", { required: true }); // modal visibility
const isLoading = defineModel<boolean>("isLoading", { required: true }); // loading state
const title = defineModel<string>("title", { required: true }); // dialog title
const rows = defineModel<any[]>("rows"); // data rows for the table
const rowsData = defineModel<any[]>("rowsData"); // raw data for the table
const columns = defineModel<QTableProps["columns"]>("columns"); // table columns definition
const visibleColumns = defineModel<string[]>("visibleColumns"); // visible columns in the table
/** define props */
const props = defineProps({
getData: Function, // function to fetch data
type: String, // type of data (e.g., "Leave", "insignia")
});
const type = ref<string>(""); //
const filter = ref<string>(""); // filter input for searching
const pagination = ref({
sortBy: "lastUpdatedAt",
});
const props = defineProps({
getData: Function,
type: String,
});
/** ปิด Dialog และรีเซ็ตค่า */
function close() {
modal.value = false;
filter.value = "";
}
/**
* งกนแปลงวนทเปนรปแบบไทย
* @param val - date range value
*/
function dateThaiRange(val: [Date, Date]) {
if (val === null) {
} else if (date2Thai(val[0]) === date2Thai(val[1])) {
@ -39,6 +52,10 @@ function dateThaiRange(val: [Date, Date]) {
}
}
/**
* งกนแปลงสถานะการลาเปนขอความท
* @param val สถานะการลา
*/
function statusLeave(val: string) {
switch (val) {
case "waitting":
@ -54,10 +71,11 @@ function statusLeave(val: string) {
}
}
/** ฟังก์ชันค้นหาข้อมูลในตาราง */
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
rowsData.value ? rowsData.value : [],
columns.value ? columns.value : []
);
}
@ -111,141 +129,148 @@ watch(
/>
</div>
</div>
<div v-if="isLoading">
<SkeletonTable :columns="columns" />
</div>
<d-table
flat
dense
bordered
virtual-scroll
:rows="rows"
:columns="columns"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<div v-else class="col-12">
<d-table
flat
dense
bordered
virtual-scroll
:rows="rows"
:columns="columns"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="(col, index) in props.cols" :key="col.name">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name == 'insignia' && type == 'insignia'">
{{ props.row.insignia ? `${props.row.insignia.name} ` : "-"
}}{{
props.row.insignia.shortName
? `(${props.row.insignia.shortName})`
: ""
}}
</div>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="(col, index) in props.cols" :key="col.name">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name == 'insignia' && type == 'insignia'">
{{ props.row.insignia ? `${props.row.insignia.name} ` : "-"
}}{{
props.row.insignia.shortName
? `(${props.row.insignia.shortName})`
: ""
}}
</div>
<div v-else-if="col.name == 'dateLeave' && type == 'Leave'">
{{
dateThaiRange([
props.row.dateStartLeave,
props.row.dateEndLeave,
])
}}
</div>
<div v-else-if="col.name == 'status' && type == 'Leave'">
{{ props.row.status ? statusLeave(props.row.status) : "-" }}
</div>
<div v-else-if="col.name == 'organization'">
{{
props.row
? findOrgNameHtml({
root: props.row.orgRoot,
child1: props.row.orgChild1,
child2: props.row.orgChild2,
child3: props.row.orgChild3,
child4: props.row.orgChild4,
})
: "-"
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
<template v-slot:item="props">
<div
class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3 grid-style-transition"
>
<q-card bordered flat class="q-pt-md">
<q-list dense>
<q-item v-for="col in props.cols" :key="col.name">
<q-item-section class="fix_top">
<q-item-label class="text-grey-6 text-weight-medium">{{
col.label
}}</q-item-label>
</q-item-section>
<q-item-section
v-if="col.name == 'insignia' && type == 'insignia'"
class="fix_top"
>
<q-item-label class="text-dark text-weight-medium">
{{
props.row.insignia
? `${props.row.insignia.name} `
: "-"
}}{{
props.row.insignia.shortName
? `(${props.row.insignia.shortName})`
: ""
}}</q-item-label
<div v-else-if="col.name == 'dateLeave' && type == 'Leave'">
{{
dateThaiRange([
props.row.dateStartLeave,
props.row.dateEndLeave,
])
}}
</div>
<div v-else-if="col.name == 'status' && type == 'Leave'">
{{ props.row.status ? statusLeave(props.row.status) : "-" }}
</div>
<div v-else-if="col.name == 'organization'">
{{
props.row
? findOrgNameHtml({
root: props.row.orgRoot,
child1: props.row.orgChild1,
child2: props.row.orgChild2,
child3: props.row.orgChild3,
child4: props.row.orgChild4,
})
: "-"
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
<template v-slot:item="props">
<div
class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3 grid-style-transition"
>
<q-card bordered flat class="q-pt-md">
<q-list dense>
<q-item v-for="col in props.cols" :key="col.name">
<q-item-section class="fix_top">
<q-item-label class="text-grey-6 text-weight-medium">{{
col.label
}}</q-item-label>
</q-item-section>
<q-item-section
v-if="col.name == 'insignia' && type == 'insignia'"
class="fix_top"
>
</q-item-section>
<q-item-section
v-else-if="col.name == 'dateLeave' && type == 'Leave'"
class="fix_top"
>
<q-item-label class="text-dark text-weight-medium">
{{
dateThaiRange([
props.row.dateStartLeave,
props.row.dateEndLeave,
])
}}</q-item-label
<q-item-label class="text-dark text-weight-medium">
{{
props.row.insignia
? `${props.row.insignia.name} `
: "-"
}}{{
props.row.insignia.shortName
? `(${props.row.insignia.shortName})`
: ""
}}</q-item-label
>
</q-item-section>
<q-item-section
v-else-if="col.name == 'dateLeave' && type == 'Leave'"
class="fix_top"
>
</q-item-section>
<q-item-section
v-else-if="col.name == 'status' && type == 'Leave'"
class="fix_top"
>
<q-item-label class="text-dark text-weight-medium">
{{
props.row.status ? statusLeave(props.row.status) : "-"
}}</q-item-label
<q-item-label class="text-dark text-weight-medium">
{{
dateThaiRange([
props.row.dateStartLeave,
props.row.dateEndLeave,
])
}}</q-item-label
>
</q-item-section>
<q-item-section
v-else-if="col.name == 'status' && type == 'Leave'"
class="fix_top"
>
</q-item-section>
<q-item-section v-else class="fix_top">
<q-item-label class="text-dark text-weight-medium">{{
col.value ? col.value : "-"
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</template>
<template v-slot:no-data>
<div
class="full-width row flex-center q-pa-sm rounded-borders text-weight-medium"
>
<span> ไมพบขอม </span>
</div>
</template>
</d-table>
<q-item-label class="text-dark text-weight-medium">
{{
props.row.status
? statusLeave(props.row.status)
: "-"
}}</q-item-label
>
</q-item-section>
<q-item-section v-else class="fix_top">
<q-item-label class="text-dark text-weight-medium">{{
col.value ? col.value : "-"
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</template>
<template v-slot:no-data>
<div
class="full-width row flex-center q-pa-sm rounded-borders text-weight-medium"
>
<span> ไมพบขอม </span>
</div>
</template>
</d-table>
</div>
</q-card-section>
</q-card>
</q-dialog>

View file

@ -12,9 +12,7 @@ import DialogHeader from "@/components/DialogHeader.vue";
import { useRequestEditStore } from "@/modules/10_registry/store/RequestEdit";
import { useCounterMixin } from "@/stores/mixin";
/**
* use
*/
/** use*/
const $q = useQuasar();
const link = ref<string>("");
const store = useRequestEditStore();
@ -22,24 +20,23 @@ const dataStore = useDataStore();
const { dialogConfirm, showLoader, hideLoader, messageError, success } =
useCounterMixin();
/**
* props
*/
/** props*/
const modalInfo = ref<boolean>(false);
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
fetchData: { type: Function, requied: true },
fetchData: { type: Function, required: true },
});
const isReadOnly = ref<boolean>(false);
const profileId = ref<string>("");
const isReadOnly = ref<boolean>(false); //
const profileId = ref<string>(""); // profileId q
const formData = reactive({
topic: "",
detail: "",
document: null,
});
const topicOption = ref<string[]>(store.optionTopic);
const topicOption = ref<string[]>(store.optionTopic); //
/** function ปิด Dialog และเคลียร์ข้อมูล */
function closeDialog() {
modal.value = false;
formData.topic = "";
@ -47,9 +44,7 @@ function closeDialog() {
formData.document = null;
}
/**
* function นยนการยนคำรองขอแกไขขอม
*/
/** function ยืนยันการยื่นคำร้องขอแก้ไขข้อมูล */
function onSubmit() {
dialogConfirm(
$q,
@ -65,17 +60,18 @@ function onSubmit() {
})
.then(async (res) => {
if (formData.document) {
createURLUpload(res.data.result, formData.document);
await createURLUpload(res.data.result, formData.document);
} else {
formData.document = null;
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
hideLoader();
}
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
},
@ -86,10 +82,12 @@ function onSubmit() {
/**
* function สราง URL ปโหลไฟลเอกสารหลกฐาน
* @param id คำรองขอแกไขขอม
* @param file ไฟลปโหลด
*/
function createURLUpload(id: string, file: any) {
async function createURLUpload(id: string, file: any) {
const fileName = { fileName: file.name };
http
await http
.post(
config.API.file(
"ระบบทะเบียนประวัติ",
@ -108,7 +106,7 @@ function createURLUpload(id: string, file: any) {
res.data[key]?.fileName !== ""
);
foundKey &&
uploadFileDoc(res.data[foundKey]?.uploadUrl, formData.document);
(await uploadFileDoc(res.data[foundKey]?.uploadUrl, formData.document));
})
.catch((err) => {
messageError($q, err);
@ -117,32 +115,29 @@ function createURLUpload(id: string, file: any) {
/**
* function สำหรบอพโหลดไฟลเอกสารหลกฐาน
* @param uploadUrl URL สำหรบอปโหลดไฟล
* @param file ไฟลปโหลด
*/
function uploadFileDoc(uploadUrl: string, file: any) {
showLoader();
axios
async function uploadFileDoc(uploadUrl: string, file: any) {
await axios
.put(uploadUrl, file, {
headers: {
"Content-Type": file.type,
},
})
.then(async (res) => {
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {
hideLoader();
});
}
/**
* class input
* @param val
* function สำหรบจดการ class ของ input
* @param val าทใชในการกำหนด class
*/
function classInput(val: boolean) {
return {
@ -164,9 +159,7 @@ function filterOption(val: string, update: Function) {
});
}
/**
* function fetch profileId
*/
/** function fetch profileId */
async function fetchProfile() {
try {
isReadOnly.value = dataStore.officerType === "OFFICER";

View file

@ -0,0 +1,40 @@
<template>
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">
อยตามทะเบยนบาน
</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">งหว</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">เขต / อำเภอ</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">แขวง / ตำบล</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">รหสไปรษณ</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
</div>
</template>

View file

@ -0,0 +1,103 @@
<script setup lang="ts">
const type = defineModel("type", {
type: String,
default: "",
});
</script>
<template>
<div class="col-12" v-if="type === 'couple'">
<q-card bordered class="bg-grey-1 q-pa-sm">
<div class="row">
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">
สถานภาพการสมรส
</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">
เลขประจำตวประชาชน
</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">-นามสก</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">นามสกลเด</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">อาช</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
</div>
</div>
</q-card>
</div>
<div class="col-12" v-else>
<q-card bordered class="bg-grey-1 q-pa-sm">
<div class="row">
<div class="col-12 col-sm-12 col-md-12 q-gutter-y-sm">
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">
เลขประจำตวประชาชน
</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">-นามสก</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">อาช</div>
<div class="col-7">
<q-skeleton type="text" />
</div>
</div>
</div>
</div>
</q-card>
</div>
</template>

View file

@ -0,0 +1,110 @@
<template>
<q-card bordered class="bg-grey-1 q-pa-md">
<div class="row q-col-gutter-y-sm">
<div class="col-12 col-sm-12 col-md-6">
<div class="row q-col-gutter-y-sm">
<div class="col-5 text-grey-6 text-weight-medium">งก</div>
<div class="col-7 text-html">
<q-skeleton class="q-mb-sm" type="text" />
</div>
<div class="col-5 text-grey-6 text-weight-medium">
<q-skeleton class="q-mb-sm" type="text" />
</div>
<div class="col-7">
<q-skeleton class="q-mb-sm" type="text" />
</div>
<div class="col-5 text-grey-6 text-weight-medium">
<q-skeleton class="q-mb-sm" type="text" />
</div>
<div class="col-7">
<q-skeleton class="q-mb-sm" type="text" />
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-6">
<div class="row q-col-gutter-y-sm">
<div class="col-5 text-grey-6 text-weight-medium">
<q-skeleton class="q-mb-sm" type="text" />
</div>
<div class="col-7">
<q-skeleton class="q-mb-sm" type="text" />
</div>
<div class="col-5 text-grey-6 text-weight-medium">
<q-skeleton class="q-mb-sm" type="text" />
</div>
<div class="col-7">
<q-skeleton class="q-mb-sm" type="text" />
</div>
<div class="col-5 text-grey-6 text-weight-medium">าน/สาขา</div>
<div class="col-7">
<q-skeleton class="q-mb-sm" type="text" />
</div>
</div>
</div>
</div>
<q-separator class="q-my-md" />
<div class="row">
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<div class="row">
<div class="col-6 text-grey-6 text-weight-medium">
นทงบรรจ
</div>
<div class="col-6">
<q-skeleton class="q-mb-sm" type="text" />
</div>
</div>
<div class="row">
<div class="col-6 text-grey-6 text-weight-medium">
นทเรมปฏราชการ
</div>
<div class="col-6">
<q-skeleton class="q-mb-sm" type="text" />
</div>
</div>
<div class="row">
<div class="col-6 text-grey-6 text-weight-medium">
นครบเกษยณอาย
</div>
<div class="col-6">
<q-skeleton class="q-mb-sm" type="text" />
</div>
</div>
<div class="row">
<div class="col-6 text-grey-6 text-weight-medium">
นทเกษยณอายราชการตามกฏหมาย
</div>
<div class="col-6">
<q-skeleton class="q-mb-sm" type="text" />
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">อายราชการ</div>
<div class="col-7">
<q-skeleton class="q-mb-sm" type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">ขาดราชการ</div>
<div class="col-7">
<q-skeleton class="q-mb-sm" type="text" />
</div>
</div>
<div class="row">
<div class="col-5 text-grey-6 text-weight-medium">
อายราชการเกอก
</div>
<div class="col-7">
<q-skeleton class="q-mb-sm" type="text" />
</div>
</div>
</div>
</div>
</q-card>
</template>

View file

@ -2,12 +2,12 @@
import { useRouter } from "vue-router";
/** component */
import Information from "@/modules/10_registry/01_Information/01_Information.vue";
import ChangeName from "@/modules/10_registry/01_Information/02_ChangeName.vue";
import Address from "@/modules/10_registry/01_Information/03_Address.vue";
import Family from "@/modules/10_registry/01_Information/04_Family.vue";
import Educations from "@/modules/10_registry/01_Information/05_Educations.vue";
import Ability from "@/modules/10_registry/01_Information/06_Ability.vue";
import Information from "@/modules/10_registry/01_Information/01_Information.vue"; //
import ChangeName from "@/modules/10_registry/01_Information/02_ChangeName.vue"; //-
import Address from "@/modules/10_registry/01_Information/03_Address.vue"; //
import Family from "@/modules/10_registry/01_Information/04_Family.vue"; //
import Educations from "@/modules/10_registry/01_Information/05_Educations.vue"; //
import Ability from "@/modules/10_registry/01_Information/06_Ability.vue"; //
const router = useRouter();
</script>

View file

@ -1,44 +1,51 @@
<script setup lang="ts">
import { ref, computed } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
import genReport from "@/plugins/genreport";
import { ref, computed, onMounted } from "vue";
import { useQuasar } from "quasar";
//
import http from "@/plugins/http";
import config from "@/app.config";
import genReport from "@/plugins/genreport";
import { useRouter } from "vue-router";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
/** import components */
import InformationPage from "@/modules/10_registry/tabs/01_information.vue";
import GovernmentPage from "@/modules/10_registry/tabs/02_government.vue";
import SalaryPage from "@/modules/10_registry/tabs/03_salary.vue";
import Certificate from "@/modules/10_registry/tabs/04_Achievement.vue";
import OtherPage from "@/modules/10_registry/tabs/05_other.vue";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
const store = useRegistryInFormationStore();
const $q = useQuasar();
const dataStore = useDataStore();
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
const router = useRouter();
const tab = ref<string>("information");
const store = useRegistryInFormationStore();
const dataStore = useDataStore();
const { messageError, showLoader, hideLoader } = useCounterMixin();
const tab = ref<string>("information"); //
const sizeImg = ref<string>(""); //
/** ข้อความแสดงชื่อเงินเดือนหรือค่าจ้าง */
const salaryText = computed(() => {
return dataStore.officerType == "OFFICER" ? "เงินเดือน" : "ค่าจ้าง";
return dataStore.officerType == "OFFICER" ? "เงินเดือน" : "ค่าจ้าง";
});
const sizeImg = ref<string>("");
function onResize(size: any) {
/**
* งกนจดการขนาดของรปภาพโปรไฟล
* @param size ขนาดทไดจาก q-resize-observer
*/
function onResize(size: { width: number; height: number }) {
const width = size.width > 100 ? 100 : size.width;
sizeImg.value = `${width}px`;
}
function onMobile(type: string) {
router.push(`/registry/${type}`);
}
/**
* งกนดาวนโหลดไฟล ..7/..1 หรอประวแบบย
* @param type ประเภทไฟลองการดาวนโหลด
* FULL: ..7/..1
* SHORT: ประวแบบย
*/
async function onClickDownloadKp7(type: string) {
showLoader();
const url =
@ -66,19 +73,19 @@ async function onClickDownloadKp7(type: string) {
});
}
/**
* งชนกลบหนาหล
*/
/** ฟังชั่นกลับหน้าหลัก*/
const clickBack = () => {
router.push(`/`);
};
/**
* function redirect ไปหนารายการคำรองขอแกไขขอม
*/
/** ฟังก์ชัน redirect ไปหน้ารายการคำร้องขอแก้ไขข้อมูล*/
function redirectToPagePetition() {
router.push(`/registry/request-edit`);
}
function onMobile(type: string) {
router.push(`/registry/${type}`);
}
</script>
<template>
@ -106,7 +113,40 @@ function redirectToPagePetition() {
</div>
<div v-if="$q.screen.gt.xs" class="row q-col-gutter-md">
<div class="col-3">
<q-card bordered>
<q-card v-if="dataStore.isLoadingProfile" bordered>
<q-resize-observer @resize="onResize" />
<q-card-section>
<div class="relative-position" style="height: 120px">
<div class="absolute-center">
<q-skeleton type="QAvatar" :size="sizeImg || '100px'" />
</div>
</div>
<div class="column items-center q-mt-md q-mb-sm q-gutter-sm">
<q-skeleton type="text" width="120px" />
<q-skeleton type="text" width="150px" />
<q-skeleton type="text" width="100px" />
<q-skeleton type="text" width="50px" />
</div>
</q-card-section>
<q-list separator class="q-mt-md">
<q-item v-for="i in 2" :key="i">
<q-item-section>
<q-skeleton type="text" />
</q-item-section>
<q-item-section>
<q-skeleton type="text" />
</q-item-section>
</q-item>
</q-list>
<q-card-section class="q-gutter-y-sm">
<q-skeleton type="QBtn" class="full-width" height="48px" />
<q-skeleton type="QBtn" class="full-width" height="48px" />
</q-card-section>
</q-card>
<q-card v-else bordered>
<q-resize-observer @resize="onResize" />
<q-card-section>
<div class="relative-position" style="height: 120px">
@ -220,8 +260,6 @@ function redirectToPagePetition() {
<q-separator />
<!-- รายการเเตละหน -->
<q-tab-panels v-model="tab" animated>
<q-tab-panel name="information">
<InformationPage />
@ -248,7 +286,41 @@ function redirectToPagePetition() {
</div>
<div v-else>
<q-card bordered>
<q-card v-if="dataStore.isLoadingProfile" bordered>
<q-resize-observer @resize="onResize" />
<q-card-section>
<div class="relative-position" style="height: 120px">
<div class="absolute-center">
<q-skeleton type="QAvatar" :size="sizeImg || '100px'" />
</div>
</div>
<div class="column items-center q-mt-md q-mb-lg q-gutter-sm">
<q-skeleton type="text" width="120px" />
<q-skeleton type="text" width="150px" />
<q-skeleton type="text" width="100px" />
<q-skeleton type="text" width="50px" />
</div>
<div class="row justify-center q-gutter-x-lg">
<q-skeleton type="QRadio" size="48px" />
<q-skeleton type="QRadio" size="48px" />
</div>
<q-list separator class="q-mt-md">
<q-item v-for="i in 5" :key="i">
<q-item-section>
<q-skeleton type="text" width="120px" height="16px" />
</q-item-section>
<q-item-section avatar>
<q-skeleton type="QIcon" size="24px" />
</q-item-section>
</q-item>
</q-list>
</q-card-section>
</q-card>
<q-card v-else bordered>
<q-resize-observer @resize="onResize" />
<q-card-section>
<div class="text-center q-mt-md">

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted, watch } from "vue";
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router";
@ -37,8 +37,11 @@ const statusOptionMain = ref<DataOption[]>(
);
const statusOption = ref<DataOption[]>(statusOptionMain.value); //
const isLoading = ref<boolean>(false); //
async function fetchData() {
showLoader();
// showLoader();
isLoading.value = true;
await http
.get(config.API.requestEditByType(link.value) + `${requestId.value}`)
.then(async (res) => {
@ -56,9 +59,10 @@ async function fetchData() {
})
.catch((err) => {
messageError($q, err);
hideLoader();
})
.finally(() => {});
.finally(() => {
isLoading.value = false;
});
}
const checkFile = ref<null | false | "img" | "doc">(null); // null , false , "img" , "doc"
@ -154,7 +158,37 @@ onMounted(async () => {
</div>
</div>
<div class="col-12"><q-separator /></div>
<q-card-section class="col-12">
<q-card-section v-if="isLoading" class="col-12">
<div class="row q-col-gutter-sm">
<!-- นทนขอ Skeleton -->
<div class="col-md-2 col-xs-12">
<q-skeleton type="QInput" height="40px" />
</div>
<!-- เรอง Skeleton -->
<div class="col-md-10 col-xs-12">
<q-skeleton type="QInput" height="40px" />
</div>
<!-- รายละเอยด Skeleton -->
<div class="col-12">
<q-skeleton type="QInput" height="160px" />
</div>
<!-- ไฟล Skeleton -->
<div class="col-12 q-mt-md">
<q-skeleton
type="rect"
width="120px"
height="20px"
class="q-mb-sm"
/>
</div>
</div>
</q-card-section>
<q-card-section v-else class="col-12">
<div class="row q-col-gutter-sm">
<!-- นทนขอ -->
<div class="col-md-2 col-xs-12">
@ -265,7 +299,19 @@ onMounted(async () => {
<div class="q-pl-sm text-weight-bold text-dark">สถานะคำรอง</div>
</div>
<div class="col-12"><q-separator /></div>
<q-card-section class="col-12">
<q-card-section v-if="isLoading" class="col-12">
<div class="row q-col-gutter-sm">
<div class="col-12">
<q-skeleton type="QInput" height="40px" />
</div>
<div class="col-12">
<q-skeleton type="QInput" height="160px" />
</div>
</div>
</q-card-section>
<q-card-section v-else class="col-12">
<div class="row q-col-gutter-sm">
<div class="col-xs-12 col-md-12">
<q-select
@ -312,6 +358,7 @@ onMounted(async () => {
<div class="col-12 q-mt-sm">
<Workflow
v-if="dataStore.officerType && requestId"
ref="workflowRef"
:id="requestId"
:sys-name="

View file

@ -6,10 +6,10 @@ import http from "@/plugins/http";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useRequestEditStore } from "@/modules/10_registry/store/RequestEdit";
import { useCounterMixin } from "@/stores/mixin";
/**
* importType
*/
/**importType*/
import type { QTableProps } from "quasar";
import type {
DataOption,
@ -17,39 +17,26 @@ import type {
} from "@/modules/10_registry/interface/index/Main";
import type { DataRequest } from "@/modules/10_registry/interface/response/Main";
/**
* importComponents
*/
/** importComponents*/
import DialogAddRequestEdit from "@/modules/10_registry/components/DialogAddRequestEdit.vue";
import SkeletonTable from "@/components/SkeletonTable.vue";
/**
* importStore
*/
import { useRequestEditStore } from "@/modules/10_registry/store/RequestEdit";
import { useCounterMixin } from "@/stores/mixin";
/**
* use
*/
/** use */
const $q = useQuasar();
const store = useRequestEditStore();
const link = ref<string>("");
const router = useRouter();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, dialogRemove, success } =
useCounterMixin();
const { messageError } = useCounterMixin();
/**
* วแปร
*/
/** ตัวแปร*/
const modalPetiton = ref<boolean>(false);
const status = ref<string>("");
const keyword = ref<string>("");
const statusOption = ref<DataOption[]>(store.optionStatus);
const isLoading = ref<boolean>(false);
/**
* Table
*/
/** Table*/
const rows = ref<DataRequest[]>([]);
const page = ref<number>(1);
const pageSize = ref<number>(10);
@ -124,32 +111,26 @@ const visibleColumns = ref<string[]>([
"remark",
]);
/**
* function กลบไปหนาทะเบยนประว
*/
/** function กลับไปหน้าทะเบียนประวัติ*/
function onclickBackPage() {
router.push(`/registry`);
}
/**
* function กดเพมรายการยนคำรองขอแกไขขอม
*/
/** function กดเพิ่มรายการยื่นคำร้องขอแก้ไขข้อมูล*/
function onClickAdd() {
modalPetiton.value = true;
}
/**
* function fetch รายการขอมลการยนคำรองขอแกไขขอม
*/
function fetchListRequset() {
/** function fetch รายการข้อมูลการยื่นคำร้องขอแก้ไขข้อมูล*/
async function fetchListRequset() {
let queryParams = {
page: page.value,
pageSize: pageSize.value,
status: status.value,
keyword: keyword.value,
};
showLoader();
http
isLoading.value = true;
await http
.get(config.API.requestEditByType(link.value) + `user`, {
params: queryParams,
})
@ -163,21 +144,17 @@ function fetchListRequset() {
messageError($q, err);
})
.finally(() => {
hideLoader();
isLoading.value = false;
});
}
/**
* function เลอกสถานะคำรอง
*/
/** function เลือกสถานะคำร้อง*/
function updateStatusValue() {
page.value = 1;
fetchListRequset();
}
/**
* function เคลยรอมลสถานะคำรอง
*/
/** function เคลียร์ข้อมูลสถานะคำร้อง*/
function clearStatus() {
status.value = "";
statusOption.value = store.optionStatus;
@ -197,80 +174,15 @@ function filterOption(val: string, update: Function) {
});
}
/**
* function พเดทขนาดหนาใน pagination
* @param newPagination อมลใหมของ pagination
*/
function updatePageSizePagination(newPagination: NewPagination) {
page.value = 1;
pageSize.value = newPagination.rowsPerPage;
}
/**
* function หาชอไฟล
* @param id รายการยนคำรองขอแกไขขอม
*/
function onDownloadFile(id: string) {
showLoader();
http
.get(
config.API.file(
"ระบบทะเบียนประวัติ",
"เอกสารหลักฐานคำร้องขอแก้ไขข้อมูล",
id
)
)
.then((res) => {
if (res.data.length !== 0) {
downloadUrl(id, res.data[0].fileName);
} else {
hideLoader();
}
})
.catch((e) => {
messageError($q, e);
hideLoader();
});
}
/**
* function โหลดไฟล
* @param id รายการยนคำรองขอแกไขขอม
* @param fileName อไฟล
*/
function downloadUrl(id: string, fileName: string) {
http
.get(
config.API.fileByFile(
"ระบบทะเบียนประวัติ",
"เอกสารหลักฐานคำร้องขอแก้ไขข้อมูล",
id,
fileName
)
)
.then((res) => {
window.open(res.data.downloadUrl, "_blank");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
// function onDeleteLidt(id: string) {
// dialogRemove($q, () => {
// showLoader();
// http
// .delete(config.API.requestEdit + `${id}`)
// .then(async (res) => {
// await fetchListRequset();
// await success($q, "");
// })
// .catch((err) => {
// messageError($q, err);
// hideLoader();
// });
// });
// }
watch(
() => pageSize.value,
() => {
@ -381,7 +293,9 @@ onMounted(async () => {
</div>
</div>
<div class="col-12">
<SkeletonTable v-if="isLoading" :columns="columns" />
<d-table
v-else
:columns="columns"
:rows="rows"
row-key="id"
@ -411,36 +325,11 @@ onMounted(async () => {
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<!-- <div v-else-if="col.name === 'document'">
<q-btn
icon="mdi-download"
round
dense
flat
color="primary"
size="12px"
@click.stop.pervent="onDownloadFile(props.row.id)"
>
<q-tooltip>หลกฐานอางอ</q-tooltip>
</q-btn>
</div> -->
<div v-else class="table_ellipsis2">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<!-- <q-td>
<q-btn
v-if="props.row.status === 'PENDING'"
flat
round
color="red"
icon="mdi-delete"
size="12px"
@click="onDeleteLidt(props.row.id)"
>
<q-tooltip>ลบคำรองขอแกไขขอม</q-tooltip>
</q-btn>
</q-td> -->
</q-tr>
</template>
<template v-slot:pagination="scope">