no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-05 13:14:28 +07:00
parent bf1c6c3fe7
commit 6dee95b41b
2 changed files with 82 additions and 81 deletions

View file

@ -288,7 +288,7 @@
@update:model-value="updatePosNo"
class="col-3"
/>
<datepicker
<!-- <datepicker
class="col-2"
menu-class-name="modalfix"
:model-value="reportYear"
@ -298,9 +298,9 @@
:enableTimePicker="false"
@update:model-value="updateReportYear"
clearable
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
> -->
<!-- <template #year="{ year }">{{ year + 543 }}</template> -->
<!-- <template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
@ -317,7 +317,7 @@
:label="`${'ปีงบประมาณ'}`"
clearable
@clear="clearReportDate"
>
> -->
<!-- <template v-slot:prepend>
<q-icon
name="event"
@ -326,10 +326,10 @@
>
</q-icon>
</template> -->
</q-input>
<!-- </q-input>
</template>
</datepicker>
<q-input
</datepicker> -->
<!-- <q-input
clearable
dense
outlined
@ -339,8 +339,8 @@
label="เลขที่คำสั่ง"
@update:model-value="updateReportNo"
class="col-3"
/>
<q-input
/> -->
<!-- <q-input
clearable
dense
outlined
@ -350,7 +350,7 @@
label="ประเภทคำสั่ง"
@update:model-value="updateReportType"
class="col-4"
/>
/> -->
<q-toggle
dense

View file

@ -81,6 +81,10 @@ const clickOpenpopup = () => {
OrderTypeOption.value = props.OrderTypeOption.filter(
(e: any) => e.name !== "ทั้งหมด"
);
reportType.value = OrderTypeOption.value[0].id;
let currentDate = new Date();
let currentYear = currentDate.getFullYear();
reportYear.value = currentYear;
}
};
@ -111,73 +115,73 @@ const clickOpenpopup = () => {
// };
const clickSearch = async (type: string) => {
console.log(reportType.value);
console.log(reportYear.value);
console.log(reportNo.value);
// await myForm.value!.validate().then((result: boolean) => {
// if (result) {
// showLoader();
// let body = {};
// if (typeKeyword.value === "no") {
// Object.assign(body, {
// posNo: Keyword.value,
// });
// } else if (typeKeyword.value === "position") {
// Object.assign(body, {
// positionId: positionKeyword.value,
// });
// }
// http
// .post(config.API.profileHistory(type), body)
// .then((res) => {
// let data = res.data.result;
// if (data.length !== 0) {
// rows.value = data.map((e: any) => ({
// id: e.id,
// citizenId: e.citizenId,
// name: e.firstName + " " + e.lastName,
// posNo: e.posNo,
// position: e.position,
// date: date2Thai(e.date),
// }));
// } else {
// notifyError($q, "");
// rows.value = [];
// }
// })
// .catch((err) => {
// messageError($q, err);
// rows.value = [];
// })
// .finally(() => {
// hideLoader();
// });
// }
// });
};
const options = ref<any>([]);
const filterFn = (val: string, update: any) => {
if (val === "") {
update(() => {
options.value = OrderTypeOption.value;
});
return;
} else {
update(() => {
options.value = OrderTypeOption.value.filter(
(e: any) => e.name.search(val) !== -1
);
});
}
console.log(options.value);
await myForm.value!.validate().then((result: boolean) => {
if (result) {
console.log(reportType.value);
console.log(reportYear.value);
console.log(reportNo.value);
// showLoader();
// let body = {};
// if (typeKeyword.value === "no") {
// Object.assign(body, {
// posNo: Keyword.value,
// });
// } else if (typeKeyword.value === "position") {
// Object.assign(body, {
// positionId: positionKeyword.value,
// });
// }
// http
// .post(config.API.profileHistory(type), body)
// .then((res) => {
// let data = res.data.result;
// if (data.length !== 0) {
// rows.value = data.map((e: any) => ({
// id: e.id,
// citizenId: e.citizenId,
// name: e.firstName + " " + e.lastName,
// posNo: e.posNo,
// position: e.position,
// date: date2Thai(e.date),
// }));
// } else {
// notifyError($q, "");
// rows.value = [];
// }
// })
// .catch((err) => {
// messageError($q, err);
// rows.value = [];
// })
// .finally(() => {
// hideLoader();
// });
}
});
};
// const options = ref<any>([]);
// const filterFn = (val: string, update: any) => {
// if (val === "") {
// update(() => {
// options.value = OrderTypeOption.value;
// });
// return;
// } else {
// update(() => {
// options.value = OrderTypeOption.value.filter(
// (e: any) => e.name.search(val) !== -1
// );
// });
// }
// console.log(options.value);
// };
const clickRedirect = (id: string) => {
router.push(`/registry/${id}`);
};
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "order",
sortBy: "citizenId",
descending: false,
page: 1,
rowsPerPage: 10,
@ -193,7 +197,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-tooltip>แสดงประวออกคำส</q-tooltip></q-btn
>
<q-dialog v-model="modal">
<q-card style="width: 850px; max-width: 80vw">
<q-card style="width: 900px; max-width: 80vw">
<q-card-section>
<div class="my-content">
<div
@ -226,22 +230,18 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-form ref="myForm">
<div class="row col-12 q-col-gutter-xs">
<q-select
class="col-4"
class="col-6"
hide-bottom-space
:rules="[(val:string) => !!val || `${'กรุณาเลือก ตำแหน่ง'}`]"
:rules="[(val:string) => !!val || `${'กรุณาเลือก ประเภท'}`]"
outlined
dense
v-model="reportType"
emit-value
map-options
:options="options"
:options="OrderTypeOption"
option-label="name"
option-value="id"
:label="`${' ประเภท'}`"
use-input
input-debounce="0"
@filter="filterFn"
behavior="menu"
>
<template v-slot:no-option>
<q-item>
@ -252,7 +252,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
</template></q-select
>
<datepicker
class="col-4"
class="col-3"
menu-class-name="modalfix"
v-model="reportYear"
:locale="'th'"
@ -277,13 +277,14 @@ const paginationLabel = (start: number, end: number, total: number) => {
reportYear == null ? null : reportYear + 543
"
:label="`${'ปีงบประมาณ'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือก ปี'}`]"
clearable
>
</q-input>
</template>
</datepicker>
<q-input
class="col-4"
class="col-3"
clearable
dense
outlined