fix === > แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย ทุกระบบ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-29 14:28:21 +07:00
parent bcd5d1d56c
commit d9bb320b16
17 changed files with 514 additions and 348 deletions

View file

@ -8,15 +8,11 @@ import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
/**
* importType
*/
/** importType*/
import type { QForm } from "quasar";
import type { DataProfile } from "@/modules/05_placement/interface/response/AppointMent";
/**
* importComponents
*/
/** importComponents*/
import CardProfile from "@/components/CardProfile.vue"; // card
const $q = useQuasar();
@ -34,6 +30,7 @@ const {
const paramsId = route.params.id; //id
const dataProfile = ref<DataProfile>(); //
const edit = ref<boolean>(false); //
const mainData = ref<any>();
const myForm = ref<QForm | null>(null);
const profileId = ref<string>("");
@ -48,9 +45,7 @@ const reason = ref<string>(""); //หมายเหตุ
const status = ref<string>("");
const fullName = ref<string>("");
/**
* fetch รายละเอยดการแตงต-เลอน-าย
*/
/** fetch รายละเอียดการแต่งตั้ง-เลื่อน-ย้าย*/
async function fecthappointmentByid() {
showLoader();
await http
@ -58,13 +53,14 @@ async function fecthappointmentByid() {
.then((res) => {
dataProfile.value = res.data.result as unknown as DataProfile;
const data = res.data.result;
mainData.value = res.data.result;
profileId.value = data.profileId;
fullName.value = `${data.prefix}${data.firstName ?? "-"} ${
data.lastName ?? "-"
}`;
(status.value = data.status),
(educationOld.value = data.educationOld ?? "-");
status.value = data.status;
educationOld.value = data.educationOld ?? "-";
organizationPositionOld.value = data.organizationPositionOld;
positionTypeOld.value = data.positionTypeOld;
positionLevelOld.value = data.positionLevelOld;
@ -81,13 +77,11 @@ async function fecthappointmentByid() {
});
}
/**
* นยนการบบทกขอมลลงบญชแนบทาย
*/
/** ยืนยันการบับทึกข้อมูลลงบัญชีแนบท้าย*/
function putAppointment() {
dialogConfirm(
$q,
() => {
async () => {
let data = {
educationOld: educationOld.value,
organizationPositionOld: organizationPositionOld.value,
@ -99,7 +93,7 @@ function putAppointment() {
positionDate: date.value,
};
showLoader();
http
await http
.put(config.API.appointmentByid(paramsId.toString()), data)
.then(async () => {
await fecthappointmentByid();
@ -118,13 +112,23 @@ function putAppointment() {
);
}
/**
* ยกเลกการแกไขลงบญชแนบทาย
*/
/** ยกเลิกการแก้ไขลงบัญชีแนบท้าย */
function cancel() {
edit.value = false;
const data = mainData.value;
if (data) {
status.value = data.status;
educationOld.value = data.educationOld ?? "-";
organizationPositionOld.value = data.organizationPositionOld;
positionTypeOld.value = data.positionTypeOld;
positionLevelOld.value = data.positionLevelOld;
posNo.value = data.positionNumberOld;
salary.value = data.salary ?? 0;
reason.value = data.reason;
date.value = data.positionDate;
}
myForm.value?.resetValidation();
fecthappointmentByid();
// fecthappointmentByid();
}
/**
@ -155,7 +159,7 @@ onMounted(() => {
class="q-mr-sm"
@click="router.push(`/placement/appoint-promote`)"
/>
รายละเอยดการแตงต-เลอน-าย{{ fullName }}
รายละเอยดการแตงต-เลอน-าย {{ fullName }}
</div>
<CardProfile :data="dataProfile as DataProfile" />
@ -306,24 +310,7 @@ onMounted(() => {
/>
</div>
</div>
<!-- <div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<q-input
v-model="salary"
:outlined="edit"
dense
:readonly="!edit"
hide-bottom-space
:borderless="!edit"
:label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules
mask="###,###,###,###"
reverse-fill-mask
:class="getClass(edit)"
/>
</div>
</div> -->
<div class="col-12"><q-separator /></div>
<div class="col-xs-6 col-sm-6 row items-center">
<div class="col-12">
@ -348,7 +335,7 @@ onMounted(() => {
:borderless="!edit"
:readonly="!edit"
:model-value="date !== null ? date2Thai(date) : null"
:rules="[(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
:rules="edit ? [(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`] : []"
hide-bottom-space
:label="`${'ดำรงตำแหน่งในระดับปัจจุบันเมื่อ'}`"
>