Merge branch 'develop' into working / ปรับ ui เกษียณ
This commit is contained in:
commit
fef791f4b8
81 changed files with 20864 additions and 2272 deletions
|
|
@ -13,8 +13,12 @@
|
|||
indicator-color="primary"
|
||||
align="left"
|
||||
>
|
||||
<q-tab name="samun" label="ขรก.กทม.สามัญ" />
|
||||
<q-tab name="employee" label="ลูกจ้างประจำ" />
|
||||
<q-tab name="officer" label="ขรก.กทม.สามัญ" @click="type = 'officer'" />
|
||||
<q-tab
|
||||
name="employee"
|
||||
label="ลูกจ้างประจำ"
|
||||
@click="type = 'employee'"
|
||||
/>
|
||||
</q-tabs>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
|
@ -27,7 +31,7 @@
|
|||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="fiscalyearOP"
|
||||
:options="yearOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
|
|
@ -37,7 +41,6 @@
|
|||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="searchFilterTable"
|
||||
/>
|
||||
<div>
|
||||
<q-btn
|
||||
|
|
@ -48,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">
|
||||
|
|
@ -126,7 +129,11 @@
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer" @click="nextPage">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
|
|
@ -134,9 +141,9 @@
|
|||
{{ props.row.Date }}
|
||||
</q-td>
|
||||
<q-td key="retireNumber" :props="props">
|
||||
{{ props.row.retireNumber }}
|
||||
{{ props.row.total }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<!-- <q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
|
|
@ -148,7 +155,7 @@
|
|||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-td> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
@ -171,7 +178,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import { onMounted, ref, useAttrs, reactive, watch } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
FormMainProbation,
|
||||
|
|
@ -179,7 +186,14 @@ import type {
|
|||
} from "@/modules/05_placement/interface/request/Main";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { resMain } from "@/modules/06_retirement/interface/response/Main";
|
||||
const yearOptions = reactive<any[]>([]);
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
|
||||
const router = useRouter();
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -190,6 +204,7 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const type = ref<string>("officer");
|
||||
const visibleColumns = ref<string[]>(["no", "Date", "retireNumber"]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
// หัวตาราง
|
||||
|
|
@ -224,31 +239,41 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<any>([
|
||||
{
|
||||
no: "1",
|
||||
Date: "2022-9-31 ",
|
||||
retireNumber: "5",
|
||||
},
|
||||
{
|
||||
no: "1",
|
||||
Date: "2022-9-15 ",
|
||||
retireNumber: "7",
|
||||
},
|
||||
{
|
||||
no: "1",
|
||||
Date: "2022-8-31 ",
|
||||
retireNumber: "15",
|
||||
},
|
||||
{
|
||||
no: "1",
|
||||
Date: "2022-9-25 ",
|
||||
retireNumber: "20",
|
||||
},
|
||||
]);
|
||||
const tab = ref<any>("samun");
|
||||
const currentYear = new Date().getFullYear();
|
||||
const rows = ref<resMain[]>([]);
|
||||
const tab = ref<any>("officer");
|
||||
const visibleColumns2 = ref<string[]>(["no", "name", "retireNumber"]);
|
||||
const getYear = () => {
|
||||
yearOptions.length = 0;
|
||||
yearOptions.push(currentYear + 543);
|
||||
// console.log(yearOptions);
|
||||
get(type.value, currentYear);
|
||||
fiscalyear.value = currentYear + 543;
|
||||
};
|
||||
const get = async (type: string, year: any) => {
|
||||
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) => ({
|
||||
id: items.id,
|
||||
Date: date2Thai(items.createdAt),
|
||||
year: items.year,
|
||||
retireNumber: items.round,
|
||||
total: items.total,
|
||||
}));
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getYear();
|
||||
});
|
||||
// หัวตาราง2
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -274,7 +299,7 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "จำนวนผู้เกษียณ",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
field: "total",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -319,34 +344,71 @@ const rows2 = ref<FormMainProbation2[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
// const clickDelete = (id: string) => {
|
||||
// $q.dialog({
|
||||
// title: "ยืนยันการลบข้อมูล",
|
||||
// message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// color: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk(async () => {})
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
// };
|
||||
|
||||
const clickAdd = () => {
|
||||
// modal.value = true;
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
title: 'เพิ่มประกาศ',
|
||||
message: 'เลือกประกาศที่ต้องการเพิ่มข้อมูล',
|
||||
options: {
|
||||
type: 'radio',
|
||||
model: 'opt1',
|
||||
// inline: true
|
||||
items: [
|
||||
{ label: 'ประกาศแก้ไข (เพิ่มคนเกษียณ)', value: 'opt1'},
|
||||
{ label: 'ประกาศแก้ไข (เฉพาะราย)', value: 'opt2' },
|
||||
{ label: 'ประกาศยกเลิก', value: 'opt3' }
|
||||
]
|
||||
},
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(data => {
|
||||
router.push(`/retirement/list/${type.value}/${currentYear}`);
|
||||
}).onCancel(() => {
|
||||
}).onDismiss(() => {
|
||||
})
|
||||
/* $q.dialog({
|
||||
title: "ยืนยันการเพิ่มข้อมูลประกาศเกษียณ",
|
||||
message: "ต้องการเพิ่มข้อมูลประกาศเกษียณใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {})
|
||||
.onOk(async () => {
|
||||
router.push(`/retirement/list/${type.value}/${currentYear}`);
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
const clickAdd = () => {
|
||||
// modal.value = true;
|
||||
router.push("/retirement/list");
|
||||
.onDismiss(() => {}); */
|
||||
};
|
||||
const clickClose = async () => {
|
||||
modal.value = false;
|
||||
};
|
||||
const fiscalyear = ref(["2566"]);
|
||||
const fiscalyear = ref<number>();
|
||||
const fiscalyearOP = ref<any>([
|
||||
{ id: 1, name: "ทั้งหมด" },
|
||||
{ id: 2, name: "2565" },
|
||||
{ id: 3, name: "2565" },
|
||||
]);
|
||||
|
||||
// ค้นหาในตาราง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
|
@ -369,9 +431,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");
|
||||
const nextPage = (prop: any) => {
|
||||
// console.log(prop.id);
|
||||
|
||||
router.push(`/retirement/listretire/${prop.id}/${type.value}`);
|
||||
};
|
||||
|
||||
watch(type, () => {
|
||||
get(type.value, currentYear);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scope>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue