569 lines
17 KiB
Vue
569 lines
17 KiB
Vue
<template>
|
|
<div class="toptitle text-dark col-12 row items-center">
|
|
<!-- <q-btn
|
|
icon="mdi-arrow-left"
|
|
unelevated
|
|
round
|
|
dense
|
|
flat
|
|
color="primary"
|
|
class="q-mr-sm"
|
|
@click="router.go(-1)"
|
|
/> -->
|
|
บันทึกผลการได้รับพระราชทานเครื่องราชย์อิสริยสภรณ์
|
|
</div>
|
|
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders">
|
|
<div class="q-pa-md row items-center">
|
|
<selector
|
|
hide-bottom-space
|
|
borderless
|
|
dense
|
|
lazy-rules
|
|
emit-value
|
|
map-options
|
|
options-dense
|
|
option-label="name"
|
|
option-value="id"
|
|
v-model="selectRound"
|
|
:options="selectRoundOption"
|
|
use-input
|
|
input-debounce="0"
|
|
input-class="text-bold text-grey"
|
|
>
|
|
<template v-slot:before
|
|
><label class="text-bold text-grey" style="font-size: 16px"
|
|
>รอบ</label
|
|
>
|
|
</template>
|
|
</selector>
|
|
<!-- :class="getClass(edit)" -->
|
|
<!-- @filter="(inputValue:string,
|
|
doneFn:Function) => filterSelector(inputValue, doneFn,'provinceOps'
|
|
) " -->
|
|
</div>
|
|
<q-separator />
|
|
<q-tabs
|
|
v-model="tab"
|
|
align="left"
|
|
class="bg-white text-grey"
|
|
active-color="primary"
|
|
indicator-color="primary"
|
|
>
|
|
<q-tab name="hight" label="ขั้นสายสะพาน" />
|
|
<q-tab name="low" label="ขั้นต่ำกว่าสายสะพาน" />
|
|
<q-tab name="medal" label="เหรียญบำเหน็จบำนาญ" />
|
|
</q-tabs>
|
|
<q-separator />
|
|
<div class="q-py-md q-px-lg">
|
|
<!-- <div>
|
|
<label class="q-mr-sm">รอบ</label>
|
|
<q-btn
|
|
flat
|
|
round
|
|
de
|
|
color="grey"
|
|
icon="mdi-menu-left"
|
|
:class="getArrow(arrow)"
|
|
@click="clickRound"
|
|
/>
|
|
</div> -->
|
|
<Transition>
|
|
<div class="bg-base rounded-borders q-pa-md q-mb-md">
|
|
<div class="row col-12 q-col-gutter-x-lg q-col-gutter-y-md">
|
|
<!-- <div class="col-xs-6 col-md-2">
|
|
<q-input
|
|
class="bg-white"
|
|
outlined
|
|
dense
|
|
lazy-rules
|
|
v-model="issue"
|
|
:label="`${'ฉบับ'}`"
|
|
hide-bottom-space
|
|
/>
|
|
</div>
|
|
<div class="col-xs-6 col-md-2">
|
|
<q-input
|
|
class="bg-white"
|
|
outlined
|
|
dense
|
|
lazy-rules
|
|
v-model="book"
|
|
:label="`${'เล่มที่'}`"
|
|
hide-bottom-space
|
|
/>
|
|
</div>
|
|
<div class="col-xs-6 col-md-2">
|
|
<q-input
|
|
class="bg-white"
|
|
outlined
|
|
dense
|
|
lazy-rules
|
|
v-model="volume"
|
|
:label="`${'เล่ม'}`"
|
|
hide-bottom-space
|
|
/>
|
|
</div>
|
|
<div class="col-xs-6 col-md-2">
|
|
<q-input
|
|
class="bg-white"
|
|
outlined
|
|
dense
|
|
lazy-rules
|
|
v-model="section"
|
|
:label="`${'ตอนที่'}`"
|
|
hide-bottom-space
|
|
/>
|
|
</div> -->
|
|
<div class="col-xs-6 col-md-4">
|
|
<q-file
|
|
class="bg-white"
|
|
outlined
|
|
dense
|
|
v-model="government"
|
|
label="ราชกิจจานุเบกษา"
|
|
hide-bottom-space
|
|
lazy-rules
|
|
>
|
|
<template v-slot:prepend>
|
|
<q-icon name="attach_file" color="primary" />
|
|
</template>
|
|
</q-file>
|
|
</div>
|
|
<div class="col-xs-6 col-md-3">
|
|
<q-file
|
|
class="bg-white"
|
|
outlined
|
|
dense
|
|
v-model="document"
|
|
label="เอกสารประกอบ"
|
|
hide-bottom-space
|
|
lazy-rules
|
|
>
|
|
<template v-slot:prepend>
|
|
<q-icon name="attach_file" color="primary" />
|
|
</template>
|
|
</q-file>
|
|
</div>
|
|
<div class="col-xs-12 col-md-5">
|
|
<q-input
|
|
class="bg-white"
|
|
outlined
|
|
dense
|
|
lazy-rules
|
|
v-model="reason"
|
|
:label="`${'หมายเหตุ'}`"
|
|
hide-bottom-space
|
|
/>
|
|
</div>
|
|
<!-- <div class="col-xs-6 col-md-2">
|
|
<datepicker
|
|
menu-class-name="modalfix"
|
|
v-model="dateGoverment"
|
|
:locale="'th'"
|
|
autoApply
|
|
borderless
|
|
:enableTimePicker="false"
|
|
week-start="0"
|
|
>
|
|
<template #year="{ year }">
|
|
{{ year + 543 }}
|
|
</template>
|
|
<template #year-overlay-value="{ value }">
|
|
{{ parseInt(value + 543) }}
|
|
</template>
|
|
<template #trigger>
|
|
<q-input
|
|
outlined
|
|
dense
|
|
class="full-width datepicker bg-white"
|
|
:model-value="
|
|
dateGoverment != null ? date2Thai(dateGoverment) : null
|
|
"
|
|
:label="`${'วันที่ประกาศราชกิจจานุเบกษา'}`"
|
|
>
|
|
<template v-slot:prepend>
|
|
<q-icon
|
|
name="event"
|
|
class="cursor-pointer"
|
|
style="color: var(--q-primary)"
|
|
>
|
|
</q-icon>
|
|
</template>
|
|
</q-input>
|
|
</template>
|
|
</datepicker>
|
|
</div>
|
|
<div class="col-xs-6 col-md-2">
|
|
<datepicker
|
|
menu-class-name="modalfix"
|
|
v-model="dateReceiver"
|
|
:locale="'th'"
|
|
autoApply
|
|
borderless
|
|
:enableTimePicker="false"
|
|
week-start="0"
|
|
>
|
|
<template #year="{ year }">
|
|
{{ year + 543 }}
|
|
</template>
|
|
<template #year-overlay-value="{ value }">
|
|
{{ parseInt(value + 543) }}
|
|
</template>
|
|
<template #trigger>
|
|
<q-input
|
|
outlined
|
|
dense
|
|
class="full-width datepicker bg-white"
|
|
:model-value="
|
|
dateReceiver != null ? date2Thai(dateReceiver) : null
|
|
"
|
|
:label="`${'วันที่ได้รับ'}`"
|
|
>
|
|
<template v-slot:prepend>
|
|
<q-icon
|
|
name="event"
|
|
class="cursor-pointer"
|
|
style="color: var(--q-primary)"
|
|
>
|
|
</q-icon>
|
|
</template>
|
|
</q-input>
|
|
</template>
|
|
</datepicker>
|
|
</div> -->
|
|
<div class="col-xs-6 col-md-4">
|
|
<p>
|
|
วันที่ประกาศราชกิจจานุเบกษา <b>{{ date2Thai(new Date()) }}</b>
|
|
</p>
|
|
</div>
|
|
<div class="col-xs-6 col-md-3">
|
|
<p>
|
|
วันที่ได้รับ <b>{{ date2Thai(new Date()) }}</b>
|
|
</p>
|
|
</div>
|
|
<div class="col-xs-12 col-md-5 flexsave">
|
|
<q-btn label="บันทึก" @click="save" color="public" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Transition>
|
|
<div :class="marginTop(arrow)">
|
|
<div class="col-12 row q-pb-sm items-center">
|
|
<selector
|
|
outlined
|
|
dense
|
|
lazy-rules
|
|
v-model="selectType"
|
|
hide-bottom-space
|
|
:label="`${'เครื่องราชฯ'}`"
|
|
emit-value
|
|
map-options
|
|
option-label="name"
|
|
:options="selectTypeOption"
|
|
option-value="id"
|
|
use-input
|
|
input-debounce="0"
|
|
style="min-width: 150px"
|
|
class="gt-xs q-ml-sm"
|
|
@filter="(inputValue:string,
|
|
doneFn:Function) => filterSelector(inputValue, doneFn,'selectTypeOption'
|
|
) "
|
|
/>
|
|
<!-- <selector
|
|
outlined
|
|
dense
|
|
lazy-rules
|
|
v-model="selectStatus"
|
|
hide-bottom-space
|
|
:label="`${'สถานะการบันทึก'}`"
|
|
emit-value
|
|
map-options
|
|
option-label="name"
|
|
:options="selectStatusOption"
|
|
option-value="id"
|
|
use-input
|
|
input-debounce="0"
|
|
style="min-width: 150px"
|
|
class="gt-xs q-ml-sm"
|
|
@filter="(inputValue:string,
|
|
doneFn:Function) => filterSelector(inputValue, doneFn,'selectStatusOption'
|
|
) "
|
|
/> -->
|
|
<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:body-cell="props">
|
|
<q-td :props="props">
|
|
<div v-if="props.col.name == 'no'">
|
|
{{ props.rowIndex + 1 }}
|
|
</div>
|
|
|
|
<div v-else>
|
|
{{ props.value }}
|
|
</div>
|
|
</q-td>
|
|
</template>
|
|
</d-table>
|
|
</div>
|
|
</div>
|
|
</q-card>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref, onMounted } from "vue";
|
|
// import { useRouter } from "vue-router";
|
|
import { useCounterMixin } from "@/stores/mixin";
|
|
|
|
import type { DataOption } from "@/modules/05_placement/interface/index/Main";
|
|
import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
|
|
import type { QTableProps, QInput } from "quasar";
|
|
|
|
// const router = useRouter();
|
|
const mixin = useCounterMixin();
|
|
const { date2Thai } = mixin;
|
|
|
|
const tab = ref<string>("hight");
|
|
const arrow = ref<boolean>(false);
|
|
|
|
const dateGoverment = ref<Date>(new Date());
|
|
const dateReceiver = ref<Date>(new Date());
|
|
const issue = ref<string>("");
|
|
const book = ref<string>("");
|
|
const volume = ref<string>("");
|
|
const section = ref<string>("");
|
|
const reason = ref<string>("");
|
|
const government = ref<any>(null);
|
|
const document = ref<any>(null);
|
|
|
|
const selectStatus = ref<string>("");
|
|
const selectStatusOption = ref<OptionData[]>([]);
|
|
const selectStatusOptionFilter = ref<OptionData[]>([]);
|
|
|
|
const selectType = ref<string>("1");
|
|
const selectTypeOption = ref<OptionData[]>([]);
|
|
const selectTypeOptionFilter = ref<OptionData[]>([]);
|
|
|
|
const selectRound = ref<string>("1");
|
|
const selectRoundOption = ref<OptionData[]>([
|
|
{ id: "1", name: "รอบการเสนอขอพระราชทานเครื่องราชฯ ปี 2566" },
|
|
]);
|
|
const selectRoundOptionFilter = ref<OptionData[]>([]);
|
|
|
|
const visibleColumns = ref<String[]>([
|
|
"no",
|
|
"status",
|
|
"name",
|
|
"type",
|
|
"page",
|
|
"number",
|
|
]);
|
|
const filterRef = ref<QInput>();
|
|
const filter = ref<string>("");
|
|
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: "status",
|
|
align: "left",
|
|
label: "สถานะ",
|
|
field: "status",
|
|
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: "type",
|
|
align: "left",
|
|
label: "ประเภทเครื่องราชฯ",
|
|
field: "type",
|
|
sortable: true,
|
|
sort: (a: string, b: string) =>
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
},
|
|
{
|
|
name: "page",
|
|
align: "left",
|
|
label: "หน้าในราชกิจนุเบกษา",
|
|
field: "page",
|
|
sortable: true,
|
|
sort: (a: string, b: string) =>
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
},
|
|
{
|
|
name: "number",
|
|
align: "left",
|
|
label: "ลำดับที่ในราชกิจจานุเบกษา",
|
|
field: "number",
|
|
sortable: true,
|
|
sort: (a: string, b: string) =>
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
},
|
|
]);
|
|
const rows = ref<any>([
|
|
{
|
|
no: "1",
|
|
status: "รอบันทึกข้อมูล",
|
|
name: "นางสาวรัชภรณ์ ภักดี",
|
|
type: "ทั้งหมด",
|
|
page: "8",
|
|
number: "11",
|
|
},
|
|
{
|
|
no: "2",
|
|
status: "บันทึกลง ก.พ. 7 แล้ว",
|
|
name: "นางสาวภาพรรณ ลออ",
|
|
type: "ทั้งหมด",
|
|
page: "12",
|
|
number: "11",
|
|
},
|
|
]);
|
|
|
|
onMounted(() => {
|
|
const op1: DataOption[] = [{ id: "1", name: "ทั้งหมด" }];
|
|
const op2: DataOption[] = [
|
|
{ id: "1", name: "ทั้งหมด" },
|
|
{ id: "2", name: "รอบันทึกข้อมูล" },
|
|
{ id: "3", name: "บันทึกลง ก.พ. 7 แล้ว" },
|
|
];
|
|
selectTypeOption.value = op1;
|
|
selectTypeOptionFilter.value = op1;
|
|
selectStatusOption.value = op2;
|
|
selectStatusOptionFilter.value = op2;
|
|
});
|
|
|
|
const clickRound = () => {
|
|
arrow.value = !arrow.value;
|
|
};
|
|
|
|
const resetFilter = () => {
|
|
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
|
filter.value = "";
|
|
filterRef.value!.focus();
|
|
};
|
|
|
|
const filterSelector = (val: any, update: Function, filtername: string) => {
|
|
switch (filtername) {
|
|
case "selectTypeOption":
|
|
update(() => {
|
|
selectTypeOption.value = selectTypeOptionFilter.value.filter(
|
|
(v: DataOption) => v.name!.indexOf(val) > -1
|
|
);
|
|
});
|
|
break;
|
|
case "selectStatusOption":
|
|
update(() => {
|
|
selectStatusOption.value = selectStatusOptionFilter.value.filter(
|
|
(v: DataOption) => v.name!.indexOf(val) > -1
|
|
);
|
|
});
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
};
|
|
|
|
const getArrow = (val: boolean) => {
|
|
return {
|
|
"arrow cursor-pointer": !val,
|
|
"arrow-active cursor-pointer": val,
|
|
};
|
|
};
|
|
|
|
const marginTop = (val: boolean) => {
|
|
return {
|
|
"": !val,
|
|
"q-mt-md": val,
|
|
};
|
|
};
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.arrow {
|
|
transition: transform 0.5s;
|
|
}
|
|
|
|
.arrow-active {
|
|
transition: transform 0.5s;
|
|
transform: rotate(-90deg);
|
|
}
|
|
|
|
.bg-base {
|
|
background-color: #efefef;
|
|
}
|
|
|
|
.v-enter-active,
|
|
.v-leave-active {
|
|
transition: opacity 0.5s ease;
|
|
}
|
|
|
|
.v-enter-from,
|
|
.v-leave-to {
|
|
opacity: 0;
|
|
}
|
|
|
|
.flexsave {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
}
|
|
</style>
|