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