clearForm /persistent

This commit is contained in:
setthawutttty 2024-02-12 11:47:49 +07:00
parent 1915538e5e
commit 7070a6602a

View file

@ -249,6 +249,7 @@ const addData = async () => {
.post(config.API.createProfileOfficer(), formData)
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
clearForm();
})
.catch((e) => {
messageError($q, e);
@ -322,14 +323,36 @@ const fetchPerson = async () => {
hideLoader();
});
};
function clearForm() {
informaData.value.cardid = null;
informaData.value.age = null;
informaData.value.prefix = null;
informaData.value.prefixId = null;
informaData.value.firstname = null;
informaData.value.lastname = null;
informaData.value.birthDate = "";
informaData.value.genderId = null;
informaData.value.bloodId = null;
informaData.value.statusId = null;
informaData.value.tel = null;
informaData.value.employeeType = null;
informaData.value.employeeClass = null;
informaData.value.profileType = null;
}
function close() {
modal.value = false;
clearForm();
}
</script>
<template>
<q-dialog v-model="modal">
<q-dialog v-model="modal" persistent>
<q-card style="min-width: 60vw">
<Header
tittle="เพิ่มข้อมูลทะเบียนประวัติข้าราชการ กทม.สามัญ"
:close="() => (modal = false)"
:close="close"
/>
<q-separator />