This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-10-04 16:44:30 +07:00
parent b0b077b1d4
commit 0d5db9160e
7 changed files with 30 additions and 68 deletions

View file

@ -3,13 +3,11 @@ import { ref } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
/** /** importType*/
* importType*
*/
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { QForm } from "quasar"; import type { QForm } from "quasar";
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
@ -18,27 +16,19 @@ import type {
Position, Position,
} from "@/modules/04_registryPerson/interface/response/History"; } from "@/modules/04_registryPerson/interface/response/History";
/** /** import components*/
* import components
*/
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
/** //use
* use
*/
const myForm = ref<QForm>(); const myForm = ref<QForm>();
const router = useRouter(); const router = useRouter();
const $q = useQuasar(); const $q = useQuasar();
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin(); const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
/** //props
* props
*/
const modal = defineModel<boolean>("modal", { required: true }); // popup const modal = defineModel<boolean>("modal", { required: true }); // popup
/** //
* วแปร
*/
const employeeClass = ref<string>(""); // const employeeClass = ref<string>(""); //
const typeKeyword = ref<string>(""); const typeKeyword = ref<string>("");
const Keyword = ref<string>(""); const Keyword = ref<string>("");
@ -47,6 +37,7 @@ const employeeClassOps = ref<DataOption[]>([
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" }, { id: "officer", name: "ข้าราชการ กทม.สามัญ" },
{ id: "perm", name: "ลูกจ้างประจำ" }, { id: "perm", name: "ลูกจ้างประจำ" },
]); ]);
//
const typeKeywordOps = ref<DataOption[]>([ const typeKeywordOps = ref<DataOption[]>([
{ id: "no", name: "ตำแหน่งเลขที่" }, { id: "no", name: "ตำแหน่งเลขที่" },
{ id: "position", name: "ตำแหน่ง" }, { id: "position", name: "ตำแหน่ง" },
@ -54,9 +45,7 @@ const typeKeywordOps = ref<DataOption[]>([
const positionOps = ref<DataOption[]>([]); const positionOps = ref<DataOption[]>([]);
const options = ref<DataOption[]>([]); const options = ref<DataOption[]>([]);
/** /** Table*/
* Table
*/
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
@ -110,9 +99,7 @@ const columns = ref<QTableProps["columns"]>([
]); ]);
const rows = ref<HistoryPos[]>([]); const rows = ref<HistoryPos[]>([]);
/** /** function fetch ข้อมูลตำแหน่ง ข้าราชการ*/
* function fetch อมลตำแหน าราชการ
*/
function fecthPositionOfficer() { function fecthPositionOfficer() {
http http
.get(config.API.listPositionPathHistory) .get(config.API.listPositionPathHistory)
@ -130,9 +117,7 @@ function fecthPositionOfficer() {
}); });
} }
/** /** function fetch ข้อมูลตำแหน่ง ลูกจ้างประจำ*/
* function fetch อมลตำแหน กจางประจำ
*/
function fetchPositionPerm() { function fetchPositionPerm() {
http http
.get(config.API.listPositionEmployeePositionHistory) .get(config.API.listPositionEmployeePositionHistory)
@ -151,9 +136,7 @@ function fetchPositionPerm() {
}); });
} }
/** /** function เปลี่ยนประเภท*/
* function เปลยนประเภท
*/
function changeEmployeeClass() { function changeEmployeeClass() {
typeKeyword.value = ""; typeKeyword.value = "";
Keyword.value = ""; Keyword.value = "";
@ -256,9 +239,7 @@ function clickRedirect(id: string) {
router.push(`${url}/${id}`); router.push(`${url}/${id}`);
} }
/** /** function ปิด popup*/
* function popup
*/
function closeDialog() { function closeDialog() {
modal.value = false; modal.value = false;
employeeClass.value = ""; employeeClass.value = "";

View file

@ -5,26 +5,18 @@ import { checkPermission } from "@/utils/permissions";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store"; import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
/** //importType
*importType
*/
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { FormFilter } from "@/modules/04_registryPerson/interface/request/Main"; import type { FormFilter } from "@/modules/04_registryPerson/interface/request/Main";
/** //importComponent
* importComponent
*/
import DialogHistory from "@/modules/04_registryPerson/components/DialogHistory.vue"; import DialogHistory from "@/modules/04_registryPerson/components/DialogHistory.vue";
/** //use
* use
*/
const store = useRegistryNewDataStore(); const store = useRegistryNewDataStore();
const router = useRouter(); const router = useRouter();
/** //props
* props
*/
const formFilter = defineModel<FormFilter>("formFilter", { required: true }); // const formFilter = defineModel<FormFilter>("formFilter", { required: true }); //
const maxPage = defineModel<Number>("maxPage", { required: true }); // const maxPage = defineModel<Number>("maxPage", { required: true }); //
const empType = defineModel<string>("empType", { required: true }); // , const empType = defineModel<string>("empType", { required: true }); // ,
@ -36,12 +28,10 @@ const props = defineProps({
total: { type: Number, default: 0 }, total: { type: Number, default: 0 },
}); });
/** //
* วแปร
*/
const modalHistory = ref<boolean>(false); // const modalHistory = ref<boolean>(false); //
/** ข้อมูล Table*/ // Table
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
@ -163,9 +153,7 @@ const pagination = ref({
rowsPerPage: formFilter.value.pageSize, rowsPerPage: formFilter.value.pageSize,
}); });
/** /** function เปลี่ยนหน้า Table*/
* function เปลยนหน Table
*/
function updatePagePagination() { function updatePagePagination() {
props.fetchData?.(); props.fetchData?.();
} }
@ -179,9 +167,7 @@ function updatePageSizePagination(newPagination: any) {
formFilter.value.pageSize = newPagination.rowsPerPage; formFilter.value.pageSize = newPagination.rowsPerPage;
} }
/** /** function เปิด popup ประวัติถือครองตำแหน่ง*/
* function เป popup ประวอครองตำแหน
*/
function onClickHistory() { function onClickHistory() {
modalHistory.value = !modalHistory.value; modalHistory.value = !modalHistory.value;
} }
@ -198,16 +184,13 @@ function onClickViewDetail(id: string) {
} }
} }
/** /** function redirect ไปหน้ารายการคำร้องขอแก้ไขข้อมูล*/
* function redirect ไปหนารายการคำรองขอแกไขขอม
*/
function redirectToPagePetition() { function redirectToPagePetition() {
router.push(`/registry-officer/request-edit`); router.push(`/registry-officer/request-edit`);
} }
/** /**
* การเปลยนแปลงของ formFilter.value.pageSize * การเปลยนแปลงของ formFilter.value.pageSize
*
* เมอมการเปลยนแปลงจำทำการดงขอมลรายการทะเบยนประวใหมตามจำนวน formFilter.value.pageSize * เมอมการเปลยนแปลงจำทำการดงขอมลรายการทะเบยนประวใหมตามจำนวน formFilter.value.pageSize
*/ */
watch( watch(

View file

@ -250,6 +250,7 @@ watch(
} }
); );
/** HooK lifecycle ทำงานเมื่อมีการเรียกใช้งาน Componenets */
onMounted(() => { onMounted(() => {
fetchListRequset(); fetchListRequset();
}); });

View file

@ -19,18 +19,15 @@ import DialogEditIDP from "@/modules/04_registryPerson/components/requestEdit/Di
const $q = useQuasar(); const $q = useQuasar();
const store = useRequestEditStore(); const store = useRequestEditStore();
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin(); const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
/**
* วแปร //
*/
const status = ref<string>("PENDING"); // const status = ref<string>("PENDING"); //
const keyword = ref<string>(""); // const keyword = ref<string>(""); //
const statusOption = ref<DataOption[]>(store.optionStatusIDP); // const statusOption = ref<DataOption[]>(store.optionStatusIDP); //
const modalEdit = ref<boolean>(false); // const modalEdit = ref<boolean>(false); //
const requestId = ref<string>(""); //id const requestId = ref<string>(""); //id
/** //Table
* Table
*/
const rows = ref<DataListsIDP[]>([]); // const rows = ref<DataListsIDP[]>([]); //
const page = ref<number>(1); // const page = ref<number>(1); //
const pageSize = ref<number>(10); // const pageSize = ref<number>(10); //
@ -279,6 +276,8 @@ watch(
} }
); );
/** HooK lifecycle ทำงานเมื่อมีการเรียกใช้งาน Componenets*/
onMounted(() => { onMounted(() => {
fetchData(); fetchData();
}); });

View file

@ -265,10 +265,6 @@ watch(modal, (val) => {
<!-- สถานะคำรอง --> <!-- สถานะคำรอง -->
<q-card-section> <q-card-section>
<q-card bordered class="col-12"> <q-card bordered class="col-12">
<!-- <div class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md">
สถานะคำรอง
</div>
<q-separator /> -->
<div class="row q-pa-md q-col-gutter-sm"> <div class="row q-pa-md q-col-gutter-sm">
<!-- สถานะ --> <!-- สถานะ -->
<div class="col-4"> <div class="col-4">

View file

@ -48,6 +48,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
* @param data * @param data
*/ */
async function fetchData(data: any) { async function fetchData(data: any) {
if (data !== null) { if (data !== null) {
let datalist = await data.map((e: any) => ({ let datalist = await data.map((e: any) => ({
id: e.id, id: e.id,

View file

@ -10,7 +10,8 @@ import type {
/** import Stores */ /** import Stores */
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
/** useStore*/
/** use*/
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { date2Thai } = mixin; const { date2Thai } = mixin;