Refactoring code module 06_retirement

This commit is contained in:
STW_TTTY\stwtt 2024-09-18 15:18:57 +07:00
parent 1225254062
commit ea921b39b0
29 changed files with 730 additions and 823 deletions

View file

@ -1,10 +1,13 @@
<script setup lang="ts">
import { ref } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { RoundData } from "@/modules/06_retirement/interface/index/Main";
/** Use */
const $q = useQuasar();
@ -33,11 +36,11 @@ const props = defineProps({
const modal = ref<boolean>(false);
const radio = ref<string>("");
const actionOption = ref<any>([]);
const actionOption = ref<RoundData[]>([]);
const action = ref<string>("");
//
const clickAdd = () => {
function clickAdd() {
if (props.rows) {
//
if (props.rows.length == 0) {
@ -61,13 +64,14 @@ const clickAdd = () => {
round: `รอบ ${e.round} (ประกาศ ณ วันที่ ${e.signDate})`,
}));
actionOption.value = list;
console.log("🚀 ~ clickAdd ~ actionOption.value:", actionOption.value);
}
}
}
};
}
//
const clickSelect = async (action: string) => {
async function clickSelect(action: string) {
dialogConfirm(
$q,
async () => {
@ -83,10 +87,10 @@ const clickSelect = async (action: string) => {
"ยืนยันการแก้ไขข้อมูลประกาศเกษียณ",
"ต้องการแก้ไขข้อมูลประกาศเกษียณใช่หรือไม่ ?"
);
};
}
// API
const cerateRetirement = async (data: object) => {
async function cerateRetirement(data: object) {
await http
.post(config.API.createProfile(), data)
.then((res) => {
@ -97,7 +101,7 @@ const cerateRetirement = async (data: object) => {
.catch((e) => {
messageError($q, e);
});
};
}
</script>
<template>
<q-btn