UI รายการข้าราชการฯที่ได้รับทุนการศึกษา

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-04-04 14:42:13 +07:00
parent db6d3440ed
commit 305c77e94a
2 changed files with 162 additions and 36 deletions

View file

@ -3,6 +3,13 @@ import { ref, reactive, onMounted } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import type {
DataOption,
DataPerson,
} from "@/modules/15_development/interface/index/Main";
import DialogGov from "@/modules/15_development/components/history/DialogGov.vue";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar(); const $q = useQuasar();
@ -11,37 +18,53 @@ const route = useRoute();
const { dialogConfirm, showLoader, hideLoader, date2Thai } = useCounterMixin(); const { dialogConfirm, showLoader, hideLoader, date2Thai } = useCounterMixin();
const title = ref<string>(route.params.id ? "แก้ไข" : "เพิ่ม"); const title = ref<string>(route.params.id ? "แก้ไข" : "เพิ่ม");
const modalDialogGov = ref<boolean>(false);
const budgetSourceOp = ref<any>(["แหล่งงบประมาณกทม", "แหล่งงบประมาณอื่นๆ"]); const budgetSourceOp = ref<DataOption[]>([
const scholarshipTypeOp = ref<any>([ { id: "1", name: "แหล่งงบประมาณกทม" },
{ id: "1", label: "การศึกษาในประเทศ" }, { id: "2", name: "แหล่งงบประมาณอื่นๆ" },
]);
const scholarshipTypeOp = ref<DataOption[]>([
{ id: "1", name: "การศึกษาในประเทศ" },
{ {
id: "2", id: "2",
label: name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)",
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)",
}, },
{ {
id: "3", id: "3",
label: name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)",
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)",
}, },
{ {
id: "4", id: "4",
label: name: "ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)",
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)",
}, },
]); ]);
const scholarshipTypeShortOp = ref<any>(["ทุน 1 (ก)(ข)(ค)", "ทุน 2 (ก)(ข)"]); const scholarshipTypeShortOp = ref<DataOption[]>([
{ id: "1", name: "ทุน 1 (ก)(ข)(ค)" },
{ id: "2", name: "ทุน 2 (ก)(ข)" },
]);
const isGov = ref<boolean>(false); const isGov = ref<boolean>(false);
const isGuarantor = ref<boolean>(false);
const isSelectGov = ref<boolean>(false);
const dataPerson = reactive({ const dataPerson = reactive({
id: "", id: "",
citizenId: "123xxxxxxxxxx", citizenId: "",
name: "นางสาวสาวิตรี ศรีสมัย", name: "",
position: "นักทรัพยากรบุคคล", position: "",
type: "ทั่วไป", type: "",
level: "ปฏิบัติงาน", level: "",
positionPath: "นักทรัพยากรบุคคล", positionSide: "",
org: "-",
});
const dataGuarantor = reactive({
id: "",
citizenId: "",
name: "",
position: "",
type: "",
level: "",
positionSide: "",
org: "-", org: "-",
}); });
const formData = reactive({ const formData = reactive({
@ -89,6 +112,35 @@ function changeTrainingDateStart() {
} }
} }
function onSelectGov(isGov: boolean) {
isSelectGov.value = isGov;
modalDialogGov.value = true;
}
function upDate(data: DataPerson) {
if (isSelectGov.value) {
dataPerson.id = data.id ? data.id : "-";
dataPerson.citizenId = data.citizenId ? data.citizenId : "-";
dataPerson.name = data.name ? data.name : "-";
dataPerson.position = data.position ? data.position : "-";
dataPerson.type = data.type ? data.type : "-";
dataPerson.level = data.level ? data.level : "-";
dataPerson.positionSide = data.positionSide ? data.positionSide : "-";
// dataPerson.org = data.
isGov.value = true;
} else {
dataGuarantor.id = data.id ? data.id : "-";
dataGuarantor.citizenId = data.citizenId ? data.citizenId : "-";
dataGuarantor.name = data.name ? data.name : "-";
dataGuarantor.position = data.position ? data.position : "-";
dataGuarantor.type = data.type ? data.type : "-";
dataGuarantor.level = data.level ? data.level : "-";
dataGuarantor.positionSide = data.positionSide ? data.positionSide : "-";
// dataGuarantor.org = data.
isGuarantor.value = true;
}
}
onMounted(() => { onMounted(() => {
isGov.value = route.params.id ? true : false; isGov.value = route.params.id ? true : false;
}); });
@ -112,7 +164,14 @@ onMounted(() => {
<q-card bordered tyle="border: 1px solid #d6dee1"> <q-card bordered tyle="border: 1px solid #d6dee1">
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md"> <div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
อมลราชการ อมลราชการ
<q-btn flat dense icon="add" color="primary" label="เลือกข้าราชการ"> <q-btn
flat
dense
icon="add"
color="primary"
label="เลือกข้าราชการ"
@click="onSelectGov(true)"
>
<q-tooltip>เพ</q-tooltip> <q-tooltip>เพ</q-tooltip>
</q-btn> </q-btn>
</div> </div>
@ -146,7 +205,7 @@ onMounted(() => {
</div> </div>
<div class="col-4 text-grey">ตำแหนงทางการบรหาร</div> <div class="col-4 text-grey">ตำแหนงทางการบรหาร</div>
<div class="col-8 text-weight-medium"> <div class="col-8 text-weight-medium">
{{ dataPerson.positionPath }} {{ dataPerson.positionSide }}
</div> </div>
<div class="col-4 text-grey">หนวยงานทงก</div> <div class="col-4 text-grey">หนวยงานทงก</div>
<div class="col-8 text-weight-medium">{{ dataPerson.org }}</div> <div class="col-8 text-weight-medium">{{ dataPerson.org }}</div>
@ -178,6 +237,7 @@ onMounted(() => {
<q-input <q-input
dense dense
outlined outlined
class="inputgreen"
:model-value=" :model-value="
formData.year ? Number(formData.year) + 543 : null formData.year ? Number(formData.year) + 543 : null
" "
@ -203,10 +263,15 @@ onMounted(() => {
<q-select <q-select
dense dense
outlined outlined
class="inputgreen"
label="แหล่งงบประมาณ" label="แหล่งงบประมาณ"
hide-bottom-space hide-bottom-space
v-model="formData.budgetSource" v-model="formData.budgetSource"
:options="budgetSourceOp" :options="budgetSourceOp"
option-label="name"
option-value="id"
emit-value
map-options
:rules="[ :rules="[
(val:string) => (val:string) =>
!!val || `${'กรุณาเลือกแหล่งงบประมาณ'}`, !!val || `${'กรุณาเลือกแหล่งงบประมาณ'}`,
@ -218,6 +283,7 @@ onMounted(() => {
dense dense
outlined outlined
hide-bottom-space hide-bottom-space
class="inputgreen"
v-model="formData.approveBudget" v-model="formData.approveBudget"
label="งบประมาณที่ได้รับอนุมัติตลอดหลักสูตร" label="งบประมาณที่ได้รับอนุมัติตลอดหลักสูตร"
mask="###,###,###,###,###,###" mask="###,###,###,###,###,###"
@ -232,6 +298,7 @@ onMounted(() => {
<q-input <q-input
dense dense
outlined outlined
class="inputgreen"
v-model="formData.approveNumber" v-model="formData.approveNumber"
label="เลขที่หนังสิออนุมัติ" label="เลขที่หนังสิออนุมัติ"
mask="#" mask="#"
@ -259,6 +326,7 @@ onMounted(() => {
<q-input <q-input
dense dense
outlined outlined
class="inputgreen"
:model-value="formData.date ? date2Thai(formData.date) : null" :model-value="formData.date ? date2Thai(formData.date) : null"
:label="`${'ลงวันที่'}`" :label="`${'ลงวันที่'}`"
hide-bottom-space hide-bottom-space
@ -295,6 +363,7 @@ onMounted(() => {
<q-input <q-input
dense dense
outlined outlined
class="inputgreen"
:model-value=" :model-value="
formData.approveDate ? date2Thai(formData.approveDate) : null formData.approveDate ? date2Thai(formData.approveDate) : null
" "
@ -329,6 +398,7 @@ onMounted(() => {
<q-input <q-input
outlined outlined
dense dense
class="inputgreen"
v-model="formData.detail" v-model="formData.detail"
label="เปลี่ยนแปลงรายละเอียด" label="เปลี่ยนแปลงรายละเอียด"
rows="3" rows="3"
@ -348,21 +418,17 @@ onMounted(() => {
lazy-rules lazy-rules
v-model="formData.scholarshipType" v-model="formData.scholarshipType"
:options="scholarshipTypeOp" :options="scholarshipTypeOp"
option-label="label" option-label="name"
option-value="id" option-value="id"
emit-value emit-value
map-options map-options
input-class="text-red" class="inputgreen"
label="เลือกประเภททุน" label="เลือกประเภททุน"
:rules="[ :rules="[
(val:string) => (val:string) =>
!!val || `${'กรุณาเลือกประเภททุน'}`, !!val || `${'กรุณาเลือกประเภททุน'}`,
]" ]"
> />
<template v-slot:selected-item="scope">
<div class="text-primary">{{ scope.opt.label }}</div>
</template>
</q-select>
</div> </div>
<div <div
class="col-3" class="col-3"
@ -375,20 +441,19 @@ onMounted(() => {
outlined outlined
hide-bottom-space hide-bottom-space
lazy-rules lazy-rules
class="inputgreen"
v-model="formData.scholarshipTypeShort" v-model="formData.scholarshipTypeShort"
:options="scholarshipTypeShortOp" :options="scholarshipTypeShortOp"
option-label="name"
option-value="id"
emit-value
map-options
label="ประเภททุน" label="ประเภททุน"
:rules="[ :rules="[
(val:string) => (val:string) =>
!!val || `${'กรุณาเลือกประเภททุน'}`, !!val || `${'กรุณาเลือกประเภททุน'}`,
]" ]"
> />
<template v-slot:selected>
<div class="text-primary">
{{ formData.scholarshipTypeShort }}
</div>
</template>
</q-select>
</div> </div>
<div <div
class="col-12" class="col-12"
@ -406,6 +471,7 @@ onMounted(() => {
reverse-fill-mask reverse-fill-mask
label="เลขที่สัญญา" label="เลขที่สัญญา"
mask="#" mask="#"
class="inputgreen"
v-model="formData.contractNumber" v-model="formData.contractNumber"
:rules="[ :rules="[
(val:string) => (val:string) =>
@ -428,6 +494,7 @@ onMounted(() => {
<q-input <q-input
dense dense
outlined outlined
class="inputgreen"
:model-value=" :model-value="
formData.contractDate formData.contractDate
? date2Thai(formData.contractDate) ? date2Thai(formData.contractDate)
@ -459,6 +526,7 @@ onMounted(() => {
hide-bottom-space hide-bottom-space
reverse-fill-mask reverse-fill-mask
lazy-rules lazy-rules
class="inputgreen"
v-model="formData.reportNumber" v-model="formData.reportNumber"
mask="#" mask="#"
label="เลขที่หนังสือรายงานตัวกลับ" label="เลขที่หนังสือรายงานตัวกลับ"
@ -483,6 +551,7 @@ onMounted(() => {
<q-input <q-input
dense dense
outlined outlined
class="inputgreen"
:model-value=" :model-value="
formData.reportDate formData.reportDate
? date2Thai(formData.reportDate) ? date2Thai(formData.reportDate)
@ -523,12 +592,13 @@ onMounted(() => {
<q-input <q-input
dense dense
outlined outlined
class="inputgreen"
:model-value=" :model-value="
formData.reportLetterDate formData.reportLetterDate
? date2Thai(formData.reportLetterDate) ? date2Thai(formData.reportLetterDate)
: null : null
" "
:label="`${'ลงวันที่'}`" :label="`${'รายงานตัวกลับเมื่่อวันที่'}`"
hide-bottom-space hide-bottom-space
:rules="[ :rules="[
(val:string) => (val:string) =>
@ -557,22 +627,50 @@ onMounted(() => {
icon="add" icon="add"
color="primary" color="primary"
label="เลือกผู้ค้ำประกัน" label="เลือกผู้ค้ำประกัน"
@click="onSelectGov(false)"
> >
<q-tooltip>เพ</q-tooltip> <q-tooltip>เพ</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div class="row col-12 q-col-gutter-md q-pa-md"> <div
class="row col-12 q-col-gutter-md q-pa-md"
v-if="isGuarantor"
>
<div class="col"> <div class="col">
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md">
<div class="col-4 text-grey">เลขประจำตวประชาชน</div> <div class="col-4 text-grey">เลขประจำตวประชาชน</div>
<div class="col-8 text-weight-medium">123xxxxxxxxxx</div> <div class="col-8 text-weight-medium">
{{ dataGuarantor.citizenId }}
</div>
<div class="col-4 text-grey">-นามสก</div>
<div class="col-8 text-weight-medium">
{{ dataGuarantor.name }}
</div>
<div class="col-4 text-grey">ตำแหน</div>
<div class="col-8 text-weight-medium">
{{ dataGuarantor.position }}
</div>
<div class="col-4 text-grey">ประเภท</div>
<div class="col-8 text-weight-medium">
{{ dataGuarantor.type }}
</div>
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md">
<div class="col-4 text-grey">ระดบตำแหน</div> <div class="col-4 text-grey">ระดบตำแหน</div>
<div class="col-8 text-weight-medium">123xxxxxxxxxx</div> <div class="col-8 text-weight-medium">
{{ dataGuarantor.level }}
</div>
<div class="col-4 text-grey">ตำแหนงทางการบรหาร</div>
<div class="col-8 text-weight-medium">
{{ dataGuarantor.positionSide }}
</div>
<div class="col-4 text-grey">หนวยงานทงก</div>
<div class="col-8 text-weight-medium">
{{ dataGuarantor.org }}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -589,6 +687,7 @@ onMounted(() => {
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
class="inputgreen"
label="หลักสูตรการฝึกอบรม" label="หลักสูตรการฝึกอบรม"
v-model="formData.trainingCourse" v-model="formData.trainingCourse"
:rules="[ :rules="[
@ -603,6 +702,7 @@ onMounted(() => {
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
class="inputgreen"
label="สถาบันการศึกษา/หน่วยงานผู้จัดการฝึกอบรม" label="สถาบันการศึกษา/หน่วยงานผู้จัดการฝึกอบรม"
v-model="formData.institution" v-model="formData.institution"
:rules="[ :rules="[
@ -630,6 +730,7 @@ onMounted(() => {
<q-input <q-input
dense dense
outlined outlined
class="inputgreen"
:model-value=" :model-value="
formData.trainingDateStart formData.trainingDateStart
? date2Thai(formData.trainingDateStart) ? date2Thai(formData.trainingDateStart)
@ -672,6 +773,7 @@ onMounted(() => {
<q-input <q-input
dense dense
outlined outlined
class="inputgreen"
:model-value=" :model-value="
formData.trainingDateEnd formData.trainingDateEnd
? date2Thai(formData.trainingDateEnd) ? date2Thai(formData.trainingDateEnd)
@ -703,6 +805,7 @@ onMounted(() => {
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
class="inputgreen"
label="สถานที่ไปศึกษาดูงาน" label="สถานที่ไปศึกษาดูงาน"
v-model="formData.studyPlace" v-model="formData.studyPlace"
:rules="[ :rules="[
@ -718,6 +821,7 @@ onMounted(() => {
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
label="หัวข้อไปศึกษาดูงาน" label="หัวข้อไปศึกษาดูงาน"
class="inputgreen"
v-model="formData.studyTopic" v-model="formData.studyTopic"
:rules="[ :rules="[
(val:string) => (val:string) =>
@ -745,6 +849,8 @@ onMounted(() => {
</div> </div>
</q-card> </q-card>
</q-form> </q-form>
<DialogGov v-model:modal="modalDialogGov" :up-date="upDate" />
</template> </template>
<style scoped></style> <style scoped></style>

View file

@ -36,10 +36,30 @@ interface NewPagination {
sortBy: string; sortBy: string;
} }
interface DataPerson {
id: string;
name: string;
prefix: string;
rank: string;
firstName: string;
lastName: string;
citizenId: string;
level: string;
type: string;
posLevelId: string;
posTypeId: string;
position: string;
positionSide: string;
posNo: string;
oc: string;
[key: string]: any;
}
export type { export type {
DataOption, DataOption,
DataOptionCheckBox, DataOptionCheckBox,
ItemsMenu, ItemsMenu,
NewPagination, NewPagination,
FormFilter, FormFilter,
DataPerson,
}; };