Merge branch 'develop' into warunee-dev
This commit is contained in:
commit
672d014936
5 changed files with 55 additions and 37 deletions
|
|
@ -1 +1,8 @@
|
|||
export type {};
|
||||
interface resMain{
|
||||
id:string;
|
||||
createdAt:Date;
|
||||
year:string;
|
||||
round:number;
|
||||
total:number;
|
||||
}
|
||||
export type {resMain};
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
indicator-color="primary"
|
||||
align="left"
|
||||
>
|
||||
<q-tab name="samun" label="ขรก.กทม.สามัญ" />
|
||||
<q-tab name="employee" label="ลูกจ้างประจำ" />
|
||||
<q-tab name="samun" label="ขรก.กทม.สามัญ" @click="get('officer')"/>
|
||||
<q-tab name="employee" label="ลูกจ้างประจำ" @click="get('employee')"/>
|
||||
</q-tabs>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import { onMounted, ref, useAttrs } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
FormMainProbation,
|
||||
|
|
@ -183,7 +183,13 @@ 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 mixin = useCounterMixin()
|
||||
const { messageError ,date2Thai,showLoader,hideLoader} = mixin
|
||||
const router = useRouter();
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -228,31 +234,35 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<any>([
|
||||
{
|
||||
no: "1",
|
||||
Date: "2022-9-31 ",
|
||||
retireNumber: "5",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
Date: "2022-9-15 ",
|
||||
retireNumber: "7",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
Date: "2022-8-31 ",
|
||||
retireNumber: "15",
|
||||
},
|
||||
{
|
||||
no: "4",
|
||||
Date: "2022-9-25 ",
|
||||
retireNumber: "20",
|
||||
},
|
||||
]);
|
||||
const rows = ref<resMain[]>([]);
|
||||
const tab = ref<any>("samun");
|
||||
const visibleColumns2 = ref<string[]>(["no", "name", "retireNumber"]);
|
||||
const get = async(type:string) =>{
|
||||
|
||||
await http
|
||||
.get(config.API.retirement(type))
|
||||
.then((res)=>{
|
||||
let data = res.data.result
|
||||
console.log(data)
|
||||
rows.value = data.map((items:resMain) =>({
|
||||
id:items.id,
|
||||
Date:date2Thai(items.createdAt),
|
||||
year:items.year,
|
||||
retireNumber:items.round,
|
||||
total:items.total
|
||||
}))
|
||||
|
||||
}).catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader()
|
||||
});
|
||||
|
||||
}
|
||||
onMounted(()=>{
|
||||
get
|
||||
})
|
||||
// หัวตาราง2
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue