แก้ไข กรณี แก้ไข + ยกเลิก
This commit is contained in:
parent
016f256d38
commit
4959e0847e
6 changed files with 54 additions and 27 deletions
|
|
@ -6,7 +6,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||||
import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive";
|
import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive";
|
||||||
import type { appointmentData,ResponseData } from "@/modules/05_placement/interface/response/AppointMent";
|
import type { appointmentData,ResponseData } from "@/modules/05_placement/interface/response/AppointMent";
|
||||||
|
import type { QForm } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ prefixId:"",
|
||||||
firstname:"",
|
firstname:"",
|
||||||
lastname:""
|
lastname:""
|
||||||
});
|
});
|
||||||
const myform = ref<any>();
|
const myForm = ref<QForm | null>(null);
|
||||||
const edit = ref<boolean>(false);
|
const edit = ref<boolean>(false);
|
||||||
const profileId = ref<string>("");
|
const profileId = ref<string>("");
|
||||||
const organizationPositionOld = ref<string>("");
|
const organizationPositionOld = ref<string>("");
|
||||||
|
|
@ -87,12 +87,18 @@ const fecthappointmentByid = async () => {
|
||||||
|
|
||||||
//ยืนยันการเเก้ไข
|
//ยืนยันการเเก้ไข
|
||||||
const clickSave = async () => {
|
const clickSave = async () => {
|
||||||
await myform.value.validate().then(async (success: boolean) => {
|
if (myForm.value !== null) {
|
||||||
if (success) {
|
myForm.value.validate().then((success: any) => {
|
||||||
dialogConfirm($q, () => putAppointment());
|
if (success) {
|
||||||
} else {
|
dialogConfirm(
|
||||||
}
|
$q,
|
||||||
});
|
async () => await putAppointment(),
|
||||||
|
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||||
|
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// เเก้ไขข้อมูล
|
// เเก้ไขข้อมูล
|
||||||
const putAppointment = async () => {
|
const putAppointment = async () => {
|
||||||
|
|
@ -127,7 +133,7 @@ const putAppointment = async () => {
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
edit.value = false
|
edit.value = false
|
||||||
fecthappointmentByid()
|
fecthappointmentByid()
|
||||||
|
myForm.value?.resetValidation()
|
||||||
}
|
}
|
||||||
const getClass = (val: boolean) => {
|
const getClass = (val: boolean) => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -210,7 +216,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<q-form ref="myform">
|
<q-form ref="myForm">
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="text-weight-bold text-grey">วุฒิการศึกษา</div>
|
<div class="text-weight-bold text-grey">วุฒิการศึกษา</div>
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ const responseData = ref<ResponseDataDetail>({
|
||||||
const edit = ref<boolean>(false);
|
const edit = ref<boolean>(false);
|
||||||
const organizationPositionOld = ref<string>("");
|
const organizationPositionOld = ref<string>("");
|
||||||
const positionTypeOld = ref<string>("");
|
const positionTypeOld = ref<string>("");
|
||||||
const myform = ref<any>();
|
const myForm = ref<QForm | null>(null);
|
||||||
const positionLevelOld = ref<string>("");
|
const positionLevelOld = ref<string>("");
|
||||||
const posNo = ref<string>("");
|
const posNo = ref<string>("");
|
||||||
const salary = ref<number>(0);
|
const salary = ref<number>(0);
|
||||||
|
|
@ -111,13 +111,20 @@ const fecthOther = async () => {
|
||||||
|
|
||||||
//-----(edit)-----//
|
//-----(edit)-----//
|
||||||
const clickEdit = async () => {
|
const clickEdit = async () => {
|
||||||
await myform.value.validate().then(async (success: boolean) => {
|
if (myForm.value !== null) {
|
||||||
if (success) {
|
myForm.value.validate().then((success: any) => {
|
||||||
dialogConfirm($q, () => saveOther());
|
if (success) {
|
||||||
} else {
|
dialogConfirm(
|
||||||
}
|
$q,
|
||||||
});
|
async () => await saveOther(),
|
||||||
|
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||||
|
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----(update)-----//
|
//-----(update)-----//
|
||||||
const saveOther = async () => {
|
const saveOther = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
|
|
@ -145,6 +152,11 @@ const saveOther = async () => {
|
||||||
await fecthOther();
|
await fecthOther();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const cancel = () => {
|
||||||
|
edit.value = false;
|
||||||
|
fecthOther();
|
||||||
|
myForm.value?.resetValidation()
|
||||||
|
};
|
||||||
const getClass = (val: boolean) => {
|
const getClass = (val: boolean) => {
|
||||||
return {
|
return {
|
||||||
"full-width inputgreen cursor-pointer": val,
|
"full-width inputgreen cursor-pointer": val,
|
||||||
|
|
@ -227,12 +239,12 @@ onMounted(async () => {
|
||||||
<q-btn outline color="public" dense class="q-px-sm" label="บันทึก"
|
<q-btn outline color="public" dense class="q-px-sm" label="บันทึก"
|
||||||
style="width: 80px" @click="clickEdit" />
|
style="width: 80px" @click="clickEdit" />
|
||||||
<q-btn outline color="red" dense class="q-px-sm" label="ยกเลิก"
|
<q-btn outline color="red" dense class="q-px-sm" label="ยกเลิก"
|
||||||
style="width: 80px" @click="(edit = !edit), fecthOther()" />
|
style="width: 80px" @click="cancel()" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<q-form ref="myform">
|
<q-form ref="myForm">
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
<div class="col-12 row bg-white q-col-gutter-md">
|
<div class="col-12 row bg-white q-col-gutter-md">
|
||||||
<div class="col-xs-12 row items-center">
|
<div class="col-xs-12 row items-center">
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ const cancel = async () => {
|
||||||
edit.value = !edit.value;
|
edit.value = !edit.value;
|
||||||
if (myForm.value !== null) {
|
if (myForm.value !== null) {
|
||||||
await getData();
|
await getData();
|
||||||
myForm.value.reset();
|
myForm.value?.resetValidation()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ const conditionSave = async () => {
|
||||||
const cancelBtn = () => {
|
const cancelBtn = () => {
|
||||||
edit.value = !edit;
|
edit.value = !edit;
|
||||||
getData();
|
getData();
|
||||||
|
myForm.value?.resetValidation()
|
||||||
};
|
};
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
const body = {
|
const body = {
|
||||||
|
|
|
||||||
|
|
@ -277,6 +277,7 @@ const saveData = async () => {
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
edit.value = false
|
edit.value = false
|
||||||
getData()
|
getData()
|
||||||
|
myForm.value?.resetValidation()
|
||||||
}
|
}
|
||||||
const getClass = (val: boolean) => {
|
const getClass = (val: boolean) => {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -89,17 +89,24 @@ const getClass = (val: boolean) => {
|
||||||
};
|
};
|
||||||
//
|
//
|
||||||
const conditionSave = async () => {
|
const conditionSave = async () => {
|
||||||
dialogConfirm(
|
if (myForm.value !== null) {
|
||||||
$q,
|
myForm.value.validate().then((success: any) => {
|
||||||
async () => await saveData(),
|
if (success) {
|
||||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
dialogConfirm(
|
||||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
$q,
|
||||||
);
|
async () => await saveData(),
|
||||||
|
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||||
|
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const cancelBtn = () => {
|
const cancelBtn = () => {
|
||||||
edit.value = !edit;
|
edit.value = !edit;
|
||||||
getData();
|
getData();
|
||||||
|
myForm.value?.resetValidation()
|
||||||
};
|
};
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
const body = {
|
const body = {
|
||||||
|
|
@ -201,7 +208,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<q-form ref="myForm " class="window-width">
|
<q-form ref="myForm" class="window-width">
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
<div class="col-12 row bg-white q-col-gutter-md">
|
<div class="col-12 row bg-white q-col-gutter-md">
|
||||||
<div class="col-xs-12 row items-center">
|
<div class="col-xs-12 row items-center">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue