โครง get (ยังไม่เสร็จ) ประกาศเกษียณ

This commit is contained in:
setthawutttty 2023-07-24 17:38:57 +07:00
parent 5d2fdf254d
commit 3e626d48e1
4 changed files with 52 additions and 30 deletions

View file

@ -1,6 +1,6 @@
/**
* api
*/
import env from "../index";
const retirement = `${env.API_RETIREMENT_URI}/retirement`
export default {};
export default {
retirement:(type:string) => `${retirement}/${type}/2023`
};

View file

@ -25,6 +25,7 @@ const config = ref<any>({
API_URI_ORG_TREE:
"https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230712_172702.json",
MEET_URI: "meet.frappet.com",
API_RETIREMENT_URI: "https://bma-ehr.frappet.synology.me/api/v1",
},
test: {
API_URI: "http://localhost:5010/api/v1",
@ -65,6 +66,9 @@ const API_URI_PROFILE_SERVICE = ref<string>(
const API_PLACEMENT_URI = ref<string>(
config.value[env.value].API_PLACEMENT_URI
);
const API_RETIREMENT_URI = ref<string>(
config.value[env.value].API_RETIREMENT_URI
);
const API_URI_ORG_TREE = ref<string>(config.value[env.value].API_URI_ORG_TREE);
export default {
@ -79,4 +83,5 @@ export default {
API_PLACEMENT_URI: API_PLACEMENT_URI.value,
API_URI_ORG_TREE: API_URI_ORG_TREE.value,
MEET_URI: MEET_URI.value,
API_RETIREMENT_URI:API_RETIREMENT_URI.value,
};

View file

@ -1 +1,8 @@
export type {};
interface resMain{
id:string;
createdAt:Date;
year:string;
round:number;
total:number;
}
export type {resMain};

View file

@ -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"]>([
{