ปรับ ระบบ บรรจุ

This commit is contained in:
STW_TTTY\stwtt 2024-05-07 17:06:34 +07:00
parent ad66cacc1e
commit 94afaca07b
13 changed files with 770 additions and 734 deletions

View file

@ -67,8 +67,8 @@ const fecthappointmentByid = async () => {
const data = res.data.result;
profileId.value = data.profileId;
title.value.fullname = `${data.prefix}${data.firstname ?? "-"} ${
data.lastname ?? "-"
title.value.fullname = `${data.prefix}${data.firstName ?? "-"} ${
data.lastName ?? "-"
}`;
title.value.organizationPositionOld = data.organizationPositionOld ?? "-";
title.value.positionLevelOld = data.positionLevelOld ?? "-";
@ -92,47 +92,39 @@ const fecthappointmentByid = async () => {
});
};
//
const clickSave = async () => {
if (myForm.value !== null) {
myForm.value.validate().then((success: any) => {
if (success) {
dialogConfirm(
$q,
async () => await putAppointment(),
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
);
}
});
}
};
//
const putAppointment = async () => {
let data = {
educationOld: educationOld.value,
organizationPositionOld: organizationPositionOld.value,
positionTypeOld: positionTypeOld.value,
positionLevelOld: positionLevelOld.value,
positionNumberOld: posNo.value,
amountOld: Number(salary.value),
reason: reason.value,
positionDate: date.value,
};
showLoader();
await http
.put(config.API.appointmentByid(paramsId.toString()), data)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
fecthappointmentByid();
edit.value = false;
});
};
function putAppointment() {
dialogConfirm(
$q,
() => {
let data = {
educationOld: educationOld.value,
organizationPositionOld: organizationPositionOld.value,
positionTypeOld: positionTypeOld.value,
positionLevelOld: positionLevelOld.value,
positionNumberOld: posNo.value,
amountOld: Number(salary.value),
reason: reason.value,
positionDate: date.value,
};
showLoader();
http
.put(config.API.appointmentByid(paramsId.toString()), data)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
fecthappointmentByid();
edit.value = false;
});
},
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
);
}
const cancel = () => {
edit.value = false;
fecthappointmentByid();
@ -175,48 +167,54 @@ onMounted(async () => {
<CardProfile :data="dataProfile as DataProfile" />
<q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">
แกไขขอมลเพอลงบญชแนบทาย
</div>
<q-space />
<div v-if="status !== 'DONE' && status !== 'REPORT'">
<div class="q-gutter-sm" v-if="!edit">
<q-btn
outline
color="primary"
dense
icon-right="mdi-file-edit-outline"
class="q-px-sm"
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
/>
<q-form
greedy
@submit.prevent
@validation-success="putAppointment"
ref="myForm"
>
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">
แกไขขอมลเพอลงบญชแนบทาย
</div>
<div class="q-gutter-sm" v-else>
<q-btn
outline
color="public"
dense
class="q-px-sm"
label="บันทึก"
style="width: 80px"
@click="clickSave"
/>
<q-btn
outline
color="red"
dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="cancel()"
/>
<q-space />
<div v-if="status !== 'DONE' && status !== 'REPORT'">
<div class="q-gutter-sm" v-if="!edit">
<q-btn
outline
color="primary"
dense
icon-right="mdi-file-edit-outline"
class="q-px-sm"
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
/>
</div>
<div class="q-gutter-sm" v-else>
<q-btn
outline
type="submit"
color="public"
dense
class="q-px-sm"
label="บันทึก"
style="width: 80px"
/>
<q-btn
outline
color="red"
dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="cancel()"
/>
</div>
</div>
</div>
</div>
<div class="col-12"><q-separator /></div>
<q-form ref="myForm">
<div class="col-12"><q-separator /></div>
<div class="row col-12 q-pa-md">
<div class="col-12">
<div class="text-weight-bold">การศกษา</div>
@ -311,12 +309,19 @@ onMounted(async () => {
</div>
<div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<CurrencyInput
<q-input
v-model="salary"
label="เงินเดือน"
:edit="edit"
:outlined="edit"
dense
:readonly="!edit"
hide-bottom-space
:borderless="!edit"
:label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules
mask="###,###,###,###"
reverse-fill-mask
class="inputgreen"
/>
</div>
</div>