insignia Reclaim
This commit is contained in:
parent
b653300188
commit
17ff56c7cf
5 changed files with 1421 additions and 179 deletions
|
|
@ -8,6 +8,7 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
/** impotrType */
|
/** impotrType */
|
||||||
|
import type { QTableColumn } from "quasar";
|
||||||
import type { DataOption } from "@/modules/07_insignia/interface/index/Main";
|
import type { DataOption } from "@/modules/07_insignia/interface/index/Main";
|
||||||
|
|
||||||
/** impotrComponents */
|
/** impotrComponents */
|
||||||
|
|
@ -23,13 +24,11 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
notifyError,
|
onSearchDataTable,
|
||||||
convertDateToAPI,
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modal: Boolean,
|
modal: Boolean,
|
||||||
save: {
|
save: {
|
||||||
|
|
@ -76,17 +75,168 @@ const receivedate = ref<Date | null>(); //วันที่ยืม
|
||||||
const returndate = ref<Date | null>(); //วันที่คืน
|
const returndate = ref<Date | null>(); //วันที่คืน
|
||||||
const fullName = ref<string>(""); //ชื่อ-นามสกุล
|
const fullName = ref<string>(""); //ชื่อ-นามสกุล
|
||||||
const reason = ref<string>("");
|
const reason = ref<string>("");
|
||||||
const listPerson = ref<any>([]);
|
|
||||||
const OrgList = ref<DataOption[]>([]);
|
const OrgList = ref<DataOption[]>([]);
|
||||||
const filterOrgList = ref<DataOption[]>([]);
|
const filterOrgList = ref<DataOption[]>([]);
|
||||||
const insigniaNoteProfileId = ref<string>("");
|
const insigniaNoteProfileId = ref<string>("");
|
||||||
const filterSelectRound = ref<any>();
|
const filterSelectRound = ref<any>();
|
||||||
const selectRound = ref<any>();
|
const selectRound = ref<any>();
|
||||||
const type = ref<any>(DataStore.type);
|
|
||||||
|
|
||||||
/**
|
const rows = ref<any[]>([]);
|
||||||
* function เคลียร์ข้อมูลในฟอร์ม
|
const rowsMain = ref<any[]>([]);
|
||||||
*/
|
const keyword = ref<string>("");
|
||||||
|
const selected = ref<any[]>([]);
|
||||||
|
const columns = ref<QTableColumn[]>([
|
||||||
|
{
|
||||||
|
name: "noNumber",
|
||||||
|
align: "left",
|
||||||
|
label: "ลำดับ",
|
||||||
|
field: "noNumber",
|
||||||
|
sortable: false,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "citizenId",
|
||||||
|
align: "left",
|
||||||
|
label: "เลขประจำตัวประชาชน",
|
||||||
|
field: "citizenId",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "fullName",
|
||||||
|
align: "left",
|
||||||
|
label: "ชื่อ-นามสกุล",
|
||||||
|
field: "fullName",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "profileType",
|
||||||
|
align: "left",
|
||||||
|
label: "ประเภทตำแหน่ง",
|
||||||
|
field: "profileType",
|
||||||
|
sortable: true,
|
||||||
|
format(val, row) {
|
||||||
|
return DataStore.profileType(val);
|
||||||
|
},
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "position",
|
||||||
|
align: "left",
|
||||||
|
label: "ตำแหน่งประเภท",
|
||||||
|
field: "position",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "requestInsignia",
|
||||||
|
align: "left",
|
||||||
|
label: "เครื่องราชๆ",
|
||||||
|
field: "requestInsignia",
|
||||||
|
format(val, row) {
|
||||||
|
return `${row.requestInsignia ?? ""}
|
||||||
|
${
|
||||||
|
row.requestInsigniaShortName ? `(${row.requestInsigniaShortName})` : ""
|
||||||
|
} `;
|
||||||
|
},
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "dateReceive",
|
||||||
|
align: "left",
|
||||||
|
label: "วันที่ได้รับพระราชทาน",
|
||||||
|
field: "dateReceive",
|
||||||
|
sortable: true,
|
||||||
|
format(val, row) {
|
||||||
|
return date2Thai(val);
|
||||||
|
},
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
|
||||||
|
// {
|
||||||
|
// name: "date",
|
||||||
|
// align: "left",
|
||||||
|
// label: "วันที่ในราชกิจนุเบกษา",
|
||||||
|
// field: "date",
|
||||||
|
// sortable: true,
|
||||||
|
// format(val, row) {
|
||||||
|
// return date2Thai(val);
|
||||||
|
// },
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "volumeNo",
|
||||||
|
// align: "left",
|
||||||
|
// label: "เล่มที่ในราชกิจนุเบกษา",
|
||||||
|
// field: "volumeNo",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "section",
|
||||||
|
// align: "left",
|
||||||
|
// label: "ตอนที่ในราชกิจนุเบกษา",
|
||||||
|
// field: "section",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "page",
|
||||||
|
// align: "left",
|
||||||
|
// label: "หน้าในราชกิจนุเบกษา",
|
||||||
|
// field: "page",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "no",
|
||||||
|
// align: "left",
|
||||||
|
// label: "ลำดับที่ในราชกิจจานุเบกษา",
|
||||||
|
// field: "no",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "number",
|
||||||
|
// align: "left",
|
||||||
|
// label: "หมายเลขใบกำกับ",
|
||||||
|
// field: "number",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
]);
|
||||||
|
const visibleColumns = ref<string[]>([
|
||||||
|
"noNumber",
|
||||||
|
"citizenId",
|
||||||
|
"fullName",
|
||||||
|
"profileType",
|
||||||
|
"position",
|
||||||
|
"requestInsignia",
|
||||||
|
"dateReceive",
|
||||||
|
// "date",
|
||||||
|
// "volumeNo",
|
||||||
|
// "section",
|
||||||
|
// "page",
|
||||||
|
// "no",
|
||||||
|
// "number",
|
||||||
|
]);
|
||||||
|
|
||||||
|
/** function เคลียร์ข้อมูลในฟอร์ม*/
|
||||||
function clearData() {
|
function clearData() {
|
||||||
receivedate.value = null;
|
receivedate.value = null;
|
||||||
returndate.value = null;
|
returndate.value = null;
|
||||||
|
|
@ -96,11 +246,13 @@ function clearData() {
|
||||||
fullName.value = "";
|
fullName.value = "";
|
||||||
brand.value = "";
|
brand.value = "";
|
||||||
reason.value = "";
|
reason.value = "";
|
||||||
|
selected.value = [];
|
||||||
|
keyword.value = "";
|
||||||
|
rows.value = [];
|
||||||
|
rowsMain.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เรียกข้อมูลรายการเครื่องราช*/
|
||||||
* function เรียกข้อมูลรายการเครื่องราช
|
|
||||||
*/
|
|
||||||
async function fecthlistInsignia() {
|
async function fecthlistInsignia() {
|
||||||
if (roundNo.value !== "" && roundNo.value !== null) {
|
if (roundNo.value !== "" && roundNo.value !== null) {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -112,25 +264,20 @@ async function fecthlistInsignia() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.noteSearchList(), data)
|
.post(config.API.noteSearchList(), data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
listPerson.value = res.data.result;
|
rowsMain.value = res.data.result;
|
||||||
|
rows.value = res.data.result;
|
||||||
|
serchDataTable();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
cardid.value = "";
|
|
||||||
fullName.value = "";
|
|
||||||
brand.value = "";
|
|
||||||
OrganazationId.value = "";
|
|
||||||
reason.value = "";
|
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function บันทึกการเพิ่มข้อมูล*/
|
||||||
* function บันทึกการเพิ่มข้อมูล
|
|
||||||
*/
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -145,10 +292,12 @@ async function onSubmit() {
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await props.closeAndFecth();
|
await props.closeAndFecth();
|
||||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
clearData();
|
closeDialog();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -163,60 +312,25 @@ async function onSubmit() {
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await props.closeAndFecth();
|
await props.closeAndFecth();
|
||||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
clearData();
|
closeDialog();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function closePopup*/
|
||||||
* function ค้นหาคนจากเลขประจำตัวประชาชน
|
|
||||||
*/
|
|
||||||
async function searchcardid() {
|
|
||||||
if (cardid.value.length === 13) {
|
|
||||||
showLoader();
|
|
||||||
const node = await listPerson.value.find(
|
|
||||||
(e: any) => e.citizenId === cardid.value
|
|
||||||
);
|
|
||||||
|
|
||||||
if (node) {
|
|
||||||
fullName.value = ` ${node.fullName}`;
|
|
||||||
brand.value = `${node.requestInsignia} (${
|
|
||||||
type.value.find((item: any) => item.name === node.requestInsignia)
|
|
||||||
?.shortName || ""
|
|
||||||
})`;
|
|
||||||
insigniaNoteProfileId.value = node.id;
|
|
||||||
hideLoader();
|
|
||||||
} else {
|
|
||||||
notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
|
|
||||||
fullName.value = "";
|
|
||||||
brand.value = "";
|
|
||||||
OrganazationId.value = "";
|
|
||||||
reason.value = "";
|
|
||||||
hideLoader();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
fullName.value = "";
|
|
||||||
brand.value = "";
|
|
||||||
receivedate.value = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function closePopup
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
clearData();
|
clearData();
|
||||||
props.close();
|
props.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function reset วันที่คืน*/
|
||||||
* function reset วันที่คืน
|
|
||||||
*/
|
|
||||||
function clearReturnDate() {
|
function clearReturnDate() {
|
||||||
returndate.value = null;
|
returndate.value = null;
|
||||||
}
|
}
|
||||||
|
|
@ -245,17 +359,21 @@ function filterSelector(val: string, update: Function, name: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function serchDataTable() {
|
||||||
* function setValue
|
rows.value = onSearchDataTable(
|
||||||
*/
|
keyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** function setValue*/
|
||||||
function setValue() {
|
function setValue() {
|
||||||
filterSelectRound.value = props.filterSelectRoundOption;
|
filterSelectRound.value = props.filterSelectRoundOption;
|
||||||
selectRound.value = props.selectRoundOption;
|
selectRound.value = props.selectRoundOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function callback เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล*/
|
||||||
* function callback เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล
|
|
||||||
*/
|
|
||||||
watch(props, () => {
|
watch(props, () => {
|
||||||
if (props.modal == true && props.roundId != "all") {
|
if (props.modal == true && props.roundId != "all") {
|
||||||
roundNo.value = props.roundId;
|
roundNo.value = props.roundId;
|
||||||
|
|
@ -267,6 +385,18 @@ watch(props, () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(selected, () => {
|
||||||
|
if (props.modal) {
|
||||||
|
const data = selected.value[0];
|
||||||
|
insigniaNoteProfileId.value = data ? data.id : "";
|
||||||
|
fullName.value = data ? data.fullName : "";
|
||||||
|
cardid.value = data ? data.citizenId : "";
|
||||||
|
brand.value = data
|
||||||
|
? `${data.requestInsignia} (${data.requestInsigniaShortName})`
|
||||||
|
: "";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/** Hook*/
|
/** Hook*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setValue();
|
setValue();
|
||||||
|
|
@ -275,7 +405,11 @@ onMounted(() => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="props.modal" persistent>
|
<q-dialog v-model="props.modal" persistent>
|
||||||
<q-card style="min-width: 900px">
|
<q-card
|
||||||
|
:style="
|
||||||
|
props.action === 'addData' ? 'min-width: 80%' : 'min-width: 900px'
|
||||||
|
"
|
||||||
|
>
|
||||||
<q-form
|
<q-form
|
||||||
ref="myForm "
|
ref="myForm "
|
||||||
greedy
|
greedy
|
||||||
|
|
@ -284,140 +418,234 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<DialogHeader tittle="ยืม-คืนเครื่องราชฯ" :close="closeDialog" />
|
<DialogHeader tittle="ยืม-คืนเครื่องราชฯ" :close="closeDialog" />
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section>
|
<q-card-section style="padding: 0px">
|
||||||
<div
|
<div
|
||||||
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
|
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
|
||||||
>
|
>
|
||||||
<div
|
<div v-if="props.action === 'addData'" class="row col-12">
|
||||||
v-if="props.action === 'addData'"
|
<div class="q-pa-md col-md-8 col-xs-12">
|
||||||
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
|
<div class="col-12">
|
||||||
>
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
<div class="col-6">
|
<q-space />
|
||||||
<q-select
|
<div class="row q-col-gutter-sm">
|
||||||
class="inputgreen"
|
<q-input
|
||||||
v-model="roundNo"
|
standout
|
||||||
dense
|
dense
|
||||||
outlined
|
v-model="keyword"
|
||||||
lazy-rules
|
outlined
|
||||||
hide-bottom-space
|
placeholder="ค้นหา"
|
||||||
:label="`${'รอบการขอเครื่องราชฯ'}`"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
emit-value
|
>
|
||||||
map-options
|
<template v-slot:append>
|
||||||
use-input
|
<q-icon name="search" />
|
||||||
option-label="name"
|
</template>
|
||||||
:options="filterSelectRound"
|
</q-input>
|
||||||
option-value="id"
|
|
||||||
:readonly="false"
|
<q-select
|
||||||
:borderless="false"
|
v-model="visibleColumns"
|
||||||
style="min-width: 150px"
|
multiple
|
||||||
:rules="[(val:string) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ']"
|
outlined
|
||||||
@update:model-value="fecthlistInsignia()"
|
dense
|
||||||
@filter="(inputValue:string,
|
options-dense
|
||||||
|
:display-value="$q.lang.table.columns"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:options="columns"
|
||||||
|
option-value="name"
|
||||||
|
style="min-width: 140px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 q-pt-sm">
|
||||||
|
<d-table
|
||||||
|
ref="table"
|
||||||
|
:columns="columns"
|
||||||
|
:rows="rows"
|
||||||
|
row-key="id"
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
:paging="true"
|
||||||
|
dense
|
||||||
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
|
selection="single"
|
||||||
|
v-model:selected="selected"
|
||||||
|
>
|
||||||
|
<template v-slot:header="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-th auto-width></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"
|
||||||
|
>
|
||||||
|
<div v-if="col.name === 'noNumber'">
|
||||||
|
{{ props.rowIndex + 1 }}
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
{{ col.value ? col.value : "-" }}
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
</d-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<q-separator vertical />
|
||||||
|
<div class="q-pa-md col">
|
||||||
|
<div class="row q-col-gutter-sm">
|
||||||
|
<div class="col-12">
|
||||||
|
<q-select
|
||||||
|
class="inputgreen"
|
||||||
|
v-model="roundNo"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'รอบการขอเครื่องราชฯ'}`"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
use-input
|
||||||
|
option-label="name"
|
||||||
|
:options="filterSelectRound"
|
||||||
|
option-value="id"
|
||||||
|
:readonly="false"
|
||||||
|
:borderless="false"
|
||||||
|
style="min-width: 150px"
|
||||||
|
:rules="[(val:string) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ']"
|
||||||
|
@update:model-value="fecthlistInsignia()"
|
||||||
|
@filter="(inputValue:string,
|
||||||
doneFn:Function) => filterSelector(inputValue, doneFn,'filterSelectRoundOption'
|
doneFn:Function) => filterSelector(inputValue, doneFn,'filterSelectRoundOption'
|
||||||
) "
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 q-mt-md text-weight-bold text-grey-7">
|
<div class="col-12 q-mt-md text-weight-bold text-grey-7">
|
||||||
ข้อมูลผู้ยืม
|
ข้อมูลผู้ยืม
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-input
|
<q-input
|
||||||
:disable="roundNo == ''"
|
:disable="roundNo == ''"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
outlined
|
outlined
|
||||||
class="inputgreen"
|
readonly
|
||||||
v-model="cardid"
|
v-model="cardid"
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:rules="[
|
:rules="[
|
||||||
(val: string) => !!val || `${'กรุณากรอกเลขประจำตัวประชาชน'}`,
|
(val: string) => !!val || `${'กรุณากรอกเลขประจำตัวประชาชน'}`,
|
||||||
(val: string) =>
|
(val: string) =>
|
||||||
val.length >= 13 ||
|
val.length >= 13 ||
|
||||||
`${'กรุณากรอกเลขประจำตัวประชาชนให้ครบ'}`,
|
`${'กรุณากรอกเลขประจำตัวประชาชนให้ครบ'}`,
|
||||||
]"
|
]"
|
||||||
label="เลขประจำตัวประชาชน"
|
label="เลขประจำตัวประชาชน"
|
||||||
maxlength="13"
|
maxlength="13"
|
||||||
mask="#############"
|
mask="#############"
|
||||||
@keyup="searchcardid"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div class="col-xs-6 col-sm-6">
|
||||||
<div class="col-xs-6 col-sm-6">
|
<q-input
|
||||||
<q-input
|
readonly
|
||||||
readonly
|
hide-bottom-space
|
||||||
hide-bottom-space
|
outlined
|
||||||
outlined
|
dense
|
||||||
dense
|
lazy-rules
|
||||||
lazy-rules
|
borderless
|
||||||
borderless
|
v-model="fullName"
|
||||||
v-model="fullName"
|
:label="`${'ชื่อ-นามสกุล'}`"
|
||||||
:label="`${'ชื่อ-นามสกุล'}`"
|
:rules="[
|
||||||
:rules="[
|
|
||||||
(val:string) =>
|
(val:string) =>
|
||||||
!!val ||
|
!!val ||
|
||||||
'ชื่อ-นามสกุลต้องไม่ว่าง กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง',
|
'ชื่อ-นามสกุลต้องไม่ว่าง กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง',
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 q-mt-md text-weight-bold text-grey-7">
|
<div class="col-12 q-mt-md text-weight-bold text-grey-7">
|
||||||
รายละเอียดการยืมเครื่องราชฯ
|
รายละเอียดการยืมเครื่องราชฯ
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-input
|
|
||||||
:rules="[(val:string) => !!val || 'กรุณาเลือกเครื่องราชฯ']"
|
|
||||||
v-model="brand"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
lazy-rules
|
|
||||||
hide-bottom-space
|
|
||||||
:label="`${'เครื่องราชฯ'}`"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-12 col-sm-6">
|
|
||||||
<datepicker
|
|
||||||
menu-class-name="modalfix"
|
|
||||||
v-model="receivedate"
|
|
||||||
: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
|
<q-input
|
||||||
class="inputgreen"
|
:rules="[(val:string) => !!val || 'กรุณาเลือกเครื่องราชฯ']"
|
||||||
|
v-model="brand"
|
||||||
|
readonly
|
||||||
dense
|
dense
|
||||||
borderless
|
|
||||||
outlined
|
outlined
|
||||||
:rules="[(val:string) => !!val || 'กรุณาเลือกวันที่']"
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:model-value="
|
:label="`${'เครื่องราชฯ'}`"
|
||||||
receivedate != null ? date2Thai(receivedate) : undefined
|
/>
|
||||||
"
|
</div>
|
||||||
:label="`${'วันที่ยืม'}`"
|
|
||||||
|
<div class="col-xs-12 col-sm-6">
|
||||||
|
<datepicker
|
||||||
|
menu-class-name="modalfix"
|
||||||
|
v-model="receivedate"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
borderless
|
||||||
|
:enableTimePicker="false"
|
||||||
|
week-start="0"
|
||||||
>
|
>
|
||||||
<template v-if="receivedate" v-slot:append>
|
<template #year="{ year }">
|
||||||
<q-icon
|
{{ year + 543 }}
|
||||||
name="cancel"
|
|
||||||
@click.stop.prevent="receivedate = null"
|
|
||||||
class="cursor-pointer"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
<template #year-overlay-value="{ value }">
|
||||||
</template>
|
{{ parseInt(value + 543) }}
|
||||||
</datepicker>
|
</template>
|
||||||
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
class="inputgreen"
|
||||||
|
dense
|
||||||
|
borderless
|
||||||
|
outlined
|
||||||
|
:rules="[(val:string) => !!val || 'กรุณาเลือกวันที่']"
|
||||||
|
hide-bottom-space
|
||||||
|
:model-value="
|
||||||
|
receivedate != null
|
||||||
|
? date2Thai(receivedate)
|
||||||
|
: undefined
|
||||||
|
"
|
||||||
|
:label="`${'วันที่ยืม'}`"
|
||||||
|
>
|
||||||
|
<template v-if="receivedate" v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
name="cancel"
|
||||||
|
@click.stop.prevent="receivedate = null"
|
||||||
|
class="cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
|
class="row col-12 q-col-gutter-xs q-pa-md"
|
||||||
v-if="props.action === 'editData'"
|
v-if="props.action === 'editData'"
|
||||||
>
|
>
|
||||||
<div class="col-12 text-weight-bold text-grey-7">
|
<div class="col-12 text-weight-bold text-grey-7">
|
||||||
|
|
@ -491,7 +719,12 @@ onMounted(() => {
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
<q-card-actions align="right">
|
<q-card-actions align="right">
|
||||||
<q-btn label="บันทึก" type="submit" color="public">
|
<q-btn
|
||||||
|
label="บันทึก"
|
||||||
|
type="submit"
|
||||||
|
color="public"
|
||||||
|
:disable="selected.length === 0 && props.action === 'addData'"
|
||||||
|
>
|
||||||
<q-tooltip>บันทึก</q-tooltip>
|
<q-tooltip>บันทึก</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
|
|
|
||||||
483
src/modules/07_insignia/components/7_Reclaim/DialogForm.vue
Normal file
483
src/modules/07_insignia/components/7_Reclaim/DialogForm.vue
Normal file
|
|
@ -0,0 +1,483 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, watch, onMounted } from "vue";
|
||||||
|
import { QForm, useQuasar } from "quasar";
|
||||||
|
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useBrrowDataStore } from "@/modules/07_insignia/storeBrrow";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
/** impotrType */
|
||||||
|
import type { QTableColumn } from "quasar";
|
||||||
|
|
||||||
|
/** impotrComponents */
|
||||||
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
|
const $q = useQuasar();
|
||||||
|
const brrowDataStore = useBrrowDataStore();
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const {
|
||||||
|
date2Thai,
|
||||||
|
dialogConfirm,
|
||||||
|
success,
|
||||||
|
messageError,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
onSearchDataTable,
|
||||||
|
convertDateToAPI,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
|
/** props*/
|
||||||
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
|
const isEdit = defineModel<boolean>("isEdit", { required: true });
|
||||||
|
|
||||||
|
const props = defineProps({});
|
||||||
|
|
||||||
|
const rows = ref<any[]>([]);
|
||||||
|
const rowsMain = ref<any[]>([]);
|
||||||
|
const keyword = ref<string>("");
|
||||||
|
const selected = ref<any[]>([]);
|
||||||
|
const columns = ref<QTableColumn[]>([
|
||||||
|
{
|
||||||
|
name: "noNumber",
|
||||||
|
align: "left",
|
||||||
|
label: "ลำดับ",
|
||||||
|
field: "noNumber",
|
||||||
|
sortable: false,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "citizenId",
|
||||||
|
align: "left",
|
||||||
|
label: "เลขประจำตัวประชาชน",
|
||||||
|
field: "citizenId",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "fullName",
|
||||||
|
align: "left",
|
||||||
|
label: "ชื่อ-นามสกุล",
|
||||||
|
field: "fullName",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "profileType",
|
||||||
|
align: "left",
|
||||||
|
label: "ประเภทตำแหน่ง",
|
||||||
|
field: "profileType",
|
||||||
|
sortable: true,
|
||||||
|
format(val, row) {
|
||||||
|
return brrowDataStore.profileType(val);
|
||||||
|
},
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "position",
|
||||||
|
align: "left",
|
||||||
|
label: "ตำแหน่งประเภท",
|
||||||
|
field: "position",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "requestInsignia",
|
||||||
|
align: "left",
|
||||||
|
label: "เครื่องราชๆ",
|
||||||
|
field: "requestInsignia",
|
||||||
|
format(val, row) {
|
||||||
|
return `${row.requestInsignia ?? ""}
|
||||||
|
${
|
||||||
|
row.requestInsigniaShortName ? `(${row.requestInsigniaShortName})` : ""
|
||||||
|
} `;
|
||||||
|
},
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "dateReceive",
|
||||||
|
align: "left",
|
||||||
|
label: "วันที่ได้รับพระราชทาน",
|
||||||
|
field: "dateReceive",
|
||||||
|
sortable: true,
|
||||||
|
format(val, row) {
|
||||||
|
return date2Thai(val);
|
||||||
|
},
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
|
||||||
|
// {
|
||||||
|
// name: "date",
|
||||||
|
// align: "left",
|
||||||
|
// label: "วันที่ในราชกิจนุเบกษา",
|
||||||
|
// field: "date",
|
||||||
|
// sortable: true,
|
||||||
|
// format(val, row) {
|
||||||
|
// return date2Thai(val);
|
||||||
|
// },
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "volumeNo",
|
||||||
|
// align: "left",
|
||||||
|
// label: "เล่มที่ในราชกิจนุเบกษา",
|
||||||
|
// field: "volumeNo",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "section",
|
||||||
|
// align: "left",
|
||||||
|
// label: "ตอนที่ในราชกิจนุเบกษา",
|
||||||
|
// field: "section",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "page",
|
||||||
|
// align: "left",
|
||||||
|
// label: "หน้าในราชกิจนุเบกษา",
|
||||||
|
// field: "page",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "no",
|
||||||
|
// align: "left",
|
||||||
|
// label: "ลำดับที่ในราชกิจจานุเบกษา",
|
||||||
|
// field: "no",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "number",
|
||||||
|
// align: "left",
|
||||||
|
// label: "หมายเลขใบกำกับ",
|
||||||
|
// field: "number",
|
||||||
|
// sortable: true,
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
|
]);
|
||||||
|
const visibleColumns = ref<string[]>([
|
||||||
|
"noNumber",
|
||||||
|
"citizenId",
|
||||||
|
"fullName",
|
||||||
|
"profileType",
|
||||||
|
"position",
|
||||||
|
"requestInsignia",
|
||||||
|
"dateReceive",
|
||||||
|
// "date",
|
||||||
|
// "volumeNo",
|
||||||
|
// "section",
|
||||||
|
// "page",
|
||||||
|
// "no",
|
||||||
|
// "number",
|
||||||
|
]);
|
||||||
|
|
||||||
|
const roundNo = ref<string | undefined>(""); //รอบการขอเครื่องราชฯ
|
||||||
|
const cardid = ref<string>(""); //เลขประจำตัวประชาชน
|
||||||
|
const fullName = ref<string>(""); //ชื่อ-นามสกุล
|
||||||
|
const insigniaType = ref<string>(""); //เครื่องราชฯ
|
||||||
|
const receivedate = ref<Date | null>(); //วันที่ยืม
|
||||||
|
const reason = ref<string>(""); //หมายเหตุการเรียกคืน
|
||||||
|
|
||||||
|
const filterSelectRound = ref<any>();
|
||||||
|
|
||||||
|
/** function เคลียร์ข้อมูลในฟอร์ม*/
|
||||||
|
function clearData() {}
|
||||||
|
|
||||||
|
/** function เรียกข้อมูลรายชื่อที่ได้รับเครื่องราช*/
|
||||||
|
async function fecthListPerson() {
|
||||||
|
if (roundNo.value !== "" && roundNo.value !== null) {
|
||||||
|
let data = {
|
||||||
|
// insigniaTypeId: props.typeId,
|
||||||
|
insigniaNoteId: roundNo.value,
|
||||||
|
insigniaId: "",
|
||||||
|
};
|
||||||
|
await http
|
||||||
|
.post(config.API.noteSearchList(), data)
|
||||||
|
.then((res) => {
|
||||||
|
rowsMain.value = res.data.result;
|
||||||
|
rows.value = res.data.result;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function บันทึกการเพิ่มข้อมูล
|
||||||
|
*/
|
||||||
|
async function onSubmit() {
|
||||||
|
dialogConfirm($q, async () => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** function closePopup*/
|
||||||
|
function closeDialog() {
|
||||||
|
modal.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
keyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** function callback เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล*/
|
||||||
|
watch(modal, () => {});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<q-dialog v-model="modal" persistent>
|
||||||
|
<q-card :style="!isEdit ? 'min-width: 80vw' : 'min-width: 30vw'">
|
||||||
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
|
<DialogHeader
|
||||||
|
:tittle="`${!isEdit ? 'บันทึก' : 'แก้ไข'}การเรียกคืนเครื่องราชฯ`"
|
||||||
|
:close="closeDialog"
|
||||||
|
/>
|
||||||
|
<q-separator />
|
||||||
|
<q-card-section :horizontal="$q.screen.gt.md" style="padding: 0px">
|
||||||
|
<div class="row col-12">
|
||||||
|
<div class="q-pa-md col-md-8 col-xs-12" v-if="!isEdit">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
|
<q-space />
|
||||||
|
<div class="row q-col-gutter-sm">
|
||||||
|
<q-input
|
||||||
|
standout
|
||||||
|
dense
|
||||||
|
v-model="keyword"
|
||||||
|
outlined
|
||||||
|
placeholder="ค้นหา"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
|
>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon name="search" />
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
|
||||||
|
<q-select
|
||||||
|
v-model="visibleColumns"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
options-dense
|
||||||
|
:display-value="$q.lang.table.columns"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:options="columns"
|
||||||
|
option-value="name"
|
||||||
|
style="min-width: 140px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 q-pt-sm">
|
||||||
|
<d-table
|
||||||
|
ref="table"
|
||||||
|
:columns="columns"
|
||||||
|
:rows="rows"
|
||||||
|
row-key="id"
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
:paging="true"
|
||||||
|
dense
|
||||||
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
|
selection="single"
|
||||||
|
v-model:selected="selected"
|
||||||
|
>
|
||||||
|
<template v-slot:header="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-th auto-width></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"
|
||||||
|
>
|
||||||
|
<div v-if="col.name === 'noNumber'">
|
||||||
|
{{ props.rowIndex + 1 }}
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
{{ col.value ? col.value : "-" }}
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
</d-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<q-separator vertical />
|
||||||
|
<div class="q-pa-md col">
|
||||||
|
<div class="row q-col-gutter-sm">
|
||||||
|
<div class="col-12">
|
||||||
|
<q-select
|
||||||
|
class="inputgreen"
|
||||||
|
v-model="roundNo"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'รอบการขอเครื่องราชฯ'}`"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
use-input
|
||||||
|
option-label="name"
|
||||||
|
:options="filterSelectRound"
|
||||||
|
option-value="id"
|
||||||
|
:readonly="false"
|
||||||
|
:borderless="false"
|
||||||
|
style="min-width: 150px"
|
||||||
|
:rules="[(val:string) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ']"
|
||||||
|
@update:model-value="fecthListPerson()"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 q-mt-md text-weight-bold text-grey-7">
|
||||||
|
ข้อมูลผู้ถูกเรียกคืน
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12 col-sm-6">
|
||||||
|
<q-input
|
||||||
|
hide-bottom-space
|
||||||
|
outlined
|
||||||
|
readonly
|
||||||
|
v-model="cardid"
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
label="เลขประจำตัวประชาชน"
|
||||||
|
maxlength="13"
|
||||||
|
mask="#############"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-6 col-sm-6">
|
||||||
|
<q-input
|
||||||
|
readonly
|
||||||
|
hide-bottom-space
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
borderless
|
||||||
|
v-model="fullName"
|
||||||
|
:label="`${'ชื่อ-นามสกุล'}`"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12 q-mt-md text-weight-bold text-grey-7">
|
||||||
|
รายละเอียดการเรียกคือเครื่องราชฯ
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12 col-sm-6">
|
||||||
|
<q-input
|
||||||
|
v-model="insigniaType"
|
||||||
|
readonly
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'เครื่องราชฯ'}`"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xs-12 col-sm-6">
|
||||||
|
<datepicker
|
||||||
|
menu-class-name="modalfix"
|
||||||
|
v-model="receivedate"
|
||||||
|
: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
|
||||||
|
class="inputgreen"
|
||||||
|
dense
|
||||||
|
borderless
|
||||||
|
outlined
|
||||||
|
:rules="[(val:string) => !!val || 'กรุณาเลือกวันที่เรียกคืน']"
|
||||||
|
hide-bottom-space
|
||||||
|
:model-value="
|
||||||
|
receivedate != null
|
||||||
|
? date2Thai(receivedate)
|
||||||
|
: undefined
|
||||||
|
"
|
||||||
|
:label="`${'วันที่เรียกคืน'}`"
|
||||||
|
>
|
||||||
|
<template v-if="receivedate" v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
name="cancel"
|
||||||
|
@click.stop.prevent="receivedate = null"
|
||||||
|
class="cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<q-input
|
||||||
|
v-model="reason"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'หมายเหตุการเรียกคืน'}`"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-card-section>
|
||||||
|
|
||||||
|
<q-separator />
|
||||||
|
|
||||||
|
<q-card-actions align="right">
|
||||||
|
<q-btn label="บันทึก" type="submit" color="public">
|
||||||
|
<q-tooltip>บันทึก</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</q-card-actions>
|
||||||
|
</q-form>
|
||||||
|
</q-card>
|
||||||
|
</q-dialog>
|
||||||
|
</template>
|
||||||
|
|
@ -27,6 +27,9 @@ const ReportView = () => import("./views/06_ReportMain.vue");
|
||||||
const report_02 = () =>
|
const report_02 = () =>
|
||||||
import("@/modules/07_insignia/components/report/ReportDetail.vue");
|
import("@/modules/07_insignia/components/report/ReportDetail.vue");
|
||||||
|
|
||||||
|
const ReclaimMain = () =>
|
||||||
|
import("@/modules/07_insignia/views/07_ReclaimMain.vue");
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
path: "/insignia/round",
|
path: "/insignia/round",
|
||||||
|
|
@ -110,4 +113,15 @@ export default [
|
||||||
Role: "STAFF",
|
Role: "STAFF",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: "/insignia/reclaim",
|
||||||
|
name: "insigniaReclaim",
|
||||||
|
component: ReclaimMain,
|
||||||
|
meta: {
|
||||||
|
Auth: true,
|
||||||
|
Key: "SYS_INSIGNIA_RECLAIM",
|
||||||
|
Role: "STAFF",
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
18
src/modules/07_insignia/storeReclaim.ts
Normal file
18
src/modules/07_insignia/storeReclaim.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { defineStore } from "pinia";
|
||||||
|
import { ref } from "vue";
|
||||||
|
|
||||||
|
export const useInsigniaReclaimStore = defineStore("insigniaReclaim", () => {
|
||||||
|
const roundData = ref<any[]>([{ name: "ทั้งหมด", id: "all" }]);
|
||||||
|
const insigniaTypeData = ref<any[]>([{ name: "ทั้งหมด", id: "all" }]);
|
||||||
|
const employeeClassData = ref<any[]>([
|
||||||
|
{ name: "ทั้งหมด", id: "all" },
|
||||||
|
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" },
|
||||||
|
{ name: "ลูกจ้างประจำ", id: "perm" },
|
||||||
|
]);
|
||||||
|
|
||||||
|
return {
|
||||||
|
roundData,
|
||||||
|
insigniaTypeData,
|
||||||
|
employeeClassData,
|
||||||
|
};
|
||||||
|
});
|
||||||
494
src/modules/07_insignia/views/07_ReclaimMain.vue
Normal file
494
src/modules/07_insignia/views/07_ReclaimMain.vue
Normal file
|
|
@ -0,0 +1,494 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { reactive, ref, onMounted, watch } from "vue";
|
||||||
|
import { storeToRefs } from "pinia";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
|
import { checkPermission } from "@/utils/permissions";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useInsigniaReclaimStore } from "@/modules/07_insignia/storeReclaim";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
import type { QTableColumn } from "quasar";
|
||||||
|
|
||||||
|
import DialogForm from "@/modules/07_insignia/components/7_Reclaim/DialogForm.vue";
|
||||||
|
|
||||||
|
const $q = useQuasar();
|
||||||
|
const { roundData, insigniaTypeData, employeeClassData } = storeToRefs(
|
||||||
|
useInsigniaReclaimStore()
|
||||||
|
);
|
||||||
|
const { showLoader, hideLoader, messageError, dialogRemove } =
|
||||||
|
useCounterMixin();
|
||||||
|
|
||||||
|
/** Table*/
|
||||||
|
const rows = ref<any[]>([]);
|
||||||
|
const keyword = ref<string>("");
|
||||||
|
const columns = ref<QTableColumn[]>([
|
||||||
|
{
|
||||||
|
name: "no",
|
||||||
|
align: "left",
|
||||||
|
label: "ลำดับ",
|
||||||
|
field: "no",
|
||||||
|
sortable: false,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "citizenId",
|
||||||
|
align: "left",
|
||||||
|
label: "เลขประจำตัวประชาชน",
|
||||||
|
field: "citizenId",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "fullName",
|
||||||
|
align: "left",
|
||||||
|
label: "ชื่อ-นามสกุล",
|
||||||
|
field: "fullName",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "employeeType",
|
||||||
|
align: "left",
|
||||||
|
label: "ประเภทตำแหน่ง",
|
||||||
|
field: "employeeType",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "insigniaType",
|
||||||
|
align: "left",
|
||||||
|
label: "ประเภทเครื่องราชฯ",
|
||||||
|
field: "insigniaType",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "dateReceive",
|
||||||
|
align: "left",
|
||||||
|
label: "วันที่ได้รับพระราชทาน",
|
||||||
|
field: "dateReceive",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "date",
|
||||||
|
align: "left",
|
||||||
|
label: "วันที่ในราชกิจนุเบกษา",
|
||||||
|
field: "date",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "volumeNo",
|
||||||
|
align: "left",
|
||||||
|
label: "เล่มที่ในราชกิจนุเบกษา",
|
||||||
|
field: "volumeNo",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "section",
|
||||||
|
align: "left",
|
||||||
|
label: "ตอนที่ในราชกิจนุเบกษา",
|
||||||
|
field: "section",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "page",
|
||||||
|
align: "left",
|
||||||
|
label: "หน้าในราชกิจนุเบกษา",
|
||||||
|
field: "page",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "number",
|
||||||
|
align: "left",
|
||||||
|
label: "ลำดับที่ในราชกิจจานุเบกษา",
|
||||||
|
field: "number",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "vatnumber",
|
||||||
|
align: "left",
|
||||||
|
label: "หมายเลขใบกำกับ",
|
||||||
|
field: "vatnumber",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "payType",
|
||||||
|
align: "left",
|
||||||
|
label: "รูปแบบการจ่าย",
|
||||||
|
field: "payType",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "dateReturn",
|
||||||
|
align: "left",
|
||||||
|
label: "วันที่เรียกคืน",
|
||||||
|
field: "dateReturn",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "reasonReturn",
|
||||||
|
align: "left",
|
||||||
|
label: "หมายเหตุการเรียกคืน",
|
||||||
|
field: "reasonReturn",
|
||||||
|
sortable: true,
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const visibleColumns = ref<string[]>([
|
||||||
|
"no",
|
||||||
|
"citizenId",
|
||||||
|
"fullName",
|
||||||
|
"employeeType",
|
||||||
|
"insigniaType",
|
||||||
|
"dateReceive",
|
||||||
|
"date",
|
||||||
|
"volumeNo",
|
||||||
|
"section",
|
||||||
|
"page",
|
||||||
|
"number",
|
||||||
|
"vatnumber",
|
||||||
|
"payType",
|
||||||
|
"dateReturn",
|
||||||
|
"reasonReturn",
|
||||||
|
]);
|
||||||
|
|
||||||
|
const isInsigniaRound = ref<boolean>(true);
|
||||||
|
|
||||||
|
const roundOps = ref<any[]>(roundData.value);
|
||||||
|
const insigniaTypeOps = ref<any[]>(insigniaTypeData.value);
|
||||||
|
const employeeClassOps = ref<any[]>(employeeClassData.value);
|
||||||
|
|
||||||
|
const modalForm = ref<boolean>(false);
|
||||||
|
const isEdit = ref<boolean>(false);
|
||||||
|
|
||||||
|
/** function เรียกรอบการเสนอขอพระราชทานเครื่องราชฯ*/
|
||||||
|
async function fetchInsigniaRound() {
|
||||||
|
roundData.value = [{ name: "ทั้งหมด", id: "all" }];
|
||||||
|
await http
|
||||||
|
.get(config.API.noteround(), { params: { path: "BORROW" } })
|
||||||
|
.then(async (res) => {
|
||||||
|
let data = res.data.result;
|
||||||
|
// isInsigniaRound.value = data.length !== 0 ? true : false;
|
||||||
|
const newOption = data.map((e: any) => ({ name: e.name, id: e.id }));
|
||||||
|
roundData.value.push(...newOption);
|
||||||
|
roundOps.value = roundData.value;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** function เรียกประเภทเครื่องราชฯ*/
|
||||||
|
async function fetchInsigniaType() {
|
||||||
|
insigniaTypeData.value = [{ name: "ทั้งหมด", id: "all" }];
|
||||||
|
await http
|
||||||
|
.get(config.API.insigniaOrg)
|
||||||
|
.then(async (res) => {
|
||||||
|
let data = res.data.result;
|
||||||
|
const newOption = data.map((e: any) => ({ name: e.name, id: e.id }));
|
||||||
|
insigniaTypeData.value.push(...newOption);
|
||||||
|
insigniaTypeOps.value = insigniaTypeData.value;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetchDataReclaim() {
|
||||||
|
rows.value = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
no: "001",
|
||||||
|
citizenId: "1103701234567",
|
||||||
|
fullName: "นายสมชาย ใจดี",
|
||||||
|
employeeType: "ข้าราชการ",
|
||||||
|
insigniaType: "เครื่องราชอิสริยาภรณ์ชั้นที่ 4",
|
||||||
|
dateReceive: "2024-12-10",
|
||||||
|
date: "2025-01-15",
|
||||||
|
volumeNo: "78",
|
||||||
|
section: "ก",
|
||||||
|
page: "35",
|
||||||
|
number: "1432",
|
||||||
|
vatnumber: "3101234567890",
|
||||||
|
payType: "โอนเงินผ่านธนาคาร",
|
||||||
|
dateReturn: "2025-02-01",
|
||||||
|
reasonReturn: "เปลี่ยนประเภทสิทธิ",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function onOpenDialogForm(actions: boolean, id: string = "") {
|
||||||
|
modalForm.value = true;
|
||||||
|
isEdit.value = actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDeleteDataReclaim(id: string) {
|
||||||
|
dialogRemove($q, async () => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Hook*/
|
||||||
|
onMounted(async () => {
|
||||||
|
try {
|
||||||
|
showLoader();
|
||||||
|
await Promise.allSettled([fetchInsigniaRound(), fetchInsigniaType()]);
|
||||||
|
fetchDataReclaim();
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
|
เรียกคืนเครื่องราชฯ
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<q-card flat bordered class="q-pa-md" v-if="isInsigniaRound">
|
||||||
|
<div class="row q-col-gutter-sm">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="row q-col-gutter-y-sm">
|
||||||
|
<div class="row q-col-gutter-sm items-center">
|
||||||
|
<q-select
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'รอบการเสนอขอเครื่องราชฯ'}`"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
use-input
|
||||||
|
hide-selected
|
||||||
|
fill-input
|
||||||
|
option-label="name"
|
||||||
|
:options="roundOps"
|
||||||
|
option-value="year"
|
||||||
|
style="width: 340px"
|
||||||
|
>
|
||||||
|
<template v-slot:no-option>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section class="text-grey">
|
||||||
|
ไม่มีข้อมูล
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<q-space />
|
||||||
|
<div class="row q-col-gutter-sm">
|
||||||
|
<q-input
|
||||||
|
standout
|
||||||
|
dense
|
||||||
|
v-model="keyword"
|
||||||
|
outlined
|
||||||
|
placeholder="ค้นหา"
|
||||||
|
>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon name="search" />
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
|
||||||
|
<q-select
|
||||||
|
v-model="visibleColumns"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
options-dense
|
||||||
|
:display-value="$q.lang.table.columns"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:options="columns"
|
||||||
|
option-value="name"
|
||||||
|
style="min-width: 140px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<q-card bordered class="q-pa-sm col-12 bg-grey-1 q-mt-sm">
|
||||||
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
|
<q-select
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
use-input
|
||||||
|
hide-selected
|
||||||
|
fill-input
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'เครื่องราชฯ'}`"
|
||||||
|
:options="insigniaTypeOps"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
>
|
||||||
|
<template v-slot:no-option>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section class="text-grey">
|
||||||
|
ไม่มีข้อมูล
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
|
|
||||||
|
<q-select
|
||||||
|
class="col-2"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'ตำแหน่งประเภท'}`"
|
||||||
|
emit-value
|
||||||
|
use-input
|
||||||
|
hide-selected
|
||||||
|
fill-input
|
||||||
|
map-options
|
||||||
|
:options="employeeClassOps"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
>
|
||||||
|
<template v-slot:no-option>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section class="text-grey">
|
||||||
|
ไม่มีข้อมูล
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<q-btn
|
||||||
|
v-if="checkPermission($route)?.attrIsCreate"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="primary"
|
||||||
|
icon="mdi-plus"
|
||||||
|
@click.stop.pervent="onOpenDialogForm(false)"
|
||||||
|
>
|
||||||
|
<q-tooltip>เพิ่ม</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<d-table
|
||||||
|
ref="table"
|
||||||
|
:columns="columns"
|
||||||
|
:rows="rows"
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
:paging="true"
|
||||||
|
dense
|
||||||
|
class="custom-header-table"
|
||||||
|
:visible-columns="visibleColumns"
|
||||||
|
>
|
||||||
|
<!-- @update:pagination="updatePagination" -->
|
||||||
|
<template v-slot:header="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-th auto-width></q-th>
|
||||||
|
<q-th
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
style="color: #000000; font-weight: 500"
|
||||||
|
>
|
||||||
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
|
</q-th>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<template v-slot:body="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-td auto-width>
|
||||||
|
<q-btn
|
||||||
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsGet &&
|
||||||
|
checkPermission($route)?.attrIsUpdate
|
||||||
|
"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="edit"
|
||||||
|
icon="edit"
|
||||||
|
@click.stop.pervent="onOpenDialogForm(true, props.row.id)"
|
||||||
|
><q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
<q-btn
|
||||||
|
v-if="checkPermission($route)?.attrIsDelete"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="red"
|
||||||
|
icon="delete"
|
||||||
|
@click.stop.pervent="onDeleteDataReclaim(props.row.id)"
|
||||||
|
><q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</q-td>
|
||||||
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
<div>
|
||||||
|
{{ col.value ?? "-" }}
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<!-- <template v-slot:pagination="scope">
|
||||||
|
ทั้งหมด {{ total.toLocaleString() }} รายการ
|
||||||
|
<q-pagination
|
||||||
|
v-model="formFilter.page"
|
||||||
|
active-color="primary"
|
||||||
|
color="dark"
|
||||||
|
:max="Number(maxPage)"
|
||||||
|
size="sm"
|
||||||
|
boundary-links
|
||||||
|
direction-links
|
||||||
|
:max-pages="5"
|
||||||
|
@update:model-value="onSearchData(false)"
|
||||||
|
></q-pagination>
|
||||||
|
</template> -->
|
||||||
|
</d-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-card>
|
||||||
|
|
||||||
|
<q-card v-else>
|
||||||
|
<div class="q-pa-md q-gutter-sm">
|
||||||
|
<q-banner inline-actions rounded class="bg-grey-1 text-center">
|
||||||
|
ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||||
|
</q-banner>
|
||||||
|
</div>
|
||||||
|
</q-card>
|
||||||
|
|
||||||
|
<DialogForm v-model:modal="modalForm" :is-edit="isEdit" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue