- add common dialog (remove, confirm & message notify) และลองใช้ในส่วนของออกคำสั่ง
- เพิ่ม action สร้างข้อมูลทุกอันที่ส่งจากทะเบียนประวัติ - fix bug call function in certificate
This commit is contained in:
parent
d09dbda153
commit
d163ac8e1c
9 changed files with 341 additions and 1422 deletions
|
|
@ -292,7 +292,7 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError } = mixin;
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
const certificateNo = ref<string>();
|
||||
|
|
|
|||
|
|
@ -6,17 +6,10 @@
|
|||
v-model:statusEdit="statusEdit"
|
||||
:profileType="profileType"
|
||||
/> -->
|
||||
<Information
|
||||
v-model:statusEdit="statusEdit"
|
||||
:fetchDataProfile="fetchData"
|
||||
/>
|
||||
<Information v-model:statusEdit="statusEdit" :fetchDataProfile="fetchData" />
|
||||
</div>
|
||||
<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 id="address" name="17" class="row col-12 q-mt-md">
|
||||
<Address v-model:statusEdit="statusEdit" />
|
||||
|
|
@ -40,20 +33,11 @@
|
|||
<CoinedVue v-model:statusEdit="statusEdit" :profileType="profileType" />
|
||||
</div>
|
||||
<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 id="position" name="7" class="row col-12 q-mt-md">
|
||||
<SalaryVue
|
||||
v-model:statusEdit="statusEdit"
|
||||
v-if="profileType === 'officer'"
|
||||
/>
|
||||
<SalaryEmployeeTempVue
|
||||
v-model:statusEdit="statusEdit"
|
||||
v-else-if="employeeClass === 'temp'"
|
||||
/>
|
||||
<SalaryVue 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 />
|
||||
</div>
|
||||
<div id="rule" name="8" class="row col-12 q-mt-md">
|
||||
|
|
@ -78,70 +62,29 @@
|
|||
<DocumentVue v-model:statusEdit="statusEdit" />
|
||||
</div>
|
||||
</div>
|
||||
<q-page-sticky
|
||||
position="top"
|
||||
expand
|
||||
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-page-sticky position="top" expand 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-avatar
|
||||
v-if="imageUrl == null"
|
||||
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-avatar v-if="imageUrl == null" 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-tooltip>อัปเดตรูปภาพ</q-tooltip>
|
||||
</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>
|
||||
</q-avatar>
|
||||
<q-avatar v-else size="65px" rounded class="containerimage">
|
||||
<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-tooltip>อัปเดตรูปภาพ</q-tooltip>
|
||||
</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>
|
||||
</q-avatar>
|
||||
<div class="row items-center text-dark q-ml-md">
|
||||
|
|
@ -157,25 +100,25 @@
|
|||
<q-btn round flat color="blue" icon="mdi-file-document">
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||
<q-list dense style="min-width: 160px">
|
||||
<q-item clickable v-close-popup @click="postAdd">
|
||||
<q-item clickable v-close-popup @click="helpPost">
|
||||
<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-item clickable v-close-popup @click="postAdd">
|
||||
<q-item clickable v-close-popup @click="repatriationPost">
|
||||
<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-item clickable v-close-popup @click="postAdd">
|
||||
<q-item clickable v-close-popup @click="appointPost">
|
||||
<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-item clickable v-close-popup @click="postAdd">
|
||||
<q-item clickable v-close-popup @click="relocationPost">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ย้าย</q-item-section>
|
||||
|
|
@ -187,25 +130,25 @@
|
|||
<q-item-section>ถึงแก่กรรม</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="postAdd">
|
||||
<q-item clickable v-close-popup @click="outPost">
|
||||
<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-item clickable v-close-popup @click="postAdd">
|
||||
<q-item clickable v-close-popup @click="dischargePost">
|
||||
<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-item clickable v-close-popup @click="postAdd">
|
||||
<q-item clickable v-close-popup @click="expulsionPost">
|
||||
<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-item clickable v-close-popup @click="postAdd">
|
||||
<q-item clickable v-close-popup @click="otherPost">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>อื่นๆ</q-item-section>
|
||||
|
|
@ -215,15 +158,8 @@
|
|||
</q-menu>
|
||||
</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>{{
|
||||
reasonStatus ? "การกลับเข้ารับราชการ" : "การออกจากราชการ"
|
||||
}}</q-tooltip>
|
||||
|
|
@ -237,9 +173,7 @@
|
|||
<q-item-section class="text-blue">ก.พ.7/ก.ก.1</q-item-section>
|
||||
</q-item>
|
||||
<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-list>
|
||||
</q-menu>
|
||||
|
|
@ -251,20 +185,8 @@
|
|||
<q-card style="width: 90vw; max-width: 80vw">
|
||||
<q-card-section class="row items-center q-pb-xs col-12">
|
||||
<q-space />
|
||||
<q-btn
|
||||
@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-btn @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 class="q-p-sm">
|
||||
<!-- <viewpdf
|
||||
|
|
@ -279,20 +201,9 @@
|
|||
<q-card style="width: 90vw; max-width: 80vw">
|
||||
<q-card-section class="row items-center q-pb-xs col-12">
|
||||
<q-space />
|
||||
<q-btn
|
||||
@click="downloadKP7Short()"
|
||||
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-btn @click="downloadKP7Short()" 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 class="q-p-sm">
|
||||
<!-- <viewpdf
|
||||
|
|
@ -309,50 +220,28 @@
|
|||
<q-card-section class="q-py-sm row">
|
||||
<div class="text-h6">เลือกรูปภาพ</div>
|
||||
<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-btn>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<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
|
||||
style="
|
||||
<div style="
|
||||
height: 160px;
|
||||
max-width: 15vw;
|
||||
display: flex !important;
|
||||
justify-content: 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" />
|
||||
<strong>อัปโหลดรูปภาพ</strong>
|
||||
</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)">
|
||||
<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
|
||||
class="absolute-top bg-transparent cursor-pointer text-right"
|
||||
style="padding: 5px"
|
||||
|
|
@ -366,21 +255,11 @@
|
|||
style="color: #ff8080"
|
||||
/>
|
||||
</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) }}
|
||||
|
||||
<q-btn
|
||||
v-if="!n.isActive"
|
||||
icon="delete"
|
||||
unelevated
|
||||
dense
|
||||
@click="deletePhoto(n.id)"
|
||||
class="bg-white"
|
||||
style="color: #ff8080"
|
||||
/>
|
||||
<q-btn v-if="!n.isActive" icon="delete" unelevated dense @click="deletePhoto(n.id)" class="bg-white"
|
||||
style="color: #ff8080" />
|
||||
</div>
|
||||
</q-img>
|
||||
</div>
|
||||
|
|
@ -398,14 +277,7 @@
|
|||
>
|
||||
<q-tooltip>ลบรูปภาพ</q-tooltip>
|
||||
</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-btn>
|
||||
</q-card-actions>
|
||||
|
|
@ -419,38 +291,18 @@
|
|||
<q-card-section class="q-py-sm row">
|
||||
<DialogHeader tittle="ถึงแก่กรรม" :close="closePassaway" />
|
||||
<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="แนบใบมรณบัตร"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
>
|
||||
<q-file class="col-12 col-sm-6 col-md-5" outlined dense v-model="filePassaway" label="แนบใบมรณบัตร"
|
||||
hide-bottom-space lazy-rules>
|
||||
<q-separator />
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
<q-input
|
||||
class="col-12 col-sm-6 col-md-7"
|
||||
dense
|
||||
outlined
|
||||
v-model="deathCertificateNo"
|
||||
label="เลขที่ใบมรณบัตร"
|
||||
/>
|
||||
<q-input 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'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<datepicker 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 }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
|
|
@ -458,63 +310,32 @@
|
|||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateDeath != null ? date2Thai(dateDeath) : null
|
||||
"
|
||||
:label="`${'วันที่เสียชีวิต'}`"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่เสียชีวิต'}`,
|
||||
]"
|
||||
>
|
||||
<q-input outlined dense class="full-width datepicker" :model-value="dateDeath != null ? date2Thai(dateDeath) : null
|
||||
" :label="`${'วันที่เสียชีวิต'}`" :rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่เสียชีวิต'}`,
|
||||
]">
|
||||
<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>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
|
||||
<q-input
|
||||
class="col-12 col-sm-6 col-md-7"
|
||||
dense
|
||||
outlined
|
||||
v-model="placeDeathCertificate"
|
||||
label="สถานที่ออกใบมรณบัตร"
|
||||
/>
|
||||
<q-input class="col-12 col-sm-6 col-md-7" dense outlined v-model="placeDeathCertificate"
|
||||
label="สถานที่ออกใบมรณบัตร" />
|
||||
<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>
|
||||
<q-space />
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<div class="flex justify-end q-pa-sm q-gutter-sm">
|
||||
<q-btn
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="clickSaveDeceased"
|
||||
:disable="
|
||||
filePassaway === null ||
|
||||
deathCertificateNo === '' ||
|
||||
placeDeathCertificate === '' ||
|
||||
reasonDeath === ''
|
||||
"
|
||||
>
|
||||
<q-btn unelevated label="บันทึก" color="public" @click="clickSaveDeceased" :disable="filePassaway === null ||
|
||||
deathCertificateNo === '' ||
|
||||
placeDeathCertificate === '' ||
|
||||
reasonDeath === ''
|
||||
">
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
|
@ -532,71 +353,34 @@
|
|||
<q-dialog v-model="dialogLeave" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-toolbar>
|
||||
<q-toolbar-title class="text-subtitle2 text-bold"
|
||||
>ประเภทการพ้นราชการ
|
||||
<q-toolbar-title class="text-subtitle2 text-bold">ประเภทการพ้นราชการ
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="closeLeave"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
<q-btn icon="close" unelevated round dense @click="closeLeave"
|
||||
style="color: #ff8080; background-color: #ffdede" />
|
||||
</q-toolbar>
|
||||
|
||||
<q-separator />
|
||||
<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">
|
||||
<q-select
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
outlined
|
||||
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"
|
||||
/>
|
||||
<q-select class="full-width inputgreen cursor-pointer" outlined 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 class="col-xs-6 col-sm-6 col-md-6">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="leaveDate"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<datepicker menu-class-name="modalfix" v-model="leaveDate" :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(leaveDate)"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่พ้นราชการ'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'วันที่พ้นราชการ'}`"
|
||||
>
|
||||
<q-input class="full-width inputgreen cursor-pointer" outlined dense lazy-rules
|
||||
:model-value="date2Thai(leaveDate)" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่พ้นราชการ'}`]"
|
||||
hide-bottom-space :label="`${'วันที่พ้นราชการ'}`">
|
||||
<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>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -604,64 +388,30 @@
|
|||
</datepicker>
|
||||
</div>
|
||||
<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="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณากรอกสาเหตุ/เหตุผลของการพ้นจากราชการ'}`,
|
||||
]"
|
||||
hide-bottom-space
|
||||
:label="`${'สาเหตุ/เหตุผลของการพ้นจากราชการ'}`"
|
||||
/>
|
||||
]" hide-bottom-space :label="`${'สาเหตุ/เหตุผลของการพ้นจากราชการ'}`" />
|
||||
</div>
|
||||
<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="leaveNumberOrder"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่ง/เอกสารอ้างอิง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'คำสั่ง/เอกสารอ้างอิง'}`"
|
||||
/>
|
||||
<q-input class="full-width inputgreen cursor-pointer" outlined dense lazy-rules autogrow
|
||||
v-model="leaveNumberOrder" :rules="[(val) => !!val || `${'กรุณากรอกคำสั่ง/เอกสารอ้างอิง'}`]"
|
||||
hide-bottom-space :label="`${'คำสั่ง/เอกสารอ้างอิง'}`" />
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="leaveDateOrder"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<datepicker menu-class-name="modalfix" v-model="leaveDateOrder" :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(leaveDateOrder)"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ออกคำสั่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'วันที่ออกคำสั่ง'}`"
|
||||
>
|
||||
<q-input class="full-width inputgreen cursor-pointer" outlined dense lazy-rules
|
||||
:model-value="date2Thai(leaveDateOrder)" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่ออกคำสั่ง'}`]"
|
||||
hide-bottom-space :label="`${'วันที่ออกคำสั่ง'}`">
|
||||
<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>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -672,13 +422,7 @@
|
|||
</q-card-section>
|
||||
<q-separator />
|
||||
<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-btn>
|
||||
</q-card-actions>
|
||||
|
|
@ -734,6 +478,7 @@ const {
|
|||
success,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
|
@ -892,7 +637,7 @@ const uploadImage = async (e: any) => {
|
|||
showLoader();
|
||||
await http
|
||||
.post(config.API.profileAvatarId(profileId.value), formData)
|
||||
.then((res) => {})
|
||||
.then((res) => { })
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
|
|
@ -1016,13 +761,97 @@ const closeKp7Short = () => {
|
|||
dialogShort.value = false;
|
||||
};
|
||||
|
||||
const postAdd = () => {
|
||||
// router.push("/dismiss-order/add");
|
||||
};
|
||||
const helpPost = () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("id", profileId.value);
|
||||
await http.post(config.API.placemenHelpGov, formData);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const downloadKP7 = () => {};
|
||||
const repatriationPost = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("id", profileId.value);
|
||||
await http.post(config.API.placemenRepatriation, formData);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const downloadKP7Short = () => {};
|
||||
const appointPost = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("id", profileId.value);
|
||||
await http.post(config.API.placemenAppointment, formData);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const relocationPost = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("id", profileId.value);
|
||||
await http.post(config.API.placemenRelocation, formData);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const outPost = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("id", profileId.value);
|
||||
await http.post(config.API.retirementOut, formData);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const dischargePost = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("id", profileId.value);
|
||||
await http.post(config.API.retirementDischarge, formData);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const expulsionPost = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("id", profileId.value);
|
||||
await http.post(config.API.retirementExpulsion, formData);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const otherPost = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("id", profileId.value);
|
||||
await http.post(config.API.placemenOther, formData);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const downloadKP7 = () => { };
|
||||
|
||||
const downloadKP7Short = () => { };
|
||||
|
||||
const clickKp7 = async () => {
|
||||
window.open(config.API.profileReportId(profileId.value));
|
||||
|
|
@ -1271,12 +1100,12 @@ const clickSaveDeceased = async () => {
|
|||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(()=>{
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
})
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
.onCancel(() => { })
|
||||
.onDismiss(() => { });
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -1,741 +0,0 @@
|
|||
div
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-py-md q-pl-md" style="height: 68vh; overflow-y: scroll">
|
||||
<div class="col-12 row q-pb-sm items-center">
|
||||
<q-btn flat round color="primary" @click="refresh" icon="mdi-plus">
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<div class="items-center" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
v-model="filter"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<d-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
>
|
||||
<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-th auto-width />
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="selectModal(props.row)"
|
||||
>{{ col.name == "no" ? props.rowIndex + 1 : col.value }}</q-td
|
||||
>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:color="props.rowIndex + 1 == 1 ? 'grey' : 'green'"
|
||||
:disable="props.rowIndex + 1 == 1"
|
||||
@click="upDown(props)"
|
||||
icon="mdi-arrow-up-bold"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับขึ้น</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:color="rows.length == props.rowIndex + 1 ? 'grey' : 'red'"
|
||||
:disable="rows.length == props.rowIndex + 1"
|
||||
@click="upDown(props, false)"
|
||||
icon="mdi-arrow-down-bold"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับลง</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="dialogDeleteData(props.row.personalId)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="flex justify-end q-pa-sm q-gutter-sm">
|
||||
<q-btn
|
||||
dense
|
||||
outline
|
||||
color="primary"
|
||||
icon="chevron_left"
|
||||
@click="previous"
|
||||
class="q-pr-md"
|
||||
label="กรอกรายละเอียด"
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="save"
|
||||
class="q-px-md"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
</q-btn>
|
||||
<!-- <q-btn dense flat round color="primary" icon="chevron_right" @click="next">
|
||||
<q-tooltip>ต่อไป</q-tooltip>
|
||||
</q-btn> -->
|
||||
</div>
|
||||
</div>
|
||||
<!--********************************** เงินเดือน ********************************** -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 50vw; max-width: 50vw">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :tittle="titleName" :close="modalOpenClose" />
|
||||
<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">
|
||||
<div class="col-12 row q-py-sm items-center q-col-gutter-sm">
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="modalData.salaryAmount"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="modalData.positionSalaryAmount"
|
||||
:label="`${'เงินประจำตำแหน่ง'}`"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<!-- :rules="[
|
||||
(val) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`,
|
||||
]" -->
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="modalData.mouthSalaryAmount"
|
||||
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<!-- :rules="[
|
||||
(val) => !!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`,
|
||||
]" -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="saveModal"
|
||||
class="q-px-md"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<!--********************************** รายชื่อ ********************************** -->
|
||||
<q-dialog v-model="modalAdd" persistent>
|
||||
<q-card style="width: 50vw; max-width: 50vw">
|
||||
<q-form ref="myFormAdd">
|
||||
<DialogHeader tittle="รายชื่อในการออกคำสั่ง" :close="modalAddChange" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-sm bg-grey-1">
|
||||
<d-table
|
||||
:rows="rows2"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>{{ col.name == "no" ? props.rowIndex + 1 : col.value }}</q-td
|
||||
>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="saveModalAdd"
|
||||
class="q-px-md"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { QInput } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Order";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const props = defineProps({
|
||||
next: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
previous: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
|
||||
const next = () => props.next();
|
||||
const previous = () => props.previous();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dialogMessage, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
|
||||
const modalData = ref<any>({
|
||||
salaryAmount: 0,
|
||||
positionSalaryAmount: 0,
|
||||
mouthSalaryAmount: 0,
|
||||
});
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const myFormAdd = ref<QForm | null>(null);
|
||||
const modal = ref<boolean>(false);
|
||||
const modalAdd = ref<boolean>(false);
|
||||
const titleName = ref<string>("");
|
||||
const filterRef = ref<QInput>();
|
||||
const filter = ref<string>("");
|
||||
const visibleColumns = ref<String[]>(["no", "idCard", "name", "education"]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
field: "no",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "idCard",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
field: "idCard",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
field: "name",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "education",
|
||||
align: "left",
|
||||
label: "วุฒิการศึกษาในการออกคำสั่ง",
|
||||
field: "education",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const rows = ref<ResponseData[]>([]);
|
||||
const rows2 = ref<ResponseData[]>([]);
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
await conditionData();
|
||||
});
|
||||
|
||||
const conditionData = async () => {
|
||||
const id = route.params.orderid
|
||||
? route.params.orderid.toString()
|
||||
: localStorage.getItem("orderId")
|
||||
? localStorage.getItem("orderId")
|
||||
: null;
|
||||
if (id !== null) {
|
||||
await getData(id);
|
||||
}
|
||||
};
|
||||
|
||||
const getData = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.personsselectedOrder(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list: ResponseData[] = [];
|
||||
data.map((r: ResponseData) => {
|
||||
list.push({
|
||||
education: r.education ?? "",
|
||||
idCard: r.idCard ?? "",
|
||||
name: r.name ?? "",
|
||||
personalId: r.personalId ?? "",
|
||||
selectStatus: r.selectStatus !== null ? r.selectStatus : false,
|
||||
sequence: r.sequence !== null ? r.sequence : 0,
|
||||
refRecordId: r.refRecordId,
|
||||
});
|
||||
});
|
||||
// console.log("list", list);
|
||||
rows.value = list;
|
||||
selected.value = rows.value;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// const saveSalary = async (id: string) => {
|
||||
// await http
|
||||
// .put(config.API.salaryOrder(id))
|
||||
// .then((res) => {
|
||||
// // const data = res.data.result;
|
||||
// // console.log(res);
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
|
||||
const dialogDeleteData = async (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ยืนยันการลบข้อมูล",
|
||||
"ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
"mdi-help-circle-outline",
|
||||
"ตกลง",
|
||||
"red",
|
||||
() => deleteData(id),
|
||||
undefined
|
||||
);
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.personsOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await conditionData();
|
||||
});
|
||||
};
|
||||
|
||||
const swapUp = async (id: string) => {
|
||||
// id = personalId
|
||||
await http
|
||||
.put(config.API.swapUpOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await conditionData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const swapDown = async (id: string) => {
|
||||
// id = personalId
|
||||
await http
|
||||
.put(config.API.swapDownOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await conditionData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const upDown = async (value: any, up: boolean = true) => {
|
||||
const indexCurrent = value.rowIndex;
|
||||
if (up) {
|
||||
await swapUp(value.row.personalId);
|
||||
// rows.value[indexCurrent] = rows.value[indexCurrent - 1];
|
||||
// rows.value[indexCurrent - 1] = value.row;
|
||||
} else {
|
||||
await swapDown(value.row.personalId);
|
||||
// rows.value[indexCurrent] = rows.value[indexCurrent + 1];
|
||||
// rows.value[indexCurrent + 1] = value.row;
|
||||
}
|
||||
};
|
||||
|
||||
const saveModal = () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
putSalary(modalData.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const personalId = ref<string>("");
|
||||
const selectModal = (e: any) => {
|
||||
console.log(e);
|
||||
titleName.value = e.name;
|
||||
personalId.value = e.personalId;
|
||||
// modalData.value = {
|
||||
// salaryAmount: 0,
|
||||
// positionSalaryAmount: 0,
|
||||
// mouthSalaryAmount: 0,
|
||||
// };
|
||||
|
||||
modalOpenClose(e.personalId);
|
||||
};
|
||||
|
||||
const modalOpenClose = async (personalId: string) => {
|
||||
modal.value = !modal.value;
|
||||
if (!modal.value) {
|
||||
titleName.value = "";
|
||||
}
|
||||
if (modal.value == true) {
|
||||
await fetchSalary(personalId);
|
||||
}
|
||||
};
|
||||
const fetchSalary = async (personalId: string) => {
|
||||
console.log(personalId);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.salaryOrder(personalId))
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
let salary = res.data.result;
|
||||
modalData.value = {
|
||||
salaryAmount: salary.salaryAmount,
|
||||
positionSalaryAmount: salary.positionSalaryAmount,
|
||||
mouthSalaryAmount: salary.monthSalaryAmount,
|
||||
};
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const putSalary = async (salary: any) => {
|
||||
modalData.value = {
|
||||
salaryAmount: Number(salary.salaryAmount),
|
||||
positionSalaryAmount: Number(salary.positionSalaryAmount),
|
||||
monthSalaryAmount: Number(salary.mouthSalaryAmount),
|
||||
};
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
await http
|
||||
.put(config.API.salaryOrder(personalId.value), modalData.value)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await conditionData();
|
||||
modal.value = false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const modalAddChange = async () => {
|
||||
modalAdd.value = !modalAdd.value;
|
||||
if (modalAdd.value == true) {
|
||||
const id = route.params.orderid
|
||||
? route.params.orderid.toString()
|
||||
: localStorage.getItem("orderId")
|
||||
? localStorage.getItem("orderId")
|
||||
: null;
|
||||
if (id !== null) {
|
||||
await fetchaddlist(id);
|
||||
}
|
||||
} else await conditionData();
|
||||
};
|
||||
const fetchaddlist = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.personsOrder(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list = [];
|
||||
list = data.map((r: ResponseData) => ({
|
||||
education: r.education ?? "",
|
||||
idCard: r.idCard ?? "",
|
||||
name: r.name ?? "",
|
||||
personalId: r.personalId ?? "",
|
||||
selectStatus: r.selectStatus !== null ? r.selectStatus : false,
|
||||
sequence: r.sequence !== null ? r.sequence : 0,
|
||||
refRecordId: r.refRecordId,
|
||||
}));
|
||||
rows2.value = list;
|
||||
selected.value = rows.value;
|
||||
// rows2.value = list.filter((e: any) => e.selectStatus === false);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const saveModalAdd = () => {
|
||||
if (myFormAdd.value !== null) {
|
||||
myFormAdd.value.validate().then(async (result: boolean) => {
|
||||
if (result && selected.value.length !== 0) {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการเพิ่มรายชื่อออกคำสั่ง",
|
||||
message: "ต้องการยืนยันการเพิ่มรายชื่อออกคำสั่งนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let data = [];
|
||||
data.push(...selected.value.map((e: any) => e.refRecordId));
|
||||
// console.log(data);
|
||||
addlist(data);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const addlist = async (data: Object) => {
|
||||
const id = route.params.orderid
|
||||
? route.params.orderid.toString()
|
||||
: localStorage.getItem("orderId")
|
||||
? localStorage.getItem("orderId")
|
||||
: null;
|
||||
if (id !== null) {
|
||||
await http
|
||||
.post(config.API.personsOrder(id), data)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
modalAddChange();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const click = (e: any) => {
|
||||
console.log(e);
|
||||
console.log(rows.value.length);
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (selected.value.length > 0) {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
next();
|
||||
});
|
||||
} else {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ข้อความแจ้งเตือน",
|
||||
"กรุณาเลือกรายชื่อ",
|
||||
"warning",
|
||||
undefined,
|
||||
"orange",
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const selectData = (row: any) => {};
|
||||
|
||||
const refresh = async () => {
|
||||
// await conditionData();
|
||||
modalAddChange();
|
||||
selected.value = [];
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
filter.value = "";
|
||||
filterRef.value!.focus();
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
|
|
@ -125,7 +125,7 @@ import config from "@/app.config";
|
|||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai, dateText, success, dialogMessage } =
|
||||
const { showLoader, hideLoader, messageError, date2Thai, dateText, success, dialogRemove } =
|
||||
mixin;
|
||||
const DataStore = useOrderPlacementDataStore();
|
||||
|
||||
|
|
@ -314,15 +314,9 @@ const redirectToPage = (id?: string, status?: string) => {
|
|||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
dialogMessage(
|
||||
dialogRemove(
|
||||
$q,
|
||||
"ยืนยันการลบข้อมูล",
|
||||
"ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
"mdi-delete",
|
||||
"ตกลง",
|
||||
"red",
|
||||
() => deleteData(id),
|
||||
undefined
|
||||
);
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,24 +3,10 @@
|
|||
<q-form ref="myForm" class="q-pa-md">
|
||||
<div class="row col-12 q-col-gutter-x-lg q-col-gutter-y-md">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="typeOrder"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกประเภทคำสั่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ประเภทคำสั่ง'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="typeOrderOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="typeOrder"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกประเภทคำสั่ง'}`]" hide-bottom-space
|
||||
:label="`${'ประเภทคำสั่ง'}`" @update:modelValue="clickEditRow" emit-value map-options option-label="name"
|
||||
:options="typeOrderOption" option-value="id" use-input input-debounce="0" />
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'typeOrderOption'
|
||||
) " -->
|
||||
|
|
@ -29,73 +15,36 @@
|
|||
<div class="col-xs-12 col-md-6">
|
||||
<!-- :readonly="!edit"
|
||||
:borderless="!edit" -->
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="nameOrder"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเรื่อง'}`]"
|
||||
:label="`${'คำสั่งเรื่อง'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<q-input :class="getClass(true)" outlined dense lazy-rules v-model="nameOrder"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเรื่อง'}`]" :label="`${'คำสั่งเรื่อง'}`"
|
||||
@update:modelValue="clickEditRow" hide-bottom-space />
|
||||
</div>
|
||||
|
||||
<div class="row col-xs-7 col-md-3 q-col-gutter-x-xs">
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="command"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่ง'}`]"
|
||||
:label="`${'คำสั่ง'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
type="number"
|
||||
/>
|
||||
<q-input :class="getClass(true)" outlined dense lazy-rules v-model="command"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่ง'}`]" :label="`${'คำสั่ง'}`" @update:modelValue="clickEditRow"
|
||||
hide-bottom-space type="number" />
|
||||
</div>
|
||||
<label class="col-1 flex justify-center items-center text-bold"
|
||||
>/</label
|
||||
>
|
||||
<label class="col-1 flex justify-center items-center text-bold">/</label>
|
||||
<div class="col-5">
|
||||
<datepicker
|
||||
v-model="dateYear"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:modelValue="clickEditRow"
|
||||
>
|
||||
<datepicker v-model="dateYear" :locale="'th'" autoApply year-picker :enableTimePicker="false"
|
||||
@update:modelValue="clickEditRow">
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:model-value="dateYear + 543"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
|
||||
:label="`${'พ.ศ.'}`"
|
||||
dense
|
||||
outlined
|
||||
>
|
||||
<q-input :model-value="dateYear + 543" :rules="[(val) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
|
||||
:label="`${'พ.ศ.'}`" dense outlined>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-5 col-md-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateCommand"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<datepicker menu-class-name="modalfix" v-model="dateCommand" :locale="'th'" autoApply borderless
|
||||
:enableTimePicker="false" week-start="0">
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
|
|
@ -103,24 +52,12 @@
|
|||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateCommand != null ? date2Thai(dateCommand) : null
|
||||
"
|
||||
:label="`${'วันที่มีผลออกคำสั่ง'}`"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่มีผลออกคำสั่ง'}`,
|
||||
]"
|
||||
>
|
||||
<q-input outlined dense class="full-width datepicker" :model-value="dateCommand != null ? date2Thai(dateCommand) : null
|
||||
" :label="`${'วันที่มีผลออกคำสั่ง'}`" :rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่มีผลออกคำสั่ง'}`,
|
||||
]">
|
||||
<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>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -129,24 +66,10 @@
|
|||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="byOrder"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกคำสั่งโดย'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'คำสั่งโดย'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="byOrderOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="byOrder"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกคำสั่งโดย'}`]" hide-bottom-space :label="`${'คำสั่งโดย'}`"
|
||||
@update:modelValue="clickEditRow" emit-value map-options option-label="name" :options="byOrderOption"
|
||||
option-value="id" use-input input-debounce="0" />
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'byOrderOption'
|
||||
) " -->
|
||||
|
|
@ -154,55 +77,25 @@
|
|||
<div class="col-xs-12 col-md-6">
|
||||
<!-- :readonly="!edit"
|
||||
:borderless="!edit" -->
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="nameCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกผู้มีอำนาจลงนาม'}`]"
|
||||
:label="`${'ผู้มีอำนาจลงนาม'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<q-input :class="getClass(true)" outlined dense lazy-rules v-model="nameCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกผู้มีอำนาจลงนาม'}`]" :label="`${'ผู้มีอำนาจลงนาม'}`"
|
||||
@update:modelValue="clickEditRow" hide-bottom-space />
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<!-- :readonly="!edit"
|
||||
:borderless="!edit" -->
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="positionCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งผู้มีอำนาจลงนาม'}`]"
|
||||
:label="`${'ตำแหน่งผู้มีอำนาจลงนาม'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<q-input :class="getClass(true)" outlined dense lazy-rules v-model="positionCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งผู้มีอำนาจลงนาม'}`]" :label="`${'ตำแหน่งผู้มีอำนาจลงนาม'}`"
|
||||
@update:modelValue="clickEditRow" hide-bottom-space />
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-separator />
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="examRound"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกรอบการสอบ'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'รอบการสอบ'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="examRoundName"
|
||||
:options="examRoundOption"
|
||||
option-value="examRoundValue"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="examRound"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกรอบการสอบ'}`]" hide-bottom-space :label="`${'รอบการสอบ'}`"
|
||||
@update:modelValue="clickEditRow" emit-value map-options option-label="examRoundName"
|
||||
:options="examRoundOption" option-value="examRoundValue" use-input input-debounce="0" />
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'testOption'
|
||||
) " -->
|
||||
|
|
@ -216,39 +109,18 @@
|
|||
filterSelector(inputValue, doneFn,'positionOption' ) " -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="register"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกมติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="registerOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="register"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกมติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)'}`]" hide-bottom-space
|
||||
:label="`${'มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)'}`" @update:modelValue="clickEditRow" emit-value
|
||||
map-options option-label="name" :options="registerOption" option-value="id" use-input input-debounce="0" />
|
||||
</div>
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'registerOption'
|
||||
) " -->
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateRegister"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<datepicker menu-class-name="modalfix" v-model="dateRegister" :locale="'th'" autoApply borderless
|
||||
:enableTimePicker="false" week-start="0">
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
|
|
@ -256,25 +128,13 @@
|
|||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateRegister != null ? date2Thai(dateRegister) : null
|
||||
"
|
||||
:label="`${'ลงวันที่ (เรื่อง รับสมัครสอบฯ)'}`"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกลงวันที่ (เรื่อง รับสมัครสอบฯ)'}`,
|
||||
]"
|
||||
>
|
||||
<q-input outlined dense class="full-width datepicker" :model-value="dateRegister != null ? date2Thai(dateRegister) : null
|
||||
" :label="`${'ลงวันที่ (เรื่อง รับสมัครสอบฯ)'}`" :rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกลงวันที่ (เรื่อง รับสมัครสอบฯ)'}`,
|
||||
]">
|
||||
<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>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -282,38 +142,18 @@
|
|||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="announce"
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="announce"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกมติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="announceOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
hide-bottom-space :label="`${'มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)'}`" @update:modelValue="clickEditRow"
|
||||
emit-value map-options option-label="name" :options="announceOption" option-value="id" use-input
|
||||
input-debounce="0" />
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'announceOption'
|
||||
) " -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnounce"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<datepicker menu-class-name="modalfix" v-model="dateAnnounce" :locale="'th'" autoApply borderless
|
||||
:enableTimePicker="false" week-start="0">
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
|
|
@ -321,25 +161,13 @@
|
|||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateAnnounce != null ? date2Thai(dateAnnounce) : null
|
||||
"
|
||||
:label="`${'ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)'}`"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกลงวันที่ (เรื่อง ผลการสอบแข่งขัน)'}`,
|
||||
]"
|
||||
>
|
||||
<q-input outlined dense class="full-width datepicker" :model-value="dateAnnounce != null ? date2Thai(dateAnnounce) : null
|
||||
" :label="`${'ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)'}`" :rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกลงวันที่ (เรื่อง ผลการสอบแข่งขัน)'}`,
|
||||
]">
|
||||
<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>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -382,7 +210,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
dialogMessage,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const route = useRoute();
|
||||
|
|
@ -576,9 +404,9 @@ const fecthExamRoundOption = async () => {
|
|||
.get(config.API.examroundOrder())
|
||||
.then((res) => {
|
||||
examRoundOption.value = res.data.result;
|
||||
console.log(examRoundOption.value);
|
||||
// console.log(examRoundOption.value);
|
||||
})
|
||||
.catch((e) => {});
|
||||
.catch((e) => { });
|
||||
};
|
||||
const submit = async () => {
|
||||
const formdata = {
|
||||
|
|
@ -599,13 +427,8 @@ const submit = async () => {
|
|||
};
|
||||
await myForm.value!.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
"info",
|
||||
"ตกลง",
|
||||
"public",
|
||||
() => {
|
||||
if (!orderId) {
|
||||
createListOrder(formdata);
|
||||
|
|
@ -614,13 +437,12 @@ const submit = async () => {
|
|||
updateOrder(formdata, orderIdString);
|
||||
}
|
||||
},
|
||||
undefined
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
const createListOrder = async (formData: Object) => {
|
||||
// console.log(formData);
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.createOrder(), formData)
|
||||
.then((res) => {
|
||||
|
|
@ -639,7 +461,7 @@ const createListOrder = async (formData: Object) => {
|
|||
};
|
||||
|
||||
const updateOrder = async (formData: Object, orderId: string) => {
|
||||
// console.log(formData);
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.detailOrder(orderId), formData)
|
||||
.then((res) => {
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ const props = defineProps({
|
|||
const next = () => props.next();
|
||||
const previous = () => props.previous();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dialogMessage, messageError, showLoader, hideLoader, success } = mixin;
|
||||
const { dialogMessageNotify, dialogConfirm, dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
|
|
@ -306,15 +306,9 @@ const getData = async (id: string) => {
|
|||
// };
|
||||
|
||||
const dialogDeleteData = async (id: string) => {
|
||||
dialogMessage(
|
||||
dialogRemove(
|
||||
$q,
|
||||
"ยืนยันการลบข้อมูล",
|
||||
"ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
"mdi-delete",
|
||||
"ตกลง",
|
||||
"red",
|
||||
() => deleteData(id),
|
||||
undefined
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -442,14 +436,10 @@ const putSalary = async (salary: any) => {
|
|||
positionSalaryAmount: Number(salary.positionSalaryAmount),
|
||||
monthSalaryAmount: Number(salary.mouthSalaryAmount),
|
||||
};
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
"info",
|
||||
"ตกลง",
|
||||
"public",
|
||||
async () => {
|
||||
showLoader()
|
||||
await http
|
||||
.put(config.API.salaryOrder(personalId.value), modalData.value)
|
||||
.then((res: any) => {
|
||||
|
|
@ -463,9 +453,9 @@ const putSalary = async (salary: any) => {
|
|||
.finally(async () => {
|
||||
await conditionData();
|
||||
modal.value = false;
|
||||
hideLoader()
|
||||
});
|
||||
},
|
||||
undefined
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -514,20 +504,15 @@ const saveModalAdd = () => {
|
|||
if (myFormAdd.value !== null) {
|
||||
myFormAdd.value.validate().then(async (result: boolean) => {
|
||||
if (result && selected.value.length !== 0) {
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ยืนยันการเพิ่มรายชื่อออกคำสั่ง",
|
||||
"ต้องการยืนยันการเพิ่มรายชื่อออกคำสั่งนี้ใช่หรือไม่?",
|
||||
"info",
|
||||
"ตกลง",
|
||||
"public",
|
||||
() => {
|
||||
let data = [];
|
||||
data.push(...selected.value.map((e: any) => e.refRecordId));
|
||||
// console.log(data);
|
||||
addlist(data);
|
||||
},
|
||||
undefined
|
||||
"ยืนยันการเพิ่มรายชื่อออกคำสั่ง",
|
||||
"ต้องการยืนยันการเพิ่มรายชื่อออกคำสั่งนี้ใช่หรือไม่?",
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -563,31 +548,18 @@ const click = (e: any) => {
|
|||
|
||||
const save = () => {
|
||||
if (selected.value.length > 0) {
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
"info",
|
||||
"ตกลง",
|
||||
"public",
|
||||
() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
next();
|
||||
},
|
||||
undefined
|
||||
);
|
||||
|
||||
} else {
|
||||
dialogMessage(
|
||||
dialogMessageNotify(
|
||||
$q,
|
||||
"ข้อความแจ้งเตือน",
|
||||
"กรุณาเลือกรายชื่อ",
|
||||
"warning",
|
||||
undefined,
|
||||
"orange",
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ const previous = () => props.previous();
|
|||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dialogMessage, messageError, showLoader, hideLoader, success } = mixin;
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
|
|
@ -598,22 +598,7 @@ const getClass = (val: boolean) => {
|
|||
};
|
||||
|
||||
const clickClose = async () => {
|
||||
// if (editRow.value == true) {
|
||||
// dialogMessage(
|
||||
// $q,
|
||||
// "ข้อมูลมีการแก้ไข",
|
||||
// "ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?",
|
||||
// "mdi-help-circle-outline",
|
||||
// "ตกลง",
|
||||
// "orange",
|
||||
// () => (modal.value = false),
|
||||
// undefined
|
||||
// );
|
||||
// } else {
|
||||
modal.value = false;
|
||||
// next.value = false;
|
||||
// previous.value = false;
|
||||
// }
|
||||
};
|
||||
|
||||
const clickAdd = async () => {
|
||||
|
|
@ -628,15 +613,9 @@ const clickAdd = async () => {
|
|||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
dialogMessage(
|
||||
dialogRemove(
|
||||
$q,
|
||||
"ยืนยันการลบข้อมูล",
|
||||
"ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
"mdi-delete",
|
||||
"ตกลง",
|
||||
"red",
|
||||
() => deleteData(id),
|
||||
undefined
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, messageError, showLoader, hideLoader, dialogMessage } = mixin;
|
||||
const { date2Thai, messageError, showLoader, hideLoader, dialogConfirm } = mixin;
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
|
||||
|
|
@ -382,14 +382,8 @@ const save = () => {
|
|||
if (myForm.value !== null) {
|
||||
myForm.value!.validate().then((success: Boolean) => {
|
||||
if (success) {
|
||||
// yay, models are correct
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
"info",
|
||||
"ตกลง",
|
||||
"public",
|
||||
async () => {
|
||||
await putOrderData();
|
||||
await postfileOrder();
|
||||
|
|
@ -397,7 +391,6 @@ const save = () => {
|
|||
await fetchAttachment(orderId.value);
|
||||
await fecthstatusOrder(orderId.value);
|
||||
},
|
||||
undefined
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -431,13 +424,8 @@ const postfileTailer = async () => {
|
|||
await http.post(config.API.attachmentFileId(orderId.value), formData);
|
||||
};
|
||||
const clickExecute = async (id: string) => {
|
||||
dialogMessage(
|
||||
dialogConfirm(
|
||||
$q,
|
||||
"ยืนยันการออกคำสั่ง",
|
||||
"ต้องการยืนยันการออกคำสั่งนี้ใช่หรือไม่?",
|
||||
"info",
|
||||
"ตกลง",
|
||||
"public",
|
||||
async () => {
|
||||
await http
|
||||
.put(config.API.executeOrder(id))
|
||||
|
|
@ -448,7 +436,8 @@ const clickExecute = async (id: string) => {
|
|||
messageError($q, e);
|
||||
});
|
||||
},
|
||||
undefined
|
||||
"ยืนยันการออกคำสั่ง",
|
||||
"ต้องการยืนยันการออกคำสั่งนี้ใช่หรือไม่?",
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue