บรรจุ แต่งตั้ง ย้าย โอน => ปรับ code และ load

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-19 16:14:43 +07:00
parent 9f4aeec575
commit 34dc306288
30 changed files with 1154 additions and 1429 deletions

View file

@ -7,13 +7,16 @@ import http from "@/plugins/http";
import config from "@/app.config";
import keycloak from "@/plugins/keycloak";
/**
* impotyType
*/
import type { resApiData } from "@/modules/05_placement/interface/response/OhterMain";
import type { QForm } from "quasar";
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
/** importComponents*/
import CardProfile from "@/components/CardProfile.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
@ -50,10 +53,12 @@ const date = ref<Date | null>(null);
const militaryDate = ref<Date | null>(null);
const reason = ref<string>("");
//-----(fetch data by id)-----//
const fetchData = async () => {
/**
* fetch รายละเอยดรายการอนๆ
*/
function fetchData() {
showLoader();
await http
http
.get(config.API.otherByid(paramsId.toString()))
.then((res: resApiData) => {
const data = res.data.result;
@ -83,10 +88,12 @@ const fetchData = async () => {
hideLoader();
edit.value = false;
});
};
}
//-----(update)-----//
const onSubmit = async () => {
/**
* นยนการบนทกขอมลเพอลงบญชแนบทาย
*/
function onSubmit() {
dialogConfirm(
$q,
async () => {
@ -117,13 +124,16 @@ const onSubmit = async () => {
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
);
};
}
const cancel = () => {
/**
* ยกเลกการแกไขขอมลเพอลงบญชแนบทาย
*/
function cancel() {
edit.value = false;
fetchData();
myForm.value?.resetValidation();
};
}
const getClass = (val: boolean) => {
return {
@ -136,7 +146,7 @@ onMounted(async () => {
if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
}
await fetchData();
fetchData();
});
</script>
@ -310,7 +320,7 @@ onMounted(async () => {
:outlined="edit"
dense
:readonly="!edit"
class="inputgreen"
:class="getClass(edit)"
hide-bottom-space
:borderless="!edit"
:label="`${'เงินเดือน'}`"