แก้บัค แบบประเมินผล (คณะกรรมการ)

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-10-03 11:00:24 +07:00
parent 77e4294ec5
commit f773550bfd
8 changed files with 792 additions and 285 deletions

View file

@ -159,4 +159,11 @@ export default {
orderCPM: (type: string) => `${order}/order/${type}/detail`, orderCPM: (type: string) => `${order}/order/${type}/detail`,
orderCPMUpdate: (type: string, id: string) => orderCPMUpdate: (type: string, id: string) =>
`${order}/order/${type}/detail/${id}`, `${order}/order/${type}/detail/${id}`,
//appoint-employee
appointEmployee: () => `${placement}/appointment/temp`,
appointEmployeeByid: (id: string) => `${placement}/appointment/temp/${id}`,
appointEmployeePosition: (id: string) => `${placement}/appointment/temp/position/${id}`,
appointEmployeeOrder: (commandTypeId: string) => `${placement}/appointment/temp/report/${commandTypeId}`,
apppointmentPositionUse: () => `${placement}/appointment/temp/use`,
}; };

View file

@ -6,10 +6,17 @@
v-model:statusEdit="statusEdit" v-model:statusEdit="statusEdit"
:profileType="profileType" :profileType="profileType"
/> --> /> -->
<Information v-model:statusEdit="statusEdit" :fetchDataProfile="fetchData" /> <Information
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 v-model:statusEdit="statusEdit" :profileType="profileType" :employeeClass="employeeClass" /> <Government
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" />
@ -33,11 +40,20 @@
<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 v-model:statusEdit="statusEdit" :profileType="profileType" /> <AssessmentVue
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 v-model:statusEdit="statusEdit" v-if="profileType === 'officer'" /> <SalaryVue
<SalaryEmployeeTempVue v-model:statusEdit="statusEdit" v-else-if="employeeClass === 'temp'" /> v-model:statusEdit="statusEdit"
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">
@ -62,29 +78,70 @@
<DocumentVue v-model:statusEdit="statusEdit" /> <DocumentVue v-model:statusEdit="statusEdit" />
</div> </div>
</div> </div>
<q-page-sticky position="top" expand class="bg-grey-2 text-white" style="z-index: 99; padding: 0% 1% 0% 1%"> <q-page-sticky
<div class="row col-12 q-gutter-sm q-pb-sm text-dark no-wrap items-center"> position="top"
<q-btn flat round class="bg-teal-1 full-height" color="primary" icon="mdi-chevron-left" dense expand
@click="router.go(-1)"> class="bg-grey-2 text-white"
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 v-if="imageUrl == null" size="65px" rounded class="containerimage"> <q-avatar
<img src="@/assets/avatar_user.jpg" class="bg-grey-3" style="object-fit: cover" /> v-if="imageUrl == null"
<div class="overlay absolute-bottom text-subtitle2 text-center cursor-pointer" @click="clickImage()"> size="65px"
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 type="file" style="display: none" ref="inputImage" accept="image/*" @change="uploadImage" /> <input
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 class="overlay absolute-bottom text-subtitle2 text-center cursor-pointer" @click="clickImage()"> <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 type="file" style="display: none" ref="inputImage" accept="image/*" @change="uploadImage" /> <input
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">
@ -97,28 +154,56 @@
</div> </div>
<q-space /> <q-space />
<q-btn round flat color="blue" icon="mdi-file-document" <q-btn
v-if="profileType == 'officer' || (profileType == 'employee' && employeeClass == 'perm')"> 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" v-if="profileType == 'officer'"> <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" v-if="profileType == 'officer'"> <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" v-if="profileType == 'officer'"> <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
clickable
v-close-popup
@click="appointEmployeePost"
v-if="profileType == 'employee'"
>
<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>
@ -130,31 +215,56 @@
<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" v-if="profileType == 'officer'"> <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" v-if="profileType == 'officer'"> <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" v-if="profileType == 'officer'"> <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" v-if="profileType == 'officer'"> <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" v-if="profileType == 'officer'"> <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>
@ -165,8 +275,15 @@
<!-- <q-tooltip>งรายช</q-tooltip> --> <!-- <q-tooltip>งรายช</q-tooltip> -->
</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' <q-btn
"> 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>
@ -180,7 +297,9 @@
<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> <q-item-section class="text-primary"
>ประวแบบย</q-item-section
>
</q-item> </q-item>
</q-list> </q-list>
</q-menu> </q-menu>
@ -192,8 +311,20 @@
<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 @click="downloadKP7()" unelevated class="btn_purple q-mr-sm" label="ดาวน์โหลด ก.พ.7/ก.ก.1"></q-btn> <q-btn
<q-btn icon="close" unelevated round dense @click="closeKp7" style="color: #ff8080; background-color: #ffdede" /> @click="downloadKP7()"
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
@ -208,9 +339,20 @@
<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 @click="downloadKP7Short()" unelevated class="btn_purple q-mr-sm" label="ดาวน์โหลด ประวัติแบบย่อ"></q-btn> <q-btn
<q-btn icon="close" unelevated round dense @click="closeKp7Short" @click="downloadKP7Short()"
style="color: #ff8080; background-color: #ffdede" /> unelevated
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
@ -227,28 +369,50 @@
<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 icon="close" unelevated round dense @click="closeImage" style="color: #ff8080; background-color: #ffdede"> <q-btn
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 class="row wrap items-start col-12 q-col-gutter-sm" style="height: 320px; overflow: auto"> <div
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 style=" <div
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 v-for="n in images" :key="n" class="col-3" @click="imageActive(n)"> <div
v-for="n in images"
:key="n"
class="col-3"
@click="imageActive(n)"
>
<div :class="getClass(n)"> <div :class="getClass(n)">
<q-img v-if="n.avatar != null" :src="n.avatar" :class="imageClass(n)"> <q-img
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"
@ -262,11 +426,21 @@
style="color: #ff8080" style="color: #ff8080"
/> />
</div> --> </div> -->
<div class="absolute-bottom col-12 cursor-pointer flex justify-between items-center" style="padding: 5px"> <div
class="absolute-bottom col-12 cursor-pointer flex justify-between items-center"
style="padding: 5px"
>
{{ date2Thai(n.createdDate) }} {{ date2Thai(n.createdDate) }}
<q-btn v-if="!n.isActive" icon="delete" unelevated dense @click="deletePhoto(n.id)" class="bg-white" <q-btn
style="color: #ff8080"> v-if="!n.isActive"
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>
@ -286,7 +460,14 @@
> >
<q-tooltip>ลบรปภาพ</q-tooltip> <q-tooltip>ลบรปภาพ</q-tooltip>
</q-btn> --> </q-btn> -->
<q-btn icon="check" dense flat round @click="selectAvatarHistory" color="positive"> <q-btn
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>
@ -300,18 +481,39 @@
<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 class="col-12 col-sm-6 col-md-5" outlined dense v-model="filePassaway" label="แนบใบมรณบัตร" <q-file
hide-bottom-space lazy-rules accept=".pdf"> class="col-12 col-sm-6 col-md-5"
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 class="col-12 col-sm-6 col-md-7" dense outlined v-model="deathCertificateNo" <q-input
label="เลขที่ใบมรณบัตร" /> class="col-12 col-sm-6 col-md-7"
dense
outlined
v-model="deathCertificateNo"
label="เลขที่ใบมรณบัตร"
/>
<datepicker class="col-12 col-sm-6 col-md-5" menu-class-name="modalfix" v-model="dateDeath" :locale="'th'" <datepicker
autoApply borderless :enableTimePicker="false" week-start="0"> class="col-12 col-sm-6 col-md-5"
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>
@ -319,32 +521,63 @@
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input outlined dense class="full-width datepicker" :model-value="dateDeath != null ? date2Thai(dateDeath) : null <q-input
" :label="`${'วันที่เสียชีวิต'}`" :rules="[ outlined
(val) => !!val || `${'กรุณาเลือกวันที่เสียชีวิต'}`, dense
]"> 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 name="event" class="cursor-pointer" style="color: var(--q-primary)"> <q-icon
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 class="col-12 col-sm-6 col-md-7" dense outlined v-model="placeDeathCertificate" <q-input
label="สถานที่ออกใบมรณบัตร" /> class="col-12 col-sm-6 col-md-7"
dense
outlined
v-model="placeDeathCertificate"
label="สถานที่ออกใบมรณบัตร"
/>
<q-separator /> <q-separator />
<q-input class="col-12" dense outlined v-model="reasonDeath" label="เหตุผลการเสียชีวิต" type="textarea" /> <q-input
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 unelevated label="บันทึก" color="public" @click="clickSaveDeceased" :disable="filePassaway === null || <q-btn
deathCertificateNo === '' || unelevated
placeDeathCertificate === '' || label="บันทึก"
reasonDeath === '' color="public"
"> @click="clickSaveDeceased"
:disable="
filePassaway === null ||
deathCertificateNo === '' ||
placeDeathCertificate === '' ||
reasonDeath === ''
"
>
<q-tooltip>นท</q-tooltip> <q-tooltip>นท</q-tooltip>
</q-btn> </q-btn>
</div> </div>
@ -362,34 +595,71 @@
<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 icon="close" unelevated round dense @click="closeLeave" <q-btn
style="color: #ff8080; background-color: #ffdede" /> icon="close"
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 class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"> <div
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 class="full-width inputgreen cursor-pointer" outlined dense lazy-rules v-model="reason" <q-select
:rules="[(val) => !!val || `${'กรุณาเลือกประเภทการพ้นราชการ'}`]" hide-bottom-space class="full-width inputgreen cursor-pointer"
:label="`${'ประเภทการพ้นราชการ'}`" emit-value map-options option-label="name" :options="reasonOptions" outlined
option-value="id" /> dense
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 menu-class-name="modalfix" v-model="leaveDate" :locale="'th'" autoApply :enableTimePicker="false" <datepicker
week-start="0"> menu-class-name="modalfix"
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 class="full-width inputgreen cursor-pointer" outlined dense lazy-rules <q-input
:model-value="date2Thai(leaveDate)" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่พ้นราชการ'}`]" class="full-width inputgreen cursor-pointer"
hide-bottom-space :label="`${'วันที่พ้นราชการ'}`"> outlined
dense
lazy-rules
:model-value="date2Thai(leaveDate)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่พ้นราชการ'}`]"
hide-bottom-space
:label="`${'วันที่พ้นราชการ'}`"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> <q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
@ -397,30 +667,64 @@
</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 class="full-width inputgreen cursor-pointer" outlined dense lazy-rules autogrow v-model="leaveDetail" <q-input
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 class="full-width inputgreen cursor-pointer" outlined dense lazy-rules autogrow <q-input
v-model="leaveNumberOrder" :rules="[(val) => !!val || `${'กรุณากรอกคำสั่ง/เอกสารอ้างอิง'}`]" class="full-width inputgreen cursor-pointer"
hide-bottom-space :label="`${'คำสั่ง/เอกสารอ้างอิง'}`" /> outlined
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 menu-class-name="modalfix" v-model="leaveDateOrder" :locale="'th'" autoApply <datepicker
:enableTimePicker="false" week-start="0"> menu-class-name="modalfix"
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 class="full-width inputgreen cursor-pointer" outlined dense lazy-rules <q-input
:model-value="date2Thai(leaveDateOrder)" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่ออกคำสั่ง'}`]" class="full-width inputgreen cursor-pointer"
hide-bottom-space :label="`${'วันที่ออกคำสั่ง'}`"> outlined
dense
lazy-rules
:model-value="date2Thai(leaveDateOrder)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ออกคำสั่ง'}`]"
hide-bottom-space
:label="`${'วันที่ออกคำสั่ง'}`"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> <q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
@ -431,7 +735,13 @@
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right"> <q-card-actions align="right">
<q-btn flat round color="public" @click="Retire" icon="mdi-content-save-outline"> <q-btn
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>
@ -645,7 +955,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);
}) })
@ -826,6 +1136,26 @@ const appointPost = async () => {
}); });
}; };
const appointEmployeePost = async () => {
console.log("post Employee");
const formData = new FormData();
formData.append("id", profileId.value);
dialogConfirm($q, async () => {
showLoader();
await http
.post(config.API.appointEmployee(), formData)
.then(() => {
success($q, "ดำเนินการสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
});
};
// const relocationPost = async () => { // const relocationPost = async () => {
// dialogConfirm($q, async () => { // dialogConfirm($q, async () => {
// const formData = new FormData(); // const formData = new FormData();
@ -910,9 +1240,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));
@ -1157,8 +1487,8 @@ const clickSaveDeceased = async () => {
hideLoader(); hideLoader();
}); });
}) })
.onCancel(() => { }) .onCancel(() => {})
.onDismiss(() => { }); .onDismiss(() => {});
}; };
</script> </script>
<style> <style>

View file

@ -1,4 +1,4 @@
divdivdiv
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
@ -60,7 +60,7 @@ const title = ref<ResponseTitle>({
const fecthappointmentByid = async () => { const fecthappointmentByid = async () => {
showLoader(); showLoader();
await http await http
.get(config.API.appointmentByid(paramsId.toString())) .get(config.API.appointEmployeeByid(paramsId.toString()))
.then((res: ResponseData) => { .then((res: ResponseData) => {
const data = res.data.result; const data = res.data.result;
appointment.value = data; appointment.value = data;
@ -120,19 +120,19 @@ const putAppointment = async () => {
reason: reason.value, reason: reason.value,
positionDate: date.value, positionDate: date.value,
}; };
// showLoader(); showLoader();
// await http await http
// .put(config.API.appointmentByid(paramsId.toString()), data) .put(config.API.appointEmployeeByid(paramsId.toString()), data)
// .then(() => { .then(() => {
// success($q, ""); success($q, "บันทึกข้อมูลสำเร็จ");
// }) })
// .catch((e) => { .catch((e) => {
// messageError($q, e); messageError($q, e);
// }) })
// .finally(() => { .finally(() => {
// fecthappointmentByid(); fecthappointmentByid();
// edit.value = false; edit.value = false;
// }); });
}; };
const cancel = () => { const cancel = () => {
edit.value = false; edit.value = false;

View file

@ -87,13 +87,12 @@ const columns2 = ref<QTableProps["columns"]>([
}, },
]); ]);
const pageNext = (item: object) => { const pageNext = (item: object) => {
props.nextPage?.(item) props.nextPage?.(item);
} };
const emit = defineEmits([ 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);
@ -111,11 +110,10 @@ const clickAddlist = () => {
dialogConfirm($q, () => createdAppoint()); dialogConfirm($q, () => createdAppoint());
}; };
// //
const createdAppoint = async () => { const createdAppoint = async () => {
let pId: string[] = []; let pId: string[] = [];
let Type = props.type as string let Type = props.type as string;
selected.value.forEach((e: UserData) => { selected.value.forEach((e: UserData) => {
pId.push(e.personalId); pId.push(e.personalId);
}); });
@ -125,7 +123,7 @@ const createdAppoint = async () => {
showLoader(); showLoader();
await http await http
.put(config.API.apppointmentReport(Type), data) .put(config.API.apppointmentReport(Type), data)
.then((res) => { .then(() => {
success($q, "บันทึกสำเร็จ"); success($q, "บันทึกสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
@ -135,7 +133,7 @@ const createdAppoint = async () => {
hideLoader(); hideLoader();
props.fecthlistappointment?.(); props.fecthlistappointment?.();
selected.value = []; selected.value = [];
props.clickClose?.() props.clickClose?.();
}); });
}; };
@ -154,36 +152,90 @@ watchEffect(() => {
<div class="row justify-between"> <div class="row justify-between">
<div class="col-5"> <div class="col-5">
<q-toolbar style="padding: 0"> <q-toolbar style="padding: 0">
<q-select outlined dense :model-value="type" @update:model-value="updateInputType" :options="optionsType" <q-select
label="คำสั่งแต่งตั่ง-เลื่อน-ย้าย" style="width: 400px; max-width: auto" emit-value map-options outlined
option-label="name" option-value="id" /> 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"
readonly
/>
</q-toolbar> </q-toolbar>
</div> </div>
<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" :model-value="filterKeyword2" <q-input
@update:model-value="updateInput" placeholder="ค้นหา" style="width: 850px; max-width: auto"> borderless
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" /> <q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon v-if="filterKeyword2 !== ''" name="clear" class="cursor-pointer" @click="Reset" /> <q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="Reset"
/>
</template> </template>
</q-input> </q-input>
<q-select v-model="visibleColumns2" multiple outlined dense options-dense <q-select
:display-value="$q.lang.table.columns" emit-value map-options :options="columns2" option-value="name" v-model="visibleColumns2"
options-cover style="min-width: 150px" class="gt-xs q-ml-sm" /> 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> </q-toolbar>
</div> </div>
</div> </div>
<d-table :columns="columns2" :rows="rows2" :filter="filterKeyword2" row-key="personalId" flat <d-table
:visible-columns="visibleColumns2" selection="multiple" v-model:selected="selected"> :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"> <template v-slot:header-selection="scope">
<q-checkbox keep-color color="primary" dense v-model="scope.selected" /> <q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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> <q-td>
<q-checkbox keep-color color="primary" dense v-model="props.selected" /> <q-checkbox
keep-color
color="primary"
dense
v-model="props.selected"
/>
</q-td> </q-td>
<q-td key="no" :props="props"> <q-td key="no" :props="props">
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
@ -194,18 +246,37 @@ watchEffect(() => {
<q-td key="fullname" :props="props" @click="pageNext(props.row)"> <q-td key="fullname" :props="props" @click="pageNext(props.row)">
{{ props.row.fullname }} {{ props.row.fullname }}
</q-td> </q-td>
<q-td key="organizationName" :props="props" @click="pageNext(props.row)"> <q-td
<div v-if="props.row.orgName !== null || key="organizationName"
props.row.positionPath !== null :props="props"
"> @click="pageNext(props.row)"
>
<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.orgName !== null ? props.row.orgName : "-" }}
{{ props.row.organizationShortName !== null ? `(${props.row.organizationShortName})` : "" }} {{
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>
@ -224,7 +295,12 @@ watchEffect(() => {
</q-card-section> </q-card-section>
<q-card-actions align="right" class="bg-white text-teal"> <q-card-actions align="right" class="bg-white text-teal">
<q-btn label="ส่งไปออกคำสั่ง" @click="clickAddlist" color="public" :disable="checkSelected" /> <q-btn
label="ส่งไปออกคำสั่ง"
@click="clickAddlist"
color="public"
:disable="checkSelected"
/>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>

View file

@ -124,81 +124,65 @@ const columns = ref<QTableProps["columns"]>([
}, },
]); ]);
// input onMounted(() => {
const resetFilter = () => { fecthlistappointment();
filterKeyword.value = ""; });
filterKeyword2.value = "";
filterRef.value.focus();
};
// modal
const clickClose = () => {
modal.value = false;
};
// modal
const popup = () => {
modal.value = true;
filterKeyword2.value = "";
fecthTypeOption();
};
// API // API
const fecthlistappointment = async () => { const fecthlistappointment = async () => {
// showLoader(); showLoader();
// rows.value = []; rows.value = [];
// await http await http
// .get(config.API.appointmentMain()) .get(config.API.appointEmployee())
// .then((res) => { .then((res) => {
// let response = res.data.result; let response = res.data.result;
// listRecevice.value = response; listRecevice.value = response;
// rows.value = response.map((e: resData) => ({ rows.value = response.map((e: resData) => ({
// personalId: e.id, personalId: e.id,
// citizenId: e.citizenId, citizenId: e.citizenId,
// fullname: e.prefix + e.firstname + " " + e.lastname, fullname: e.prefix + e.firstname + " " + e.lastname,
// organizationName: organizationName:
// e.organizationName + e.organizationName +
// " " + " " +
// e.organizationShortName + e.organizationShortName +
// " " + " " +
// e.positionNumber + e.positionNumber +
// " " + " " +
// e.positionPath, e.positionPath,
// orgName: e.organizationName, orgName: e.organizationName,
// organizationShortName: e.organizationShortName, organizationShortName: e.organizationShortName,
// positionNumber: e.positionNumber, positionNumber: e.positionNumber,
// positionPath: e.positionPath, positionPath: e.positionPath,
// 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, educationOld: e.educationOld,
// organizationPositionOld: e.organizationPositionOld, organizationPositionOld: e.organizationPositionOld,
// positionTypeOld: e.positionTypeOld, positionTypeOld: e.positionTypeOld,
// positionLevelOld: e.positionLevelOld, positionLevelOld: e.positionLevelOld,
// positionNumberOld: e.positionNumberOld, positionNumberOld: e.positionNumberOld,
// salary: e.salary, salary: e.salary,
// positionDate: e.positionDate, 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.educationOld &&
// e.organizationPositionOld && e.organizationPositionOld &&
// e.positionTypeOld && e.positionTypeOld &&
// e.positionLevelOld && e.positionLevelOld &&
// e.positionNumberOld && e.positionNumberOld &&
// e.salary !== null && e.salary !== null &&
// e.positionDate e.positionDate
// ); );
// }) })
// .catch((e) => { .catch((e) => {
// messageError($q, e); messageError($q, e);
// }) })
// .finally(() => { .finally(() => {
// hideLoader(); hideLoader();
// }); });
}; };
// //
@ -208,15 +192,14 @@ const fecthTypeOption = async () => {
.get(config.API.typeOrder()) .get(config.API.typeOrder())
.then((res) => { .then((res) => {
optionsType.value = res.data.result.filter( optionsType.value = res.data.result.filter(
(e: OpType) => (e: OpType) => e.commandCode === "C-PM-05"
e.commandCode === "C-PM-05"
); );
type.value = optionsType.value[0].id;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}); });
}; };
// //
const openModalTree = (id: string) => { const openModalTree = (id: string) => {
personalId.value = id; personalId.value = id;
@ -227,12 +210,11 @@ const openModalTree = (id: string) => {
const clickDelete = (id: string) => { const clickDelete = (id: string) => {
dialogRemove($q, () => deleteAppoint(id)); dialogRemove($q, () => deleteAppoint(id));
}; };
// //
const deleteAppoint = async (id: string) => { const deleteAppoint = async (id: string) => {
showLoader(); showLoader();
await http await http
.delete(config.API.appointmentDelete(id)) .delete(config.API.appointEmployeeByid(id))
.then(() => { .then(() => {
success($q, "ลบข้อมูลสำเร็จ"); success($q, "ลบข้อมูลสำเร็จ");
}) })
@ -244,7 +226,6 @@ const deleteAppoint = async (id: string) => {
hideLoader(); hideLoader();
}); });
}; };
// modal // modal
const closeModalTree = async () => { const closeModalTree = async () => {
await fecthlistappointment(); await fecthlistappointment();
@ -257,10 +238,22 @@ const nextPage = (id: string) => {
path: `appoint-promote/detail/${id}`, path: `appoint-promote/detail/${id}`,
}); });
}; };
// input
onMounted(() => { const resetFilter = () => {
fecthlistappointment(); filterKeyword.value = "";
}); filterKeyword2.value = "";
filterRef.value.focus();
};
// modal
const clickClose = () => {
modal.value = false;
};
// modal
const popup = () => {
modal.value = true;
filterKeyword2.value = "";
fecthTypeOption();
};
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
@ -271,27 +264,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">
@ -302,19 +333,38 @@ 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">
{{ {{
@ -322,20 +372,20 @@ onMounted(() => {
}} }}
{{ {{
props.row.organizationShortName !== null props.row.organizationShortName !== null
? `(${props.row.organizationShortName})` ? `(${props.row.organizationShortName})`
: "" : ""
}} }}
</div> </div>
<div class="text-weight-light"> <div class="text-weight-light">
{{ {{
props.row.positionPath !== null props.row.positionPath !== null
? props.row.positionPath ? props.row.positionPath
: "-" : "-"
}} }}
{{ {{
props.row.positionNumber !== null props.row.positionNumber !== null
? `(${props.row.positionNumber})` ? `(${props.row.positionNumber})`
: "" : ""
}} }}
</div> </div>
</div> </div>
@ -346,29 +396,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>
@ -386,9 +480,21 @@ onMounted(() => {
</div> </div>
</q-card> </q-card>
<Dialogbody v-model:Modal="modal" :clickClose="clickClose" :optionsType="optionsType" :rows2="rows2" <Dialogbody
v-model:filterKeyword2="filterKeyword2" v-model:type="type" :nextPage="nextPage" v-model:Modal="modal"
:fecthlistappointment="fecthlistappointment" /> :clickClose="clickClose"
<DialogOrgTree v-model:modal="modalTree" :close="closeModalTree" :personal="personal" :personalId="personalId" /> :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> </template>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

View file

@ -59,9 +59,7 @@ const fetchPublishFile = async () => {
hideLoader(); hideLoader();
}); });
}; };
// json // json
const loadTreeData = async () => { const loadTreeData = async () => {
expanded.value = []; expanded.value = [];
await http await http
@ -69,7 +67,6 @@ const loadTreeData = async () => {
.then((res: any) => { .then((res: any) => {
treeData.value = res.data; treeData.value = res.data;
dataRespone.value = res.data; dataRespone.value = res.data;
// Filter objects with "name" null // Filter objects with "name" null
const filteredData = res.data.filter(filterByPersonIdNull); const filteredData = res.data.filter(filterByPersonIdNull);
treeData.value = filteredData; treeData.value = filteredData;
@ -81,7 +78,6 @@ const loadTreeData = async () => {
hideLoader(); hideLoader();
}); });
}; };
function filterByPersonIdNull(obj: any) { function filterByPersonIdNull(obj: any) {
if (obj.name === null && obj.isCondition != true) { if (obj.name === null && obj.isCondition != true) {
return true; return true;
@ -92,12 +88,10 @@ function filterByPersonIdNull(obj: any) {
} }
return false; return false;
} }
// position // position
const fetchplacementPosition = async () => { const fetchplacementPosition = async () => {
await http await http
.get(config.API.apppointmentPosition()) .get(config.API.apppointmentPositionUse())
.then((res: any) => { .then((res: any) => {
placementPosition.value = res.data.result; placementPosition.value = res.data.result;
}) })
@ -105,9 +99,6 @@ const fetchplacementPosition = async () => {
messageError($q, e); messageError($q, e);
}); });
}; };
const props = defineProps({ const props = defineProps({
personalId: String, personalId: String,
modal: Boolean, modal: Boolean,
@ -117,10 +108,8 @@ const props = defineProps({
}, },
personal: Object, personal: Object,
}); });
const myFilterMethod = (node: any, filter: string) => { const myFilterMethod = (node: any, filter: string) => {
const filt = filter; const filt = filter;
return ( return (
(node.name && node.name.indexOf(filt) > -1) || (node.name && node.name.indexOf(filt) > -1) ||
(node.organizationName && node.organizationName.indexOf(filt) > -1) || (node.organizationName && node.organizationName.indexOf(filt) > -1) ||
@ -138,7 +127,6 @@ const myFilterMethod = (node: any, filter: string) => {
(node.positionLevel && node.positionLevel.indexOf(filt) > -1) (node.positionLevel && node.positionLevel.indexOf(filt) > -1)
); );
}; };
const validateData = async () => { const validateData = async () => {
checkValidate.value = true; checkValidate.value = true;
await myFormPosition.value.validate().then((result: boolean) => { await myFormPosition.value.validate().then((result: boolean) => {
@ -147,7 +135,6 @@ const validateData = async () => {
} }
}); });
}; };
const saveAppoint = async () => { const saveAppoint = async () => {
myFormPosition.value.validate().then(async (result: boolean) => { myFormPosition.value.validate().then(async (result: boolean) => {
if (props.personalId !== undefined) { if (props.personalId !== undefined) {
@ -165,8 +152,8 @@ const saveAppoint = async () => {
}; };
showLoader(); showLoader();
await http await http
.put(config.API.appointmentPosition(id.value), dataAppoint) .put(config.API.appointEmployeePosition(id.value), dataAppoint)
.then((res) => { .then(() => {
success($q, "บันทึกสำเร็จ"); success($q, "บันทึกสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
@ -182,8 +169,6 @@ const saveAppoint = async () => {
} }
}); });
}; };
const closeModal = () => { const closeModal = () => {
if (editDataStatus.value == true) { if (editDataStatus.value == true) {
dialogConfirm( dialogConfirm(
@ -199,7 +184,6 @@ const closeModal = () => {
closeAndClear(); closeAndClear();
} }
}; };
const closeAndClear = async () => { const closeAndClear = async () => {
await props.close(); await props.close();
editDataStatus.value = false; editDataStatus.value = false;

View file

@ -114,9 +114,9 @@ const fecthAssign = async () => {
director_id3.value = res.data.data.mentors[0].name; director_id3.value = res.data.data.mentors[0].name;
} }
dateAutherise.value = res.data.data.chairman_dated; // dateAutherise.value = res.data.data.chairman_dated;
director1_dated.value = res.data.data.director1_dated; // director1_dated.value = res.data.data.director1_dated;
director2_dated.value = res.data.data.director2_dated; // director2_dated.value = res.data.data.director2_dated;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -165,7 +165,9 @@ const fetchEvaluate = async () => {
other_training_percent.value = data.develop_other_training_percent; other_training_percent.value = data.develop_other_training_percent;
develop_result.value = data.develop_result; develop_result.value = data.develop_result;
evaluate_result.value = data.evaluate_result; evaluate_result.value = data.evaluate_result;
dateAutherise.value = data.chairman_dated;
director1_dated.value = data.director1_dated;
director2_dated.value = data.director2_dated;
if ( if (
data.achievement_other_desc !== "" && data.achievement_other_desc !== "" &&
data.achievement_other_level !== null data.achievement_other_level !== null
@ -463,8 +465,9 @@ onMounted(async () => {
</div> </div>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" /> <q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
การทดลองปฎหนาทราชการ<span class="text-primary q-pr-sm">{{ การทดลองปฎหนาทราชการ<span class="text-primary q-pr-sm">{{
"ครั้งที่ " + assign.round_no "ครั้งที่ " + assign.round_no
}}</span> งแตนท }}</span>
งแตนท
<span class="text-black q-px-sm">{{ <span class="text-black q-px-sm">{{
date2Thai(assign.date_start) date2Thai(assign.date_start)
}}</span> }}</span>

View file

@ -1,5 +1,6 @@
interface OpType { interface OpType {
commandCode:string commandCode: string
id: string
} }
export type { export type {
OpType OpType