ปรับ code บรรจุ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-12-20 10:29:07 +07:00
parent 063db4e245
commit 35a5817db3
16 changed files with 559 additions and 700 deletions

View file

@ -3,7 +3,7 @@ const placement = `${env.API_PLACEMENT_URI}/placement`;
const disciplineReportList = `${env.API_URI}/discipline/complaint/report`; const disciplineReportList = `${env.API_URI}/discipline/complaint/report`;
const orgTree = `${env.API_URI_ORG_TREE}`; const orgTree = `${env.API_URI_ORG_TREE}`;
const order = `${env.API_PLACEMENT_URI}`; const order = `${env.API_PLACEMENT_URI}`;
const receive = `${env.API_PLACEMENT_URI}/placement/Receive`; const receive = `${env.API_PLACEMENT_URI}/placement/receive`;
const transfer = `${placement}/transfer`; const transfer = `${placement}/transfer`;
const placemenHelpGov = `${placement}/officer`; const placemenHelpGov = `${placement}/officer`;
const placemenRepatriation = `${placement}/repatriation`; const placemenRepatriation = `${placement}/repatriation`;

View file

@ -530,7 +530,7 @@ onMounted(async () => {
<q-card class="no-scroll"> <q-card class="no-scroll">
<DialogHeader :tittle="title" :close="close" /> <DialogHeader :tittle="title" :close="close" />
<q-separator /> <q-separator />
<q-card-section style="max-height: 80vh" class="scroll"> <q-card-section style="max-height: 80vh">
<div class="row"> <div class="row">
<q-card <q-card
bordered bordered
@ -589,7 +589,12 @@ onMounted(async () => {
</template> </template>
</q-tree> </q-tree>
</q-card> </q-card>
<q-card bordered class="col-12 col-sm-9 q-pa-sm">
<q-card
bordered
style="height: 75vh"
class="col-12 col-sm-9 q-pa-sm scroll"
>
<q-tab-panels <q-tab-panels
v-model="nodeId" v-model="nodeId"
animated animated
@ -616,7 +621,7 @@ onMounted(async () => {
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div class="col-12 q-pa-md"> <div class="col-12 q-pa-md">
<q-toolbar style="padding: 0px"> <q-toolbar style="padding: 0px">
<div class="row q-gutter-md"> <div class="row q-gutter-sm">
<q-checkbox <q-checkbox
keep-color keep-color
v-model="isBlank" v-model="isBlank"
@ -628,7 +633,7 @@ onMounted(async () => {
</div> </div>
<q-space /> <q-space />
<div class="row q-gutter-md"> <div class="row q-gutter-sm">
<q-checkbox <q-checkbox
keep-color keep-color
v-model="isAll" v-model="isAll"
@ -648,7 +653,7 @@ onMounted(async () => {
@keydown.enter.prevent="onSearch" @keydown.enter.prevent="onSearch"
> >
<template v-slot:append> <template v-slot:append>
<q-icon name="search" color="grey-5" /> <q-icon name="search" />
</template> </template>
</q-input> </q-input>
</div> </div>

View file

@ -40,7 +40,7 @@ const {
hideLoader, hideLoader,
date2Thai, date2Thai,
dialogMessageNotify, dialogMessageNotify,
onSearchDataTable onSearchDataTable,
} = mixin; } = mixin;
const route = useRoute(); const route = useRoute();
@ -496,7 +496,6 @@ function onSearch() {
); );
} }
onMounted(() => { onMounted(() => {
fetchTree(); fetchTree();
}); });
@ -504,379 +503,380 @@ onMounted(() => {
<template> <template>
<q-dialog v-model="modal" persistent full-width> <q-dialog v-model="modal" persistent full-width>
<q-card class="no-scroll"> <q-card class="no-scroll">
<DialogHeader :tittle="title" :close="close" /> <DialogHeader :tittle="title" :close="close" />
<q-separator /> <q-separator />
<q-card-section style="max-height: 80vh" class="scroll"> <q-card-section style="max-height: 80vh">
<div class="row"> <div class="row">
<q-card <q-card
bordered bordered
class="col-12 col-sm-3 scroll q-pa-sm" class="col-12 col-sm-3 scroll q-pa-sm"
style="height: 75vh" style="height: 75vh"
>
<q-toolbar style="padding: 0">
<q-toolbar-title class="text-subtitle2 text-bold"
>เลอกหนวยงาน/วนราชการ</q-toolbar-title
>
</q-toolbar>
<q-input dense outlined v-model="filter" label="ค้นหา">
<template v-slot:append>
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
</template>
</q-input>
<q-tree
class="q-pa-sm q-gutter-sm"
dense
:nodes="lazy"
node-key="orgTreeId"
label-key="labelName"
:filter="filter"
no-results-label="ไม่พบข้อมูลที่ค้นหา"
no-nodes-label="ไม่มีข้อมูล"
v-model:expanded="expanded"
> >
<q-toolbar style="padding: 0"> <template v-slot:default-header="prop">
<q-toolbar-title class="text-subtitle2 text-bold" <q-item
>เลอกหนวยงาน/วนราชการ</q-toolbar-title @click.stop="updateSelected(prop.node)"
clickable
:active="nodeId == prop.node.orgTreeId"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
> >
</q-toolbar> <div>
<div class="text-weight-medium">
<q-input dense outlined v-model="filter" label="ค้นหา"> {{ prop.node.orgTreeName }}
<template v-slot:append>
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
</template>
</q-input>
<q-tree
class="q-pa-sm q-gutter-sm"
dense
:nodes="lazy"
node-key="orgTreeId"
label-key="labelName"
:filter="filter"
no-results-label="ไม่พบข้อมูลที่ค้นหา"
no-nodes-label="ไม่มีข้อมูล"
v-model:expanded="expanded"
>
<template v-slot:default-header="prop">
<q-item
@click.stop="updateSelected(prop.node)"
clickable
:active="nodeId == prop.node.orgTreeId"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<div>
<div class="text-weight-medium">
{{ prop.node.orgTreeName }}
</div>
<div class="text-weight-light">
{{
prop.node.orgCode == null ? null : prop.node.orgCode
}}
{{
prop.node.orgTreeShortName == null
? null
: prop.node.orgTreeShortName
}}
</div>
</div> </div>
</q-item> <div class="text-weight-light">
</template> {{ prop.node.orgCode == null ? null : prop.node.orgCode }}
</q-tree> {{
</q-card> prop.node.orgTreeShortName == null
<q-card bordered class="col-12 col-sm-9 q-pa-sm"> ? null
<q-tab-panels : prop.node.orgTreeShortName
v-model="nodeId" }}
animated
transition-prev="jump-up"
transition-next="jump-up"
>
<q-tab-panel
v-for="(item, index) in itemTaps"
:key="index"
:name="item"
>
<div class="column q-col-gutter-sm">
<!-- เลอกตำแหนงเลขท -->
<div class="col-7">
<q-card
bordered
style="height: 100%; border: 1px solid #d6dee1"
>
<div
class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
>
เลอกตำแหนงเลขท
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12 q-pa-md">
<q-toolbar style="padding: 0px">
<div class="row q-gutter-md">
<q-checkbox
keep-color
v-model="isBlank"
label="แสดงเฉพาะตำแหน่งว่าง"
color="primary"
>
<q-tooltip>แสดงเฉพาะตำแหนงวาง </q-tooltip>
</q-checkbox>
</div>
<q-space />
<div class="row q-gutter-md">
<q-checkbox
keep-color
v-model="isAll"
label="แสดงตำแหน่งทั้งหมด"
color="primary"
>
<q-tooltip
>แสดงตำแหนงทงหมดภายใตหนวยงาน/วนราชการทเลอก</q-tooltip
>
</q-checkbox>
<div>
<q-input
outlined
dense
v-model="filters"
label="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" color="grey-5" />
</template>
</q-input>
</div>
<div>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
emit-value
:display-value="$q.lang.table.columns"
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div>
</q-toolbar>
<d-table
ref="table"
:columns="columns"
:rows="positionNo.length !== 0 ? positionNo : []"
row-key="id"
flat
bordered
:paging="true"
dense
:rows-per-page-options="[10, 25, 50, 100]"
class="tableTb"
:visible-columns="visibleColumns"
>
<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 in props.cols"
:key="col.name"
:props="props"
@click="onClickSelectPos(props.row.id)"
:class="{
'text-red': props.row.isCondition === true,
'bg-blue-2': props.row.id === positionId,
}"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name === 'posMasterNo'">
{{
props.row.isSit
? col.value + " " + "(ทับที่)"
: col.value
}}
</div>
<div v-else-if="col.name === 'isPosition'">
<div v-if="col.value">
<q-icon
name="done"
color="primary"
size="24px"
>
<q-tooltip>ตรงตามตำแหน </q-tooltip>
</q-icon>
</div>
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</q-card>
</div>
<!-- เลอกตำแหน -->
<div class="col-5">
<q-card
bordered
style="height: 100%; border: 1px solid #d6dee1"
>
<div
class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
>
เลอกตำแหน
</div>
<div class="col-12"><q-separator /></div>
<q-tab-panels
v-model="positionId"
animated
swipeable
vertical
transition-prev="jump-up"
transition-next="jump-up"
>
<q-tab-panel
v-for="(item, index) in positionData"
:key="index"
:name="item.id"
>
<div class="col-12">
<q-toolbar style="padding: 0px">
<datepicker
menu-class-name="modalfix"
v-model="datePos"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:min-date="datePos"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
ref="dateRef"
outlined
dense
hide-bottom-space
:model-value="
datePos != null
? date2Thai(datePos)
: null
"
label="วันที่รายงานตัว"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</q-toolbar>
<d-table
ref="table"
:columns="columnsPostition"
:rows="
rowsPosition.length !== 0 ? rowsPosition : []
"
row-key="id"
flat
bordered
:paging="true"
dense
:rows-per-page-options="[10, 25, 50, 100]"
class="tableTb"
selection="single"
v-model:selected="selectedPos"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.checkBox"
/>
</template>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width />
<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>
<q-checkbox
keep-color
color="primary"
dense
v-model="props.selected"
/>
</q-td>
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div
v-else-if="col.name === 'posMasterNo'"
>
{{
props.row.isSit
? col.value + " " + "(ทับที่)"
: col.value
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</q-tab-panel>
</q-tab-panels>
</q-card>
</div> </div>
</div> </div>
</q-tab-panel> </q-item>
</q-tab-panels> </template>
</q-card> </q-tree>
</div> </q-card>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white text-teal"> <q-card
<q-btn label="บันทึก" color="secondary" type="submit" @click="onSubmit" bordered
><q-tooltip>นทกขอม</q-tooltip></q-btn style="height: 75vh"
class="col-12 col-sm-9 q-pa-sm scroll"
> >
</q-card-actions> <q-tab-panels
v-model="nodeId"
animated
transition-prev="jump-up"
transition-next="jump-up"
>
<q-tab-panel
v-for="(item, index) in itemTaps"
:key="index"
:name="item"
>
<div class="column q-col-gutter-sm">
<!-- เลอกตำแหนงเลขท -->
<div class="col-7">
<q-card
bordered
style="height: 100%; border: 1px solid #d6dee1"
>
<div
class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
>
เลอกตำแหนงเลขท
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12 q-pa-md">
<q-toolbar style="padding: 0px">
<div class="row q-gutter-md">
<q-checkbox
keep-color
v-model="isBlank"
label="แสดงเฉพาะตำแหน่งว่าง"
color="primary"
>
<q-tooltip>แสดงเฉพาะตำแหนงวาง </q-tooltip>
</q-checkbox>
</div>
<q-space />
<div class="row q-gutter-md">
<q-checkbox
keep-color
v-model="isAll"
label="แสดงตำแหน่งทั้งหมด"
color="primary"
>
<q-tooltip
>แสดงตำแหนงทงหมดภายใตหนวยงาน/วนราชการทเลอก</q-tooltip
>
</q-checkbox>
<div>
<q-input
outlined
dense
v-model="filters"
label="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" color="grey-5" />
</template>
</q-input>
</div>
<div>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
emit-value
:display-value="$q.lang.table.columns"
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div>
</q-toolbar>
<d-table
ref="table"
:columns="columns"
:rows="positionNo.length !== 0 ? positionNo : []"
row-key="id"
flat
bordered
:paging="true"
dense
:rows-per-page-options="[10, 25, 50, 100]"
class="tableTb"
:visible-columns="visibleColumns"
>
<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 in props.cols"
:key="col.name"
:props="props"
@click="onClickSelectPos(props.row.id)"
:class="{
'text-red': props.row.isCondition === true,
'bg-blue-2': props.row.id === positionId,
}"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name === 'posMasterNo'">
{{
props.row.isSit
? col.value + " " + "(ทับที่)"
: col.value
}}
</div>
<div v-else-if="col.name === 'isPosition'">
<div v-if="col.value">
<q-icon
name="done"
color="primary"
size="24px"
>
<q-tooltip>ตรงตามตำแหน </q-tooltip>
</q-icon>
</div>
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</q-card>
</div>
<!-- เลอกตำแหน -->
<div class="col-5">
<q-card
bordered
style="height: 100%; border: 1px solid #d6dee1"
>
<div
class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
>
เลอกตำแหน
</div>
<div class="col-12"><q-separator /></div>
<q-tab-panels
v-model="positionId"
animated
swipeable
vertical
transition-prev="jump-up"
transition-next="jump-up"
>
<q-tab-panel
v-for="(item, index) in positionData"
:key="index"
:name="item.id"
>
<div class="col-12">
<q-toolbar style="padding: 0px">
<datepicker
menu-class-name="modalfix"
v-model="datePos"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:min-date="datePos"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
ref="dateRef"
outlined
dense
hide-bottom-space
:model-value="
datePos != null
? date2Thai(datePos)
: null
"
label="วันที่รายงานตัว"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</q-toolbar>
<d-table
ref="table"
:columns="columnsPostition"
:rows="
rowsPosition.length !== 0 ? rowsPosition : []
"
row-key="id"
flat
bordered
:paging="true"
dense
:rows-per-page-options="[10, 25, 50, 100]"
class="tableTb"
selection="single"
v-model:selected="selectedPos"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.checkBox"
/>
</template>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width />
<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>
<q-checkbox
keep-color
color="primary"
dense
v-model="props.selected"
/>
</q-td>
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name === 'posMasterNo'">
{{
props.row.isSit
? col.value + " " + "(ทับที่)"
: col.value
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</q-tab-panel>
</q-tab-panels>
</q-card>
</div>
</div>
</q-tab-panel>
</q-tab-panels>
</q-card>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white text-teal">
<q-btn label="บันทึก" color="secondary" type="submit" @click="onSubmit"
><q-tooltip>นทกขอม</q-tooltip></q-btn
>
</q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
</template> </template>

View file

@ -252,7 +252,7 @@ onMounted(async () => {
<DialogHeader :tittle="title" :close="close" /> <DialogHeader :tittle="title" :close="close" />
<q-separator /> <q-separator />
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<q-card-section style="max-height: 70vh" class="scroll"> <q-card-section style="max-height: 70vh">
<div class="row"> <div class="row">
<q-card <q-card
bordered bordered
@ -302,7 +302,12 @@ onMounted(async () => {
</template> </template>
</q-tree> </q-tree>
</q-card> </q-card>
<q-card bordered class="col-12 col-sm-9 q-pa-sm">
<q-card
bordered
style="height: 75vh"
class="col-12 col-sm-9 q-pa-sm scroll"
>
<div class="col-12 row q-py-sm items-center q-col-gutter-sm"> <div class="col-12 row q-py-sm items-center q-col-gutter-sm">
<q-space /> <q-space />
<div class="items-center" style="display: flex"> <div class="items-center" style="display: flex">

View file

@ -346,6 +346,18 @@ interface PersonData {
statusName: string; statusName: string;
organizationName: string; organizationName: string;
id: string; id: string;
posTypeOldId: string;
posLevelOldId: string;
positionOld: string;
status: string;
educationOld: string;
organizationPositionOld: string;
positionTypeOld: string;
positionLevelOld: string;
positionNumberOld: number;
positionDate: string;
posTypeNameOld: string;
posLevelNameOld: string;
} }
interface AppointTopic { interface AppointTopic {

View file

@ -131,6 +131,22 @@ interface MemBerType {
actFullName: string; actFullName: string;
isDirector?: boolean; isDirector?: boolean;
} }
interface FormDataAppoint {
node: string;
nodeId: number;
orgRevisionId: string;
positionId: string;
posMasterNo: number;
positionName: string;
posTypeId: string;
posTypeName: string;
posLevelId: string;
posLevelName: string;
reportingDate: string;
posmasterId: string;
typeCommand: string;
}
export type { export type {
FormPlacementMainData, FormPlacementMainData,
FormOrderPlacementMainData, FormOrderPlacementMainData,
@ -146,5 +162,6 @@ export type {
AppointMainRows, AppointMainRows,
FormAppointData, FormAppointData,
MemBerType, MemBerType,
PersonsAppointData PersonsAppointData,
FormDataAppoint,
}; };

View file

@ -28,6 +28,10 @@ interface ResponseRow {
positionTypeId: string; positionTypeId: string;
positionLevelId: string; positionLevelId: string;
amountOld: number; amountOld: number;
posTypeOldId: string;
posLevelOldId: string;
positionOld: string;
posMasterNo: number;
} }
interface ResponseData { interface ResponseData {

View file

@ -89,8 +89,8 @@ export const useProfileDataStore = defineStore("profilePlacenent", () => {
export const usePlacementDataStore = defineStore("placement", () => { export const usePlacementDataStore = defineStore("placement", () => {
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
const tabsMain = ref<string>("probation"); const tabsMain = ref<string>("probation");
const isOfficer = ref<boolean|null>(null); const isOfficer = ref<boolean | null>(null);
const isStaff = ref<boolean|null>(null); const isStaff = ref<boolean | null>(null);
const { hideLoader } = mixin; const { hideLoader } = mixin;
interface placement { interface placement {
mappingPosition: { columns: String[] }; mappingPosition: { columns: String[] };
@ -113,8 +113,9 @@ export const usePlacementDataStore = defineStore("placement", () => {
let DataMainUpdate = ref<FormPlacementMainData[]>([]); // ข้อมูลเปลี่ยนแปลง let DataMainUpdate = ref<FormPlacementMainData[]>([]); // ข้อมูลเปลี่ยนแปลง
const DataMainYearSet = (val: FormPlacementMainData[]) => const DataMainYearSet = (val: FormPlacementMainData[]) =>
(DataMainYear.value = val); (DataMainYear.value = val);
const DataMain = (val: FormPlacementMainData[]) => (DataMainOrig.value = val); const DataMain = async (val: FormPlacementMainData[]) =>
const DataUpdateMain = ( (DataMainOrig.value = val);
const DataUpdateMain = async (
filter_1: number | string, filter_1: number | string,
filter_2: string | null, filter_2: string | null,
filter_3: boolean filter_3: boolean

View file

@ -17,7 +17,8 @@ import config from "@/app.config";
const DataStore = usePlacementDataStore(); const DataStore = usePlacementDataStore();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai,onSearchDataTable } = mixin; const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const searchYear = ref(); const searchYear = ref();
const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]); const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
@ -31,10 +32,6 @@ const rowsData = ref<any[]>([]);
/** ค้นหาในตาราง */ /** ค้นหาในตาราง */
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const filterRef = ref<any>(null); const filterRef = ref<any>(null);
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
/**ครั้งที่สอบ */ /**ครั้งที่สอบ */
const examTime = ref<number | string>(""); const examTime = ref<number | string>("");
@ -59,19 +56,6 @@ const pagination = ref({
rowsPerPage: 10, rowsPerPage: 10,
}); });
/** ส่วนเเสดงผล ตาราง */
const visibleColumns = ref([
"id",
"examRound",
"examOrder",
"examOrder",
"fiscalYear",
"numberOfCandidates",
"examTypeName",
"accountStartDate",
"accountExpirationDate",
]);
/**หัวตาราง */ /**หัวตาราง */
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
@ -151,6 +135,17 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const visibleColumns = ref([
"id",
"examRound",
"examOrder",
"examOrder",
"fiscalYear",
"numberOfCandidates",
"examTypeName",
"accountStartDate",
"accountExpirationDate",
]);
/** /**
* งชนดงขอมรายการสอบแขงข / ดเลอกตามป * งชนดงขอมรายการสอบแขงข / ดเลอกตามป
@ -165,8 +160,7 @@ async function fetchPlacementData(val: number) {
const data = await res.data.result; const data = await res.data.result;
dataPlacement.value = data; dataPlacement.value = data;
DataStore.DataMainOrig = dataPlacement.value; DataStore.DataMainOrig = dataPlacement.value;
const listData = const listData = DataStore.DataMainOrig.map((e: any) => ({
DataStore.DataMainOrig.map((e: any) => ({
id: e.id, id: e.id,
examRound: e.examRound, examRound: e.examRound,
examOrder: e.examOrder, examOrder: e.examOrder,
@ -178,8 +172,8 @@ async function fetchPlacementData(val: number) {
fiscalYear: e.fiscalYear, fiscalYear: e.fiscalYear,
numberOfCandidates: e.numberOfCandidates, numberOfCandidates: e.numberOfCandidates,
})); }));
rows.value = listData rows.value = listData;
rowsData.value = listData rowsData.value = listData;
filterKeyword.value = ""; filterKeyword.value = "";
examTime.value = "ทั้งหมด"; examTime.value = "ทั้งหมด";
examType.value = "ทั้งหมด"; examType.value = "ทั้งหมด";
@ -199,9 +193,7 @@ async function fetchPlacementData(val: number) {
}); });
} }
/** /** ฟังชั่นดึงข้อมูล ปี ค.ส. */
* งชนดงขอม ..
*/
async function fetchYearOptions() { async function fetchYearOptions() {
showLoader(); showLoader();
await http await http
@ -243,9 +235,7 @@ function redirectToPage(examId?: number) {
router.push(`/placement/personal-list/${examId}`); router.push(`/placement/personal-list/${examId}`);
} }
/** /** ฟิลเตอร์หาครั้งที่สอบ ตาม ปี*/
* ลเตอรหาครงทสอบ ตาม
*/
async function examTimeFilter() { async function examTimeFilter() {
for (const data of dataPlacement.value) { for (const data of dataPlacement.value) {
const examOrder = data.examOrder; const examOrder = data.examOrder;
@ -275,9 +265,7 @@ function examTypeFilter() {
}); });
} }
/** /** ฟังก์ชันค้นหาข้อมูล ายการสอบแข่งขัน / คัดเลือก*/
* งกนคนหาขอม ายการสอบแขงข / ดเลอก
*/
async function searchFilterTable() { async function searchFilterTable() {
rows.value = []; rows.value = [];
if (examType.value !== undefined && examType.value !== null) { if (examType.value !== undefined && examType.value !== null) {
@ -287,7 +275,7 @@ async function searchFilterTable() {
expiredAccount.value expiredAccount.value
); );
const dataArr: any = []; const dataArr: any = [];
await DataStore.DataMainUpdate.map((e: any) => { DataStore.DataMainUpdate.map((e: any) => {
dataArr.push({ dataArr.push({
id: e.id, id: e.id,
examRound: e.examRound, examRound: e.examRound,
@ -373,11 +361,6 @@ function filterFnYear(val: string, update: any) {
} }
} }
function paginationLabel(start: number, end: number, total: number) {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
}
function onSearch() { function onSearch() {
rows.value = onSearchDataTable( rows.value = onSearchDataTable(
filterKeyword.value, filterKeyword.value,
@ -386,9 +369,7 @@ function onSearch() {
); );
} }
/** /** เรียกใช้ฟังชั่น เมื่อเริ่มหน้านี้*/
* เรยกใชงช เมอเรมหนาน
*/
onMounted(async () => { onMounted(async () => {
await fetchYearOptions(); await fetchYearOptions();
}); });
@ -398,9 +379,10 @@ onMounted(async () => {
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
รายการสอบแขงข/ดเลอก รายการสอบแขงข/ดเลอก
</div> </div>
<q-card flat bordered class="col-12 q-mt-sm q-pa-md"> <q-card flat bordered class="col-12 q-mt-sm q-pa-md">
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12">
<q-select <q-select
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
v-model="searchYear" v-model="searchYear"
@ -432,7 +414,6 @@ onMounted(async () => {
<q-space /> <q-space />
<q-input <q-input
class="col-xs-12 col-sm-3 col-md-2"
standout standout
dense dense
v-model="filterKeyword" v-model="filterKeyword"
@ -442,18 +423,12 @@ onMounted(async () => {
@keydown.enter="onSearch" @keydown.enter="onSearch"
> >
<template v-slot:append> <template v-slot:append>
<q-icon name="search" /> <q-icon name="search" />
<!-- <q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/> -->
</template> </template>
</q-input> </q-input>
<q-select <q-select
class="col-xs-12 col-sm-3 col-md-2" class="q-ml-sm"
v-model="visibleColumns" v-model="visibleColumns"
multiple multiple
outlined outlined
@ -526,7 +501,11 @@ onMounted(async () => {
hide-selected hide-selected
fill-input fill-input
:clearable="examType !== 'all' && examType !== 'ทั้งหมด'" :clearable="examType !== 'all' && examType !== 'ทั้งหมด'"
@clear="(examType = 'all'), searchFilterTable()" @clear="
(examTimeOP2 = examTimeOP),
(examType = 'ทั้งหมด'),
searchFilterTable()
"
> >
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
@ -547,8 +526,9 @@ onMounted(async () => {
</div> </div>
</q-card> </q-card>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-table <d-table
ref="table" ref="table"
:rows="rows" :rows="rows"
:columns="columns" :columns="columns"
@ -556,12 +536,9 @@ onMounted(async () => {
flat flat
bordered bordered
dense dense
class="custom-header-table"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
> >
<template v-slot:pagination="scope"> <!-- <template v-slot:pagination="scope">
<q-pagination <q-pagination
v-model="pagination.page" v-model="pagination.page"
active-color="primary" active-color="primary"
@ -572,7 +549,7 @@ onMounted(async () => {
boundary-links boundary-links
direction-links direction-links
></q-pagination> ></q-pagination>
</template> </template> -->
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th auto-width /> <q-th auto-width />
@ -621,7 +598,7 @@ onMounted(async () => {
</q-td> </q-td>
</q-tr> </q-tr>
</template> </template>
</q-table> </d-table>
</div> </div>
</div> </div>
</q-card> </q-card>
@ -643,35 +620,4 @@ onMounted(async () => {
.icon-color { .icon-color {
color: #4154b3; color: #4154b3;
} }
.custom-header-table {
max-height: 64vh;
.q-table tr:nth-child(odd) td {
background: white;
}
.q-table tr:nth-child(even) td {
background: #f8f8f8;
}
.q-table thead tr {
background: #ecebeb;
}
.q-table thead tr th {
position: sticky;
z-index: 1;
}
/* this will be the loading indicator */
.q-table thead tr:last-child th {
/* height of all previous header rows */
top: 48px;
}
.q-table thead tr:first-child th {
top: 0;
}
}
</style> </style>

View file

@ -18,14 +18,15 @@ const $q = useQuasar();
const router = useRouter(); const router = useRouter();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { statusText } = useTransferDataStore(); const { statusText } = useTransferDataStore();
const { date2Thai, messageError, showLoader, hideLoader } = mixin; const { date2Thai, messageError, showLoader, hideLoader, onSearchDataTable } =
mixin;
const modal = ref<boolean>(false); // const modal = ref<boolean>(false); //
const dataTransfer = ref<ResponseData[]>([]); // const dataTransfer = ref<ResponseData[]>([]); //
//Table //Table
const rows = ref<ResponseData[]>([]); // const rows = ref<ResponseData[]>([]); //
const filterMain = ref<string>(""); // const filter = ref(""); //
const rowsOrder = ref<ResponseData[]>([]); // const rowsOrder = ref<ResponseData[]>([]); //
const rowsOrderData = ref<ResponseData[]>([]); // const rowsOrderData = ref<ResponseData[]>([]); //
const filterOrder = ref<string>(""); // const filterOrder = ref<string>(""); //
@ -118,9 +119,7 @@ const visibleColumns = ref<string[]>([
"createdAt", "createdAt",
]); ]);
/** /** ฟังก์ชันดึงข้อมูรายการขอโอน*/
* งกนดงขอมรายการขอโอน
*/
async function fetchData() { async function fetchData() {
showLoader(); showLoader();
await http await http
@ -140,7 +139,6 @@ async function fetchData() {
/** /**
* งกนสงไปออกคำส * งกนสงไปออกคำส
*
* นหารายชอออกคำสงตามสถานะ อน (APPROVE) * นหารายชอออกคำสงตามสถานะ อน (APPROVE)
*/ */
function openModalOrder() { function openModalOrder() {
@ -159,62 +157,34 @@ function openModalOrder() {
modal.value = true; modal.value = true;
} }
/** /** ฟังก์ชันปิด popup ส่งไปออกคำสั่ง*/
* งกนป popup งไปออกคำส
*
*/
function closeModal() { function closeModal() {
modal.value = false; modal.value = false;
filterOrder.value = ""; filterOrder.value = "";
} }
/** function onSearch() {
* งกนคนคาตวแปรคนหา rows.value = onSearchDataTable(
* filter.value,
* กำหนด filterMain และ filterOrder เปนคาวาง dataTransfer.value,
*/ columns.value ? columns.value : []
function resetFilter() { );
filterMain.value = "";
filterOrder.value = "";
} }
/** /**
* ทำงานเม Components กเรยกใชงาน * ทำงานเม Components กเรยกใชงาน
*
* จะเรยกใช fetchData เพอดงขอมลรายการขอโอน * จะเรยกใช fetchData เพอดงขอมลรายการขอโอน
*/ */
onMounted(async () => { onMounted(async () => {
await fetchData(); await fetchData();
}); });
const filter = ref("");
const filterAndApply = () => {
const searchText = filter.value.trim().toLowerCase();
if (!searchText) {
rows.value = dataTransfer.value; //
return;
}
rows.value = dataTransfer.value.filter((row: any) => {
return columns.value?.some((col: any) => {
const rawValue = row[col.field];
const formattedValue = col.format
? col.format(rawValue, row) // `format`
: rawValue;
return String(formattedValue).toLowerCase().includes(searchText);
});
});
};
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center">รายการขอโอน</div> <div class="toptitle text-dark col-12 row items-center">รายการขอโอน</div>
<q-card flat bordered class="col-12 q-mt-sm"> <q-card flat bordered class="col-12 q-mt-sm">
<div class="row q-pa-md"> <div class="row q-pa-md">
<div class="col-12"> <div class="col-12 q-col-gutter-sm">
<div class="row col-12"> <div class="row col-12">
<q-btn <q-btn
v-if="checkPermission($route)?.attrIsUpdate" v-if="checkPermission($route)?.attrIsUpdate"
@ -229,14 +199,13 @@ const filterAndApply = () => {
<q-space /> <q-space />
<q-input <q-input
class="col-xs-12 col-sm-3 col-md-2"
standout standout
dense dense
v-model="filter" v-model="filter"
ref="filterRef" ref="filterRef"
outlined outlined
placeholder="ค้นหา" placeholder="ค้นหา"
@keyup.enter="filterAndApply" @keyup.enter="onSearch"
> >
<template v-slot:append> <template v-slot:append>
<q-icon name="search" /> <q-icon name="search" />
@ -244,6 +213,7 @@ const filterAndApply = () => {
</q-input> </q-input>
<q-select <q-select
class="q-ml-sm"
v-model="visibleColumns" v-model="visibleColumns"
multiple multiple
outlined outlined
@ -255,11 +225,10 @@ const filterAndApply = () => {
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
/> />
</div> </div>
<div class="col-12 q-pt-sm"> <div class="col-12">
<d-table <d-table
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"

View file

@ -10,6 +10,7 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { FormDataAppoint } from "@/modules/05_placement/interface/request/Main";
import type { import type {
ResponseData, ResponseData,
ResponseRow, ResponseRow,
@ -31,7 +32,7 @@ const {
messageError, messageError,
date2Thai, date2Thai,
dialogRemove, dialogRemove,
onSearchDataTable onSearchDataTable,
} = mixin; } = mixin;
const dataRecevice = ref<ResponseData[]>([]); // const dataRecevice = ref<ResponseData[]>([]); //
@ -149,9 +150,7 @@ const columns = ref<QTableProps["columns"]>([
}, },
]); ]);
/** /** ฟังก์ชันดึงข้อมูลรายการรับโอน*/
* งกนดงขอมลรายการรบโอน
*/
async function fecthlistRecevice() { async function fecthlistRecevice() {
showLoader(); showLoader();
await http await http
@ -171,16 +170,12 @@ async function fecthlistRecevice() {
}); });
} }
/** /** ไปหน้าเพิ่มข้อมูลรายการรับโอน*/
* ไปหนาเพมขอมลรายการรบโอน
*/
function onAddReceive() { function onAddReceive() {
router.push(`/placement/receive/add`); router.push(`/placement/receive/add`);
} }
/** /** ฟังก์ชันบันทึกการอัปโหลดเอกสาร*/
* งกนบนทกการอปโหลดเอกสาร
*/
function onSubmitDoc() { function onSubmitDoc() {
const formData = new FormData(); const formData = new FormData();
formData.append("File", files.value); formData.append("File", files.value);
@ -199,24 +194,13 @@ function onSubmitDoc() {
}); });
} }
/** /** ฟังก์ชันปิด popup ออกคำสั่ง*/
* งกนบรเซตคาในฟลเตอร
*/
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
}
/**
* งกนป popup ออกคำส
*/
function clickClose() { function clickClose() {
modal.value = false; modal.value = false;
filterKeyword2.value = ""; filterKeyword2.value = "";
} }
/** /** ฟังก์ชันปิด popup อัปเดตไฟล์*/
* งกนป popup ปเดตไฟล
*/
function clickCloseUpload() { function clickCloseUpload() {
modalupload.value = false; modalupload.value = false;
files.value = null; files.value = null;
@ -224,8 +208,10 @@ function clickCloseUpload() {
/** /**
* งกนเป popup เลอกหนวยงานทบโอน * งกนเป popup เลอกหนวยงานทบโอน
* @param id id รายการรบโอนทเลอกหนวยงานทบโอน
* @param data อมลรายการรบโอน
*/ */
function openModalTree(id: string, data: any) { function openModalTree(id: string, data: ResponseRow) {
personalId.value = id; personalId.value = id;
personal.value = dataRecevice.value.filter((e: ResponseData) => e.id === id); personal.value = dataRecevice.value.filter((e: ResponseData) => e.id === id);
dataRows.value = data; dataRows.value = data;
@ -260,6 +246,8 @@ function openDelete(id: string) {
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
}); });
@ -277,12 +265,11 @@ function nextPage(id: string) {
/** /**
* งกนสงไปออกคำส * งกนสงไปออกคำส
*
* นหารายชอออกคำสงตามสถานะ อน (APPROVE) * นหารายชอออกคำสงตามสถานะ อน (APPROVE)
*/ */
function openModalOrder() { function openModalOrder() {
const row = filters.value.filter( const row = filters.value.filter(
(r: any) => (r: ResponseRow) =>
(r.status == "WAITTING" || (r.status == "WAITTING" ||
r.status == "PENDING" || r.status == "PENDING" ||
r.status == "APPROVE") && r.status == "APPROVE") &&
@ -299,7 +286,11 @@ function openModalOrder() {
modal.value = true; modal.value = true;
} }
async function onSave(data: any) { /**
* งกนบนทกการเลอกหนวยงานทบโอน
* @param data อมลหนวยงานทบโอน
*/
async function onSave(data: FormDataAppoint) {
const dataAppoint = { const dataAppoint = {
node: data.node, node: data.node,
nodeId: data.nodeId, nodeId: data.nodeId,
@ -340,19 +331,16 @@ function onSearch() {
); );
} }
/** ทำงานเมื่อมีการเรียกใช้ Components*/
/** onMounted(async () => {
* ทำงานเมอมการเรยกใช Components await fecthlistRecevice();
*/
onMounted(() => {
fecthlistRecevice();
}); });
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center">รายการรบโอน</div> <div class="toptitle text-dark col-12 row items-center">รายการรบโอน</div>
<q-card flat bordered class="col-12 q-mt-sm"> <q-card flat bordered class="col-12 q-mt-sm">
<div class="row q-pa-md"> <div class="row q-pa-md">
<div class="col-12"> <div class="col-12 q-gutter-sm">
<div class="row col-12"> <div class="row col-12">
<q-btn <q-btn
v-if="checkPermission($route)?.attrIsCreate" v-if="checkPermission($route)?.attrIsCreate"
@ -377,7 +365,6 @@ onMounted(() => {
</q-btn> </q-btn>
<q-space /> <q-space />
<q-input <q-input
class="col-xs-12 col-sm-3 col-md-2"
standout standout
dense dense
v-model="filterKeyword" v-model="filterKeyword"
@ -388,15 +375,10 @@ onMounted(() => {
> >
<template v-slot:append> <template v-slot:append>
<q-icon name="search" /> <q-icon name="search" />
<!-- <q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/> -->
</template> </template>
</q-input> </q-input>
<q-select <q-select
class="q-ml-sm"
v-model="visibleColumns" v-model="visibleColumns"
multiple multiple
outlined outlined
@ -408,11 +390,10 @@ onMounted(() => {
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
/> />
</div> </div>
<div class="col-12 q-pt-sm"> <div class="col-12">
<d-table <d-table
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"

View file

@ -9,15 +9,11 @@ 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";
/** /** importType*/
* importType
*/
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { officerType } from "@/modules/05_placement/interface/response/officer"; import type { officerType } from "@/modules/05_placement/interface/response/officer";
/** /** importComponents*/
* importComponents
*/
import Dialogbody from "@/modules/05_placement/components/Help-Government/DialogOrders.vue"; import Dialogbody from "@/modules/05_placement/components/Help-Government/DialogOrders.vue";
const $q = useQuasar(); const $q = useQuasar();
@ -34,14 +30,11 @@ const {
dialogRemove, dialogRemove,
findOrgNameOld, findOrgNameOld,
findPosMasterNoOld, findPosMasterNoOld,
onSearchDataTable onSearchDataTable,
} = mixin; } = mixin;
/** /** Table*/
* Table
*/
const modal = ref<boolean>(false); // popup ; const modal = ref<boolean>(false); // popup ;
const filterKeyword = ref<string>(""); // const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); // const filterKeyword2 = ref<string>(""); //
const rows = ref<officerType[]>([]); // const rows = ref<officerType[]>([]); //
@ -185,9 +178,7 @@ const visibleColumns = ref<string[]>([
"status", "status",
]); ]);
/** /**fetch รายการช่วยราชการ*/
* fetch รายการชวยราชการ
*/
async function getData() { async function getData() {
showLoader(); showLoader();
await http await http
@ -210,9 +201,9 @@ async function getData() {
* @param id รายการทองการลบ * @param id รายการทองการลบ
*/ */
function clickDelete(id: string) { function clickDelete(id: string) {
dialogRemove($q, () => { dialogRemove($q, async () => {
showLoader(); showLoader();
http await http
.delete(config.API.officerMainDelete(id)) .delete(config.API.officerMainDelete(id))
.then(async () => { .then(async () => {
await getData(); await getData();
@ -235,9 +226,7 @@ function openDetail(id: string) {
router.push(`/placement/help-government/detail/${id}`); router.push(`/placement/help-government/detail/${id}`);
} }
/** /** เปิด popup ส่งไปออกคำสั่งช่วยราชการ*/
* เป popup งไปออกคำสงชวยราชการ
*/
function openModalOrder() { function openModalOrder() {
const row = rows.value.filter( const row = rows.value.filter(
(item: officerType) => (item: officerType) =>
@ -254,22 +243,12 @@ function openModalOrder() {
modal.value = true; modal.value = true;
} }
/** /** ปิด popup ส่งไปออกคำสั่งช่วยราชการ*/
* popup งไปออกคำสงชวยราชการ
*/
function closeModal() { function closeModal() {
modal.value = false; modal.value = false;
filterKeyword2.value = ""; filterKeyword2.value = "";
} }
/**
* เซตขอมลในชองฟลเตอร
*/
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
}
function onSearch() { function onSearch() {
rows.value = onSearchDataTable( rows.value = onSearchDataTable(
filterKeyword.value, filterKeyword.value,
@ -278,17 +257,15 @@ function onSearch() {
); );
} }
/** /** ทำงานเมื่อมีการเรียกใช้ Components*/
* ทำงานเมอมการเรยกใช Components onMounted(async () => {
*/ await getData();
onMounted(() => {
getData();
}); });
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center">รายการชวยราชการ</div> <div class="toptitle text-dark col-12 row items-center">รายการชวยราชการ</div>
<q-card flat bordered class="col-12 q-mt-sm"> <q-card flat bordered class="col-12">
<div class="row q-pa-md"> <div class="row q-pa-md">
<div class="col-12"> <div class="col-12">
<div class="row col-12"> <div class="row col-12">
@ -305,7 +282,6 @@ onMounted(() => {
</q-btn> </q-btn>
<q-space /> <q-space />
<q-input <q-input
class="col-xs-12 col-sm-3 col-md-2"
standout standout
dense dense
v-model="filterKeyword" v-model="filterKeyword"
@ -320,6 +296,7 @@ onMounted(() => {
</q-input> </q-input>
<q-select <q-select
class="q-ml-sm"
v-model="visibleColumns" v-model="visibleColumns"
multiple multiple
outlined outlined
@ -331,7 +308,6 @@ onMounted(() => {
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
/> />
</div> </div>

View file

@ -27,7 +27,7 @@ const {
success, success,
dialogRemove, dialogRemove,
findPosMasterNoOld, findPosMasterNoOld,
onSearchDataTable onSearchDataTable,
} = useCounterMixin(); } = useCounterMixin();
const modal = ref<boolean>(false); // const modal = ref<boolean>(false); //
@ -143,16 +143,12 @@ const visibleColumns = ref<string[]>([
"status", "status",
]); ]);
/** /** rediarect ไปหน้ารายละเอียด*/
* rediarect ไปหนารายละเอยด
*/
function openDetail(id: string) { function openDetail(id: string) {
router.push(`/placement/repatriate/detail/${id}`); router.push(`/placement/repatriate/detail/${id}`);
} }
/** /** fetch รายการส่งตัวกลับ*/
* fetch รายการสงตวกล
*/
async function getData() { async function getData() {
showLoader(); showLoader();
await http await http
@ -169,9 +165,7 @@ async function getData() {
hideLoader(); hideLoader();
}); });
} }
/** /** ยืนยันการลบรายการ*/
* นยนการลบรายการ
*/
function clickDelete(id: string) { function clickDelete(id: string) {
dialogRemove($q, () => { dialogRemove($q, () => {
showLoader(); showLoader();
@ -190,9 +184,7 @@ function clickDelete(id: string) {
}); });
} }
/** /** เปิด popup ส่งไปออกคำสั่งส่งตัวกลับ*/
* เป popup งไปออกคำสงสงตวกล
*/
function openModalOrder() { function openModalOrder() {
// filter status // filter status
const row = rows.value.filter( const row = rows.value.filter(
@ -214,22 +206,12 @@ function openModalOrder() {
modal.value = true; modal.value = true;
} }
/** /** ปิด popup ส่งไปออกคำสั่งส่งตัวกลับ*/
* popup งไปออกคำสงสงตวกล
*/
function closeModal() { function closeModal() {
modal.value = false; modal.value = false;
filterKeyword2.value = ""; filterKeyword2.value = "";
} }
/**
* เซตคาในชอง ลเตอร
*/
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
}
function onSearch() { function onSearch() {
rows.value = onSearchDataTable( rows.value = onSearchDataTable(
filterKeyword.value, filterKeyword.value,
@ -238,9 +220,7 @@ function onSearch() {
); );
} }
/** /** ทำงานเมื่อมีการเรียกใช้ Components*/
* ทำงานเมอมการเรยกใช Components
*/
onMounted(async () => { onMounted(async () => {
await getData(); await getData();
}); });
@ -265,7 +245,6 @@ onMounted(async () => {
</q-btn> </q-btn>
<q-space /> <q-space />
<q-input <q-input
class="col-xs-12 col-sm-3 col-md-2"
standout standout
dense dense
v-model="filterKeyword" v-model="filterKeyword"
@ -279,7 +258,7 @@ onMounted(async () => {
</template> </template>
</q-input> </q-input>
<q-select <q-select
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" class="q-ml-sm"
v-model="visibleColumns" v-model="visibleColumns"
multiple multiple
outlined outlined
@ -338,7 +317,6 @@ onMounted(async () => {
flat flat
round round
dense dense
@click.stop.prevent="clickDelete(props.row.id)" @click.stop.prevent="clickDelete(props.row.id)"
> >
<q-tooltip>ลบขอม</q-tooltip> <q-tooltip>ลบขอม</q-tooltip>

View file

@ -14,6 +14,7 @@ import type { resData } from "@/modules/05_placement/interface/response/AppointM
import type { OpType } from "@/modules/05_placement/interface/response/Main"; import type { OpType } from "@/modules/05_placement/interface/response/Main";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { PersonData } from "@/modules/05_placement/interface/index/Main"; import type { PersonData } from "@/modules/05_placement/interface/index/Main";
import type { FormDataAppoint } from "@/modules/05_placement/interface/request/Main";
/** importComponents*/ /** importComponents*/
import Dialogbody from "@/modules/05_placement/components/AppointMent/DialogOrders.vue"; // import Dialogbody from "@/modules/05_placement/components/AppointMent/DialogOrders.vue"; //
@ -30,7 +31,7 @@ const {
messageError, messageError,
date2Thai, date2Thai,
dialogRemove, dialogRemove,
onSearchDataTable onSearchDataTable,
} = useCounterMixin(); } = useCounterMixin();
const modal = ref<boolean>(false); // popup const modal = ref<boolean>(false); // popup
@ -39,7 +40,7 @@ const posType = ref<string>(""); //ประเภทตำแหน่ง
const posLevel = ref<string>(""); // const posLevel = ref<string>(""); //
const position = ref<string>(""); // const position = ref<string>(""); //
const typeModal = ref<string | null>(null); // popup , , const typeModal = ref<string | null>(null); // popup , ,
const dataRows = ref<any[]>([]); const dataRows = ref<PersonData>();
const personalId = ref<string>(""); const personalId = ref<string>("");
const filterRef = ref<any>(null); const filterRef = ref<any>(null);
@ -154,13 +155,6 @@ const pagination = ref({
rowsPerPage: 10, rowsPerPage: 10,
}); });
/** รีเซ็ตคำค้นหารายการ*/
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
filterRef.value.focus();
}
/** fetch รายการแต่งตั้ง-เลื่อน-ย้าย*/ /** fetch รายการแต่งตั้ง-เลื่อน-ย้าย*/
async function fecthlistappointment() { async function fecthlistappointment() {
showLoader(); showLoader();
@ -172,8 +166,7 @@ async function fecthlistappointment() {
rows.value = response; rows.value = response;
rowsData.value = response; rowsData.value = response;
// //
const listData = const listData = rows.value.filter(
rows.value.filter(
(e: any) => (e: any) =>
e.root !== null && e.root !== null &&
e.status !== "REPORT" && e.status !== "REPORT" &&
@ -185,8 +178,8 @@ async function fecthlistappointment() {
e.positionNumberOld && e.positionNumberOld &&
e.positionDate e.positionDate
); );
rows2.value = listData rows2.value = listData;
rows2Data.value = listData rows2Data.value = listData;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -229,7 +222,7 @@ function nextPage(id: string) {
} }
/** เปิด popup เลือกหน่วยงาน*/ /** เปิด popup เลือกหน่วยงาน*/
function openModalTree(data: any, type: string) { function openModalTree(data: PersonData, type: string) {
personalId.value = data.id; personalId.value = data.id;
typeModal.value = type; typeModal.value = type;
dataRows.value = data; dataRows.value = data;
@ -240,7 +233,7 @@ function openModalTree(data: any, type: string) {
} }
/** ยืนยันการเลือกหน่วยงานที่แต่งตั้ง*/ /** ยืนยันการเลือกหน่วยงานที่แต่งตั้ง*/
function onSave(data: any) { async function onSave(data: FormDataAppoint) {
const dataAppoint = { const dataAppoint = {
node: data.node, node: data.node,
nodeId: data.nodeId, nodeId: data.nodeId,
@ -258,7 +251,7 @@ function onSave(data: any) {
}; };
showLoader(); showLoader();
http await http
.put(config.API.appointmentPosition(personalId.value), dataAppoint) .put(config.API.appointmentPosition(personalId.value), dataAppoint)
.then(async () => { .then(async () => {
await fecthlistappointment(); await fecthlistappointment();
@ -268,7 +261,7 @@ function onSave(data: any) {
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(() => {
hideLoader(); hideLoader();
}); });
} }
@ -293,8 +286,8 @@ function onSearch() {
} }
/** ทำงานเมื่อมีการเรียกใช้ Components*/ /** ทำงานเมื่อมีการเรียกใช้ Components*/
onMounted(() => { onMounted(async () => {
fecthlistappointment(); await fecthlistappointment();
}); });
</script> </script>

View file

@ -13,6 +13,7 @@ import type { QTableProps } from "quasar";
import type { PersonData } from "@/modules/05_placement/interface/index/Main"; import type { PersonData } from "@/modules/05_placement/interface/index/Main";
import type { resData } from "@/modules/05_placement/interface/response/AppointMent"; import type { resData } from "@/modules/05_placement/interface/response/AppointMent";
import type { OpType } from "@/modules/05_placement/interface/response/Main"; import type { OpType } from "@/modules/05_placement/interface/response/Main";
import type { FormDataAppoint } from "@/modules/05_placement/interface/request/Main";
import DialogOrgSelectEmployee from "@/components/Dialogs/DialogOrgSelectEmployee.vue"; // import DialogOrgSelectEmployee from "@/components/Dialogs/DialogOrgSelectEmployee.vue"; //
import Dialogbody from "@/modules/05_placement/components/AppointEmployee/DialogOrders.vue"; import Dialogbody from "@/modules/05_placement/components/AppointEmployee/DialogOrders.vue";
@ -29,7 +30,7 @@ const {
messageError, messageError,
date2Thai, date2Thai,
dialogRemove, dialogRemove,
onSearchDataTable onSearchDataTable,
} = mixin; } = mixin;
const personalId = ref<string>(""); const personalId = ref<string>("");
@ -39,7 +40,7 @@ const typeModal = ref<string>(""); //ประเภท popup ปรับระ
const posType = ref<string>(""); // const posType = ref<string>(""); //
const posLevel = ref<string>(""); // const posLevel = ref<string>(""); //
const position = ref<string>(""); // const position = ref<string>(""); //
const dataRows = ref<any[]>([]); const dataRows = ref<PersonData>();
const filterRef = ref<any>(null); const filterRef = ref<any>(null);
const listRecevice = ref<resData[]>([]); // const listRecevice = ref<resData[]>([]); //
@ -150,21 +151,10 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
/**
* เซ input
*/
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
filterRef.value.focus();
}
/** /** fetch รายการปรับระดับชั้นงานลูกจ้าง*/
* fetch รายการปรบระดบชนงานลกจาง
*/
async function fecthlistappointment() { async function fecthlistappointment() {
showLoader(); showLoader();
await http await http
.get(config.API.appointEmployee()) .get(config.API.appointEmployee())
.then(async (res) => { .then(async (res) => {
@ -172,11 +162,9 @@ async function fecthlistappointment() {
listRecevice.value = response; listRecevice.value = response;
rows.value = response; rows.value = response;
rowsData.value = response; rowsData.value = response;
// //
const listData = const listData = rows.value.filter(
rows.value.filter( (e: PersonData) =>
(e: any) =>
e.root !== null && e.root !== null &&
e.status !== "REPORT" && e.status !== "REPORT" &&
e.status !== "DONE" && e.status !== "DONE" &&
@ -187,8 +175,8 @@ async function fecthlistappointment() {
e.positionNumberOld && e.positionNumberOld &&
e.positionDate e.positionDate
); );
rows2.value = listData rows2.value = listData;
rows2Data.value = listData rows2Data.value = listData;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -203,9 +191,9 @@ async function fecthlistappointment() {
* @param id รายการปรบระดบชนงานลกจาง * @param id รายการปรบระดบชนงานลกจาง
*/ */
function clickDelete(id: string) { function clickDelete(id: string) {
dialogRemove($q, () => { dialogRemove($q, async () => {
showLoader(); showLoader();
http await http
.delete(config.API.appointEmployeeByid(id)) .delete(config.API.appointEmployeeByid(id))
.then(async () => { .then(async () => {
await fecthlistappointment(); await fecthlistappointment();
@ -230,17 +218,13 @@ function nextPage(id: string) {
}); });
} }
/** /** เปิด popup ส่งไปออกคำสั่ง*/
* เป popup งไปออกคำส
*/
function popup() { function popup() {
modal.value = true; modal.value = true;
filterKeyword2.value = ""; filterKeyword2.value = "";
} }
/** /** ปิด popup ส่งไปออกคำสั่ง*/
* popup งไปออกคำส
*/
function clickClose() { function clickClose() {
modal.value = false; modal.value = false;
} }
@ -250,7 +234,7 @@ function clickClose() {
* @param data อมลหนวยงาน * @param data อมลหนวยงาน
* @param type ประเภท าย,ปร * @param type ประเภท าย,ปร
*/ */
function openModalTree(data: any, type: string) { function openModalTree(data: PersonData, type: string) {
typeModal.value = type; typeModal.value = type;
personalId.value = data.id; personalId.value = data.id;
dataRows.value = data; dataRows.value = data;
@ -260,10 +244,8 @@ function openModalTree(data: any, type: string) {
modalTree.value = true; modalTree.value = true;
} }
/** /** ยืนยันการบันทึกข้อมูลเลือกตำแหน่ง*/
* นยนการบนทกขอมลเลอกตำแหน async function onSave(data: FormDataAppoint) {
*/
function onSave(data: any) {
const dataAppoint = { const dataAppoint = {
node: data.node, node: data.node,
nodeId: data.nodeId, nodeId: data.nodeId,
@ -280,7 +262,7 @@ function onSave(data: any) {
typeCommand: data.typeCommand, typeCommand: data.typeCommand,
}; };
showLoader(); showLoader();
http await http
.put(config.API.appointmentPosition(personalId.value), dataAppoint) .put(config.API.appointmentPosition(personalId.value), dataAppoint)
.then(async () => { .then(async () => {
await fecthlistappointment(); await fecthlistappointment();
@ -303,8 +285,8 @@ function onSearch() {
); );
} }
onMounted(() => { onMounted(async () => {
fecthlistappointment(); await fecthlistappointment();
}); });
</script> </script>
@ -330,7 +312,6 @@ onMounted(() => {
<q-space /> <q-space />
<q-input <q-input
class="col-xs-12 col-sm-3 col-md-2"
standout standout
dense dense
v-model="filterKeyword" v-model="filterKeyword"
@ -356,7 +337,7 @@ onMounted(() => {
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" class="q-ml-sm"
/> />
</div> </div>

View file

@ -33,9 +33,7 @@ const {
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
/** /** Table*/
* Table
*/
const rows = ref<listMain[]>([]); // const rows = ref<listMain[]>([]); //
const rowsData = ref<listMain[]>([]); // const rowsData = ref<listMain[]>([]); //
const rows2 = ref<listMain[]>([]); // const rows2 = ref<listMain[]>([]); //
@ -131,9 +129,7 @@ const pagination = ref({
rowsPerPage: 10, rowsPerPage: 10,
}); });
/** /** fetch รายการอื่นๆ*/
* fetch รายการอนๆ
*/
async function fecthlistOthet() { async function fecthlistOthet() {
showLoader(); showLoader();
await http await http
@ -165,17 +161,13 @@ async function fecthlistOthet() {
}); });
} }
/** /** เปิด popup ส่งไปออกคำสั่งอื่นๆ*/
* เป popup งไปออกคำสงอนๆ
*/
function popup() { function popup() {
modal.value = true; modal.value = true;
filterKeyword2.value = ""; filterKeyword2.value = "";
} }
/** /** ปิด popup ส่งไปออกคำสั่งอื่นๆ*/
* popup งไปออกคำสงอนๆ
*/
function clickClose() { function clickClose() {
modal.value = false; modal.value = false;
} }
@ -185,9 +177,9 @@ function clickClose() {
* @param id รายการอนๆ * @param id รายการอนๆ
*/ */
function clickDelete(id: string) { function clickDelete(id: string) {
dialogRemove($q, () => { dialogRemove($q, async () => {
showLoader(); showLoader();
http await http
.delete(config.API.otherByid(id)) .delete(config.API.otherByid(id))
.then(async () => { .then(async () => {
await fecthlistOthet(); await fecthlistOthet();
@ -243,7 +235,6 @@ onMounted(() => {
</q-btn> </q-btn>
<q-space /> <q-space />
<q-input <q-input
class="col-xs-12 col-sm-3 col-md-2"
standout standout
dense dense
v-model="filterKeyword" v-model="filterKeyword"
@ -268,7 +259,7 @@ onMounted(() => {
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" class="q-ml-sm"
/> />
</div> </div>