Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop

This commit is contained in:
Kittapath 2023-09-29 17:39:48 +07:00
commit 9b910afc6e
39 changed files with 3454 additions and 1558 deletions

View file

@ -250,6 +250,12 @@ const menuList = readonly<any[]>([
path: "appoint-promote", path: "appoint-promote",
role: "placement", role: "placement",
}, },
{
key: 6.8,
label: "รายการแต่งตั้งลูกจ้างประจำ",
path: "appoint-employee",
role: "placement",
},
// { // {
// key: 6.9, // key: 6.9,
// label: "รายการย้าย", // label: "รายการย้าย",

View file

@ -6,17 +6,10 @@
v-model:statusEdit="statusEdit" v-model:statusEdit="statusEdit"
:profileType="profileType" :profileType="profileType"
/> --> /> -->
<Information <Information v-model:statusEdit="statusEdit" :fetchDataProfile="fetchData" />
v-model:statusEdit="statusEdit"
:fetchDataProfile="fetchData"
/>
</div> </div>
<div id="government" name="16" class="row col-12 q-mt-md"> <div id="government" name="16" class="row col-12 q-mt-md">
<Government <Government v-model:statusEdit="statusEdit" :profileType="profileType" :employeeClass="employeeClass" />
v-model:statusEdit="statusEdit"
:profileType="profileType"
:employeeClass="employeeClass"
/>
</div> </div>
<div id="address" name="17" class="row col-12 q-mt-md"> <div id="address" name="17" class="row col-12 q-mt-md">
<Address v-model:statusEdit="statusEdit" /> <Address v-model:statusEdit="statusEdit" />
@ -40,20 +33,11 @@
<CoinedVue v-model:statusEdit="statusEdit" :profileType="profileType" /> <CoinedVue v-model:statusEdit="statusEdit" :profileType="profileType" />
</div> </div>
<div id="assessment" name="6" class="row col-12 q-mt-md"> <div id="assessment" name="6" class="row col-12 q-mt-md">
<AssessmentVue <AssessmentVue v-model:statusEdit="statusEdit" :profileType="profileType" />
v-model:statusEdit="statusEdit"
:profileType="profileType"
/>
</div> </div>
<div id="position" name="7" class="row col-12 q-mt-md"> <div id="position" name="7" class="row col-12 q-mt-md">
<SalaryVue <SalaryVue v-model:statusEdit="statusEdit" v-if="profileType === 'officer'" />
v-model:statusEdit="statusEdit" <SalaryEmployeeTempVue v-model:statusEdit="statusEdit" v-else-if="employeeClass === 'temp'" />
v-if="profileType === 'officer'"
/>
<SalaryEmployeeTempVue
v-model:statusEdit="statusEdit"
v-else-if="employeeClass === 'temp'"
/>
<SalaryEmployeeVue v-model:statusEdit="statusEdit" v-else /> <SalaryEmployeeVue v-model:statusEdit="statusEdit" v-else />
</div> </div>
<div id="rule" name="8" class="row col-12 q-mt-md"> <div id="rule" name="8" class="row col-12 q-mt-md">
@ -78,70 +62,29 @@
<DocumentVue v-model:statusEdit="statusEdit" /> <DocumentVue v-model:statusEdit="statusEdit" />
</div> </div>
</div> </div>
<q-page-sticky <q-page-sticky position="top" expand class="bg-grey-2 text-white" style="z-index: 99; padding: 0% 1% 0% 1%">
position="top" <div class="row col-12 q-gutter-sm q-pb-sm text-dark no-wrap items-center">
expand <q-btn flat round class="bg-teal-1 full-height" color="primary" icon="mdi-chevron-left" dense
class="bg-grey-2 text-white" @click="router.go(-1)">
style="z-index: 99; padding: 0% 1% 0% 1%"
>
<div
class="row col-12 q-gutter-sm q-pb-sm text-dark no-wrap items-center"
>
<q-btn
flat
round
class="bg-teal-1 full-height"
color="primary"
icon="mdi-chevron-left"
dense
@click="router.go(-1)"
>
</q-btn> </q-btn>
<q-avatar <q-avatar v-if="imageUrl == null" size="65px" rounded class="containerimage">
v-if="imageUrl == null" <img src="@/assets/avatar_user.jpg" class="bg-grey-3" style="object-fit: cover" />
size="65px" <div class="overlay absolute-bottom text-subtitle2 text-center cursor-pointer" @click="clickImage()">
rounded
class="containerimage"
>
<img
src="@/assets/avatar_user.jpg"
class="bg-grey-3"
style="object-fit: cover"
/>
<div
class="overlay absolute-bottom text-subtitle2 text-center cursor-pointer"
@click="clickImage()"
>
<q-icon name="mdi-camera" size="18px" color="blue"> <q-icon name="mdi-camera" size="18px" color="blue">
<q-tooltip>ปเดตรปภาพ</q-tooltip> <q-tooltip>ปเดตรปภาพ</q-tooltip>
</q-icon> </q-icon>
<input <input type="file" style="display: none" ref="inputImage" accept="image/*" @change="uploadImage" />
type="file"
style="display: none"
ref="inputImage"
accept="image/*"
@change="uploadImage"
/>
</div> </div>
</q-avatar> </q-avatar>
<q-avatar v-else size="65px" rounded class="containerimage"> <q-avatar v-else size="65px" rounded class="containerimage">
<img :src="imageUrl" class="bg-grey-3" style="object-fit: cover" /> <img :src="imageUrl" class="bg-grey-3" style="object-fit: cover" />
<div <div class="overlay absolute-bottom text-subtitle2 text-center cursor-pointer" @click="clickImage()">
class="overlay absolute-bottom text-subtitle2 text-center cursor-pointer"
@click="clickImage()"
>
<q-icon name="mdi-camera" size="18px" color="blue"> <q-icon name="mdi-camera" size="18px" color="blue">
<q-tooltip>ปเดตรปภาพ</q-tooltip> <q-tooltip>ปเดตรปภาพ</q-tooltip>
</q-icon> </q-icon>
<input <input type="file" style="display: none" ref="inputImage" accept="image/*" @change="uploadImage" />
type="file"
style="display: none"
ref="inputImage"
accept="image/*"
@change="uploadImage"
/>
</div> </div>
</q-avatar> </q-avatar>
<div class="row items-center text-dark q-ml-md"> <div class="row items-center text-dark q-ml-md">
@ -154,26 +97,32 @@
</div> </div>
<q-space /> <q-space />
<q-btn round flat color="blue" icon="mdi-file-document"> <q-btn round flat color="blue" icon="mdi-file-document"
v-if="profileType == 'officer' || (profileType == 'employee' && employeeClass == 'perm')">
<q-menu transition-show="jump-down" transition-hide="jump-up"> <q-menu transition-show="jump-down" transition-hide="jump-up">
<q-list dense style="min-width: 160px"> <q-list dense style="min-width: 160px">
<q-item clickable v-close-popup @click="helpPost"> <q-item clickable v-close-popup @click="helpPost" v-if="profileType == 'officer'">
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> <q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section> </q-item-section>
<q-item-section>วยราชการ</q-item-section> <q-item-section>วยราชการ</q-item-section>
</q-item> </q-item>
<q-separator /> <q-separator />
<q-item clickable v-close-popup @click="repatriationPost"> <q-item clickable v-close-popup @click="repatriationPost" v-if="profileType == 'officer'">
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> <q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section> </q-item-section>
<q-item-section>งตวกล</q-item-section> <q-item-section>งตวกล</q-item-section>
</q-item> </q-item>
<q-separator /> <q-separator />
<q-item clickable v-close-popup @click="appointPost"> <q-item clickable v-close-popup @click="appointPost" v-if="profileType == 'officer'">
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> <q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section> </q-item-section>
<q-item-section>แตงต-เลอน-าย</q-item-section> <q-item-section>แตงต-เลอน-าย</q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="appointPost" v-if="profileType == 'employee'">
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section>
<q-item-section>แตงต</q-item-section>
</q-item>
<q-separator /> <q-separator />
<!-- <q-item clickable v-close-popup @click="relocationPost"> <!-- <q-item clickable v-close-popup @click="relocationPost">
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> <q-item-section style="min-width: 0px" avatar class="q-py-sm">
@ -181,31 +130,31 @@
<q-item-section>าย</q-item-section> <q-item-section>าย</q-item-section>
</q-item> </q-item>
<q-separator /> --> <q-separator /> -->
<q-item clickable v-close-popup @click="clickPassaway"> <q-item clickable v-close-popup @click="clickPassaway" v-if="profileType == 'officer'">
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> <q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section> </q-item-section>
<q-item-section>งแกกรรม</q-item-section> <q-item-section>งแกกรรม</q-item-section>
</q-item> </q-item>
<q-separator /> <q-separator />
<q-item clickable v-close-popup @click="outPost"> <q-item clickable v-close-popup @click="outPost" v-if="profileType == 'officer'">
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> <q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section> </q-item-section>
<q-item-section>ใหออกจากราชการ</q-item-section> <q-item-section>ใหออกจากราชการ</q-item-section>
</q-item> </q-item>
<q-separator /> <q-separator />
<q-item clickable v-close-popup @click="dischargePost"> <q-item clickable v-close-popup @click="dischargePost" v-if="profileType == 'officer'">
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> <q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section> </q-item-section>
<q-item-section>ปลดออกจากราชการ</q-item-section> <q-item-section>ปลดออกจากราชการ</q-item-section>
</q-item> </q-item>
<q-separator /> <q-separator />
<q-item clickable v-close-popup @click="expulsionPost"> <q-item clickable v-close-popup @click="expulsionPost" v-if="profileType == 'officer'">
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> <q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section> </q-item-section>
<q-item-section>ไลออกจากราชการ</q-item-section> <q-item-section>ไลออกจากราชการ</q-item-section>
</q-item> </q-item>
<q-separator /> <q-separator />
<q-item clickable v-close-popup @click="otherPost"> <q-item clickable v-close-popup @click="otherPost" v-if="profileType == 'officer'">
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> <q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section> </q-item-section>
<q-item-section>นๆ</q-item-section> <q-item-section>นๆ</q-item-section>
@ -216,15 +165,8 @@
<!-- <q-tooltip>งรายช</q-tooltip> --> <!-- <q-tooltip>งรายช</q-tooltip> -->
</q-btn> </q-btn>
<q-btn <q-btn round flat :color="reasonStatus ? 'primary' : 'pink-5'" @click="clickRetire()" :icon="reasonStatus ? 'mdi-home-import-outline' : 'mdi-home-export-outline'
round ">
flat
:color="reasonStatus ? 'primary' : 'pink-5'"
@click="clickRetire()"
:icon="
reasonStatus ? 'mdi-home-import-outline' : 'mdi-home-export-outline'
"
>
<q-tooltip>{{ <q-tooltip>{{
reasonStatus ? "การกลับเข้ารับราชการ" : "การออกจากราชการ" reasonStatus ? "การกลับเข้ารับราชการ" : "การออกจากราชการ"
}}</q-tooltip> }}</q-tooltip>
@ -238,9 +180,7 @@
<q-item-section class="text-blue">..7/..1</q-item-section> <q-item-section class="text-blue">..7/..1</q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="clickKp7Short()"> <q-item clickable v-close-popup @click="clickKp7Short()">
<q-item-section class="text-primary" <q-item-section class="text-primary">ประวแบบย</q-item-section>
>ประวแบบย</q-item-section
>
</q-item> </q-item>
</q-list> </q-list>
</q-menu> </q-menu>
@ -252,20 +192,8 @@
<q-card style="width: 90vw; max-width: 80vw"> <q-card style="width: 90vw; max-width: 80vw">
<q-card-section class="row items-center q-pb-xs col-12"> <q-card-section class="row items-center q-pb-xs col-12">
<q-space /> <q-space />
<q-btn <q-btn @click="downloadKP7()" unelevated class="btn_purple q-mr-sm" label="ดาวน์โหลด ก.พ.7/ก.ก.1"></q-btn>
@click="downloadKP7()" <q-btn icon="close" unelevated round dense @click="closeKp7" style="color: #ff8080; background-color: #ffdede" />
unelevated
class="btn_purple q-mr-sm"
label="ดาวน์โหลด ก.พ.7/ก.ก.1"
></q-btn>
<q-btn
icon="close"
unelevated
round
dense
@click="closeKp7"
style="color: #ff8080; background-color: #ffdede"
/>
</q-card-section> </q-card-section>
<q-card-section class="q-p-sm"> <q-card-section class="q-p-sm">
<!-- <viewpdf <!-- <viewpdf
@ -280,20 +208,9 @@
<q-card style="width: 90vw; max-width: 80vw"> <q-card style="width: 90vw; max-width: 80vw">
<q-card-section class="row items-center q-pb-xs col-12"> <q-card-section class="row items-center q-pb-xs col-12">
<q-space /> <q-space />
<q-btn <q-btn @click="downloadKP7Short()" unelevated class="btn_purple q-mr-sm" label="ดาวน์โหลด ประวัติแบบย่อ"></q-btn>
@click="downloadKP7Short()" <q-btn icon="close" unelevated round dense @click="closeKp7Short"
unelevated style="color: #ff8080; background-color: #ffdede" />
class="btn_purple q-mr-sm"
label="ดาวน์โหลด ประวัติแบบย่อ"
></q-btn>
<q-btn
icon="close"
unelevated
round
dense
@click="closeKp7Short"
style="color: #ff8080; background-color: #ffdede"
/>
</q-card-section> </q-card-section>
<q-card-section class="q-p-sm"> <q-card-section class="q-p-sm">
<!-- <viewpdf <!-- <viewpdf
@ -310,50 +227,28 @@
<q-card-section class="q-py-sm row"> <q-card-section class="q-py-sm row">
<div class="text-h6">เลอกรปภาพ</div> <div class="text-h6">เลอกรปภาพ</div>
<q-space /> <q-space />
<q-btn <q-btn icon="close" unelevated round dense @click="closeImage" style="color: #ff8080; background-color: #ffdede">
icon="close"
unelevated
round
dense
@click="closeImage"
style="color: #ff8080; background-color: #ffdede"
>
<q-tooltip>ดหนาน</q-tooltip> <q-tooltip>ดหนาน</q-tooltip>
</q-btn> </q-btn>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-section class="col-12 row"> <q-card-section class="col-12 row">
<div <div class="row wrap items-start col-12 q-col-gutter-sm" style="height: 320px; overflow: auto">
class="row wrap items-start col-12 q-col-gutter-sm"
style="height: 320px; overflow: auto"
>
<div class="col-3" @click="addNewImage"> <div class="col-3" @click="addNewImage">
<div <div style="
style="
height: 160px; height: 160px;
max-width: 15vw; max-width: 15vw;
display: flex !important; display: flex !important;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
" " class="column rounded-borders cursor-pointer bg-active-image text-white">
class="column rounded-borders cursor-pointer bg-active-image text-white"
>
<q-icon name="add" size="60px" color="white" /> <q-icon name="add" size="60px" color="white" />
<strong>ปโหลดรปภาพ</strong> <strong>ปโหลดรปภาพ</strong>
</div> </div>
</div> </div>
<div <div v-for="n in images" :key="n" class="col-3" @click="imageActive(n)">
v-for="n in images"
:key="n"
class="col-3"
@click="imageActive(n)"
>
<div :class="getClass(n)"> <div :class="getClass(n)">
<q-img <q-img v-if="n.avatar != null" :src="n.avatar" :class="imageClass(n)">
v-if="n.avatar != null"
:src="n.avatar"
:class="imageClass(n)"
>
<!-- <div <!-- <div
class="absolute-top bg-transparent cursor-pointer text-right" class="absolute-top bg-transparent cursor-pointer text-right"
style="padding: 5px" style="padding: 5px"
@ -367,21 +262,11 @@
style="color: #ff8080" style="color: #ff8080"
/> />
</div> --> </div> -->
<div <div class="absolute-bottom col-12 cursor-pointer flex justify-between items-center" style="padding: 5px">
class="absolute-bottom col-12 cursor-pointer flex justify-between items-center"
style="padding: 5px"
>
{{ date2Thai(n.createdDate) }} {{ date2Thai(n.createdDate) }}
<q-btn <q-btn v-if="!n.isActive" icon="delete" unelevated dense @click="deletePhoto(n.id)" class="bg-white"
v-if="!n.isActive" style="color: #ff8080">
icon="delete"
unelevated
dense
@click="deletePhoto(n.id)"
class="bg-white"
style="color: #ff8080"
>
<q-tooltip>ลบรปภาพ</q-tooltip> <q-tooltip>ลบรปภาพ</q-tooltip>
</q-btn> </q-btn>
</div> </div>
@ -401,14 +286,7 @@
> >
<q-tooltip>ลบรปภาพ</q-tooltip> <q-tooltip>ลบรปภาพ</q-tooltip>
</q-btn> --> </q-btn> -->
<q-btn <q-btn icon="check" dense flat round @click="selectAvatarHistory" color="positive">
icon="check"
dense
flat
round
@click="selectAvatarHistory"
color="positive"
>
<q-tooltip>เลอกรปภาพ</q-tooltip> <q-tooltip>เลอกรปภาพ</q-tooltip>
</q-btn> </q-btn>
</q-card-actions> </q-card-actions>
@ -422,39 +300,18 @@
<q-card-section class="q-py-sm row"> <q-card-section class="q-py-sm row">
<DialogHeader tittle="ถึงแก่กรรม" :close="closePassaway" /> <DialogHeader tittle="ถึงแก่กรรม" :close="closePassaway" />
<div class="col-12 row q-pa-sm q-col-gutter-sm"> <div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-file <q-file class="col-12 col-sm-6 col-md-5" outlined dense v-model="filePassaway" label="แนบใบมรณบัตร"
class="col-12 col-sm-6 col-md-5" hide-bottom-space lazy-rules accept=".pdf">
outlined
dense
v-model="filePassaway"
label="แนบใบมรณบัตร"
hide-bottom-space
lazy-rules
accept=".pdf"
>
<q-separator /> <q-separator />
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" /> <q-icon name="attach_file" />
</template> </template>
</q-file> </q-file>
<q-input <q-input class="col-12 col-sm-6 col-md-7" dense outlined v-model="deathCertificateNo"
class="col-12 col-sm-6 col-md-7" label="เลขที่ใบมรณบัตร" />
dense
outlined
v-model="deathCertificateNo"
label="เลขที่ใบมรณบัตร"
/>
<datepicker <datepicker class="col-12 col-sm-6 col-md-5" menu-class-name="modalfix" v-model="dateDeath" :locale="'th'"
class="col-12 col-sm-6 col-md-5" autoApply borderless :enableTimePicker="false" week-start="0">
menu-class-name="modalfix"
v-model="dateDeath"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
@ -462,63 +319,32 @@
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input outlined dense class="full-width datepicker" :model-value="dateDeath != null ? date2Thai(dateDeath) : null
outlined " :label="`${'วันที่เสียชีวิต'}`" :rules="[
dense (val) => !!val || `${'กรุณาเลือกวันที่เสียชีวิต'}`,
class="full-width datepicker" ]">
:model-value="
dateDeath != null ? date2Thai(dateDeath) : null
"
:label="`${'วันที่เสียชีวิต'}`"
:rules="[
(val) => !!val || `${'กรุณาเลือกวันที่เสียชีวิต'}`,
]"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<q-input <q-input class="col-12 col-sm-6 col-md-7" dense outlined v-model="placeDeathCertificate"
class="col-12 col-sm-6 col-md-7" label="สถานที่ออกใบมรณบัตร" />
dense
outlined
v-model="placeDeathCertificate"
label="สถานที่ออกใบมรณบัตร"
/>
<q-separator /> <q-separator />
<q-input <q-input class="col-12" dense outlined v-model="reasonDeath" label="เหตุผลการเสียชีวิต" type="textarea" />
class="col-12"
dense
outlined
v-model="reasonDeath"
label="เหตุผลการเสียชีวิต"
type="textarea"
/>
</div> </div>
<q-space /> <q-space />
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<div class="flex justify-end q-pa-sm q-gutter-sm"> <div class="flex justify-end q-pa-sm q-gutter-sm">
<q-btn <q-btn unelevated label="บันทึก" color="public" @click="clickSaveDeceased" :disable="filePassaway === null ||
unelevated deathCertificateNo === '' ||
label="บันทึก" placeDeathCertificate === '' ||
color="public" reasonDeath === ''
@click="clickSaveDeceased" ">
:disable="
filePassaway === null ||
deathCertificateNo === '' ||
placeDeathCertificate === '' ||
reasonDeath === ''
"
>
<q-tooltip>นท</q-tooltip> <q-tooltip>นท</q-tooltip>
</q-btn> </q-btn>
</div> </div>
@ -536,71 +362,34 @@
<q-dialog v-model="dialogLeave" persistent> <q-dialog v-model="dialogLeave" persistent>
<q-card style="width: 600px"> <q-card style="width: 600px">
<q-toolbar> <q-toolbar>
<q-toolbar-title class="text-subtitle2 text-bold" <q-toolbar-title class="text-subtitle2 text-bold">ประเภทการพนราชการ
>ประเภทการพนราชการ
</q-toolbar-title> </q-toolbar-title>
<q-btn <q-btn icon="close" unelevated round dense @click="closeLeave"
icon="close" style="color: #ff8080; background-color: #ffdede" />
unelevated
round
dense
@click="closeLeave"
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar> </q-toolbar>
<q-separator /> <q-separator />
<q-card-section class="q-p-sm"> <q-card-section class="q-p-sm">
<div <div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-select <q-select class="full-width inputgreen cursor-pointer" outlined dense lazy-rules v-model="reason"
class="full-width inputgreen cursor-pointer" :rules="[(val) => !!val || `${'กรุณาเลือกประเภทการพ้นราชการ'}`]" hide-bottom-space
outlined :label="`${'ประเภทการพ้นราชการ'}`" emit-value map-options option-label="name" :options="reasonOptions"
dense option-value="id" />
lazy-rules
v-model="reason"
:rules="[(val) => !!val || `${'กรุณาเลือกประเภทการพ้นราชการ'}`]"
hide-bottom-space
:label="`${'ประเภทการพ้นราชการ'}`"
emit-value
map-options
option-label="name"
:options="reasonOptions"
option-value="id"
/>
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<datepicker <datepicker menu-class-name="modalfix" v-model="leaveDate" :locale="'th'" autoApply :enableTimePicker="false"
menu-class-name="modalfix" week-start="0">
v-model="leaveDate"
:locale="'th'"
autoApply
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template> <template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{ <template #year-overlay-value="{ value }">{{
parseInt(value + 543) parseInt(value + 543)
}}</template> }}</template>
<template #trigger> <template #trigger>
<q-input <q-input class="full-width inputgreen cursor-pointer" outlined dense lazy-rules
class="full-width inputgreen cursor-pointer" :model-value="date2Thai(leaveDate)" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่พ้นราชการ'}`]"
outlined hide-bottom-space :label="`${'วันที่พ้นราชการ'}`">
dense
lazy-rules
:model-value="date2Thai(leaveDate)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่พ้นราชการ'}`]"
hide-bottom-space
:label="`${'วันที่พ้นราชการ'}`"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
@ -608,64 +397,30 @@
</datepicker> </datepicker>
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-input <q-input class="full-width inputgreen cursor-pointer" outlined dense lazy-rules autogrow v-model="leaveDetail"
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
autogrow
v-model="leaveDetail"
:rules="[ :rules="[
(val) => (val) =>
!!val || `${'กรุณากรอกสาเหตุ/เหตุผลของการพ้นจากราชการ'}`, !!val || `${'กรุณากรอกสาเหตุ/เหตุผลของการพ้นจากราชการ'}`,
]" ]" hide-bottom-space :label="`${'สาเหตุ/เหตุผลของการพ้นจากราชการ'}`" />
hide-bottom-space
:label="`${'สาเหตุ/เหตุผลของการพ้นจากราชการ'}`"
/>
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-input <q-input class="full-width inputgreen cursor-pointer" outlined dense lazy-rules autogrow
class="full-width inputgreen cursor-pointer" v-model="leaveNumberOrder" :rules="[(val) => !!val || `${'กรุณากรอกคำสั่ง/เอกสารอ้างอิง'}`]"
outlined hide-bottom-space :label="`${'คำสั่ง/เอกสารอ้างอิง'}`" />
dense
lazy-rules
autogrow
v-model="leaveNumberOrder"
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่ง/เอกสารอ้างอิง'}`]"
hide-bottom-space
:label="`${'คำสั่ง/เอกสารอ้างอิง'}`"
/>
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<datepicker <datepicker menu-class-name="modalfix" v-model="leaveDateOrder" :locale="'th'" autoApply
menu-class-name="modalfix" :enableTimePicker="false" week-start="0">
v-model="leaveDateOrder"
:locale="'th'"
autoApply
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template> <template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{ <template #year-overlay-value="{ value }">{{
parseInt(value + 543) parseInt(value + 543)
}}</template> }}</template>
<template #trigger> <template #trigger>
<q-input <q-input class="full-width inputgreen cursor-pointer" outlined dense lazy-rules
class="full-width inputgreen cursor-pointer" :model-value="date2Thai(leaveDateOrder)" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่ออกคำสั่ง'}`]"
outlined hide-bottom-space :label="`${'วันที่ออกคำสั่ง'}`">
dense
lazy-rules
:model-value="date2Thai(leaveDateOrder)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ออกคำสั่ง'}`]"
hide-bottom-space
:label="`${'วันที่ออกคำสั่ง'}`"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
@ -676,13 +431,7 @@
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right"> <q-card-actions align="right">
<q-btn <q-btn flat round color="public" @click="Retire" icon="mdi-content-save-outline">
flat
round
color="public"
@click="Retire"
icon="mdi-content-save-outline"
>
<q-tooltip>นท</q-tooltip> <q-tooltip>นท</q-tooltip>
</q-btn> </q-btn>
</q-card-actions> </q-card-actions>
@ -823,7 +572,6 @@ const fetchData = async () => {
.get(config.API.profileAvatarId(profileId.value)) .get(config.API.profileAvatarId(profileId.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
fullname.value = data.fullname; fullname.value = data.fullname;
imageUrl.value = data.avatar; imageUrl.value = data.avatar;
position.value = data.position; position.value = data.position;
@ -897,7 +645,7 @@ const uploadImage = async (e: any) => {
showLoader(); showLoader();
await http await http
.post(config.API.profileAvatarId(profileId.value), formData) .post(config.API.profileAvatarId(profileId.value), formData)
.then((res) => {}) .then((res) => { })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
@ -1162,9 +910,9 @@ const otherPost = async () => {
}); });
}; };
const downloadKP7 = () => {}; const downloadKP7 = () => { };
const downloadKP7Short = () => {}; const downloadKP7Short = () => { };
const clickKp7 = async () => { const clickKp7 = async () => {
window.open(config.API.profileReportId(profileId.value)); window.open(config.API.profileReportId(profileId.value));
@ -1409,8 +1157,8 @@ const clickSaveDeceased = async () => {
hideLoader(); hideLoader();
}); });
}) })
.onCancel(() => {}) .onCancel(() => { })
.onDismiss(() => {}); .onDismiss(() => { });
}; };
</script> </script>
<style> <style>

View file

@ -0,0 +1,323 @@
divdivdiv
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import CurrencyInput from "@/components/CurruncyInput.vue";
import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive";
import type {
appointmentData,
ResponseData,
} from "@/modules/05_placement/interface/response/AppointMent";
import type { QForm } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const route = useRoute();
const router = useRouter();
const mixin = useCounterMixin();
const appointment = ref<appointmentData>({
citizenId: "",
prefixId: "",
firstname: "",
lastname: "",
});
const myForm = ref<QForm | null>(null);
const edit = ref<boolean>(false);
const profileId = ref<string>("");
const organizationPositionOld = ref<string>("");
const positionTypeOld = ref<string>("");
const positionLevelOld = ref<string>("");
const posNo = ref<string>("");
const salary = ref<number>(0);
const educationOld = ref<string>("");
const reason = ref<string>("");
const date = ref<Date | null>(null);
const status = ref<string>("");
const avatar = ref<string>("");
const paramsId = route.params.id;
const {
date2Thai,
messageError,
showLoader,
hideLoader,
success,
dialogConfirm,
} = mixin;
const title = ref<ResponseTitle>({
fullname: "",
organizationPositionOld: "",
positionLevelOld: "",
positionTypeOld: "",
});
// id
const fecthappointmentByid = async () => {
showLoader();
await http
.get(config.API.appointmentByid(paramsId.toString()))
.then((res: ResponseData) => {
const data = res.data.result;
appointment.value = data;
profileId.value = data.profileId;
title.value.fullname = `${data.prefix}${data.firstname ?? "-"} ${data.lastname ?? "-"
}`;
title.value.organizationPositionOld = data.organizationPositionOld ?? "-";
title.value.positionLevelOld = data.positionLevelOld ?? "-";
title.value.positionTypeOld = data.positionTypeOld ?? "-";
(status.value = data.status),
(educationOld.value = data.educationOld ?? "-");
organizationPositionOld.value = data.organizationPositionOld;
positionTypeOld.value = data.positionTypeOld;
positionLevelOld.value = data.positionLevelOld;
posNo.value = data.positionNumberOld;
salary.value = data.salary ?? 0;
reason.value = data.reason;
date.value = data.positionDate;
avatar.value = data.avatar ?? "";
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
//
const clickSave = async () => {
if (myForm.value !== null) {
myForm.value.validate().then((success: any) => {
if (success) {
dialogConfirm(
$q,
async () => await putAppointment(),
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
);
}
});
}
};
//
const putAppointment = async () => {
let data = {
citizenId: appointment.value.citizenId,
prefixId: appointment.value.prefixId,
firstname: appointment.value.firstname,
lastname: appointment.value.lastname,
educationOld: educationOld.value,
organizationPositionOld: organizationPositionOld.value,
positionTypeOld: positionTypeOld.value,
positionLevelOld: positionLevelOld.value,
positionNumberOld: posNo.value,
amountOld: Number(salary.value),
reason: reason.value,
positionDate: date.value,
};
// showLoader();
// await http
// .put(config.API.appointmentByid(paramsId.toString()), data)
// .then(() => {
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// fecthappointmentByid();
// edit.value = false;
// });
};
const cancel = () => {
edit.value = false;
fecthappointmentByid();
myForm.value?.resetValidation();
};
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
onMounted(async () => {
await fecthappointmentByid();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm"
@click="router.push(`/appoint-promote`)" />
รายละเอยดการแตงต-เลอน {{ title.fullname }}
</div>
<q-card bordered class="row col-12 text-dark">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-subtitle2">
{{ title.fullname }}
</div>
<q-space />
<q-btn outline color="blue" dense icon-right="mdi-open-in-new" class="q-px-sm" label="ดูข้อมูลทะเบียนประวัติ"
@click="router.push(`/registry/${profileId}`)" />
</div>
<div class="col-12"><q-separator /></div>
<div class="row col-12 q-pa-md">
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-3 col-sm-2 col-md-1 row">
<q-img :src="avatar" v-if="avatar !== ''" />
<q-img src="@/assets/avatar_user.jpg" v-else />
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12 q-pl-md">
<div class="col-12 text-top">ตำแหนงในสายงาน</div>
<div class="col-12 text-detail">
{{ title.positionTypeOld }}
</div>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<div class="col-12 text-top">ระด</div>
<div class="col-12 text-detail">
{{ title.positionLevelOld }}
</div>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<div class="col-12 text-top">งก</div>
<div class="col-12 text-detail">
{{ title.organizationPositionOld }}
</div>
</div>
</div>
</div>
</div>
</q-card>
<q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">
แกไขขอมลเพอลงบญชแนบทาย
</div>
<q-space />
<div v-if="status !== 'DONE' && status !== 'REPORT'">
<div class="q-gutter-sm" v-if="!edit">
<q-btn outline color="primary" dense icon-right="mdi-file-edit-outline" class="q-px-sm" label="แก้ไข"
style="width: 80px" @click="edit = !edit" />
</div>
<div class="q-gutter-sm" v-else>
<q-btn outline color="public" dense class="q-px-sm" label="บันทึก" style="width: 80px" @click="clickSave" />
<q-btn outline color="red" dense class="q-px-sm" label="ยกเลิก" style="width: 80px" @click="cancel()" />
</div>
</div>
</div>
<div class="col-12"><q-separator /></div>
<q-form ref="myForm">
<div class="row col-12 q-pa-md">
<div class="col-12">
<div class="text-weight-bold">การศกษา</div>
</div>
<div class="col-12">
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :readonly="!edit" :borderless="!edit"
v-model="educationOld" :rules="[(val) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]" hide-bottom-space
:label="`${'วุฒิการศึกษา'}`" type="text" />
</div>
</div>
<div class="row col-12 q-pa-md">
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-12 row q-pa-md items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนงและหนวยงานเด</div>
</div>
<div class="col-12">
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :readonly="!edit" :borderless="!edit"
v-model="organizationPositionOld" :rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
hide-bottom-space :label="`${'ตำแหน่ง/สังกัด'}`" type="textarea" />
</div>
</div>
<div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :readonly="!edit" :borderless="!edit"
v-model="positionTypeOld" :rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]" hide-bottom-space
:label="`${'ตำแหน่งประเภท'}`" />
</div>
</div>
<div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :readonly="!edit" :borderless="!edit"
v-model="positionLevelOld" :rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]" hide-bottom-space
:label="`${'ระดับ'}`" />
</div>
</div>
<div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :readonly="!edit" :borderless="!edit"
v-model="posNo" :rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]" hide-bottom-space
:label="`${'เลขที่'}`" />
</div>
</div>
<div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<CurrencyInput v-model="salary" label="เงินเดือน" :edit="edit"
:rules="[(val: number) => !!val || `${'กรุณากรอกเงินเดือน'}`]" lazy-rules />
</div>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-xs-6 col-sm-6 row items-center">
<div class="col-12">
<datepicker menu-class-name="modalfix" :readonly="!edit" v-model="date" :locale="'th'" autoApply
:enableTimePicker="false" week-start="0">
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :borderless="!edit" :readonly="!edit"
:model-value="date !== null ? date2Thai(date) : null"
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]" hide-bottom-space
:label="`${'ดำรงตำแหน่งในระดับปัจจุบันเมื่อ'}`">
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" :style="edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
">
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
</div>
<div class="col-12">
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :readonly="!edit" :borderless="!edit"
v-model="reason" hide-bottom-space :label="`${'หมายเหตุ '}`" type="textarea" />
</div>
</div>
</div>
</q-form>
</q-card>
</template>
<style lang="scss" scope>
.q-img {
border-radius: 5px;
height: 70px;
}
.text-top {
color: gray;
font-weight: 400;
padding-bottom: 3px;
}
.text-detail {
font-weight: 500;
}
</style>

View file

@ -0,0 +1,27 @@
<script setup lang="ts">
const props = defineProps({
title: String,
close: {
type: Function,
default: () => console.log("not function"),
},
});
const close = async () => {
props.close();
};
</script>
<template>
<q-toolbar class="q-py-md">
<q-toolbar-title class="header-text">{{ title }}</q-toolbar-title>
<q-btn icon="close" unelevated round dense @click="close" style="color: #ff8080; background-color: #ffdede" />
</q-toolbar>
</template>
<style scoped lang="scss">
.header-text {
font-size: 18px;
font-weight: 600;
line-height: 26px;
color: #35373C;
}
</style>

View file

@ -0,0 +1,231 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { UserData } from "@/modules/05_placement/interface/response/AppointMent";
import DialogHeader from "@/modules/05_placement/components/AppointMent/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const $q = useQuasar();
const selected = ref<[]>([]);
const checkSelected = computed(() => {
if (selected.value.length === 0 || props.type === "") {
return true;
}
});
const props = defineProps({
Modal: Boolean,
clickClose: Function,
fecthlistappointment: Function,
nextPage: Function,
optionsType: Array,
rows2: Array,
filterKeyword2: String,
type: String,
});
const visibleColumns2 = ref<string[]>([
"no",
"citizenId",
"fullname",
"organizationName",
"birthday",
]);
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "citizenId",
align: "left",
label: "เลขประจำตัวประชาชน",
sortable: true,
field: "citizenId",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "fullname",
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationName",
align: "left",
label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน",
sortable: true,
field: "organizationName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "birthday",
align: "left",
label: "วัน/เดือน/ปี เกิด",
sortable: true,
field: "birthday",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const pageNext = (item: object) => {
props.nextPage?.(item)
}
const emit = defineEmits([
"update:filterKeyword2",
"update:type",
"update:selected",
]);
const updateInput = (value: any) => {
emit("update:filterKeyword2", value);
};
const updateInputType = (value: string) => {
emit("update:type", value);
};
//
const Reset = () => {
emit("update:filterKeyword2", "");
};
// modal
const clickAddlist = () => {
dialogConfirm($q, () => createdAppoint());
};
//
const createdAppoint = async () => {
let pId: string[] = [];
let Type = props.type as string
selected.value.forEach((e: UserData) => {
pId.push(e.personalId);
});
let data = {
id: pId,
};
showLoader();
await http
.put(config.API.apppointmentReport(Type), data)
.then((res) => {
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
props.fecthlistappointment?.();
selected.value = [];
props.clickClose?.()
});
};
watchEffect(() => {
if (props.Modal === true) {
selected.value = [];
}
});
</script>
<template>
<q-dialog v-model="props.Modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่ง" :close="clickClose" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-between">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-select outlined dense :model-value="type" @update:model-value="updateInputType" :options="optionsType"
label="คำสั่งแต่งตั่ง-เลื่อน-ย้าย" style="width: 400px; max-width: auto" emit-value map-options
option-label="name" option-value="id" />
</q-toolbar>
</div>
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input borderless outlined dense debounce="300" :model-value="filterKeyword2"
@update:model-value="updateInput" placeholder="ค้นหา" style="width: 850px; max-width: auto">
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon v-if="filterKeyword2 !== ''" name="clear" class="cursor-pointer" @click="Reset" />
</template>
</q-input>
<q-select v-model="visibleColumns2" multiple outlined dense options-dense
:display-value="$q.lang.table.columns" emit-value map-options :options="columns2" option-value="name"
options-cover style="min-width: 150px" class="gt-xs q-ml-sm" />
</q-toolbar>
</div>
</div>
<d-table :columns="columns2" :rows="rows2" :filter="filterKeyword2" row-key="personalId" flat
:visible-columns="visibleColumns2" selection="multiple" v-model:selected="selected">
<template v-slot:header-selection="scope">
<q-checkbox keep-color color="primary" dense v-model="scope.selected" />
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="citizenId" :props="props" @click="pageNext(props.row)">
{{ props.row.citizenId }}
</q-td>
<q-td key="fullname" :props="props" @click="pageNext(props.row)">
{{ props.row.fullname }}
</q-td>
<q-td key="organizationName" :props="props" @click="pageNext(props.row)">
<div v-if="props.row.orgName !== null ||
props.row.positionPath !== null
">
<div class="col-4">
<div class="text-weight-medium">
{{ props.row.orgName !== null ? props.row.orgName : "-" }}
{{ props.row.organizationShortName !== null ? `(${props.row.organizationShortName})` : "" }}
</div>
<div class="text-weight-light">
{{ props.row.positionPath !== null ? props.row.positionPath : "-" }}
{{ props.row.positionNumber !== null ? `(${props.row.positionNumber})` : "" }}
</div>
</div>
</div>
<div v-else>
<div class="col-4">
<div class="text-weight-medium">-</div>
</div>
</div>
</q-td>
<q-td key="birthday" :props="props" @click="pageNext(props.row)">
{{ props.row.birthday }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn label="ส่งไปออกคำสั่ง" @click="clickAddlist" color="public" :disable="checkSelected" />
</q-card-actions>
</q-card>
</q-dialog>
</template>

View file

@ -0,0 +1,394 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import Dialogbody from "@/modules/05_placement/components/AppointEmployee/Dialogbody.vue";
import DialogOrgTree from "@/modules/05_placement/components/AppointEmployee/Modal.vue";
import type {
listAppointType,
resData,
orgFilter,
} from "@/modules/05_placement/interface/response/AppointMent";
import type { OpType } from "@/modules/05_placement/interface/response/Main";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const modal = ref<boolean>(false);
const storeFn = useTransferDataStore();
const { statusText } = storeFn;
const mixin = useCounterMixin(); //
const {
showLoader,
hideLoader,
success,
messageError,
date2Thai,
dialogRemove,
} = mixin;
const router = useRouter();
const rows = ref<listAppointType[]>([]);
const rows2 = ref<listAppointType[]>([]);
const modalTree = ref<boolean>(false);
const personal = ref<resData[]>([]);
const personalId = ref<string>("");
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const filterRef = ref<any>(null);
const listRecevice = ref<resData[]>([]);
const optionsType = ref<OpType[]>([]);
const type = ref<string>("");
const visibleColumns = ref<string[]>([
"no",
"citizenId",
"fullname",
"organizationName",
"birthday",
"createdAt",
"status",
]);
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "citizenId",
align: "left",
label: "เลขประจำตัวประชาชน",
sortable: true,
field: "citizenId",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "fullname",
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationName",
align: "left",
label: "หน่วยงานที่รับการแต่งตั้ง",
sortable: true,
field: "organizationName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "birthday",
align: "left",
label: "วัน/เดือน/ปี เกิด",
sortable: true,
field: "birthday",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "status",
align: "left",
label: "สถานะ",
sortable: true,
field: "status",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
// input
const resetFilter = () => {
filterKeyword.value = "";
filterKeyword2.value = "";
filterRef.value.focus();
};
// modal
const clickClose = () => {
modal.value = false;
};
// modal
const popup = () => {
modal.value = true;
filterKeyword2.value = "";
fecthTypeOption();
};
// API
const fecthlistappointment = async () => {
// showLoader();
// rows.value = [];
// await http
// .get(config.API.appointmentMain())
// .then((res) => {
// let response = res.data.result;
// listRecevice.value = response;
// rows.value = response.map((e: resData) => ({
// personalId: e.id,
// citizenId: e.citizenId,
// fullname: e.prefix + e.firstname + " " + e.lastname,
// organizationName:
// e.organizationName +
// " " +
// e.organizationShortName +
// " " +
// e.positionNumber +
// " " +
// e.positionPath,
// orgName: e.organizationName,
// organizationShortName: e.organizationShortName,
// positionNumber: e.positionNumber,
// positionPath: e.positionPath,
// status: statusText(e.status),
// createdAt: date2Thai(e.createdAt),
// birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth),
// educationOld: e.educationOld,
// organizationPositionOld: e.organizationPositionOld,
// positionTypeOld: e.positionTypeOld,
// positionLevelOld: e.positionLevelOld,
// positionNumberOld: e.positionNumberOld,
// salary: e.salary,
// positionDate: e.positionDate,
// }));
// rows2.value = rows.value.filter(
// (e: orgFilter) =>
// e.orgName !== null &&
// e.status !== "" &&
// e.status !== "" &&
// e.educationOld &&
// e.organizationPositionOld &&
// e.positionTypeOld &&
// e.positionLevelOld &&
// e.positionNumberOld &&
// e.salary !== null &&
// e.positionDate
// );
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
};
//
const fecthTypeOption = async () => {
type.value = "";
await http
.get(config.API.typeOrder())
.then((res) => {
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-05"
);
})
.catch((e) => {
messageError($q, e);
});
};
//
const openModalTree = (id: string) => {
personalId.value = id;
personal.value = listRecevice.value.filter((e) => e.id === id);
modalTree.value = true;
};
//
const clickDelete = (id: string) => {
dialogRemove($q, () => deleteAppoint(id));
};
//
const deleteAppoint = async (id: string) => {
showLoader();
await http
.delete(config.API.appointmentDelete(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
fecthlistappointment();
hideLoader();
});
};
// modal
const closeModalTree = async () => {
await fecthlistappointment();
modalTree.value = false;
};
//
const nextPage = (id: string) => {
router.push({
path: `appoint-promote/detail/${id}`,
});
};
onMounted(() => {
fecthlistappointment();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการแตงตงลกจางประจำ
</div>
<q-card flat bordered class="col-12 q-mt-sm">
<q-separator />
<div class="row q-pa-md">
<div class="col-12">
<div class="row col-12">
<q-btn @click="popup()" size="14px" flat round color="add" icon="mdi-account-arrow-right">
<q-tooltip>งไปออกคำส</q-tooltip>
</q-btn>
<q-space />
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" outlined
debounce="300" placeholder="ค้นหา">
<template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" />
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
</template>
</q-input>
<q-select v-model="visibleColumns" multiple outlined dense options-dense :display-value="$q.lang.table.columns"
emit-value map-options :options="columns" option-value="name" options-cover style="min-width: 150px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" />
</div>
<div class="col-12 q-pt-sm">
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="citizenId"
:visible-columns="visibleColumns" 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-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td key="no" :props="props" @click="nextPage(props.row.personalId)">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="citizenId" :props="props" @click="nextPage(props.row.personalId)">
{{ props.row.citizenId }}
</q-td>
<q-td key="fullname" :props="props" @click="nextPage(props.row.personalId)">
{{ props.row.fullname }}
</q-td>
<q-td key="organizationName" :props="props" @click="nextPage(props.row.personalId)">
<div v-if="props.row.orgName !== null ||
props.row.positionPath !== null
">
<div class="col-4">
<div class="text-weight-medium">
{{
props.row.orgName !== null ? props.row.orgName : "-"
}}
{{
props.row.organizationShortName !== null
? `(${props.row.organizationShortName})`
: ""
}}
</div>
<div class="text-weight-light">
{{
props.row.positionPath !== null
? props.row.positionPath
: "-"
}}
{{
props.row.positionNumber !== null
? `(${props.row.positionNumber})`
: ""
}}
</div>
</div>
</div>
<div v-else>
<div class="col-4">
<div class="text-weight-medium">-</div>
</div>
</div>
</q-td>
<q-td key="birthday" :props="props" @click="nextPage(props.row.personalId)">
{{ props.row.birthday }}
</q-td>
<q-td key="createdAt" :props="props" @click="nextPage(props.row.personalId)">
{{ props.row.createdAt }}
</q-td>
<q-td key="status" :props="props" @click="nextPage(props.row.personalId)">
{{ props.row.status }}
</q-td>
<q-td auto-width>
<q-btn v-if="props.row.status !== 'ส่งรายชื่อไปออกคำสั่ง' &&
props.row.status !== 'ออกคำสั่งแล้ว'
" icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense>
<q-menu transition-show="jump-down" transition-hide="jump-up">
<q-list dense style="min-width: 100px">
<q-item clickable v-close-popup @click="openModalTree(props.row.personalId)">
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
<q-icon color="primary" size="xs" name="mdi-bookmark-outline" />
</q-item-section>
<q-item-section>เลอกหนวยงาน/ตำแหน</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="clickDelete(props.row.personalId)">
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
<q-tooltip>ลบขอม</q-tooltip>
<q-icon color="red" size="xs" name="mdi-delete" />
</q-item-section>
<q-item-section>ลบ</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</div>
</q-card>
<Dialogbody v-model:Modal="modal" :clickClose="clickClose" :optionsType="optionsType" :rows2="rows2"
v-model:filterKeyword2="filterKeyword2" v-model:type="type" :nextPage="nextPage"
:fecthlistappointment="fecthlistappointment" />
<DialogOrgTree v-model:modal="modalTree" :close="closeModalTree" :personal="personal" :personalId="personalId" />
</template>
<style scoped lang="scss"></style>

View file

@ -0,0 +1,581 @@
<script setup lang="ts">
import { useQuasar, QForm } from "quasar";
import { onMounted, reactive, ref, watch } from "vue";
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { date2Thai, hideLoader, messageError, showLoader, success, dialogConfirm } = mixin; //
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
const noData = ref<string>("ไม่พบข้อมูลผังโครงสร้าง");
const checkValidate = ref<boolean>(false);
const myFormPosition = ref<any>();
const selected = ref<string>("");
const selectedFile = ref<string>("");
const dataRespone = ref<any>();
const personal = ref<any>();
const expanded = ref<string[]>([]);
const treeData = ref<Array<any>>([]);
const placementPosition = ref<any>([]);
const search = ref<string>("");
const filterRef = ref<any>(null);
const id = ref<string>("");
const editDataStatus = ref<boolean>(false);
// Set form field
let dataForm = reactive({
personalId: "",
containDate: new Date(),
posNoId: "",
positionId: "",
positionLevelId: "",
positionLineId: "",
positionPathSideId: "",
positionTypeId: "",
});
onMounted(async () => {
await fetchPublishFile();
await loadTreeData();
await fetchplacementPosition();
});
const fetchPublishFile = async () => {
await http
.get(config.API.getPublishFileHistory)
.then((res) => {
let data = res.data.result;
selectedFile.value = data[0].fileName;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
};
// json
const loadTreeData = async () => {
expanded.value = [];
await http
.get(`${config.s3ClusterUrl}${selectedFile.value}`)
.then((res: any) => {
treeData.value = res.data;
dataRespone.value = res.data;
// Filter objects with "name" null
const filteredData = res.data.filter(filterByPersonIdNull);
treeData.value = filteredData;
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
function filterByPersonIdNull(obj: any) {
if (obj.name === null && obj.isCondition != true) {
return true;
}
if (obj.children && obj.children.length > 0) {
obj.children = obj.children.filter(filterByPersonIdNull);
return obj.children.length > 0;
}
return false;
}
// position
const fetchplacementPosition = async () => {
await http
.get(config.API.apppointmentPosition())
.then((res: any) => {
placementPosition.value = res.data.result;
})
.catch((e: any) => {
messageError($q, e);
});
};
const props = defineProps({
personalId: String,
modal: Boolean,
close: {
type: Function,
default: () => console.log("close modal"),
},
personal: Object,
});
const myFilterMethod = (node: any, filter: string) => {
const filt = filter;
return (
(node.name && node.name.indexOf(filt) > -1) ||
(node.organizationName && node.organizationName.indexOf(filt) > -1) ||
(node.positionNum && node.positionNum.indexOf(filt) > -1) ||
(node.positionName && node.positionName.indexOf(filt) > -1) ||
(node.governmentCode && node.governmentCode.toString().indexOf(filt) > -1) ||
(node.agency && node.agency.indexOf(filt) > -1) ||
(node.government && node.government.indexOf(filt) > -1) ||
(node.department && node.department.indexOf(filt) > -1) ||
(node.pile && node.pile.indexOf(filt) > -1) ||
(node.organizationShortName && node.organizationShortName.indexOf(filt) > -1) ||
(node.positionSideName && node.positionSideName.indexOf(filt) > -1) ||
(node.executivePosition && node.executivePosition.indexOf(filt) > -1) ||
(node.executivePositionSide && node.executivePositionSide.indexOf(filt) > -1) ||
(node.positionLevel && node.positionLevel.indexOf(filt) > -1)
);
};
const validateData = async () => {
checkValidate.value = true;
await myFormPosition.value.validate().then((result: boolean) => {
if (result == false) {
checkValidate.value = false;
}
});
};
const saveAppoint = async () => {
myFormPosition.value.validate().then(async (result: boolean) => {
if (props.personalId !== undefined) {
id.value = props.personalId.toString();
}
if (result) {
const dataAppoint = await {
recruitDate: dataForm.containDate,
posNoId: dataForm.posNoId,
positionId: dataForm.positionId,
positionLevelId: dataForm.positionLevelId,
positionLineId: dataForm.positionLineId,
positionPathSideId: dataForm.positionPathSideId,
positionTypeId: dataForm.positionTypeId,
};
showLoader();
await http
.put(config.API.appointmentPosition(id.value), dataAppoint)
.then((res) => {
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await closeAndClear();
await fetchPublishFile();
await loadTreeData();
await fetchplacementPosition();
hideLoader();
});
}
});
};
const closeModal = () => {
if (editDataStatus.value == true) {
dialogConfirm(
$q,
async () => {
editDataStatus.value = false;
await closeAndClear();
},
`ข้อมูลมีการแก้ไข`,
`ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`
);
} else {
closeAndClear();
}
};
const closeAndClear = async () => {
await props.close();
editDataStatus.value = false;
selected.value = "";
dataForm.personalId = "";
dataForm.containDate = new Date();
dataForm.posNoId = "";
dataForm.positionId = "";
dataForm.positionLevelId = "";
dataForm.positionLineId = "";
dataForm.positionPathSideId = "";
dataForm.positionTypeId = "";
};
//
const posNoOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
//
const positionOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
// /
const positionPathSideOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
//
const positionTypeOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
//
const positionLineOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
//
const positionLevelOptions = ref<Object[]>([
{
label: "",
value: "",
},
]);
const selectedPosition = async (data: any) => {
if (data.name == null && selected.value != data.keyId) {
editDataStatus.value = true;
selected.value = data.keyId;
// posNo Options
posNoOptions.value = [
{
label: data.positionNum,
value: data.positionNumId,
},
];
dataForm.posNoId = data.positionNumId;
// position Options
positionOptions.value = [
{
label: data.positionName,
value: data.positionNameId,
},
];
dataForm.positionId = data.positionNameId;
// positionPathSide Options
let positionPathSideArr: any = [];
if (data.positionSideNameObj && data.positionSideNameObj != null) {
data.positionSideNameObj.map((x: any) => {
positionPathSideArr.push({
label: x.Name,
value: x.Id,
});
});
positionPathSideOptions.value = positionPathSideArr;
dataForm.positionPathSideId =
positionPathSideArr.length > 1 || positionPathSideArr.length == 0
? ""
: positionPathSideArr[0].value;
}
// positionType Options
positionTypeOptions.value = [
{
label: data.positionType,
value: data.positionTypeId,
},
];
dataForm.positionTypeId = data.positionTypeId;
// positionLine Options
positionLineOptions.value = [
{
label: data.positionLine,
value: data.positionLineId,
},
];
dataForm.positionLineId = data.positionLineId;
// positionLevel Options
let positionLevelsArr: any = [];
if (data.positionLevelObj != null) {
data.positionLevelObj.map((x: any) => {
positionLevelsArr.push({
label: x.Name,
value: x.Id,
});
});
positionLevelOptions.value = positionLevelsArr;
dataForm.positionLevelId =
positionLevelsArr.length > 1 || positionLevelsArr.length == 0
? ""
: positionLevelsArr[0].value;
dataForm.positionLevelId = data.positionLevelObj[0].Id;
}
} else if (selected.value == data.keyId) {
selected.value = "";
dataForm.posNoId = "";
dataForm.positionId = "";
dataForm.positionLevelId = "";
dataForm.positionLineId = "";
dataForm.positionPathSideId = "";
dataForm.positionTypeId = "";
}
};
const checkPosition = (val: string) => {
const num = placementPosition.value.findIndex((e: string) => e === val);
return num;
};
watch(props, () => {
expanded.value = [];
const dataPersonal = props.personal;
if (dataPersonal) {
dataPersonal.map((data: any) => {
personal.value = data;
});
}
if (personal.value) {
let findData: any = null;
dataRespone.value.map((x: any) => {
findData = findByPerson(x);
if (findData != null) {
selectedPosition(findData);
for (let i = 3; i <= findData.keyId.length; i += 2) {
expanded.value.push(findData.keyId.slice(0, i));
}
}
});
}
});
function findByPerson(element: any): any {
if (
element.positionNumId &&
element.positionLineId === personal.value.positionLineId &&
element.positionTypeId === personal.value.positionTypeId &&
element.positionNumId === personal.value.posNoId &&
(element.positionLevelObj === null ||
element.positionLevelObj[0].Id === personal.value.positionLevelId)
) {
return element;
} else if (element.children) {
var i;
var result = null;
for (i = 0; result == null && i < element.children.length; i++) {
result = findByPerson(element.children[i]);
}
return result;
}
return null;
}
</script>
<template>
<q-dialog v-model="props.modal" persistent>
<q-card style="width: 900px; max-width: 80vw">
<q-form ref="myFormPosition">
<DialogHeader title="เลือกหน่วยงานที่แต่งตั้ง - เลื่อน" :close="closeModal" />
<q-separator />
<q-card-section class="q-pa-sm bg-grey-1">
<div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-sm-7 row">
<q-card flat bordered class="fit q-pa-sm">
<q-scroll-area visible style="height: 70vh">
<q-input outlined dense ref="filterRef" v-model="search" placeholder="ค้นหา" class="q-mb-sm">
<template v-slot:append>
<q-icon name="mdi-magnify" />
</template>
</q-input>
<div class="q-pa-sm q-gutter-sm">
<q-tree no-transition dense :nodes="treeData" node-key="keyId" :filter="search"
:no-results-label="notFound" :no-nodes-label="noData" :filter-method="myFilterMethod"
v-model:expanded="expanded">
<template v-slot:header-organization="prop">
<div class="col">
<div class="row items-center q-px-xs q-pt-xs q-gutter-sm">
<!--แสดงชอแผนก มพวหนา คลกแลวกาง/ Tree-->
<div class="text-weight-medium">
{{ prop.node.organizationName }}
</div>
<q-badge v-if="prop.node.totalPositionVacant > 0" rounded color="red" outline
:label="prop.node.totalPositionVacant" />
<q-space />
</div>
<div class="col items-center q-px-xs q-pt-xs">
<div class="text-weight-medium text-grey-7">
{{ prop.node.governmentCode }}
{{ prop.node.organizationShortName }}
</div>
</div>
</div>
</template>
<template v-slot:header-person="prop">
<q-item clickable :active="selected == prop.node.keyId" @click="selectedPosition(prop.node)"
:disable="prop.node.name != null ||
checkPosition(prop.node.positionNumId) != -1
" active-class="my-list-link text-primary text-weight-medium"
class="row items-center text-dark q-py-xs q-pl-sm rounded-borders my-list">
<img v-if="prop.node.avatar == '' ||
prop.node.avatar ==
'https://cdn.quasar.dev/img/boy-avatar.png'
" src="@/assets/avatar_user.jpg" class="col-xs-1 col-sm-2" style="
width: 28px;
height: 28px;
border-radius: 50%;
" />
<img v-else :src="prop.node.avatar" class="col-xs-1 col-sm-2" style="
width: 28px;
height: 28px;
border-radius: 50%;
" />
<!--=====ตำแหนงวาง แดง=====-->
<div v-if="prop.node.name == null" class="q-px-sm text-weight-medium text-red">
าง
</div>
<!--=====วหน เขยว=====-->
<div v-else-if="prop.node.positionLeaderFlag">
<div class="q-px-sm text-weight-medium text-primary">
{{ prop.node.name }}
</div>
</div>
<!--=====กนอง ปกต=====-->
<div v-else>
<div class="q-px-sm text-weight-medium">
{{ prop.node.name }}
</div>
</div>
<!--อทายชอคน แสดงสปกต-->
<div class="q-pr-sm">
{{ prop.node.positionName }}
</div>
<div class="q-pr-sm">
{{ prop.node.positionNum }}
</div>
<div class="q-pr-sm">
{{ prop.node.positionLevel }}
</div>
<q-icon v-if="prop.node.positionLeaderFlag" class="q-mr-sm" size="15px" color="primary"
name="mdi-bookmark"></q-icon>
<q-space />
</q-item>
</template>
</q-tree>
</div>
</q-scroll-area>
</q-card>
</div>
<div class="col-xs-12 col-sm-5">
<q-card flat bordered class="fit q-pa-sm">
<q-scroll-area visible style="height: 70vh">
<div class="row col-12 q-col-gutter-xs">
<div class="col-xs-12 col-sm-12 col-md-12"></div>
<div class="col-xs-12 col-sm-12 col-md-12">
<datepicker menu-class-name="modalfix" v-model="dataForm.containDate" :locale="'th'" autoApply
:enableTimePicker="false" week-start="0">
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input class="full-width inputgreen cursor-pointer" outlined dense lazy-rules :model-value="date2Thai(new Date(dataForm.containDate))
" :rules="[(val: string) => !!val || `${'วันที่รายงานตัว'}`]"
:label="`${'วันที่รายงานตัว'}`" hide-bottom-space>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<q-space />
<div class="col-xs-12 col-sm-12 col-md-12">
<q-select class="full-width inputgreen cursor-pointer custom-input" outlined standout dense
hide-bottom-space lazy-rules :options="posNoOptions" v-model="dataForm.posNoId"
:label="`${'ตำแหน่งเลขที่'}`" map-options />
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<q-select outlined class="full-width inputgreen cursor-pointer custom-input" standout dense
hide-bottom-space lazy-rules :options="positionOptions" v-model="dataForm.positionId"
:label="`${'ตำแหน่ง'}`" map-options />
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<q-select outlined class="full-width inputgreen cursor-pointer custom-input" standout dense
hide-bottom-space lazy-rules emit-value :options="positionPathSideOptions"
v-model="dataForm.positionPathSideId" :label="`${'ด้าน/สาขา'}`" map-options />
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<q-select outlined class="full-width inputgreen cursor-pointer custom-input" standout dense
hide-bottom-space lazy-rules :options="positionTypeOptions" v-model="dataForm.positionTypeId"
:label="`${'ประเภทตำแหน่ง'}`" map-options />
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<q-select outlined class="full-width inputgreen cursor-pointer custom-input" standout dense
hide-bottom-space lazy-rules :options="positionLineOptions" v-model="dataForm.positionLineId"
:label="`${'สายงาน'}`" map-options />
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<q-select outlined class="full-width inputgreen cursor-pointer custom-input" standout dense
lazy-rules :options="positionLevelOptions" v-model="dataForm.positionLevelId"
:label="`${'ระดับ'}`" hide-bottom-space
:rules="[(val: string) => !!val || `${'กรุณาเลือกระดับ'}`]" emit-value map-options />
</div>
</div>
</q-scroll-area>
</q-card>
</div>
</div>
</q-card-section>
<q-separator />
<DialogFooter :editvisible="true" :validate="validateData" :save="saveAppoint"
v-model:modalEdit="editDataStatus" />
</q-form>
</q-card>
</q-dialog>
</template>
<style scoped lang="scss">
.q-tree__node-header {
padding: 0px;
margin-top: 0px;
border-radius: 4px;
outline: 0;
}
.my-list-link {
color: rgb(118, 168, 222);
border-radius: 5px;
background: #a3d3fb48 !important;
font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217);
}
</style>

View file

@ -163,7 +163,7 @@ onMounted(async () => {
class="q-mr-sm" class="q-mr-sm"
@click="router.push(`/appoint-promote`)" @click="router.push(`/appoint-promote`)"
/> />
รายละเอยดการแตงต-เลอน {{ title.fullname }} รายละเอยดการแตงต-เลอน-าย {{ title.fullname }}
</div> </div>
<q-card bordered class="row col-12 text-dark"> <q-card bordered class="row col-12 text-dark">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"> <div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">

View file

@ -68,7 +68,7 @@ const columns2 = ref<QTableProps["columns"]>([
{ {
name: "organizationName", name: "organizationName",
align: "left", align: "left",
label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน", label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน-ย้าย",
sortable: true, sortable: true,
field: "organizationName", field: "organizationName",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",

View file

@ -4,18 +4,22 @@ import type { QTableProps } from "quasar";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store" import { useTransferDataStore } from "@/modules/05_placement/store";
import Dialogbody from "@/modules/05_placement/components/AppointMent/Dialogbody.vue" import Dialogbody from "@/modules/05_placement/components/AppointMent/Dialogbody.vue";
import DialogOrgTree from "@/modules/05_placement/components/AppointMent/AppointmentModal.vue"; import DialogOrgTree from "@/modules/05_placement/components/AppointMent/AppointmentModal.vue";
import type { listAppointType,resData,orgFilter } from "@/modules/05_placement/interface/response/AppointMent" import type {
import type { OpType } from "@/modules/05_placement/interface/response/Main" listAppointType,
resData,
orgFilter,
} from "@/modules/05_placement/interface/response/AppointMent";
import type { OpType } from "@/modules/05_placement/interface/response/Main";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
const $q = useQuasar(); const $q = useQuasar();
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
const storeFn = useTransferDataStore(); const storeFn = useTransferDataStore();
const { statusText } = storeFn const { statusText } = storeFn;
const mixin = useCounterMixin(); // const mixin = useCounterMixin(); //
const { const {
showLoader, showLoader,
@ -85,7 +89,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "organizationName", name: "organizationName",
align: "left", align: "left",
label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน", label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน-ย้าย",
sortable: true, sortable: true,
field: "organizationName", field: "organizationName",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
@ -167,15 +171,30 @@ const fecthlistappointment = async () => {
status: statusText(e.status), status: statusText(e.status),
createdAt: date2Thai(e.createdAt), createdAt: date2Thai(e.createdAt),
birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth), birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth),
educationOld: e.educationOld,
organizationPositionOld: e.organizationPositionOld,
positionTypeOld: e.positionTypeOld,
positionLevelOld: e.positionLevelOld,
positionNumberOld: e.positionNumberOld,
salary: e.salary,
positionDate: e.positionDate,
})); }));
rows2.value = rows.value.filter( rows2.value = rows.value.filter(
(e: orgFilter) => (e: orgFilter) =>
e.orgName !== null && e.orgName !== null &&
e.status !== "ส่งรายชื่อไปออกคำสั่ง" && e.status !== "ส่งรายชื่อไปออกคำสั่ง" &&
e.status !== "ออกคำสั่งเสร็จแล้ว" e.status !== "ออกคำสั่งเสร็จแล้ว" &&
e.educationOld &&
e.organizationPositionOld &&
e.positionTypeOld &&
e.positionLevelOld &&
e.positionNumberOld &&
e.salary !== null &&
e.positionDate
); );
}) })
.catch((e) => { .catch((e) => {
messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -241,7 +260,6 @@ const nextPage = (id: string) => {
}); });
}; };
onMounted(() => { onMounted(() => {
fecthlistappointment(); fecthlistappointment();
}); });
@ -255,27 +273,65 @@ onMounted(() => {
<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">
<q-btn @click="popup()" size="14px" flat round color="add" icon="mdi-account-arrow-right"> <q-btn
@click="popup()"
size="14px"
flat
round
color="add"
icon="mdi-account-arrow-right"
>
<q-tooltip>งไปออกคำสงแตงต-เลอน-าย</q-tooltip> <q-tooltip>งไปออกคำสงแตงต-เลอน-าย</q-tooltip>
</q-btn> </q-btn>
<q-space /> <q-space />
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" outlined <q-input
debounce="300" placeholder="ค้นหา"> class="col-xs-12 col-sm-3 col-md-2"
standout
dense
v-model="filterKeyword"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
>
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon v-if="filterKeyword == ''" name="search" />
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" /> <q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
<q-select v-model="visibleColumns" multiple outlined dense options-dense :display-value="$q.lang.table.columns" <q-select
emit-value map-options :options="columns" option-value="name" options-cover style="min-width: 150px" v-model="visibleColumns"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" /> multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
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 q-pt-sm">
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="citizenId" <d-table
:visible-columns="visibleColumns" v-model:pagination="pagination"> :columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="citizenId"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
>
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
@ -286,27 +342,60 @@ onMounted(() => {
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props" class="cursor-pointer">
<q-td key="no" :props="props" @click="nextPage(props.row.personalId)"> <q-td
key="no"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</q-td> </q-td>
<q-td key="citizenId" :props="props" @click="nextPage(props.row.personalId)"> <q-td
key="citizenId"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.citizenId }} {{ props.row.citizenId }}
</q-td> </q-td>
<q-td key="fullname" :props="props" @click="nextPage(props.row.personalId)"> <q-td
key="fullname"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.fullname }} {{ props.row.fullname }}
</q-td> </q-td>
<q-td key="organizationName" :props="props" @click="nextPage(props.row.personalId)"> <q-td
<div v-if="props.row.orgName !== null || key="organizationName"
props.row.positionPath !== null :props="props"
"> @click="nextPage(props.row.personalId)"
>
<div
v-if="
props.row.orgName !== null ||
props.row.positionPath !== null
"
>
<div class="col-4"> <div class="col-4">
<div class="text-weight-medium"> <div class="text-weight-medium">
{{ props.row.orgName !== null ? props.row.orgName : "-" }} {{
{{ props.row.organizationShortName !== null ? `(${props.row.organizationShortName})` : "" }} props.row.orgName !== null ? props.row.orgName : "-"
}}
{{
props.row.organizationShortName !== null
? `(${props.row.organizationShortName})`
: ""
}}
</div> </div>
<div class="text-weight-light"> <div class="text-weight-light">
{{ props.row.positionPath !== null ? props.row.positionPath : "-" }} {{
{{ props.row.positionNumber !== null ? `(${props.row.positionNumber})` : "" }} props.row.positionPath !== null
? props.row.positionPath
: "-"
}}
{{
props.row.positionNumber !== null
? `(${props.row.positionNumber})`
: ""
}}
</div> </div>
</div> </div>
</div> </div>
@ -316,29 +405,73 @@ onMounted(() => {
</div> </div>
</div> </div>
</q-td> </q-td>
<q-td key="birthday" :props="props" @click="nextPage(props.row.personalId)"> <q-td
key="birthday"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.birthday }} {{ props.row.birthday }}
</q-td> </q-td>
<q-td key="createdAt" :props="props" @click="nextPage(props.row.personalId)"> <q-td
key="createdAt"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.createdAt }} {{ props.row.createdAt }}
</q-td> </q-td>
<q-td key="status" :props="props" @click="nextPage(props.row.personalId)"> <q-td
key="status"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.status }} {{ props.row.status }}
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn v-if="props.row.status !== 'ส่งรายชื่อไปออกคำสั่ง' && <q-btn
props.row.status !== 'ออกคำสั่งแล้ว' v-if="
" icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense> props.row.status !== 'ส่งรายชื่อไปออกคำสั่ง' &&
<q-menu transition-show="jump-down" transition-hide="jump-up"> props.row.status !== 'ออกคำสั่งแล้ว'
"
icon="mdi-dots-vertical"
size="12px"
color="grey-7"
flat
round
dense
>
<q-menu
transition-show="jump-down"
transition-hide="jump-up"
>
<q-list dense style="min-width: 100px"> <q-list dense style="min-width: 100px">
<q-item clickable v-close-popup @click="openModalTree(props.row.personalId)"> <q-item
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> clickable
<q-icon color="primary" size="xs" name="mdi-bookmark-outline" /> v-close-popup
@click="openModalTree(props.row.personalId)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-icon
color="primary"
size="xs"
name="mdi-bookmark-outline"
/>
</q-item-section> </q-item-section>
<q-item-section>เลอกหนวยงาน/ตำแหน</q-item-section> <q-item-section>เลอกหนวยงาน/ตำแหน</q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="clickDelete(props.row.personalId)"> <q-item
<q-item-section style="min-width: 0px" avatar class="q-py-sm"> clickable
v-close-popup
@click="clickDelete(props.row.personalId)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>ลบขอม</q-tooltip> <q-tooltip>ลบขอม</q-tooltip>
<q-icon color="red" size="xs" name="mdi-delete" /> <q-icon color="red" size="xs" name="mdi-delete" />
</q-item-section> </q-item-section>
@ -366,6 +499,11 @@ onMounted(() => {
:nextPage="nextPage" :nextPage="nextPage"
:fecthlistappointment="fecthlistappointment" :fecthlistappointment="fecthlistappointment"
/> />
<DialogOrgTree v-model:modal="modalTree" :close="closeModalTree" :personal="personal" :personalId="personalId" /> <DialogOrgTree
v-model:modal="modalTree"
:close="closeModalTree"
:personal="personal"
:personalId="personalId"
/>
</template> </template>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

View file

@ -425,7 +425,7 @@ function filterFnYear(val: string, update: any) {
</template> </template>
</q-select> </q-select>
<q-select <q-select
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-3"
v-model="examType" v-model="examType"
label="ประเภทการสอบ" label="ประเภทการสอบ"
dense dense

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed,watchEffect } from "vue"; import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
@ -25,8 +25,8 @@ const props = defineProps({
fecthlistOthet: Function, fecthlistOthet: Function,
optionsType: Array, optionsType: Array,
rows2: Array, rows2: Array,
filterKeyword2:String, filterKeyword2: String,
type:String, type: String,
}); });
const visibleColumns2 = ref<string[]>([ const visibleColumns2 = ref<string[]>([
"no", "no",
@ -96,7 +96,6 @@ const emit = defineEmits([
"update:filterKeyword2", "update:filterKeyword2",
"update:type", "update:type",
"update:selected", "update:selected",
]); ]);
const updateInput = (value: any) => { const updateInput = (value: any) => {
emit("update:filterKeyword2", value); emit("update:filterKeyword2", value);
@ -107,7 +106,7 @@ const updateInputType = (value: any) => {
}; };
// //
const Reset = () => { const Reset = () => {
emit("update:filterKeyword2", ""); emit("update:filterKeyword2", "");
}; };
// modal // modal
const clickAddlist = () => { const clickAddlist = () => {
@ -117,7 +116,7 @@ const clickAddlist = () => {
// //
const addOther = async () => { const addOther = async () => {
let pId: string[] = []; let pId: string[] = [];
let Type = props.type as string let Type = props.type as string;
selected.value.forEach((e: any) => { selected.value.forEach((e: any) => {
pId.push(e.personalId); pId.push(e.personalId);
}); });
@ -136,7 +135,7 @@ const addOther = async () => {
.finally(() => { .finally(() => {
props.fecthlistOthet?.(); props.fecthlistOthet?.();
selected.value = []; selected.value = [];
props.clickClose?.() props.clickClose?.();
}); });
}; };
watchEffect(() => { watchEffect(() => {
@ -144,6 +143,23 @@ watchEffect(() => {
selected.value = []; selected.value = [];
} }
}); });
// filter OptionsType
const OptionsTypeFn = ref<any>([]);
function filterFnOptionsType(val: string, update: any) {
if (val == "") {
update(() => {
OptionsTypeFn.value = props.optionsType;
});
} else {
update(() => {
if (props.optionsType) {
OptionsTypeFn.value = props.optionsType.filter(
(e: any) => e.name.search(val) !== -1
);
}
});
}
}
</script> </script>
<template> <template>
@ -160,14 +176,23 @@ watchEffect(() => {
dense dense
:model-value="type" :model-value="type"
@update:model-value="updateInputType" @update:model-value="updateInputType"
:options="optionsType" :options="OptionsTypeFn"
label="ประเภทคำสั่ง" label="ประเภทคำสั่ง"
style="width: 400px; max-width: auto" style="width: 400px; max-width: auto"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
option-value="id" option-value="id"
/> use-input
@filter="filterFnOptionsType"
><template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</q-toolbar> </q-toolbar>
</div> </div>
<div class="col-5"> <div class="col-5">
@ -232,7 +257,6 @@ watchEffect(() => {
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props" class="cursor-pointer">
<q-td> <q-td>
<q-checkbox <q-checkbox
keep-color keep-color
color="primary" color="primary"

View file

@ -150,9 +150,19 @@ const fecthlistOthet = async () => {
status: r.status ?? "-", status: r.status ?? "-",
statustext: statusText(r.status ?? ""), statustext: statusText(r.status ?? ""),
fullname: `${r.prefix ?? ""}${r.firstname ?? ""} ${r.lastname ?? ""}`, fullname: `${r.prefix ?? ""}${r.firstname ?? ""} ${r.lastname ?? ""}`,
amountOld: r.amountOld,
positionDate: r.positionDate,
})); }));
rows2.value = rows.value.filter( rows2.value = rows.value.filter(
(e: listMain) => e.status !== "REPORT" && e.status !== "DONE" (e: listMain) =>
e.status !== "REPORT" &&
e.status !== "DONE" &&
e.organizationPositionOld &&
e.positionTypeOld &&
e.positionLevelOld &&
e.positionNumberOld &&
e.amountOld !== null &&
e.positionDate
); );
}) })
.catch((e) => { .catch((e) => {

View file

@ -52,8 +52,15 @@ const popup = () => {
(r.status == "WAITTING" || (r.status == "WAITTING" ||
r.status == "PENDING" || r.status == "PENDING" ||
r.status == "APPROVE") && r.status == "APPROVE") &&
r.positionNumber != null r.positionNumber != null &&
r.educationOld &&
r.organizationPositionOld &&
r.positionTypeOld &&
r.positionLevelOld &&
r.positionNumberOld &&
r.amountOld !== null
); );
rows2.value = row; rows2.value = row;
modal.value = true; modal.value = true;
}; };
@ -147,27 +154,28 @@ const columns = ref<QTableProps["columns"]>([
}, },
]); ]);
//save file //save file
const SaveData = async () => { const SaveData = async () => {
myForm.value.validate().then((result: boolean) => { myForm.value.validate().then((result: boolean) => {
if (result) { if (result) {
const formData = new FormData(); const formData = new FormData();
formData.append("File", files.value); formData.append("File", files.value);
showLoader(); showLoader();
http http
.put(config.API.receiveFile(personalId.value), formData) .put(config.API.receiveFile(personalId.value), formData)
.then(() => { .then(() => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
await clickCloseUpload(); await clickCloseUpload();
hideLoader(); hideLoader();
});
}); }
}})}; });
};
const fecthlistRecevice = async () => { const fecthlistRecevice = async () => {
showLoader(); showLoader();
@ -175,6 +183,7 @@ const fecthlistRecevice = async () => {
.get(config.API.receiveData()) .get(config.API.receiveData())
.then((res: any) => { .then((res: any) => {
const response = res.data.result; const response = res.data.result;
listRecevice.value = response; listRecevice.value = response;
let list: ResponseRow[] = []; let list: ResponseRow[] = [];
response.map((e: ResponseData) => { response.map((e: ResponseData) => {
@ -194,12 +203,23 @@ const fecthlistRecevice = async () => {
organizationShortName: e.organizationShortName, organizationShortName: e.organizationShortName,
positionNumber: e.positionNumber, positionNumber: e.positionNumber,
positionPath: e.positionPath, positionPath: e.positionPath,
birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth) && birthday:
e.dateOfBirth.toString() === "0001-01-01T00:00:00" ? "-" : date2Thai(e.dateOfBirth), e.dateOfBirth == null
? "-"
: date2Thai(e.dateOfBirth) &&
e.dateOfBirth.toString() === "0001-01-01T00:00:00"
? "-"
: date2Thai(e.dateOfBirth),
status: e.status, status: e.status,
statusText: statusText(e.status ?? ""), statusText: statusText(e.status ?? ""),
createdAt: e.createdAt !== null ? new Date(e.createdAt) : null, createdAt: e.createdAt !== null ? new Date(e.createdAt) : null,
dateText: e.createdAt !== null ? date2Thai(e.createdAt) : "-", dateText: e.createdAt !== null ? date2Thai(e.createdAt) : "-",
educationOld: e.educationOld ?? "",
organizationPositionOld: e.organizationPositionOld ?? "",
positionTypeOld: e.positionTypeOld,
positionLevelOld: e.positionLevelOld,
positionNumberOld: e.positionNumberOld,
amountOld: e.amountOld,
}); });
}); });
rows.value = list; rows.value = list;
@ -231,7 +251,7 @@ const clickClose = () => {
// //
const clickCloseUpload = () => { const clickCloseUpload = () => {
modalupload.value = false; modalupload.value = false;
files.value = null files.value = null;
}; };
// //
const openModalTree = (id: string) => { const openModalTree = (id: string) => {
@ -292,26 +312,62 @@ onMounted(() => {
<q-btn flat round color="primary" @click="add" icon="mdi-plus"> <q-btn flat round color="primary" @click="add" icon="mdi-plus">
<q-tooltip>เพมขอม</q-tooltip> <q-tooltip>เพมขอม</q-tooltip>
</q-btn> </q-btn>
<q-btn size="14px" flat round color="add" icon="mdi-account-arrow-right" @click="popup()" > <q-btn
size="14px"
flat
round
color="add"
icon="mdi-account-arrow-right"
@click="popup()"
>
<q-tooltip>งไปออกคำสงรบโอน</q-tooltip> <q-tooltip>งไปออกคำสงรบโอน</q-tooltip>
</q-btn> </q-btn>
<q-space /> <q-space />
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" <q-input
ref="filterRef" outlined debounce="300" placeholder="ค้นหา" > class="col-xs-12 col-sm-3 col-md-2"
standout
dense
v-model="filterKeyword"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
>
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon v-if="filterKeyword == ''" name="search" />
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" /> <q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
<q-select v-model="visibleColumns" multiple outlined dense options-dense <q-select
:display-value="$q.lang.table.columns" emit-value map-options v-model="visibleColumns"
:options="columns" option-value="name" options-cover style="min-width: 150px" multiple
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" /> outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
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 q-pt-sm">
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="fullname" <d-table
:visible-columns="visibleColumns" > :columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="fullname"
:visible-columns="visibleColumns"
>
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
@ -322,25 +378,60 @@ onMounted(() => {
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props" class="cursor-pointer">
<q-td key="no" :props="props" @click="nextPage(props.row.personalId)"> <q-td
key="no"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</q-td> </q-td>
<q-td key="citizenId" :props="props" @click="nextPage(props.row.personalId)" > <q-td
key="citizenId"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.citizenId }} {{ props.row.citizenId }}
</q-td> </q-td>
<q-td key="fullname" :props="props" @click="nextPage(props.row.personalId)" > <q-td
key="fullname"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.fullname }} {{ props.row.fullname }}
</q-td> </q-td>
<q-td key="organizationName" :props="props" @click="nextPage(props.row.personalId)" > <q-td
<div v-if=" props.row.orgName !== null || props.row.positionPath !== null " > key="organizationName"
:props="props"
@click="nextPage(props.row.personalId)"
>
<div
v-if="
props.row.orgName !== null ||
props.row.positionPath !== null
"
>
<div class="col-4"> <div class="col-4">
<div class="text-weight-medium"> <div class="text-weight-medium">
{{ props.row.orgName !== null ? props.row.orgName : "-" }} {{
{{ props.row.organizationShortName !== null ? `(${props.row.organizationShortName})` : "" }} props.row.orgName !== null ? props.row.orgName : "-"
}}
{{
props.row.organizationShortName !== null
? `(${props.row.organizationShortName})`
: ""
}}
</div> </div>
<div class="text-weight-light"> <div class="text-weight-light">
{{ props.row.positionPath !== null ? props.row.positionPath : "-" }} {{
{{ props.row.positionNumber !== null ? `(${props.row.positionNumber})` : "" }} props.row.positionPath !== null
? props.row.positionPath
: "-"
}}
{{
props.row.positionNumber !== null
? `(${props.row.positionNumber})`
: ""
}}
</div> </div>
</div> </div>
</div> </div>
@ -350,46 +441,119 @@ onMounted(() => {
</div> </div>
</div> </div>
</q-td> </q-td>
<q-td key="birthday" :props="props" @click="nextPage(props.row.personalId)" > <q-td
key="birthday"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.birthday }} {{ props.row.birthday }}
</q-td> </q-td>
<q-td key="dateText" :props="props" @click="nextPage(props.row.personalId)" > <q-td
key="dateText"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.dateText }} {{ props.row.dateText }}
</q-td> </q-td>
<q-td key="statusText" :props="props" @click="nextPage(props.row.personalId)" > <q-td
key="statusText"
:props="props"
@click="nextPage(props.row.personalId)"
>
{{ props.row.statusText }} {{ props.row.statusText }}
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn icon="mdi-dots-vertical" size="12px" color="grey-7" <q-btn
flat round dense > icon="mdi-dots-vertical"
<q-menu transition-show="jump-down" transition-hide="jump-up" > size="12px"
color="grey-7"
flat
round
dense
>
<q-menu
transition-show="jump-down"
transition-hide="jump-up"
>
<q-list dense style="min-width: 100px"> <q-list dense style="min-width: 100px">
<q-item clickable v-close-popup @click="openModalTree(props.row.personalId)" <q-item
:disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' " > clickable
<q-item-section style="min-width: 0px" avatar class="q-py-sm" > v-close-popup
<q-icon :color=" props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'primary' " @click="openModalTree(props.row.personalId)"
size="xs" name="mdi-bookmark-outline" /> :disable="
props.row.status == 'REPORT' ||
props.row.status == 'DONE'
"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-icon
:color="
props.row.status == 'REPORT' ||
props.row.status == 'DONE'
? 'grey'
: 'primary'
"
size="xs"
name="mdi-bookmark-outline"
/>
</q-item-section> </q-item-section>
<q-item-section <q-item-section
>เลอกหนวยงานทบโอน</q-item-section >เลอกหนวยงานทบโอน</q-item-section
> >
</q-item> </q-item>
<q-item clickable v-close-popup <q-item
@click="openUpload(props.row.personalId)" :disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' "> clickable
<q-item-section style="min-width: 0px" avatar class="q-py-sm" > v-close-popup
<q-icon size="xs" name="attach_file" @click="openUpload(props.row.personalId)"
:color=" props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'blue' " /> :disable="
props.row.status == 'REPORT' ||
props.row.status == 'DONE'
"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-icon
size="xs"
name="attach_file"
:color="
props.row.status == 'REPORT' ||
props.row.status == 'DONE'
? 'grey'
: 'blue'
"
/>
</q-item-section> </q-item-section>
<q-item-section>ปโหลดเอกสาร</q-item-section> <q-item-section>ปโหลดเอกสาร</q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="openDelete(props.row.personalId)" <q-item
:disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' " > clickable
<q-item-section style="min-width: 0px" avatar class="q-py-sm" > v-close-popup
@click="openDelete(props.row.personalId)"
:disable="
props.row.status == 'REPORT' ||
props.row.status == 'DONE'
"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>ลบขอม</q-tooltip> <q-tooltip>ลบขอม</q-tooltip>
<q-icon <q-icon
:color=" :color="
props.row.status == 'REPORT' || props.row.status == 'REPORT' ||
props.row.status == 'DONE' ? 'grey' : 'red' " props.row.status == 'DONE'
? 'grey'
: 'red'
"
size="xs" size="xs"
name="mdi-delete" name="mdi-delete"
/> />
@ -423,8 +587,18 @@ onMounted(() => {
<q-card-section class="q-py-sm"> <q-card-section class="q-py-sm">
<div class="col-12 row items-center q-col-gutter-sm"> <div class="col-12 row items-center q-col-gutter-sm">
<div class="col-12"> <div class="col-12">
<q-file ref="myForm" outlined dense v-model="files" label="อัปโหลดเอกสาร" lazy-rules <q-file
:rules="[(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน']" hide-bottom-space > ref="myForm"
outlined
dense
v-model="files"
label="อัปโหลดเอกสาร"
lazy-rules
:rules="[
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
]"
hide-bottom-space
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" /> <q-icon name="attach_file" />
</template> </template>
@ -435,7 +609,13 @@ onMounted(() => {
<q-separator /> <q-separator />
<div class="row q-px-sm q-py-xs"> <div class="row q-px-sm q-py-xs">
<q-space /> <q-space />
<q-btn flat round color="public" @click="SaveData()" icon="mdi-content-save-outline" > <q-btn
flat
round
color="public"
@click="SaveData()"
icon="mdi-content-save-outline"
>
<q-tooltip>นท</q-tooltip> <q-tooltip>นท</q-tooltip>
</q-btn> </q-btn>
</div> </div>

View file

@ -155,9 +155,17 @@ const openModalOrder = () => {
openModal(); openModal();
const row = rows.value.filter( const row = rows.value.filter(
(item: officerType) => (item: officerType) =>
item.status == "WAITTING" || (item.status == "WAITTING" ||
item.status == "PENDING" || item.status == "PENDING" ||
item.status == "APPROVE" item.status == "APPROVE") &&
item.organizationPositionOld &&
item.positionTypeOld &&
item.positionLevelOld &&
item.positionNumberOld &&
item.salary !== null &&
item.organization &&
item.date &&
item.dateRepatriation
); );
rows2.value = row; rows2.value = row;
}; };
@ -187,6 +195,7 @@ const getData = async () => {
positionNumberOld: item.positionNumberOld, positionNumberOld: item.positionNumberOld,
organizationPositionOld: item.organizationPositionOld, organizationPositionOld: item.organizationPositionOld,
isActive: item.isActive, isActive: item.isActive,
dateRepatriation: item.dateRepatriation,
})); }));
}) })
.catch((e) => {}) .catch((e) => {})
@ -224,26 +233,63 @@ onMounted(async () => {
<q-separator /> <q-separator />
<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">
<q-btn flat round size="14px" color="add" icon="mdi-account-arrow-right" @click="openModalOrder" > <q-btn
flat
round
size="14px"
color="add"
icon="mdi-account-arrow-right"
@click="openModalOrder"
>
<q-tooltip>งไปออกคำสงสงตวกล</q-tooltip> <q-tooltip>งไปออกคำสงสงตวกล</q-tooltip>
</q-btn> </q-btn>
<q-space /> <q-space />
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" <q-input
outlined debounce="300" placeholder="ค้นหา" > class="col-xs-12 col-sm-3 col-md-2"
standout
dense
v-model="filterKeyword"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
>
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon v-if="filterKeyword == ''" name="search" />
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" /> <q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
<q-select class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" v-model="visibleColumns" multiple outlined <q-select
dense options-dense :display-value="$q.lang.table.columns" emit-value map-options :options="columns" class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
option-value="name" options-cover style="min-width: 150px" /> v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
</div> </div>
<div class="col-12 q-pt-sm"> <div class="col-12 q-pt-sm">
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="id" :visible-columns="visibleColumns" > <d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
>
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
@ -252,45 +298,89 @@ onMounted(async () => {
<q-th auto-width /> <q-th auto-width />
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props" class="cursor-pointer">
<q-td key="no" :props="props" @click="openDetail(props.row.id)"> <q-td key="no" :props="props" @click="openDetail(props.row.id)">
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</q-td> </q-td>
<q-td key="fullname" :props="props" @click="openDetail(props.row.id)" > <q-td
key="fullname"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.fullname }} {{ props.row.fullname }}
</q-td> </q-td>
<q-td key="posNo" :props="props" @click="openDetail(props.row.id)" > <q-td
key="posNo"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.posNo }} {{ props.row.posNo }}
</q-td> </q-td>
<q-td key="position" :props="props" @click="openDetail(props.row.id)" > <q-td
key="position"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.position }} {{ props.row.position }}
</q-td> </q-td>
<q-td key="positionLevel" :props="props" @click="openDetail(props.row.id)" > <q-td
key="positionLevel"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.positionLevel }} {{ props.row.positionLevel }}
</q-td> </q-td>
<q-td key="organizationPositionOld" :props="props" @click="openDetail(props.row.id)" > <q-td
key="organizationPositionOld"
:props="props"
@click="openDetail(props.row.id)"
>
<div class="table_ellipsis"> <div class="table_ellipsis">
{{ props.row.organizationPositionOld }} {{ props.row.organizationPositionOld }}
</div> </div>
</q-td> </q-td>
<q-td key="organization" :props="props" @click="openDetail(props.row.id)" > <q-td
key="organization"
:props="props"
@click="openDetail(props.row.id)"
>
<div class="table_ellipsis"> <div class="table_ellipsis">
{{ props.row.organization }} {{ props.row.organization }}
</div> </div>
</q-td> </q-td>
<q-td key="createdAt" :props="props" @click="openDetail(props.row.id)" > <q-td
key="createdAt"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.createdAt }} {{ props.row.createdAt }}
</q-td> </q-td>
<q-td key="statusText" :props="props" @click="openDetail(props.row.id)" > <q-td
key="statusText"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.statusText }} {{ props.row.statusText }}
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn icon="delete" size="14px" flat round dense <q-btn
:color="props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'red-7'" icon="delete"
size="14px"
flat
round
dense
:color="
props.row.status == 'REPORT' || props.row.status == 'DONE'
? 'grey'
: 'red-7'
"
@click="clickDelete(props.row.fullname, props.row.id)" @click="clickDelete(props.row.fullname, props.row.id)"
:disable="props.row.status == 'REPORT' || props.row.status == 'DONE'" > :disable="
props.row.status == 'REPORT' || props.row.status == 'DONE'
"
>
<q-tooltip>ลบขอม</q-tooltip> <q-tooltip>ลบขอม</q-tooltip>
</q-btn> </q-btn>
</q-td> </q-td>

View file

@ -26,7 +26,7 @@ const rows = ref<ResponseData[]>([]);
const rows2 = ref<ResponseData[]>([]); const rows2 = ref<ResponseData[]>([]);
const filters = ref<ResponseData[]>([]); const filters = ref<ResponseData[]>([]);
// //
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"no", "no",
"fullname", "fullname",
@ -135,20 +135,30 @@ const columns = ref<QTableProps["columns"]>([
}, },
]); ]);
const openModal = () => (modal.value = true); const openModal = () => (modal.value = true);
const closeModal = () => { const closeModal = () => {
modal.value = false modal.value = false;
filterKeyword2.value = "" filterKeyword2.value = "";
}; };
// //
const openModalOrder = () => { const openModalOrder = () => {
console.log(filters.value);
openModal(); openModal();
const row = filters.value.filter( const row = filters.value.filter(
(r: ResponseData) => (r: ResponseData) =>
r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE" (r.status == "WAITTING" ||
r.status == "PENDING" ||
r.status == "APPROVE") &&
r.createdAt &&
r.organizationPositionOld &&
r.positionTypeOld &&
r.positionLevel &&
r.posNo &&
r.salary !== null &&
r.organization &&
r.createdAt
); );
rows2.value = row; rows2.value = row;
}; };

View file

@ -170,16 +170,20 @@ const openDetail = (id: string) => {
}; };
const openModal = () => (modal.value = true); const openModal = () => (modal.value = true);
const closeModal = () => { const closeModal = () => {
modal.value = false modal.value = false;
filterKeyword2.value = ""; filterKeyword2.value = "";
}; };
const openModalOrder = () => { const openModalOrder = () => {
openModal(); openModal();
const row = rows.value.filter( const row = rows.value.filter(
(item: officerType) => (item: officerType) =>
item.status == "WAITTING" || (item.status == "WAITTING" ||
item.status == "PENDING" || item.status == "PENDING" ||
item.status == "APPROVE" item.status == "APPROVE") &&
item.organizationPositionOld &&
item.organization &&
item.dateStart &&
item.dateEnd
); );
rows2.value = row; rows2.value = row;
}; };
@ -213,7 +217,7 @@ const getData = async () => {
})); }));
}) })
.catch((e) => {}) .catch((e) => {})
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
}; };
@ -246,21 +250,53 @@ onMounted(async () => {
<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">
<q-btn @click="openModalOrder" size="14px" flat round color="add" icon="mdi-account-arrow-right" > <q-btn
@click="openModalOrder"
size="14px"
flat
round
color="add"
icon="mdi-account-arrow-right"
>
<q-tooltip>งไปออกคำสงชวยราชการ</q-tooltip> <q-tooltip>งไปออกคำสงชวยราชการ</q-tooltip>
</q-btn> </q-btn>
<q-space /> <q-space />
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" <q-input
outlined debounce="300" placeholder="ค้นหา" > class="col-xs-12 col-sm-3 col-md-2"
standout
dense
v-model="filterKeyword"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
>
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon v-if="filterKeyword == ''" name="search" />
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" /> <q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
<q-select v-model="visibleColumns" multiple outlined dense options-dense :display-value="$q.lang.table.columns" <q-select
emit-value map-options :options="columns" option-value="name" options-cover style="min-width: 150px" v-model="visibleColumns"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" /> multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
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 q-pt-sm">
@ -291,42 +327,90 @@ onMounted(async () => {
> >
{{ props.row.fullname }} {{ props.row.fullname }}
</q-td> </q-td>
<q-td key="posNo" :props="props" @click="openDetail(props.row.id)" > <q-td
key="posNo"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.posNo }} {{ props.row.posNo }}
</q-td> </q-td>
<q-td key="position" :props="props" @click="openDetail(props.row.id)" > <q-td
key="position"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.position }} {{ props.row.position }}
</q-td> </q-td>
<q-td key="positionLevel" :props="props" @click="openDetail(props.row.id)" > <q-td
key="positionLevel"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.positionLevel }} {{ props.row.positionLevel }}
</q-td> </q-td>
<q-td key="organizationPositionOld" :props="props" @click="openDetail(props.row.id)" > <q-td
key="organizationPositionOld"
:props="props"
@click="openDetail(props.row.id)"
>
<div class="table_ellipsis"> <div class="table_ellipsis">
{{ props.row.organizationPositionOld }} {{ props.row.organizationPositionOld }}
</div> </div>
</q-td> </q-td>
<q-td key="organization" :props="props" @click="openDetail(props.row.id)" > <q-td
key="organization"
:props="props"
@click="openDetail(props.row.id)"
>
<div class="table_ellipsis"> <div class="table_ellipsis">
{{ props.row.organization }} {{ props.row.organization }}
</div> </div>
</q-td> </q-td>
<q-td key="dateStart" :props="props" @click="openDetail(props.row.id)" > <q-td
key="dateStart"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.dateStart }} {{ props.row.dateStart }}
</q-td> </q-td>
<q-td key="dateEnd" :props="props" @click="openDetail(props.row.id)" > <q-td
key="dateEnd"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.dateEnd }} {{ props.row.dateEnd }}
</q-td> </q-td>
<q-td key="createdAt" :props="props" @click="openDetail(props.row.id)" > <q-td
key="createdAt"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.createdAt }} {{ props.row.createdAt }}
</q-td> </q-td>
<q-td key="statusText" :props="props" @click="openDetail(props.row.id)" > <q-td
key="statusText"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.statusText }} {{ props.row.statusText }}
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn icon="delete" size="14px" flat round dense <q-btn
:color=" props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'red-7' " icon="delete"
size="14px"
flat
round
dense
:color="
props.row.status == 'REPORT' || props.row.status == 'DONE'
? 'grey'
: 'red-7'
"
@click="clickDelete(props.row.fullname, props.row.id)" @click="clickDelete(props.row.fullname, props.row.id)"
:disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' " > :disable="
props.row.status == 'REPORT' || props.row.status == 'DONE'
"
>
<q-tooltip>ลบขอม</q-tooltip> <q-tooltip>ลบขอม</q-tooltip>
</q-btn> </q-btn>
</q-td> </q-td>

View file

@ -393,7 +393,7 @@ function filterFn(val: string, update: any) {
<div class="col-6"> <div class="col-6">
<div class="row"> <div class="row">
<q-select <q-select
class="col-5 q-mr-sm" class="col-5 col-sm-3 col-md-8"
v-model="fillter" v-model="fillter"
label="สถานะ" label="สถานะ"
dense dense

View file

@ -1,84 +1,105 @@
interface listAppointType { interface listAppointType {
personalId:string personalId: string
citizenId:number citizenId: number
fullname:string fullname: string
organizationName:string organizationName: string
orgName:string orgName: string
organizationShortName:string organizationShortName: string
positionNumber:string positionNumber: string
positionPath:string positionPath: string
status:string status: string
createdAt:string createdAt: string
birthday:string birthday: string
educationOld: string
organizationPositionOld: string
positionTypeOld: string
positionLevelOld: string
positionNumberOld: string
salary: number
positionDate: Date
} }
interface resData { interface resData {
id:string id: string
citizenId:number citizenId: number
prefix:string prefix: string
firstname:string firstname: string
lastname:string lastname: string
organizationName:string organizationName: string
organizationShortName:string organizationShortName: string
positionNumber:string positionNumber: string
positionPath:string positionPath: string
status:string status: string
createdAt:Date createdAt: Date
dateOfBirth:Date dateOfBirth: Date
educationOld: string
organizationPositionOld: string
positionTypeOld: string
positionLevelOld: string
positionNumberOld: string
salary: number
positionDate: Date
} }
interface orgFilter{ interface orgFilter {
orgName:string orgName: string
status:string status: string
educationOld: string
organizationPositionOld: string
positionTypeOld: string
positionLevelOld: string
positionNumberOld: string
salary: number
positionDate: Date
} }
interface appointmentData{ interface appointmentData {
citizenId:string citizenId: string
prefixId?:string prefixId?: string
firstname?:string firstname?: string
lastname?:string lastname?: string
} }
interface UserData { interface UserData {
personalId: string; personalId: string;
citizenId: string; citizenId: string;
fullname: string; fullname: string;
organizationName: string ; organizationName: string;
orgName: string ; orgName: string;
organizationShortName: string ; organizationShortName: string;
positionNumber: string ; positionNumber: string;
positionPath: string; positionPath: string;
status: string; status: string;
createdAt: string; createdAt: string;
birthday: string; birthday: string;
} }
interface ResponseData {
data: {
result: {
citizenId: string
profileId: string;
prefix: string;
firstname: string;
lastname: string;
organizationPositionOld: string;
positionLevelOld: string;
positionTypeOld: string;
status: string;
educationOld: string;
positionNumberOld: string;
salary: number;
reason: string;
positionDate: Date;
avatar: string;
interface ResponseData {
data: {
result: {
citizenId:string
profileId: string;
prefix: string;
firstname: string;
lastname: string;
organizationPositionOld: string;
positionLevelOld: string;
positionTypeOld: string;
status: string;
educationOld: string;
positionNumberOld: string;
salary: number;
reason: string;
positionDate: Date;
avatar: string;
};
}; };
} };
}
export type { export type {
listAppointType, listAppointType,
resData, resData,
orgFilter, orgFilter,
appointmentData, appointmentData,
UserData, UserData,
ResponseData ResponseData
} }

View file

@ -20,6 +20,8 @@ interface listMain {
status: string; status: string;
statustext: string; statustext: string;
createdAt: Date; createdAt: Date;
amountOld: number;
positionDate: Date
} }
//ข้อมูลจาก api //ข้อมูลจาก api
interface listMainAPI { interface listMainAPI {
@ -44,6 +46,8 @@ interface listMainAPI {
status: string; status: string;
statustext: string; statustext: string;
createdAt: Date; createdAt: Date;
amountOld: number;
positionDate: Date
} }
interface OtherdataInterface { interface OtherdataInterface {

View file

@ -19,6 +19,13 @@ interface ResponseRow {
statusText: string; statusText: string;
createdAt: Date | null; createdAt: Date | null;
dateText: string | null; dateText: string | null;
educationOld: string
organizationPositionOld: string
positionTypeOld: string
positionLevelOld: string
positionNumberOld: string
amountOld: number
} }
interface ResponseData { interface ResponseData {
@ -55,6 +62,7 @@ interface ResponseData {
recruitDate: Date; recruitDate: Date;
salary: number; salary: number;
status: string; status: string;
amountOld: number
} }
export type { ResponseTitle, ResponseData, ResponseRow }; export type { ResponseTitle, ResponseData, ResponseRow };

View file

@ -19,8 +19,7 @@ interface officerType {
isActive: boolean; isActive: boolean;
dateEnd: string; dateEnd: string;
dateStart: string; dateStart: string;
dateRepatriation: Date
} }
interface ResponseData { interface ResponseData {
data: { data: {

View file

@ -61,6 +61,9 @@ const ReceiveAdd = () =>
//แต่งตั้ง-เลื่อน //แต่งตั้ง-เลื่อน
const AppointmentMain = () => import("@/modules/05_placement/components/AppointMent/Main.vue"); const AppointmentMain = () => import("@/modules/05_placement/components/AppointMent/Main.vue");
const AppointmentDetail = () => import("@/modules/05_placement/components/AppointMent/Detail.vue"); const AppointmentDetail = () => import("@/modules/05_placement/components/AppointMent/Detail.vue");
//แต่งตั้งลูกจ้างประจำ
const AppointEmployeeMain = () => import("@/modules/05_placement/components/AppointEmployee/Main.vue");
const AppointEmployeeDetail = () => import("@/modules/05_placement/components/AppointEmployee/Detail.vue");
//อื่นๆ //อื่นๆ
const OtherMain = () => import("@/modules/05_placement/components/Other/Main.vue") const OtherMain = () => import("@/modules/05_placement/components/Other/Main.vue")
const OthertDetail = () => import("@/modules/05_placement/components/Other/Detail.vue"); const OthertDetail = () => import("@/modules/05_placement/components/Other/Detail.vue");
@ -306,13 +309,33 @@ export default [
Role: "placement", Role: "placement",
}, },
}, },
{
path: "appoint-employee",
name: "appoint-employee",
component: AppointEmployeeMain,
meta: {
Auth: true,
Key: [6.9],
Role: "placement",
},
},
{
path: "appoint-employee/detail/:id",
name: "appoint-employee-detail",
component: AppointEmployeeDetail,
meta: {
Auth: true,
Key: [6.9],
Role: "placement",
},
},
{ {
path: "other", path: "other",
name: "other", name: "other",
component: OtherMain, component: OtherMain,
meta: { meta: {
Auth: true, Auth: true,
Key: [6.9], Key: [6.10],
Role: "placement", Role: "placement",
}, },
}, { }, {
@ -321,7 +344,7 @@ export default [
component: relocation, component: relocation,
meta: { meta: {
Auth: true, Auth: true,
Key: [6.9], Key: [6.10],
Role: "placement", Role: "placement",
}, },
}, },

View file

@ -158,7 +158,7 @@ const openModalOrder = () => {
openModal(); openModal();
const row = filters.value.filter( const row = filters.value.filter(
(r: ResponseItems) => (r: ResponseItems) =>
r.status == "PENDING" || r.status == "APPROVE" || r.status == "REJECT" r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE"
); );
rows2.value = row; rows2.value = row;
}; };

View file

@ -72,19 +72,17 @@ const columns = ref<QTableProps["columns"]>([
// () // ()
const currentYear = new Date().getFullYear(); const currentYear = new Date().getFullYear();
const rows = ref<resMain[]>([]); const rows = ref<resMain[]>([]);
const yearOptions = ref<any[]>([]); const yearOptions = ref<any>([{ id: "", year: "ทั้งหมด" }]);
onMounted(() => { onMounted(async () => {
filteryear(); await fetchRetirement(type.value, currentYear);
// await fetchRetirement(type.value, currentYear);
}); });
// //
const filteryear = () => { const filteryear = () => {
yearOptions.value = [{ id: currentYear, name: currentYear + 543 }]; // yearOptions.value.push({ id: currentYear, name: currentYear + 543 });
yearOptions.value.push({ id: currentYear, name: currentYear + 543 }); // yearOptionsFilter.value = [{ id: currentYear, name: currentYear + 543 }];
// fiscalyear.value = yearOptions[0].id; // yearOptionsFilter.value.push({ id: currentYear, name: currentYear + 543 });
yearOptionsFilter.value = [{ id: currentYear, name: currentYear + 543 }];
yearOptionsFilter.value.push({ id: currentYear, name: currentYear + 543 });
fetchRetirement(type.value, currentYear); fetchRetirement(type.value, currentYear);
}; };
// //
@ -98,7 +96,7 @@ const fetchRetirement = async (type: string, year: any) => {
rows.value = data.map((items: any) => ({ rows.value = data.map((items: any) => ({
id: items.id, id: items.id,
Date: date2Thai(items.createdAt), Date: date2Thai(items.createdAt),
year: items.year, year: items.year + 543,
retireNumber: items.round, retireNumber: items.round,
total: items.total, total: items.total,
round: items.round, round: items.round,
@ -106,6 +104,19 @@ const fetchRetirement = async (type: string, year: any) => {
json: items.json, json: items.json,
document: items.document, document: items.document,
})); }));
let option: any[] = [];
data.map((items: any) => {
option.push({
id: items.year,
year: (items.year + 543).toString(),
typeReport: typeReportChangeName(items.typeReport), //
});
});
yearOptions.value = [{ id: 0, year: "ทั้งหมด" }];
yearOptions.value.push(...option);
yearOptionsFilter.value = yearOptions.value;
actionOption.value = rows.value; actionOption.value = rows.value;
rows.value.sort((a, b) => a.round - b.round); // rows.value.sort((a, b) => a.round - b.round); //
checkststus(rows.value); checkststus(rows.value);
@ -144,10 +155,10 @@ const pagination = ref({
rowsPerPage: 10, rowsPerPage: 10,
}); });
const filterSelector = (val: any, update: Function, year: any) => { const filterSelector = (val: any, update: Function) => {
update(() => { update(() => {
yearOptions.value = yearOptionsFilter.value.filter( yearOptions.value = yearOptionsFilter.value.filter(
(v: any) => v.name.valueOf(val.toLowerCase()) > -1 (v: any) => v.year.indexOf(val) > -1
); );
}); });
}; };
@ -219,18 +230,28 @@ const typeReportChangeName = (val: string) => {
map-options map-options
:options="yearOptions" :options="yearOptions"
option-value="id" option-value="id"
option-label="name" option-label="year"
lazy-rules lazy-rules
use-input
hide-bottom-space hide-bottom-space
:readonly="false" :readonly="false"
:borderless="false" :borderless="false"
:outlined="true" :outlined="true"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn
) "
:hide-dropdown-icon="false" :hide-dropdown-icon="false"
style="min-width: 150px" style="min-width: 150px"
@filter="(inputValue:any, >
doneFn:Function) => filterSelector(inputValue, doneFn,'yearOptions' <template v-slot:no-option>
) " <q-item>
/> <q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
<!-- use-input --> <!-- use-input -->
<div> <div>
<popupAdd <popupAdd

View file

@ -347,17 +347,17 @@ const fecthlistperson = async (id: string) => {
const clickAdd = async () => { const clickAdd = async () => {
dataPerson.id dataPerson.id
? await myForm.value!.validate().then((result: boolean) => { ? await myForm.value!.validate().then((result: boolean) => {
if (result) { if (result) {
dialogConfirm( dialogConfirm(
$q, $q,
async () => { async () => {
await addlistperson(dataPerson.id); await addlistperson(dataPerson.id);
}, },
"ยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ", "ยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ",
"ต้องการยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ นี้หรือไม่?" "ต้องการยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ นี้หรือไม่?"
); );
} }
}) })
: dialogMessageNotify($q, "กรุณาเลือกราชชื่อที่ต้องการเพิ่ม"); : dialogMessageNotify($q, "กรุณาเลือกราชชื่อที่ต้องการเพิ่ม");
}; };
// //
@ -409,11 +409,17 @@ const downloadFile = (response: any, filename: string) => {
}; };
// file // file
const downloadFileexcel = async () => { const downloadFileexcel = async () => {
const findInsigniaId = DataStore.dataInsigniaType.find(
(e: any) => e.name == DataStore.typeinsignia
);
showLoader(); showLoader();
await http await http
.get(config.API.insigniaDowanload(DataStore.requestId), { .put(config.API.insigniaDowanload(DataStore.requestId), {
responseType: "blob", profileType:
}) DataStore.employeeClass == "all" ? null : DataStore.employeeClass,
InsigniaId: DataStore.typeinsignia == "all" ? null : findInsigniaId.id,
}, { responseType: "blob" })
.then(async (res) => { .then(async (res) => {
await downloadFile( await downloadFile(
res, res,
@ -656,33 +662,29 @@ const clickShowWarn = (
const filterSelector = (val: any, update: Function, name: any) => { const filterSelector = (val: any, update: Function, name: any) => {
update(() => { update(() => {
const needle = val.toLowerCase(); const needle = val.toLowerCase();
if (name === 'typeinsigniaOptions') { if (name === "typeinsigniaOptions") {
DataStore.typeinsignia = '' DataStore.typeinsignia = "";
typeinsigniaOptions.value = DataStore.typeinsigniaOptions.filter( typeinsigniaOptions.value = DataStore.typeinsigniaOptions.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1 (v: any) => v.name.toLowerCase().indexOf(needle) > -1
); );
} } else if (name === "employeeClassOps") {
else if(name === 'employeeClassOps'){ DataStore.employeeClass = "";
DataStore.employeeClass = '' employeeClassOps.value = DataStore.employeeClassOps.filter(
employeeClassOps.value = DataStore.employeeClassOps.filter( (v: any) => v.name.toLowerCase().indexOf(needle) > -1
(v: any) => v.name.toLowerCase().indexOf(needle) > -1 );
); } else if (name === "filterOrganizationOP") {
}
else if(name === 'filterOrganizationOP'){
filterOrganizationOP.value = organizationOptions.value.filter( filterOrganizationOP.value = organizationOptions.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1 (v: any) => v.name.toLowerCase().indexOf(needle) > -1
); );
} }
});
} };
)
}
const clearInsigniaFilters = (name: string) => { const clearInsigniaFilters = (name: string) => {
if (name === "typeinsigniaOptions") { if (name === "typeinsigniaOptions") {
DataStore.typeinsignia = "all"; DataStore.typeinsignia = "all";
typeinsigniaOptions.value = DataStore.typeinsigniaOptions; typeinsigniaOptions.value = DataStore.typeinsigniaOptions;
} else if (name === 'employeeClassOps') { } else if (name === "employeeClassOps") {
DataStore.employeeClass = "all"; DataStore.employeeClass = "all";
employeeClassOps.value = DataStore.employeeClassOps; employeeClassOps.value = DataStore.employeeClassOps;
} }
@ -693,221 +695,100 @@ const clearInsigniaFilters = (name: string) => {
<div class="col-12 row q-pa-md"> <div class="col-12 row q-pa-md">
<div class="row col-12"> <div class="row col-12">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<q-select <q-select class="col-4" v-if="roleDataStore.adminRole" v-model="organization" label="หน่วยงาน" dense emit-value
class="col-4" map-options :options="filterOrganizationOP" option-value="id" option-label="name" lazy-rules use-input
v-if="roleDataStore.adminRole" hide-bottom-space :readonly="false" :borderless="false" :outlined="true" :hide-dropdown-icon="false"
v-model="organization" style="min-width: 150px" @update:model-value="changtypeOc" @filter="(inputValue: any,
label="หน่วยงาน" doneFn: Function) => filterSelector(inputValue, doneFn, 'filterOrganizationOP'
dense )" />
emit-value <q-select class="col-1" v-model="DataStore.typeinsignia" label="ประเภทเครื่องราชฯ ที่ยืนขอ" dense emit-value
map-options map-options :options="typeinsigniaOptions" option-value="id" option-label="name" lazy-rules hide-bottom-space
:options="filterOrganizationOP" use-input :readonly="false" :borderless="false" :outlined="true" :hide-dropdown-icon="false"
option-value="id" style="min-width: 180px" @update:model-value="
option-label="name"
lazy-rules
use-input
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 150px"
@update:model-value="changtypeOc"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrganizationOP'
) "
/>
<q-select
class="col-1"
v-model="DataStore.typeinsignia"
label="ประเภทเครื่องราชฯ ที่ยืนขอ"
dense
emit-value
map-options
:options="typeinsigniaOptions"
option-value="id"
option-label="name"
lazy-rules
hide-bottom-space
use-input
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 180px"
@update:model-value="
DataStore.searchDataTable( DataStore.searchDataTable(
DataStore.typeinsignia, DataStore.typeinsignia,
DataStore.employeeClass DataStore.employeeClass
) )
" " @filter="(inputValue: any,
@filter="(inputValue:any, doneFn: Function) => filterSelector(inputValue, doneFn, 'typeinsigniaOptions'
doneFn:Function) => filterSelector(inputValue, doneFn,'typeinsigniaOptions' )">
) "
>
<template v-if="DataStore.typeinsignia !== 'all'" v-slot:append> <template v-if="DataStore.typeinsignia !== 'all'" v-slot:append>
<q-icon <q-icon name="cancel" @click.stop.prevent="
name="cancel" clearInsigniaFilters('typeinsigniaOptions'),
@click.stop.prevent="
clearInsigniaFilters('typeinsigniaOptions'),
DataStore.searchDataTable(
DataStore.typeinsignia,
DataStore.employeeClass
)
"
class="cursor-pointer"
/>
</template>
</q-select>
<div>
<q-select
class="col-2"
v-model="DataStore.employeeClass"
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'สถานภาพ'}`"
emit-value
use-input
map-options
option-label="name"
:options="employeeClassOps"
option-value="id"
:readonly="false"
:borderless="false"
style="min-width: 150px"
@update:model-value="
DataStore.searchDataTable( DataStore.searchDataTable(
DataStore.typeinsignia, DataStore.typeinsignia,
DataStore.employeeClass DataStore.employeeClass
) )
" " class="cursor-pointer" />
@filter="(inputValue:any, </template>
doneFn:Function) => filterSelector(inputValue, doneFn,'employeeClassOps' </q-select>
) " <div>
> <q-select class="col-2" v-model="DataStore.employeeClass" dense outlined lazy-rules hide-bottom-space
:label="`${'สถานภาพ'}`" emit-value use-input map-options option-label="name" :options="employeeClassOps"
option-value="id" :readonly="false" :borderless="false" style="min-width: 150px" @update:model-value="
DataStore.searchDataTable(
DataStore.typeinsignia,
DataStore.employeeClass
)
" @filter="(inputValue: any,
doneFn: Function) => filterSelector(inputValue, doneFn, 'employeeClassOps'
)">
<template v-if="DataStore.employeeClass !== 'all'" v-slot:append> <template v-if="DataStore.employeeClass !== 'all'" v-slot:append>
<q-icon <q-icon name="cancel" @click.stop.prevent="
name="cancel" clearInsigniaFilters('employeeClassOps'),
@click.stop.prevent=" DataStore.searchDataTable(
clearInsigniaFilters('employeeClassOps'), DataStore.typeinsignia,
DataStore.searchDataTable( DataStore.employeeClass
DataStore.typeinsignia, )
DataStore.employeeClass " class="cursor-pointer" />
)
"
class="cursor-pointer"
/>
</template> </template>
</q-select> </q-select>
</div> </div>
<div> <div>
<q-btn <q-btn size="md" icon="mdi-download" flat round color="primary" @click="downloadFileexcel">
size="md"
icon="mdi-download"
flat
round
color="primary"
@click="downloadFileexcel"
>
<q-tooltip>ดาวนโหลด</q-tooltip> <q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn size="12px" flat round color="add" icon="mdi-plus" @click="clickmodalAdd" v-if="(DataStore.isLock == false &&
size="12px" DataStore.requestStatus == 'st5' &&
flat roleDataStore.adminRole) ||
round checkStatus == true
color="add" ">
icon="mdi-plus"
@click="clickmodalAdd"
v-if="
(DataStore.isLock == false &&
DataStore.requestStatus == 'st5' &&
roleDataStore.adminRole) ||
checkStatus == true
"
>
<q-tooltip>เพ</q-tooltip> <q-tooltip>เพ</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<q-space /> <q-space />
<q-input <q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" outlined
class="col-xs-12 col-sm-3 col-md-2" debounce="300" placeholder="ค้นหา">
standout
dense
v-model="filterKeyword"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
>
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon v-if="filterKeyword == ''" name="search" />
<q-icon <q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
<q-select <q-select v-model="visibleColumns" multiple outlined dense options-dense :display-value="$q.lang.table.columns"
v-model="visibleColumns" emit-value map-options :options="columns" option-value="name" options-cover style="min-width: 150px"
multiple class="col-xs-12 col-sm-3 col-md-2" />
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
class="col-xs-12 col-sm-3 col-md-2"
/>
</div> </div>
<div class="col-12 q-pt-sm"> <div class="col-12 q-pt-sm">
<q-table <q-table ref="table" :columns="columns" :rows="DataStore.rows" :filter="filterKeyword" row-key="name" flat
ref="table" bordered :paging="true" dense class="custom-header-table" :visible-columns="visibleColumns"
:columns="columns" :pagination-label="paginationLabel" v-model:pagination="pagination">
:rows="DataStore.rows"
:filter="filterKeyword"
row-key="name"
flat
bordered
:paging="true"
dense
class="custom-header-table"
:visible-columns="visibleColumns"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
>
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
<q-th></q-th> <q-th></q-th>
<q-th <q-th auto-width v-if="(DataStore.isLock == false &&
auto-width DataStore.requestStatus == 'st5') ||
v-if=" checkStatus == true
(DataStore.isLock == false && " />
DataStore.requestStatus == 'st5') ||
checkStatus == true
"
/>
<q-th v-else></q-th> <q-th v-else></q-th>
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr <q-tr :props="props" class="cursor-pointer" @click.stop="nextPage(props.row.profileId)">
:props="props"
class="cursor-pointer"
@click.stop="nextPage(props.row.profileId)"
>
<q-td key="no" :props="props"> <q-td key="no" :props="props">
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</q-td> </q-td>
@ -942,112 +823,50 @@ const clearInsigniaFilters = (name: string) => {
{{ props.row.dateSend }} {{ props.row.dateSend }}
</q-td> </q-td>
<q-td key="note" class="text-center"> <q-td key="note" class="text-center">
<q-btn <q-btn v-if="props.row.reason" icon="mdi-information-outline" size="12px" color="blue" flat round dense
v-if="props.row.reason" @click.stop="clickShowreson(props.row.name, props.row.reason)">
icon="mdi-information-outline"
size="12px"
color="blue"
flat
round
dense
@click.stop="clickShowreson(props.row.name, props.row.reason)"
>
<q-tooltip>หมายเหต</q-tooltip> <q-tooltip>หมายเหต</q-tooltip>
</q-btn> </q-btn>
</q-td> </q-td>
<q-td key="warn" class="text-center" v-if="props.row.statusMark"> <q-td key="warn" class="text-center" v-if="props.row.statusMark">
<q-btn <q-btn icon="mdi-information-outline" size="12px" color="red" flat round dense @click.stop="
icon="mdi-information-outline" clickShowWarn(
size="12px" props.row.markDiscipline,
color="red" props.row.markLeave,
flat props.row.markRate
round )
dense ">
@click.stop=" <q-tooltip>แจงเตอน</q-tooltip></q-btn>
clickShowWarn(
props.row.markDiscipline,
props.row.markLeave,
props.row.markRate
)
"
>
<q-tooltip>แจงเตอน</q-tooltip></q-btn
>
</q-td> </q-td>
<q-td v-else auto-width></q-td> <q-td v-else auto-width></q-td>
<q-td <q-td v-close-popup auto-width v-if="(DataStore.isLock == false &&
v-close-popup DataStore.requestStatus == 'st5' &&
auto-width roleDataStore.adminRole) ||
v-if=" checkStatus == true
(DataStore.isLock == false && ">
DataStore.requestStatus == 'st5' && <q-btn v-if="roleDataStore.adminRole ||
roleDataStore.adminRole) || (roleDataStore.insignia1Role &&
checkStatus == true (requestStatus == 'st1' || requestStatus == 'st4'))
" " icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense @click.stop>
>
<q-btn
v-if="
roleDataStore.adminRole ||
(roleDataStore.insignia1Role &&
(requestStatus == 'st1' || requestStatus == 'st4'))
"
icon="mdi-dots-vertical"
size="12px"
color="grey-7"
flat
round
dense
@click.stop
>
<q-menu transition-show="jump-down" transition-hide="jump-up"> <q-menu transition-show="jump-down" transition-hide="jump-up">
<q-list dense style="min-width: 250px"> <q-list dense style="min-width: 250px">
<q-item <q-item clickable @click.stop="clickmodalEdit(props.row)" v-close-popup>
clickable <q-item-section style="min-width: 0px" avatar class="q-py-sm">
@click.stop="clickmodalEdit(props.row)"
v-close-popup
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>แกไขเครองราชฯ นขอ</q-tooltip> <q-tooltip>แกไขเครองราชฯ นขอ</q-tooltip>
<q-icon color="primary" size="xs" name="mdi-pencil" /> <q-icon color="primary" size="xs" name="mdi-pencil" />
</q-item-section> </q-item-section>
<q-item-section <q-item-section>แกไขเครองราชฯ นขอ</q-item-section>
>แกไขเครองราชฯ นขอ</q-item-section
>
</q-item> </q-item>
<q-item <q-item clickable @click.stop="clickReject(props.row.id)" v-close-popup>
clickable <q-item-section style="min-width: 0px" avatar class="q-py-sm">
@click.stop="clickReject(props.row.id)"
v-close-popup
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>ไมนขอ</q-tooltip> <q-tooltip>ไมนขอ</q-tooltip>
<q-icon <q-icon color="blue" size="xs" name="mdi-alert-circle-outline" />
color="blue"
size="xs"
name="mdi-alert-circle-outline"
/>
</q-item-section> </q-item-section>
<q-item-section>ไมนขอ</q-item-section> <q-item-section>ไมนขอ</q-item-section>
</q-item> </q-item>
<q-item <q-item clickable @click.stop="clickDelete(props.row.id)" v-close-popup>
clickable <q-item-section style="min-width: 0px" avatar class="q-py-sm">
@click.stop="clickDelete(props.row.id)"
v-close-popup
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-tooltip>ลบออก</q-tooltip> <q-tooltip>ลบออก</q-tooltip>
<q-icon color="red" size="xs" name="mdi-delete" /> <q-icon color="red" size="xs" name="mdi-delete" />
</q-item-section> </q-item-section>
@ -1058,30 +877,16 @@ const clearInsigniaFilters = (name: string) => {
</q-btn> </q-btn>
</q-td> </q-td>
<q-td v-else auto-width></q-td> <q-td v-else auto-width></q-td>
<q-td <q-td auto-width v-if="props.row.insigniaSend == 'เหรียญจักรพรรดิมาลา'">
auto-width <btnDownloadFile :profileId="props.row.profileId" :round="DataStore.roundId"
v-if="props.row.insigniaSend == 'เหรียญจักรพรรดิมาลา'" :optionRound="DataStore.optionRound" />
>
<btnDownloadFile
:profileId="props.row.profileId"
:round="DataStore.roundId"
:optionRound="DataStore.optionRound"
/>
</q-td> </q-td>
<q-td v-else auto-width></q-td> <q-td v-else auto-width></q-td>
</q-tr> </q-tr>
</template> </template>
<template v-slot:pagination="scope"> <template v-slot:pagination="scope">
<q-pagination <q-pagination v-model="pagination.page" active-color="primary" color="primary" :max="scope.pagesNumber"
v-model="pagination.page" :max-pages="5" size="sm" boundary-links direction-links></q-pagination>
active-color="primary"
color="primary"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template> </template>
</q-table> </q-table>
</div> </div>
@ -1093,14 +898,8 @@ const clearInsigniaFilters = (name: string) => {
<q-toolbar class="q-py-md"> <q-toolbar class="q-py-md">
<q-toolbar-title class="text-h6">เพมรายช </q-toolbar-title> <q-toolbar-title class="text-h6">เพมรายช </q-toolbar-title>
<q-btn <q-btn icon="close" unelevated round dense @click="modalAdd = false"
icon="close" style="color: #ff8080; background-color: #ffdede" />
unelevated
round
dense
@click="modalAdd = false"
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar> </q-toolbar>
<q-separator /> <q-separator />
<q-card-section class="q-pa-sm bg-grey-1"> <q-card-section class="q-pa-sm bg-grey-1">
@ -1109,49 +908,24 @@ const clearInsigniaFilters = (name: string) => {
<q-card flat bordered class="fit q-pa-sm"> <q-card flat bordered class="fit q-pa-sm">
<q-toolbar style="padding: 0"> <q-toolbar style="padding: 0">
<q-space /> <q-space />
<q-input <q-input borderless outlined dense debounce="300" placeholder="ค้นหา" v-model="filterKeyword2">
borderless
outlined
dense
debounce="300"
placeholder="ค้นหา"
v-model="filterKeyword2"
>
<template v-slot:append> <template v-slot:append>
<q-icon name="search" /> <q-icon name="search" />
</template> </template>
</q-input> </q-input>
</q-toolbar> </q-toolbar>
<q-table <q-table flat bordered dense :rows="rows2" :columns="columns2" :filter="filterKeyword2" row-key="fullname"
flat class="custom-header-table" :pagination-label="paginationLabel2" v-model:pagination="pagination2">
bordered
dense
:rows="rows2"
:columns="columns2"
:filter="filterKeyword2"
row-key="fullname"
class="custom-header-table"
:pagination-label="paginationLabel2"
v-model:pagination="pagination2"
>
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th <q-th v-for="col in props.cols" :key="col.name" :props="props">
v-for="col in props.cols"
:key="col.name"
:props="props"
>
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr <q-tr :props="props" class="cursor-pointer" :class="{ 'text-primary': props.row.id === dataPerson.id }"
:props="props" @click="selectPerson(props.row)">
class="cursor-pointer"
:class="{ 'text-primary': props.row.id === dataPerson.id }"
@click="selectPerson(props.row)"
>
<q-td style="width: 75px">{{ props.rowIndex + 1 }}</q-td> <q-td style="width: 75px">{{ props.rowIndex + 1 }}</q-td>
<q-td style="width: 250px" key="citizenId" :props="props"> <q-td style="width: 250px" key="citizenId" :props="props">
{{ props.row.citizenId }} {{ props.row.citizenId }}
@ -1162,15 +936,8 @@ const clearInsigniaFilters = (name: string) => {
</q-tr> </q-tr>
</template> </template>
<template v-slot:pagination="scope"> <template v-slot:pagination="scope">
<q-pagination <q-pagination v-model="pagination2.page" color="primary" :max="scope.pagesNumber" :max-pages="5"
v-model="pagination2.page" size="sm" boundary-links direction-links></q-pagination>
color="primary"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template> </template>
</q-table> </q-table>
</q-card> </q-card>
@ -1181,71 +948,28 @@ const clearInsigniaFilters = (name: string) => {
<div class="q-pa-md"> <div class="q-pa-md">
<div class="row q-gutter-sm"> <div class="row q-gutter-sm">
<div class="col-12"> <div class="col-12">
<q-input <q-input borderless outlined dense label="ตำแหน่งในสายงาน" placeholder="ตำแหน่งในสายงาน"
borderless v-model="dataPerson.position" readonly />
outlined
dense
label="ตำแหน่งในสายงาน"
placeholder="ตำแหน่งในสายงาน"
v-model="dataPerson.position"
readonly
/>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-input <q-input borderless outlined dense label="สังกัด" placeholder="สังกัด"
borderless v-model="dataPerson.organizationOrganization" readonly />
outlined
dense
label="สังกัด"
placeholder="สังกัด"
v-model="dataPerson.organizationOrganization"
readonly
/>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-input <q-input borderless outlined dense label="ระดับ" placeholder="ระดับ " v-model="dataPerson.level"
borderless readonly />
outlined
dense
label="ระดับ"
placeholder="ระดับ "
v-model="dataPerson.level"
readonly
/>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-select <q-select v-model="insigniaType" label="ประเภทเครื่องราชฯ" dense emit-value map-options
v-model="insigniaType" :options="insigniaOptions" option-value="id" option-label="name" lazy-rules hide-bottom-space
label="ประเภทเครื่องราชฯ" :readonly="false" :borderless="false" :outlined="true" :hide-dropdown-icon="false" :rules="[
dense
emit-value
map-options
:options="insigniaOptions"
option-value="id"
option-label="name"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
:rules="[
(val) => !!val || `กรุณาเลือกประเภทเครื่องราช`, (val) => !!val || `กรุณาเลือกประเภทเครื่องราช`,
]" ]" />
/>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-input <q-input type="textarea" class="full-width inputgreen cursor-pointer" hide-bottom-space outlined
type="textarea" dense lazy-rules :rules="[(val) => !!val || `กรุณากรอกหมายเหตุ`]" v-model="reason"
class="full-width inputgreen cursor-pointer" :label="`หมายเหตุ`" />
hide-bottom-space
outlined
dense
lazy-rules
:rules="[(val) => !!val || `กรุณากรอกหมายเหตุ`]"
v-model="reason"
:label="`หมายเหตุ`"
/>
</div> </div>
</div> </div>
</div> </div>
@ -1267,42 +991,18 @@ const clearInsigniaFilters = (name: string) => {
<q-dialog v-model="modalEdit" persistent> <q-dialog v-model="modalEdit" persistent>
<q-card style="width: 450px; max-width: 80vw"> <q-card style="width: 450px; max-width: 80vw">
<q-form ref="myForm"> <q-form ref="myForm">
<DialogHeader <DialogHeader tittle="แก้ไขเครื่องราชฯ ที่ยื่นขอ" :close="closeModalEdit" />
tittle="แก้ไขเครื่องราชฯ ที่ยื่นขอ"
:close="closeModalEdit"
/>
<q-separator /> <q-separator />
<q-card-section class="q-pa-sm bg-grey-1"> <q-card-section class="q-pa-sm bg-grey-1">
<div class="row col-12 q-py-md"> <div class="row col-12 q-py-md">
<q-select <q-select v-model="insignia" label="ชื่อเครื่องราชฯ" dense emit-value map-options :options="insigniaOptions"
v-model="insignia" option-value="id" option-label="name" lazy-rules hide-bottom-space :readonly="false" :borderless="false"
label="ชื่อเครื่องราชฯ" :outlined="true" :hide-dropdown-icon="false" style="width: 100%" />
dense
emit-value
map-options
:options="insigniaOptions"
option-value="id"
option-label="name"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
style="width: 100%"
/>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right"> <q-card-actions align="right">
<q-btn <q-btn dense unelevated label="บันทึก" color="public" @click="clickSave" class="q-px-md">
dense
unelevated
label="บันทึก"
color="public"
@click="clickSave"
class="q-px-md"
>
<!-- icon="mdi-content-save-outline" --> <!-- icon="mdi-content-save-outline" -->
<q-tooltip>นท</q-tooltip> <q-tooltip>นท</q-tooltip>
</q-btn> </q-btn>
@ -1312,59 +1012,27 @@ const clearInsigniaFilters = (name: string) => {
</q-dialog> </q-dialog>
<!-- popup เหตผลไมนขอ --> <!-- popup เหตผลไมนขอ -->
<DialogPopupReason <DialogPopupReason :modal="modelPopupReject" title="เหตุผลการไม่ยื่นขอ" label="หมายเหตุ"
:modal="modelPopupReject" :click-close="closemodelPopupReject" :savaForm="savaReasonReject" />
title="เหตุผลการไม่ยื่นขอ"
label="หมายเหตุ"
:click-close="closemodelPopupReject"
:savaForm="savaReasonReject"
/>
<!-- เหตผลทลบออก --> <!-- เหตผลทลบออก -->
<DialogPopupReason <DialogPopupReason :modal="modelPopupDelete" title="เหตุผลการลบออก" label="หมายเหตุ"
:modal="modelPopupDelete" :click-close="closemodelPopupDelete" :savaForm="savaReasonDelete" />
title="เหตุผลการลบออก"
label="หมายเหตุ"
:click-close="closemodelPopupDelete"
:savaForm="savaReasonDelete"
/>
<!-- หมายเหต --> <!-- หมายเหต -->
<DialogInformation <DialogInformation :modal="dialogNote" :title="dialogTitle" :desc="dialogDesc" :click-close="clickCloseReson" />
:modal="dialogNote"
:title="dialogTitle"
:desc="dialogDesc"
:click-close="clickCloseReson"
/>
<!-- แจงเตอน --> <!-- แจงเตอน -->
<q-dialog v-model="dialogWarn"> <q-dialog v-model="dialogWarn">
<q-card style="width: 800px; max-width: 80vw"> <q-card style="width: 800px; max-width: 80vw">
<q-toolbar class="q-py-md"> <q-toolbar class="q-py-md">
<q-toolbar-title class="text-h6">แจงเตอน </q-toolbar-title> <q-toolbar-title class="text-h6">แจงเตอน </q-toolbar-title>
<q-btn <q-btn icon="close" unelevated round dense v-close-popup style="color: #ff8080; background-color: #ffdede" />
icon="close"
unelevated
round
dense
v-close-popup
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar> </q-toolbar>
<q-separator /> <q-separator />
<div class="q-pa-md"> <div class="q-pa-md">
<div class="q-gutter-sm"> <div class="q-gutter-sm">
<q-item <q-item tag="label" v-ripple v-for="list in checkboxData" :key="list.id">
tag="label"
v-ripple
v-for="list in checkboxData"
:key="list.id"
>
<q-item-section avatar> <q-item-section avatar>
<q-checkbox <q-checkbox v-model="list.val" :val="`${list.id}`" color="teal" disable />
v-model="list.val"
:val="`${list.id}`"
color="teal"
disable
/>
<!-- <q-radio v-model="checkboxList" :val="list.id" color="teal" /> --> <!-- <q-radio v-model="checkboxList" :val="list.id" color="teal" /> -->
</q-item-section> </q-item-section>
<q-item-section> <q-item-section>

View file

@ -40,6 +40,7 @@ const modalPopupBackToEdit = ref<boolean>(false); //model แก้ไข
onMounted(async () => { onMounted(async () => {
tab.value = DataStore.mainTab; tab.value = DataStore.mainTab;
await fecthlistRound(); await fecthlistRound();
DataStore.dataInsigniaType.length === 0 && (await fecthInsignia());
}); });
// //
@ -123,6 +124,18 @@ const fecthType = async () => {
messageError($q, err); messageError($q, err);
}); });
}; };
//
const fecthInsignia = async () => {
await http
.get(config.API.insignia)
.then((res) => {
let data = res.data.result;
DataStore.fetchInsigniaType(data);
})
.catch((err) => {
messageError($q, err);
});
};
// //
const changround = async () => { const changround = async () => {
@ -436,7 +449,7 @@ const uploadFile = async (event: any) => {
<q-card flat bordered class="col-12 q-mt-sm" v-if="loading"> <q-card flat bordered class="col-12 q-mt-sm" v-if="loading">
<div <div
v-if="roleDataStore.insignia1Role && requestStatus == 'st4'" v-if="(roleDataStore.insignia1Role && requestStatus == 'st4') || (roleDataStore.insignia2Role && requestStatus == 'st5')"
class="q-pa-md q-gutter-sm" class="q-pa-md q-gutter-sm"
> >
<q-banner <q-banner
@ -568,7 +581,7 @@ const uploadFile = async (event: any) => {
@click="sendToDirector" @click="sendToDirector"
/> />
<q-btn <q-btn
v-if="roleDataStore.insignia2Role && requestStatus == 'st3'" v-if="roleDataStore.insignia2Role && (requestStatus == 'st3' || requestStatus == 'st5')"
dense dense
unelevated unelevated
label="ตีกลับ" label="ตีกลับ"

View file

@ -40,7 +40,7 @@ const affiliationReceived = ref<string>("");
const receivedate = ref<Date | null>(); const receivedate = ref<Date | null>();
const announceDate = ref<Date | null>(); const announceDate = ref<Date | null>();
const invoiceDate = ref<Date | null>(null); const invoiceDate = ref<Date | null>(null);
const filterinsigniaOp2 = ref<any>(DataStore.insigniaOp2)
const employeeClass = ref<string>(""); const employeeClass = ref<string>("");
const employeeClassOps = ref<DataOption[]>([ const employeeClassOps = ref<DataOption[]>([
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" }, { id: "officer", name: "ข้าราชการ กทม.สามัญ" },
@ -276,6 +276,19 @@ const searchcardid = () => {
} else notifyError($q, "ไม่พบข้อมูลเลขบัตรประชาชนนี้"); } else notifyError($q, "ไม่พบข้อมูลเลขบัตรประชาชนนี้");
} }
}; };
const filterSelector = (val: any, update: Function, name: any) => {
update(() => {
const needle = val.toLowerCase();
if (name === 'insigniaOp2') {
brand.value = ''
filterinsigniaOp2.value = DataStore.insigniaOp2.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
}
)
}
</script> </script>
<template> <template>
@ -398,14 +411,17 @@ const searchcardid = () => {
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="DataStore.insigniaOp2" :options="filterinsigniaOp2"
option-value="id" option-value="id"
:readonly="false" :readonly="false"
use-input
:borderless="false" :borderless="false"
style="min-width: 150px" style="min-width: 150px"
:rules="[ :rules="[
(val) => !!val || 'กรุณากรอกชื่อชั้นตราเครื่องราชอิสริยาภรณ์', (val) => !!val || 'กรุณากรอกชื่อชั้นตราเครื่องราชอิสริยาภรณ์',
]" ]"
@filter="(inputValue:any,doneFn:Function) =>
filterSelector(inputValue, doneFn,'insigniaOp2') "
/> />
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">

View file

@ -124,18 +124,21 @@ onMounted(()=>{
<q-dialog v-model="props.modal" persistent> <q-dialog v-model="props.modal" persistent>
<q-card style="min-width: 900px"> <q-card style="min-width: 900px">
<q-toolbar> <q-toolbar>
<q-toolbar-title v-if="props.fileCheck === null" class="text-subtitle2 text-bold">รับเครื่องราชฯ</q-toolbar-title> <q-toolbar-title class="text-subtitle2 text-bold">-นเครองราชฯ</q-toolbar-title>
<q-toolbar-title v-else class="text-subtitle2 text-bold">นเครองราชฯ</q-toolbar-title>
<q-btn icon="close" unelevated round dense @click="close" style="color: #ff8080; background-color: #ffdede" /> <q-btn icon="close" unelevated round dense @click="close" style="color: #ff8080; background-color: #ffdede" />
</q-toolbar> </q-toolbar>
<q-separator /> <q-separator />
<q-form ref="myForm"> <q-form ref="myForm">
<div class="q-pa-md bg-grey-1"> <div class="q-pa-md bg-grey-1">
<div v-if="props.fileCheck === null" class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"> <div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-12 text-weight-bold text-grey-7">
บเครองราชฯ
</div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<datepicker menu-class-name="modalfix" v-model="Datereceive" :locale="'th'" autoApply borderless <datepicker menu-class-name="modalfix" v-model="Datereceive" :locale="'th'" autoApply borderless
:enableTimePicker="false" week-start="0"> :enableTimePicker="false" week-start="0" :readonly="fileCheck !== null">
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
@ -145,7 +148,7 @@ onMounted(()=>{
<template #trigger> <template #trigger>
<q-input dense borderless outlined lazy-rules :rules="[(val) => !!val || 'กรุณาเลือกวันที่ได้รับ']" <q-input dense borderless outlined lazy-rules :rules="[(val) => !!val || 'กรุณาเลือกวันที่ได้รับ']"
hide-bottom-space :model-value="Datereceive != null ? date2Thai(Datereceive) : undefined hide-bottom-space :model-value="Datereceive != null ? date2Thai(Datereceive) : undefined
" :label="`${'วันที่ได้รับ'}`" clearable @clear="clearReceiveDate"> " :label="`${'วันที่ได้รับ'}`" clearable @clear="clearReceiveDate" :disable="fileCheck !== null">
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" color="primary"> <q-icon name="event" class="cursor-pointer" color="primary">
</q-icon> </q-icon>
@ -158,7 +161,7 @@ onMounted(()=>{
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-file outlined dense v-model="files" label="ไฟล์หลักฐานการรับ" lazy-rules <q-file outlined dense v-model="files" label="ไฟล์หลักฐานการรับ" lazy-rules
:rules="[(val) => val || 'กรุณาเลือกไฟล์หลักฐานการรับ']" hide-bottom-space> :rules="[(val) => val || 'กรุณาเลือกไฟล์หลักฐานการรับ']" hide-bottom-space :disable="fileCheck !== null">
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="attach_file" color="primary" />
</template> </template>
@ -167,10 +170,15 @@ onMounted(()=>{
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id" <q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id"
emit-value map-options outlined v-model="OrganazationId" lazy-rules :label="`หน่วยงานที่รับ`" emit-value map-options outlined v-model="OrganazationId" lazy-rules :label="`หน่วยงานที่รับ`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่รับ']" /> :rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่รับ']" :disable="fileCheck !== null"/>
</div> </div>
</div> </div>
<div v-if="props.fileCheck !== null" class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"> <div class="col-12 q-my-sm"> <q-separator/></div>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-12 text-weight-bold text-grey-7">
นเครองราชฯ
</div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<datepicker menu-class-name="modalfix" v-model="Datereturn" :locale="'th'" autoApply borderless <datepicker menu-class-name="modalfix" v-model="Datereturn" :locale="'th'" autoApply borderless

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from "vue"; import { ref, watch,onMounted } from "vue";
import { QForm, useQuasar } from "quasar"; import { QForm, useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
@ -14,6 +14,7 @@ const routeName = router.currentRoute.value.name;
const amount = ref<number | null>(); const amount = ref<number | null>();
const Org = ref<string | null>(""); const Org = ref<string | null>("");
const grandCross = ref<string | null>(""); const grandCross = ref<string | null>("");
const filterInsigniaOp = ref<any>()
const closeModal = () => { const closeModal = () => {
props.close(); props.close();
}; };
@ -41,7 +42,22 @@ watch(props, () => {
amount.value = null; amount.value = null;
} }
}); });
watch(() => props.insigniaList, (newVal) => {
filterInsigniaOp.value = newVal;
});
const filterSelector = (val: any, update: Function, name: any) => {
update(() => {
const needle = val.toLowerCase();
if (name === 'filterInsigniaOp') {
grandCross.value = null
filterInsigniaOp.value = props.insigniaList.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
}
)
}
const clickSave = () => { const clickSave = () => {
if (myForm.value !== null) { if (myForm.value !== null) {
myForm.value.validate().then(async (success) => { myForm.value.validate().then(async (success) => {
@ -67,12 +83,14 @@ const clickSave = () => {
<div class="col-6"> <div class="col-6">
<q-select <q-select
hide-bottom-space hide-bottom-space
:options="insigniaList" :options="filterInsigniaOp"
dense dense
borderless borderless
use-input
lazy-rules
option-label="name" option-label="name"
option-value="id" option-value="id"
emit-value emit-valuez
map-options map-options
outlined outlined
options-cover options-cover
@ -83,6 +101,8 @@ const clickSave = () => {
? `เครื่องราชฯ` ? `เครื่องราชฯ`
: `เลือกหน่วยงาน` : `เลือกหน่วยงาน`
" "
@filter="(inputValue:any,doneFn:Function) =>
filterSelector(inputValue, doneFn,'filterInsigniaOp') "
/> />
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">

View file

@ -176,7 +176,7 @@ watch(tab, () => {
if (!a) { if (!a) {
DataStore.insignia = ""; DataStore.insignia = "";
} }
filterInsigniaOp.value = insigniaOp.value filterInsigniaOp.value = insigniaOp.value
fecthlistInsignia(); fecthlistInsignia();
}); });

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from "vue"; import { ref, watch,onMounted } from "vue";
import { QForm, useQuasar } from "quasar"; import { QForm, useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -30,8 +30,10 @@ const returndate = ref<Date | null>();
const reason = ref<string>(""); const reason = ref<string>("");
const listPerson = ref<any>([]); const listPerson = ref<any>([]);
const OrgList = ref<DataOption[]>([]); const OrgList = ref<DataOption[]>([]);
const filterOrgList = ref<any>([]);
const insigniaNoteProfileId = ref<string>(""); const insigniaNoteProfileId = ref<string>("");
const filterSelectRound = ref<any>()
const selectRound = ref<any>()
// //
const clearData = () => { const clearData = () => {
receivedate.value = null; receivedate.value = null;
@ -68,7 +70,10 @@ const props = defineProps({
type: String, type: String,
}, },
selectRoundOption: { selectRoundOption: {
type: Array, type: Array,
},
filterSelectRoundOption: {
type: Array,
}, },
profileId: { profileId: {
type: String, type: String,
@ -92,7 +97,8 @@ watch(props, () => {
// //
const fecthlistInsignia = async () => { const fecthlistInsignia = async () => {
showLoader(); if(roundNo.value !== ''&& roundNo.value !== null){
showLoader();
let data = { let data = {
insigniaTypeId: props.typeId, insigniaTypeId: props.typeId,
insigniaNoteId: roundNo.value, insigniaNoteId: roundNo.value,
@ -115,6 +121,8 @@ const fecthlistInsignia = async () => {
hideLoader(); hideLoader();
}); });
}; };
}
// //
const fetchOrgList = async () => { const fetchOrgList = async () => {
@ -136,6 +144,7 @@ const fetchOrgList = async () => {
// ]; // ];
// } else { // } else {
OrgList.value = orgArr; OrgList.value = orgArr;
filterOrgList.value = OrgList.value
// } // }
}) })
.catch((err) => { .catch((err) => {
@ -240,6 +249,31 @@ const clearReceiveDate = () => {
const clearReturnDate = () => { const clearReturnDate = () => {
returndate.value = null; returndate.value = null;
}; };
const filterSelector = (val: any, update: Function, name: any) => {
update(() => {
const needle = val.toLowerCase();
if (name === 'filterOrgList') {
OrganazationId.value = ''
filterOrgList.value = OrgList.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
if (name === 'filterSelectRoundOption') {
roundNo.value = ''
filterSelectRound.value = selectRound.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
}
)
}
const setValue = () => {
filterSelectRound.value = props.filterSelectRoundOption
selectRound.value = props.selectRoundOption
}
onMounted(() => {
setValue();
});
</script> </script>
<template> <template>
@ -267,14 +301,18 @@ const clearReturnDate = () => {
:label="`${'รอบการขอเครื่องราชฯ'}`" :label="`${'รอบการขอเครื่องราชฯ'}`"
emit-value emit-value
map-options map-options
use-input
option-label="name" option-label="name"
:options="selectRoundOption" :options="filterSelectRound"
option-value="id" option-value="id"
:readonly="false" :readonly="false"
:borderless="false" :borderless="false"
style="min-width: 150px" style="min-width: 150px"
:rules="[(val) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ']" :rules="[(val) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ']"
@update:model-value="fecthlistInsignia()" @update:model-value="fecthlistInsignia()"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'filterSelectRoundOption'
) "
/> />
</div> </div>
<div class="col-12 q-mt-md text-weight-bold text-grey-7"> <div class="col-12 q-mt-md text-weight-bold text-grey-7">
@ -382,18 +420,22 @@ const clearReturnDate = () => {
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-select <q-select
hide-bottom-space hide-bottom-space
:options="OrgList" :options="filterOrgList"
dense dense
borderless borderless
option-label="name" option-label="name"
option-value="id" option-value="id"
emit-value emit-value
use-input
map-options map-options
outlined outlined
v-model="OrganazationId" v-model="OrganazationId"
lazy-rules lazy-rules
:label="`เลือกหน่วยงาน`" :label="`เลือกหน่วยงาน`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงาน']" :rules="[(val) => !!val || 'กรุณาเลือกหน่วยงาน']"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList'
) "
/> />
</div> </div>
</div> </div>
@ -452,7 +494,7 @@ const clearReturnDate = () => {
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-select <q-select
hide-bottom-space hide-bottom-space
:options="OrgList" :options="filterOrgList"
dense dense
lazy-rules lazy-rules
borderless borderless
@ -461,9 +503,13 @@ const clearReturnDate = () => {
emit-value emit-value
map-options map-options
outlined outlined
use-input
v-model="OrganazationId" v-model="OrganazationId"
:label="`เลือกหน่วยงานที่ส่งคืน`" :label="`เลือกหน่วยงานที่ส่งคืน`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']" :rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList'
) "
/> />
</div> </div>

View file

@ -19,15 +19,18 @@ const tab = ref<string>("");
const selectRound = ref<string>(); const selectRound = ref<string>();
const selectRoundOption = ref<OptionDataYear[]>([]); const selectRoundOption = ref<OptionDataYear[]>([]);
const filterSelectRoundOption = ref<any>([]);
const selectRoundAllOption = ref<OptionDataYear[]>([]); const selectRoundAllOption = ref<OptionDataYear[]>([]);
const filterSelectRoundAllOption = ref<OptionDataYear[]>([]);
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
const action = ref<string>(""); const action = ref<string>("");
const profileId = ref<string>(""); const profileId = ref<string>("");
const roundYear = ref<any>(); const roundYear = ref<any>();
const insigniaList = ref<any>([]); const insigniaList = ref<any>([]);
const fileterInsigniaList = ref<any>([]);
const loadView = ref<boolean>(false); const loadView = ref<boolean>(false);
const employeeClassOps = ref<any>(DataStore.employeeClassOps)
onMounted(async () => { onMounted(async () => {
await fecthRound(); await fecthRound();
}); });
@ -58,8 +61,10 @@ const fecthRound = async () => {
year: e.year, year: e.year,
}); });
}); });
filterSelectRoundAllOption.value = selectRoundAllOption.value
selectRound.value = data[0].id; selectRound.value = data[0].id;
filterSelectRoundOption.value = selectRoundOption.value
console.log(filterSelectRoundOption.value)
yearRound.value = data[0].year; yearRound.value = data[0].year;
roundYear.value = data[0].year; roundYear.value = data[0].year;
if (roundYear.value) { if (roundYear.value) {
@ -326,6 +331,7 @@ watch(tab, async () => {
(x: any) => x.type == tab.value || x.type == "" (x: any) => x.type == tab.value || x.type == ""
); );
DataStore.insignia = ""; DataStore.insignia = "";
fileterInsigniaList.value = insigniaList.value
fecthlistInsignia(); fecthlistInsignia();
}); });
@ -392,6 +398,44 @@ const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total; if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total; else return start + "-" + end + " ใน " + total;
}; };
const filterSelector = (val: any, update: Function, name: any) => {
update(() => {
const needle = val.toLowerCase();
if (name === 'employeeClassOps') {
DataStore.employeeClass = ''
employeeClassOps.value = DataStore.employeeClassOps.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
else if (name === 'fileterInsigniaList') {
DataStore.insignia = null as any
fileterInsigniaList.value = insigniaList.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
else if (name === 'filterSelectRoundAllOption') {
yearRound.value = null as any
filterSelectRoundAllOption.value = selectRoundAllOption.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
}
)
}
const clearInsigniaFilters = (name: string) => {
if (name === "employeeClassOps") {
DataStore.employeeClass = "all";
employeeClassOps.value = DataStore.employeeClassOps;
}
else if (name === "fileterInsigniaList") {
DataStore.insignia = "";
fileterInsigniaList.value = insigniaList.value;
}
// else if (name === 'employeeClassOps') {
// }
};
</script> </script>
<template> <template>
@ -426,7 +470,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
> >
<div class="q-pa-md"> <div class="q-pa-md">
<div class="row col-12 q-pb-sm q-col-gutter-x-xs"> <div class="row col-12 q-pb-sm q-col-gutter-x-xs">
<div>
<q-select <q-select
v-model="yearRound" v-model="yearRound"
dense dense
@ -436,26 +480,30 @@ const paginationLabel = (start: number, end: number, total: number) => {
:label="`${'รอบการเสนอขอเครื่องราชฯ'}`" :label="`${'รอบการเสนอขอเครื่องราชฯ'}`"
emit-value emit-value
map-options map-options
use-input
option-label="name" option-label="name"
:options="selectRoundAllOption" :options="filterSelectRoundAllOption"
option-value="year" option-value="year"
:borderless="false" :borderless="false"
style="min-width: 150px" style="min-width: 150px"
@update:model-value="selectorRound" @update:model-value="selectorRound"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'filterSelectRoundAllOption'
) "
/> />
</div>
<div> <div>
<q-select <q-select
v-model="DataStore.insignia" v-model="DataStore.insignia"
dense dense
outlined outlined
use-input
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
:label="`${'เครื่องราชฯ'}`" :label="`${'เครื่องราชฯ'}`"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="insigniaList" :options="fileterInsigniaList"
option-value="id" option-value="id"
:readonly="false" :readonly="false"
:borderless="false" :borderless="false"
@ -466,31 +514,68 @@ const paginationLabel = (start: number, end: number, total: number) => {
DataStore.employeeClass DataStore.employeeClass
) )
" "
/> @filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'fileterInsigniaList'
) "
>
<template v-if="DataStore.insignia !== ''" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
clearInsigniaFilters('fileterInsigniaList'),
DataStore.searchDatatable(
DataStore.insignia,
DataStore.employeeClass
)
"
class="cursor-pointer"
/>
</template>
</q-select>
</div> </div>
<div> <div>
<q-select <q-select
v-model="DataStore.employeeClass" class="col-2"
dense v-model="DataStore.employeeClass"
outlined dense
lazy-rules outlined
hide-bottom-space lazy-rules
:label="`${'สถานภาพ'}`" hide-bottom-space
emit-value :label="`${'สถานภาพ'}`"
map-options emit-value
option-label="name" use-input
:options="DataStore.employeeClassOps" map-options
option-value="id" option-label="name"
:readonly="false" :options="employeeClassOps"
:borderless="false" option-value="id"
style="min-width: 150px" :readonly="false"
@update:model-value=" :borderless="false"
DataStore.searchDatatable( style="min-width: 150px"
DataStore.insignia, @update:model-value="
DataStore.employeeClass DataStore.searchDatatable(
) DataStore.insignia,
DataStore.employeeClass
)
"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'employeeClassOps'
) "
>
<template v-if="DataStore.employeeClass !== 'all'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
clearInsigniaFilters('employeeClassOps'),
DataStore.searchDatatable(
DataStore.insignia,
DataStore.employeeClass
)
" "
class="cursor-pointer"
/> />
</template>
</q-select>
</div> </div>
<div> <div>
@ -600,7 +685,8 @@ const paginationLabel = (start: number, end: number, total: number) => {
:round-id="selectRound == '0' ? 'all' : selectRound" :round-id="selectRound == '0' ? 'all' : selectRound"
:action="action" :action="action"
:profile-id="profileId" :profile-id="profileId"
:select-round-option="selectRoundOption" v-model:selectRoundOption="selectRoundOption"
v-model:filterSelectRoundOption="filterSelectRoundOption"
:type-id="tab" :type-id="tab"
/> />
</q-card> </q-card>

View file

@ -40,6 +40,7 @@ onMounted(async () => {
const splitterModel = ref(14); const splitterModel = ref(14);
const selectList = ref<any>(); const selectList = ref<any>();
const optionsList = ref<any>([{ id: 0, name: "เลือกกรอบการยื่นขอ" }]); const optionsList = ref<any>([{ id: 0, name: "เลือกกรอบการยื่นขอ" }]);
const filterOtion = ref<any>([]);
const nextPage = () => { const nextPage = () => {
if (page.value < numOfPages.value) { if (page.value < numOfPages.value) {
@ -65,6 +66,7 @@ const fecthlistRound = async () => {
year: e.period_year, year: e.period_year,
name: e.period_name, name: e.period_name,
})); }));
filterOtion.value = optionsList.value
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -130,6 +132,18 @@ const downloadReport = async (
hideLoader(); hideLoader();
}); });
}; };
const filterSelector = (val: any, update: Function, name: any) => {
update(() => {
const needle = val.toLowerCase();
if (name === 'selectList') {
filterOtion.value = optionsList.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
}
)
}
</script> </script>
<template> <template>
@ -152,19 +166,23 @@ const downloadReport = async (
<q-toolbar style="padding: 0"> <q-toolbar style="padding: 0">
<q-form ref="myForm" class="row items-center"> <q-form ref="myForm" class="row items-center">
<q-select <q-select
style="width: 400px;"
class="q-pa-none" class="q-pa-none"
use-input use-input
fill-input fill-input
hide-selected hide-selected
dense dense
lazy-rules
outlined outlined
v-model="selectList" v-model="selectList"
:options="optionsList" :options="filterOtion"
label="เลือกรอบ" label="เลือกรอบ"
option-value="id" option-value="id"
option-label="name" option-label="name"
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']" :rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
@update:model-value="updateSelect" @update:model-value="updateSelect"
@filter="(inputValue:any,doneFn:Function) =>
filterSelector(inputValue, doneFn,'selectList') "
/> />
</q-form> </q-form>
<q-space /> <q-space />

View file

@ -37,6 +37,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
{ id: '44', title: 'บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ' } { id: '44', title: 'บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ' }
]) ])
const mainTab = ref<string | undefined>("pending"); const mainTab = ref<string | undefined>("pending");
const dataInsigniaType = ref<any>([])
// เรียกราชชื่อการเสนอขอ // เรียกราชชื่อการเสนอขอ
const fetchData = async (data: any) => { const fetchData = async (data: any) => {
if (data !== null) { if (data !== null) {
@ -124,6 +125,10 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
rows.value = listinsignia.value; rows.value = listinsignia.value;
} }
}; };
// ประเภทเครื่องราช
function fetchInsigniaType(data: any) {
dataInsigniaType.value = data
}
// ประเภทลูกจ้าง // ประเภทลูกจ้าง
const profileType = (val: string) => { const profileType = (val: string) => {
@ -167,11 +172,13 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
employeeClass, employeeClass,
employeeClassOps, employeeClassOps,
fetchDataInsignia, fetchDataInsignia,
fetchInsigniaType,
isLock, isLock,
requestId, requestId,
roleUser, roleUser,
requestStatus, requestStatus,
optionReport, optionReport,
convertStatus convertStatus,
dataInsigniaType,
}; };
}); });

View file

@ -1,403 +1,476 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue'; import { ref, watch } from "vue";
import type { FormRegistryEmployee } from '../interface/request/Main'; import type { FormRegistryEmployee } from "../interface/request/Main";
import { useQuasar, type QTableProps, QInput } from 'quasar'; import { useQuasar, type QTableProps, QInput } from "quasar";
import { useCounterMixin } from '@/stores/mixin'; 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 DialogHeader from "@/modules/04_registry/components/DialogHeader.vue"; import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
const mixin = useCounterMixin(); // const mixin = useCounterMixin(); //
const { const {
success, success,
messageError, messageError,
showLoader, showLoader,
hideLoader, hideLoader,
dialogConfirm, dialogConfirm,
dialogMessageNotify, dialogMessageNotify,
} = mixin; // } = mixin; //
const $q = useQuasar(); const $q = useQuasar();
const props = defineProps({ const props = defineProps({
modal: { modal: {
type: Boolean, type: Boolean,
default: false, default: false,
},
rows: {
type: Object,
default: [],
},
fetchNewList: {
type: Function,
default: () => {
/* ฟังก์ชั่น get รายการข้อมูลในหน้าหลักใหม่ */
}, },
rows: { },
type: Object, closeDialog: {
default: [] type: Function,
}, default: () => {
fetchNewList: { /* ฟังก์ชั่นปิด dialog ส่งไปออกคำสั่ง */
type: Function,
default: () => { /* ฟังก์ชั่น get รายการข้อมูลในหน้าหลักใหม่ */ }
},
closeDialog: {
type: Function,
default: () => { /* ฟังก์ชั่นปิด dialog ส่งไปออกคำสั่ง */ }
}, },
},
}); });
const filter = ref<string>(""); const filter = ref<string>("");
const filterRef = ref<QInput>(); const filterRef = ref<QInput>();
// visible columns dialog // visible columns dialog
const visibleColumnsOrder = ref<string[]>([ const visibleColumnsOrder = ref<string[]>([
"no", "no",
"fullname", "fullname",
"fullnameOld", "fullnameOld",
"oc", "oc",
"positionEmployeePosition", "positionEmployeePosition",
"positionEmployeePositionSide", "positionEmployeePositionSide",
"positionLine", "positionLine",
"govAge", "govAge",
"positionEmployeeGroup", "positionEmployeeGroup",
"dateAppoint", "dateAppoint",
"refSalary", "refSalary",
"dateStart", "dateStart",
"createdAt", "createdAt",
"salaryDate", "salaryDate",
"age", "age",
"amount", "amount",
"statustext", "statustext",
"leaveDateOrder", "leaveDateOrder",
"newAgency", "newAgency",
"currentAgency", "currentAgency",
]); ]);
// //
const columnsOrder = ref<QTableProps["columns"]>([ const columnsOrder = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
align: "left", align: "left",
label: "ลำดับ", label: "ลำดับ",
sortable: false, sortable: false,
field: "no", field: "no",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "fullname", name: "fullname",
align: "left", align: "left",
label: "ชื่อ-สกุล", label: "ชื่อ-นามสกุล",
sortable: true, sortable: true,
field: "fullname", field: "fullname",
headerStyle: "font-size: 14px; min-width: 200px", headerStyle: "font-size: 14px; min-width: 200px",
style: "font-size: 14px; ", style: "font-size: 14px; ",
}, },
{ {
name: "newAgency", name: "newAgency",
align: "left", align: "left",
label: "หน่วยงานที่รับการบรรจุ", label: "หน่วยงานที่รับการบรรจุ",
sortable: true, sortable: true,
field: "newAgency", field: "newAgency",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { a.localeCompare(b, undefined, {
numeric: true, numeric: true,
sensitivity: "base", sensitivity: "base",
}), }),
}, },
{ {
name: "currentAgency", name: "currentAgency",
align: "left", align: "left",
label: "หน่วยงานปัจจุบัน", label: "หน่วยงานปัจจุบัน",
sortable: true, sortable: true,
field: "currentAgency", field: "currentAgency",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { a.localeCompare(b, undefined, {
numeric: true, numeric: true,
sensitivity: "base", sensitivity: "base",
}), }),
}, },
{ {
name: "amount", name: "amount",
align: "left", align: "left",
label: "ค่าจ้าง", label: "ค่าจ้าง",
sortable: true, sortable: true,
field: "amount", field: "amount",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { a.localeCompare(b, undefined, {
numeric: true, numeric: true,
sensitivity: "base", sensitivity: "base",
}), }),
}, },
{ {
name: "govAge", name: "govAge",
align: "left", align: "left",
label: "อายุราชการ(ปี)", label: "อายุราชการ(ปี)",
sortable: true, sortable: true,
field: "govAge", field: "govAge",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { a.localeCompare(b, undefined, {
numeric: true, numeric: true,
sensitivity: "base", sensitivity: "base",
}), }),
}, },
{ {
name: "dateAppoint", name: "dateAppoint",
align: "left", align: "left",
label: "วันที่จ้าง", label: "วันที่จ้าง",
sortable: true, sortable: true,
field: "dateAppoint", field: "dateAppoint",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "dateStart", name: "dateStart",
align: "left", align: "left",
label: "วันที่เริ่มปฎิบัติราชการ", label: "วันที่เริ่มปฎิบัติราชการ",
sortable: true, sortable: true,
field: "dateStart", field: "dateStart",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "salaryDate", name: "salaryDate",
align: "left", align: "left",
label: "วันที่แต่งตั้ง", label: "วันที่แต่งตั้ง",
sortable: true, sortable: true,
field: "salaryDate", field: "salaryDate",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "refSalary", name: "refSalary",
align: "left", align: "left",
label: "เอกสารอ้างอิง", label: "เอกสารอ้างอิง",
sortable: true, sortable: true,
field: "refSalary", field: "refSalary",
headerStyle: "font-size: 14px; min-width: 200px", headerStyle: "font-size: 14px; min-width: 200px",
style: "font-size: 14px; ", style: "font-size: 14px; ",
}, },
{ {
name: "age", name: "age",
align: "left", align: "left",
label: "อายุ", label: "อายุ",
sortable: true, sortable: true,
field: "age", field: "age",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { a.localeCompare(b, undefined, {
numeric: true, numeric: true,
sensitivity: "base", sensitivity: "base",
}), }),
}, },
{ {
name: "fullnameOld", name: "fullnameOld",
align: "left", align: "left",
label: "ชื่อ-สกุล(เดิม)", label: "ชื่อ-สกุล(เดิม)",
sortable: true, sortable: true,
field: "fullnameOld", field: "fullnameOld",
headerStyle: "font-size: 14px; min-width: 200px", headerStyle: "font-size: 14px; min-width: 200px",
style: "font-size: 14px; ", style: "font-size: 14px; ",
}, },
{ {
name: "createdAt", name: "createdAt",
align: "left", align: "left",
label: "วันที่สร้าง", label: "วันที่สร้าง",
sortable: true, sortable: true,
field: "createdAt", field: "createdAt",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "leaveDateOrder", name: "leaveDateOrder",
align: "left", align: "left",
label: "วันที่พ้นราชการ", label: "วันที่พ้นราชการ",
sortable: true, sortable: true,
field: "leaveDateOrder", field: "leaveDateOrder",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "statustext", name: "statustext",
align: "left", align: "left",
label: "สถานะ", label: "สถานะ",
sortable: true, sortable: true,
field: "statustext", field: "statustext",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { a.localeCompare(b, undefined, {
numeric: true, numeric: true,
sensitivity: "base", sensitivity: "base",
}), }),
}, },
]); ]);
// checkbox // checkbox
const selected = ref<any>([]); const selected = ref<any>([]);
const save = () => { const save = () => {
if (selected.value.length == 0) { if (selected.value.length == 0) {
dialogMessageNotify($q, "กรุณาเลือกคนออกคำสั่ง"); dialogMessageNotify($q, "กรุณาเลือกคนออกคำสั่ง");
} else dialogConfirm($q, () => sendToCommand()); } else dialogConfirm($q, () => sendToCommand());
}; };
// post // post
const sendToCommand = async () => { const sendToCommand = async () => {
let pId: string[] = []; let pId: string[] = [];
selected.value.forEach((e: any) => { selected.value.forEach((e: any) => {
pId.push(e.id); pId.push(e.id);
});
let data = {
id: pId,
};
showLoader();
await http
.post(config.API.organizationEmployeeSendOrder, data)
.then((res: any) => {
success($q, "บันทึกสำเร็จ");
})
.catch((e: any) => {
messageError($q, e);
})
.finally(async () => {
props.fetchNewList();
props.closeDialog();
selected.value = [];
hideLoader();
}); });
let data = {
id: pId,
};
showLoader();
await http
.post(config.API.organizationEmployeeSendOrder, data)
.then((res: any) => {
success($q, "บันทึกสำเร็จ");
})
.catch((e: any) => {
messageError($q, e);
})
.finally(async () => {
props.fetchNewList()
props.closeDialog()
selected.value = [];
hideLoader();
});
}; };
// PENDING () // PENDING ()
const rowsOrder = ref<FormRegistryEmployee[]>([]); const rowsOrder = ref<FormRegistryEmployee[]>([]);
const filterRowData = () => { const filterRowData = () => {
rowsOrder.value = props.rows.filter( rowsOrder.value = props.rows.filter(
(r: FormRegistryEmployee) => r.status == "PENDING" (r: FormRegistryEmployee) => r.status == "PENDING"
); );
} };
// props modal filter icon // props modal filter icon
watch(props, () => { watch(props, () => {
if (props.modal === true && props.rows) { if (props.modal === true && props.rows) {
filterRowData() filterRowData();
} visibleColumnsOrder.value = [
"no",
"fullname",
"fullnameOld",
"oc",
"positionEmployeePosition",
"positionEmployeePositionSide",
"positionLine",
"govAge",
"positionEmployeeGroup",
"dateAppoint",
"refSalary",
"dateStart",
"createdAt",
"salaryDate",
"age",
"amount",
"statustext",
"leaveDateOrder",
"newAgency",
"currentAgency",
];
}
}); });
</script> </script>
<template> <template>
<q-dialog v-model="props.modal"> <q-dialog v-model="props.modal">
<q-card style="width: 900px; max-width: 80vw"> <q-card style="width: 900px; max-width: 80vw">
<DialogHeader tittle="ส่งรายชื่อไปออกคำสั่ง" :close="props.closeDialog" /> <DialogHeader tittle="ส่งรายชื่อไปออกคำสั่ง" :close="props.closeDialog" />
<q-separator /> <q-separator />
<q-card-section class="q-pt-none"> <q-card-section class="q-pt-none">
<div class="row justify-end"> <div class="row justify-end">
<div class="col-5"> <div class="col-5">
<q-toolbar style="padding: 0"> <q-toolbar style="padding: 0">
<q-input borderless outlined dense debounce="300" v-model="filter" ref="filterRef" <q-input
placeholder="ค้นหา" style="width: 850px; max-width: auto"> borderless
<template v-slot:append> outlined
<q-icon name="search" /> dense
</template> debounce="300"
</q-input> v-model="filter"
</q-toolbar> ref="filterRef"
</div> placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
<q-select
v-model="visibleColumnsOrder"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columnsOrder"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:rows="rowsOrder"
:columns="columnsOrder"
:visible-columns="visibleColumnsOrder"
:filter="filter"
row-key="id"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="newAgency" :props="props">
<div
class="col-12"
v-if="
props.row.draftOrganizationOrganization == null &&
props.row.draftPositionEmployee == null
"
>
<div class="text-weight-medium">
{{ "-" }}
</div>
</div> </div>
<div class="col-12" v-else>
<div class="text-weight-medium">
{{ props.row.draftOrganizationOrganization ?? "-" }}
</div>
<div class="text-weight-light">
{{ props.row.draftPositionEmployee ?? "-" }}
</div>
</div>
</q-td>
<q-td key="currentAgency" :props="props">
<div
class="col-12"
v-if="props.row.oc == null && props.row.position == null"
>
<div class="text-weight-medium">
{{ "-" }}
</div>
</div>
<div class="col-12" v-else>
<div class="text-weight-medium">
{{ props.row.oc ?? "-" }}
</div>
<div class="text-weight-light">
{{ props.row.position ?? "-" }}
</div>
</div>
</q-td>
<d-table :rows="rowsOrder" :columns="columnsOrder" :visible-columns="visibleColumnsOrder" :filter="filter" <q-td key="amount" :props="props">
row-key="id" selection="multiple" v-model:selected="selected"> {{ props.row.amount }}
<template v-slot:header-selection="scope"> </q-td>
<q-checkbox keep-color color="primary" dense v-model="scope.selected" /> <q-td key="govAge" :props="props">
</template> {{ props.row.govAge }}
<template v-slot:body="props"> </q-td>
<q-tr :props="props" class="cursor-pointer"> <q-td key="dateAppoint" :props="props">
<q-td> {{ props.row.dateAppoint }}
<q-checkbox keep-color color="primary" dense v-model="props.selected" /> </q-td>
</q-td> <q-td key="dateStart" :props="props">
{{ props.row.dateStart }}
</q-td>
<q-td key="salaryDate" :props="props">
{{ props.row.salaryDate }}
</q-td>
<q-td key="refSalary" :props="props">
{{ props.row.refSalary }}
</q-td>
<q-td key="age" :props="props">
{{ props.row.age }}
</q-td>
<q-td key="fullnameOld" :props="props">
{{ props.row.fullnameOld }}
</q-td>
<q-td key="createdAt" :props="props">
{{ props.row.createdAt }}
</q-td>
<q-td key="isLeave" :props="props">
{{ props.row.isLeave }}
</q-td>
<q-td key="no" :props="props"> <q-td key="leaveDateOrder" :props="props">
{{ props.rowIndex + 1 }} {{ props.row.leaveDateOrder }}
</q-td> </q-td>
<q-td key="fullname" :props="props"> <q-td key="statustext" :props="props">
{{ props.row.fullname }} {{ props.row.statustext }}
</q-td> </q-td>
<q-td key="newAgency" :props="props"> </q-tr>
<div class="col-12" v-if="props.row.draftOrganizationOrganization == null && </template>
props.row.draftPositionEmployee == null </d-table>
"> </q-card-section>
<div class="text-weight-medium">
{{ "-" }}
</div>
</div>
<div class="col-12" v-else>
<div class="text-weight-medium">
{{ props.row.draftOrganizationOrganization ?? "-" }}
</div>
<div class="text-weight-light">
{{ props.row.draftPositionEmployee ?? "-" }}
</div>
</div>
</q-td>
<q-td key="currentAgency" :props="props">
<div class="col-12" v-if="props.row.oc == null && props.row.position == null">
<div class="text-weight-medium">
{{ "-" }}
</div>
</div>
<div class="col-12" v-else>
<div class="text-weight-medium">
{{ props.row.oc ?? "-" }}
</div>
<div class="text-weight-light">
{{ props.row.position ?? "-" }}
</div>
</div>
</q-td>
<q-td key="amount" :props="props"> <q-card-actions align="right" class="bg-white text-teal">
{{ props.row.amount }} <q-btn label="ส่งไปออกคำสั่ง" @click="save" color="public" />
</q-td> </q-card-actions>
<q-td key="govAge" :props="props"> </q-card>
{{ props.row.govAge }} </q-dialog>
</q-td> </template>
<q-td key="dateAppoint" :props="props">
{{ props.row.dateAppoint }}
</q-td>
<q-td key="dateStart" :props="props">
{{ props.row.dateStart }}
</q-td>
<q-td key="salaryDate" :props="props">
{{ props.row.salaryDate }}
</q-td>
<q-td key="refSalary" :props="props">
{{ props.row.refSalary }}
</q-td>
<q-td key="age" :props="props">
{{ props.row.age }}
</q-td>
<q-td key="fullnameOld" :props="props">
{{ props.row.fullnameOld }}
</q-td>
<q-td key="createdAt" :props="props">
{{ props.row.createdAt }}
</q-td>
<q-td key="isLeave" :props="props">
{{ props.row.isLeave }}
</q-td>
<q-td key="leaveDateOrder" :props="props">
{{ props.row.leaveDateOrder }}
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn label="ส่งไปออกคำสั่ง" @click="save" color="public" />
</q-card-actions>
</q-card>
</q-dialog>
</template>

View file

@ -310,7 +310,7 @@ const deleteData = async (id: string) => {
// **** ***// // **** ***//
const rowsPosition = ref<any>([]); // const rowsPosition = ref<any>([]); //
const filters = ref<FormRegistryEmployee[]>([]); const filters = ref<FormRegistryEmployee[]>([]);
const filterKeyword2 = ref<string>(""); const filterKeyword2 = ref<any>("");
const modal = ref<boolean>(false); // - dialod const modal = ref<boolean>(false); // - dialod
const selectedPosition = ref<any>([]); // const selectedPosition = ref<any>([]); //
@ -970,7 +970,7 @@ const showEmployeeTemp = async () => {
dense dense
ref="filterRef" ref="filterRef"
debounce="300" debounce="300"
:model-value="filterKeyword2" v-model="filterKeyword2"
placeholder="ค้นหา" placeholder="ค้นหา"
style="width: 850px; max-width: auto" style="width: 850px; max-width: auto"
> >

View file

@ -45,13 +45,19 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
(item) => item.orderTypeValue === filter_1 (item) => item.orderTypeValue === filter_1
); );
} else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear === null) { } else if (
filter_1 !== "" &&
filter_2 !== "ทั้งหมด" &&
filterYear === null
) {
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
(item) => item.orderTypeValue === filter_1 && item.OrderStatus === filter_2 (item) =>
item.orderTypeValue === filter_1 && item.OrderStatus === filter_2
); );
} else if (filter_1 !== "" && filter_2 === "ทั้งหมด" && filterYear !== 0) { } else if (filter_1 !== "" && filter_2 === "ทั้งหมด" && filterYear !== 0) {
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
(item) => item.orderTypeValue === filter_1 && item.fiscalYear === filterYear (item) =>
item.orderTypeValue === filter_1 && item.fiscalYear === filterYear
); );
} else if (filter_1 === "" && filter_2 !== "ทั้งหมด" && filterYear === 0) { } else if (filter_1 === "" && filter_2 !== "ทั้งหมด" && filterYear === 0) {
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
@ -61,27 +67,32 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
(item) => item.fiscalYear === filterYear (item) => item.fiscalYear === filterYear
); );
} else if (filter_1 === "" && filter_2 !== "ทั้งหมด" && filterYear !== null) { } else if (
filter_1 === "" &&
filter_2 !== "ทั้งหมด" &&
filterYear !== null
) {
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
(item) => (item) =>
item.OrderStatus === filter_2 && item.fiscalYear === filterYear item.OrderStatus === filter_2 && item.fiscalYear === filterYear
); );
} else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear === 0) { } else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear === 0) {
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
(item) => item.OrderStatus === filter_2 && item.orderTypeValue === filter_1 (item) =>
item.OrderStatus === filter_2 && item.orderTypeValue === filter_1
); );
} else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear !== null) { } else if (
filter_1 !== "" &&
filter_2 !== "ทั้งหมด" &&
filterYear !== null
) {
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
(item) => (item) =>
item.orderTypeValue === filter_1 && item.orderTypeValue === filter_1 &&
item.OrderStatus === filter_2 && item.OrderStatus === filter_2 &&
item.fiscalYear === filterYear item.fiscalYear === filterYear
); );
} else if ( } else if (filter_1 == "" && filter_2 == "ทั้งหมด" && filterYear !== null) {
filter_1 == "" &&
filter_2 == "ทั้งหมด" &&
filterYear !== null
) {
DataMainUpdateOrder.value = DataMainOrigOrder.value; DataMainUpdateOrder.value = DataMainOrigOrder.value;
} }
}; };
@ -144,6 +155,6 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
DataUpdateOrder, DataUpdateOrder,
DataMainYearSetOrder, DataMainYearSetOrder,
DataMainOrder, DataMainOrder,
nameOrderFilter nameOrderFilter,
}; };
}); });

View file

@ -18,15 +18,6 @@ const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const DataStore = useOrderPlacementDataStore(); const DataStore = useOrderPlacementDataStore();
const OpsFilterYear = ref<any>({
fiscalyearOP: [],
});
const OpsFilterOrderType = ref<any>({
OrderTypeOption: [],
});
const OpsFilterOrderStatus = ref<any>({
OrderStatusOption: [],
});
const pagination = ref({ const pagination = ref({
descending: true, descending: true,
page: 1, page: 1,
@ -153,16 +144,6 @@ const OriginalDataFetch = async () => {
OrderType: e.orderTypeName, OrderType: e.orderTypeName,
orderTypeValue: e.orderTypeValue, orderTypeValue: e.orderTypeValue,
})); }));
// OpsFilterYear.value.fiscalYear = res.data.result.map((e: any) => ({
// fiscalYear: Number(e.fiscalYear),
// }));
OpsFilterOrderStatus.value.OrderStatus = res.data.result.map(
(e: any) => ({
OrderStatus: e.orderStatusName,
})
);
console.log(fiscalyear.value);
console.log(OrderStatus.value);
}) })
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
@ -199,22 +180,26 @@ const redirectToPage = (id?: string, status?: string) => {
const clickAdd = () => { const clickAdd = () => {
router.push({ name: "OrderAdd" }); router.push({ name: "OrderAdd" });
}; };
const Ops = ref<any>({
fiscalyearOP: [],
});
// //
const fiscalyear = ref<number | null>(0); const fiscalyear = ref<number | null>(0);
const fiscalyearOP = ref<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]); const fiscalyearOP = ref<any>([{ id: 0, name: "ทั้งหมด" }]);
const fiscalyearFilter1 = ref<any>([]); const fiscalyearFilter1 = ref<any>([]);
const fiscalYearFilter = async () => { const fiscalYearFilter = async () => {
await http.get(config.API.yearOptionsOrder()).then((res) => { await http.get(config.API.yearOptionsOrder()).then((res) => {
const response = res.data.result; const response = res.data.result;
fiscalyearOP.value = [{ id: 0, name: "ทั้งหมด" }]; fiscalyearOP.value = [{ id: 0, name: "ทั้งหมด" }];
fiscalyearOP.value.push(...response); response.map((r: any) => {
fiscalyearOP.value.push({ id: r.id, name: r.name.toString() });
});
fiscalyearFilter1.value = [{ id: 0, name: "ทั้งหมด" }]; fiscalyearFilter1.value = [{ id: 0, name: "ทั้งหมด" }];
fiscalyearFilter1.value.push(...response); response.map((r: any) => {
fiscalyearFilter1.value.push({
id: r.id,
name: r.name.toString(),
});
});
}); });
}; };
@ -300,7 +285,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
case "fiscalyearOP": case "fiscalyearOP":
update(() => { update(() => {
fiscalyearOP.value = fiscalyearFilter1.value.filter( fiscalyearOP.value = fiscalyearFilter1.value.filter(
(v: any) => v.name.valueOf(val) > -1 (v: any) => v.name.indexOf(val) > -1
); );
}); });
break; break;
@ -347,6 +332,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
option-value="id" option-value="id"
option-label="name" option-label="name"
lazy-rules lazy-rules
use-input
hide-bottom-space hide-bottom-space
:readonly="false" :readonly="false"
:borderless="false" :borderless="false"
@ -356,7 +342,13 @@ const paginationLabel = (start: string, end: string, total: string) => {
@filter="(inputValue:any, @filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'fiscalyearOP' doneFn:Function) => filterSelector(inputValue, doneFn,'fiscalyearOP'
) " ) "
/> >
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey"> ไมอม </q-item-section>
</q-item>
</template>
</q-select>
<!-- use-input --> <!-- use-input -->
<div> <div>
<q-btn <q-btn
@ -433,7 +425,15 @@ const paginationLabel = (start: string, end: string, total: string) => {
@filter="(inputValue:any, @filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'OrderTypeOption' doneFn:Function) => filterSelector(inputValue, doneFn,'OrderTypeOption'
) " ) "
/> >
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</div> </div>
<div class="col-xs-12 col-sm-3 col-md-3"> <div class="col-xs-12 col-sm-3 col-md-3">
<q-select <q-select
@ -456,7 +456,15 @@ const paginationLabel = (start: string, end: string, total: string) => {
@filter="(inputValue:any, @filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'OrderStatusOption' doneFn:Function) => filterSelector(inputValue, doneFn,'OrderStatusOption'
) " ) "
/> >
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</div> </div>
<q-space /> <q-space />
<div><PopupHistory :OrderTypeOption="OrderTypeOption" /></div> <div><PopupHistory :OrderTypeOption="OrderTypeOption" /></div>