Refactoring code module 06_retirement
This commit is contained in:
parent
1225254062
commit
ea921b39b0
29 changed files with 730 additions and 823 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue