diff --git a/src/modules/10_registry/01_Information/01_Information.vue b/src/modules/10_registry/01_Information/01_Information.vue index 83a33f9..51c6b64 100644 --- a/src/modules/10_registry/01_Information/01_Information.vue +++ b/src/modules/10_registry/01_Information/01_Information.vue @@ -12,8 +12,11 @@ import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; const $q = useQuasar(); const store = useRegistryInFormationStore(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError, date2Thai } = mixin; +const { showLoader, hideLoader, messageError, date2Thai, dialogConfirm } = + mixin; +const editPhone = ref(false); +const editEmail = ref(false); const rowsHistory = ref([]); const modalHistory = ref(false); @@ -31,8 +34,10 @@ const formDataInformation = reactive({ religion: "", //ศาสนา bloodGroup: "", //หมู่เลือด phone: "", //เบอร์โทร + email: "", }); +const emailVerify = ref(null); const visibleColumnsHistory = ref([ "citizenId", "prefix", @@ -277,6 +282,39 @@ function getHistory() { }); } +function onUndo(type: string) { + if (type == "phone") { + editPhone.value = false; + } else { + editEmail.value = false; + } +} + +function onSubmitEdit(type: string) { + dialogConfirm( + $q, + () => { + if (type == "phone") { + onSavePhone(); + } else { + onSaveEmail(); + } + }, + `ยืนยันการบันทึก${type == "phone" ? "(เบอร์โทร)" : "(Email)"}` + ); +} + +/** บันทึกเบอร์โทร */ +function onSavePhone() { + editPhone.value = false; +} + +/** บันทึก email */ +function onSaveEmail() { + emailVerify.value = false; + editEmail.value = false; +} + onMounted(() => { getData(); }); @@ -403,9 +441,122 @@ onMounted(() => {
-
เบอร์โทร
-
- {{ formDataInformation.phone ? formDataInformation.phone : "-" }} +
เบอร์โทร
+
+
+ + + +
+ + แก้ไข + +
+
+ + บันทึก + + + ยกเลิก + +
+
+
+
+
+
อีเมล
+
+
+ + +
+
+ + แก้ไข + +
+
+ + บันทึก + + + ยกเลิก + +
+
+
+ + รอยืนยันอีเมล + +
+