บรรจุ แต่งตั้ง ย้าย โอน => ปรับ 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

@ -19,7 +19,6 @@ import CardProfile from "@/components/CardProfile.vue";
const $q = useQuasar();
const route = useRoute();
const router = useRouter();
const mixin = useCounterMixin();
const edit = ref<boolean>(false);
const dataId = route.params.id as string;
const {
@ -30,12 +29,10 @@ const {
success,
dialogConfirm,
findOrgName,
} = mixin;
} = useCounterMixin();
const myForm = ref<QForm | null>(null);
const dataProfile = ref<DataProfile>();
const fullname = ref<string>("");
/** form แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
@ -50,8 +47,10 @@ const dateRepatriation = ref<Date | null>(null);
const reason = ref<string>("");
const status = ref<string>("");
/** fetch ข้อมูลรายละเอียด*/
const getData = () => {
/**
* fetch อมลรายละเอยด*
*/
function getData() {
showLoader();
http
.get(config.API.repatriationDetail(dataId))
@ -79,9 +78,12 @@ const getData = () => {
.finally(() => {
hideLoader();
});
};
}
const onSubmit = () => {
/**
* นยนการบนทกขอมลการแกไขขอมลเพอลงบญชแนบทายสำเร
*/
function onSubmit() {
dialogConfirm(
$q,
() => {
@ -99,10 +101,10 @@ const onSubmit = () => {
showLoader();
http
.put(config.API.repatriationMainEdit(dataId), body)
.then(() => {
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
.then(async () => {
await getData();
await success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
edit.value = false;
getData();
})
.catch((e) => {
messageError($q, e);
@ -114,14 +116,20 @@ const onSubmit = () => {
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
);
};
}
const cancelBtn = () => {
/**
* ยกเลกการแกไขขอมลเพอลงบญชแนบทายสำเร
*/
function cancelBtn() {
edit.value = !edit;
getData();
myForm.value?.resetValidation();
};
getData();
}
/**
* class Input
*/
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,
@ -146,7 +154,7 @@ onMounted(() => {
class="q-mr-sm"
@click="router.push(`/placement/repatriate`)"
/>
รายละเอยดการสงตวกล {{ fullname }}
รายละเอยดการสงตวกล{{ fullname }}
</div>
<CardProfile :data="dataProfile as DataProfile" />
@ -283,7 +291,7 @@ onMounted(() => {
hide-bottom-space
:borderless="!edit"
:label="`${'เงินเดือน'}`"
class="inputgreen"
:class="getClass(edit)"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules
mask="###,###,###,###"