no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-07-25 14:11:16 +07:00
parent a24e2298c0
commit 00f81dba34
6 changed files with 274 additions and 206 deletions

View file

@ -51,7 +51,7 @@
color="add"
icon="mdi-plus"
>
<q-tooltip>เพทดลองปฏหนาทราชการ</q-tooltip>
<q-tooltip>เพ</q-tooltip>
</q-btn>
<!-- <q-menu>
<q-list style="min-width: 100px">
@ -178,7 +178,7 @@
</template>
<script setup lang="ts">
import { onMounted, ref, useAttrs, reactive,watch } from "vue";
import { onMounted, ref, useAttrs, reactive, watch } from "vue";
import type { QTableProps } from "quasar";
import type {
FormMainProbation,
@ -243,18 +243,19 @@ const currentYear = new Date().getFullYear();
const rows = ref<resMain[]>([]);
const tab = ref<any>("officer");
const visibleColumns2 = ref<string[]>(["no", "name", "retireNumber"]);
const getYear = () => {
const getYear = () => {
yearOptions.length = 0;
yearOptions.push(currentYear+543);
yearOptions.push(currentYear + 543);
console.log(yearOptions);
get(type.value, currentYear);
fiscalyear.value = currentYear+543;
fiscalyear.value = currentYear + 543;
};
const get = async (type: string, year: number) => {
const get = async (type: string, year: string) => {
await http
.get(config.API.retirement(type, year))
.then((res) => {
console.log(res);
rows.value = [];
let data = res.data.result;
rows.value = data.map((items: resMain) => ({
@ -265,9 +266,7 @@ const get = async (type: string, year: number) => {
total: items.total,
}));
})
.catch((e) => {
})
.catch((e) => {})
.finally(() => {
hideLoader();
});
@ -345,24 +344,24 @@ const rows2 = ref<FormMainProbation2[]>([
},
]);
const clickDelete = (id: string) => {
$q.dialog({
title: "ยืนยันการลบข้อมูล",
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {})
.onCancel(() => {})
.onDismiss(() => {});
};
// const clickDelete = (id: string) => {
// $q.dialog({
// title: "",
// message: "?",
// cancel: {
// flat: true,
// color: "negative",
// },
// persistent: true,
// })
// .onOk(async () => {})
// .onCancel(() => {})
// .onDismiss(() => {});
// };
const clickAdd = () => {
// modal.value = true;
router.push("/retirement/list");
router.push(`/retirement/list/${type.value}/${currentYear}`);
};
const clickClose = async () => {
modal.value = false;
@ -396,16 +395,15 @@ const paginationLabel = (start: string, end: string, total: string) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
const nextPage = () => {
router.push(`/retirement/list/${type.value}/${currentYear}`);
const nextPage = (prop: any) => {
console.log(prop.id);
router.push(`/retirement/list/${prop.id}`);
};
watch(type,()=>{
console.log(type.value)
get(type.value,currentYear)
console.log("🚀 ~ file: Main.vue:417 ~ watch ~ fiscalyear:",typeof fiscalyear.value)
})
watch(type, () => {
get(type.value, currentYear);
});
</script>
<style lang="scss" scope>