ทะเบียนประวัติ === > fix phon email
This commit is contained in:
parent
a9d5fc3770
commit
8d5fc1f92e
1 changed files with 23 additions and 3 deletions
|
|
@ -1,8 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useQuasar, type QTableColumn, type QTableProps } from "quasar";
|
||||
import { ref, reactive, onMounted, computed } from "vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -241,6 +241,20 @@ function onHistory() {
|
|||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
const mainEmail = ref<string>("");
|
||||
const mainPhone = ref<string>("");
|
||||
|
||||
const isCheckEmail = computed(() => {
|
||||
return mainEmail.value === formDataInformation.email ? true : false;
|
||||
});
|
||||
|
||||
const isCheckPhone = computed(() => {
|
||||
console.log("mainPhone", mainPhone.value);
|
||||
console.log("formDataInformation", formDataInformation.phone);
|
||||
|
||||
return mainPhone.value === formDataInformation.phone ? true : false;
|
||||
});
|
||||
|
||||
/** get data */
|
||||
async function getData() {
|
||||
showLoader();
|
||||
|
|
@ -264,6 +278,9 @@ async function getData() {
|
|||
formDataInformation.phone = data.phone;
|
||||
formDataInformation.email = data.email ? data.email.split("@")[0] : "";
|
||||
|
||||
mainEmail.value = data.email ? data.email.split("@")[0] : "";
|
||||
mainPhone.value = data.phone ? data.phone : "";
|
||||
|
||||
email.value = data.email ? data.email.split("@")[0] : "";
|
||||
phone.value = data.phone;
|
||||
|
||||
|
|
@ -528,13 +545,15 @@ onMounted(async () => {
|
|||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div v-else class="self-center col-3">
|
||||
<q-btn
|
||||
:disable="isCheckPhone"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
icon="save"
|
||||
color="primary"
|
||||
:color="isCheckPhone ? 'grey-6' : 'primary'"
|
||||
@click="onSavePhone"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
|
|
@ -593,11 +612,12 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div v-else class="self-center">
|
||||
<q-btn
|
||||
:disable="isCheckEmail"
|
||||
:color="isCheckEmail ? 'grey-6' : 'primary'"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
icon="save"
|
||||
color="primary"
|
||||
@click="onSaveEmail"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue