fixing
This commit is contained in:
parent
afe7fbf3dd
commit
7004be79f4
1 changed files with 12 additions and 7 deletions
|
|
@ -263,7 +263,7 @@ const visibleColumnsHistory = ref<String[]>([
|
||||||
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
http
|
||||||
.get(config.API.registryNewByProfileId(profileId.value, empType.value))
|
.get(config.API.registryNewByProfileId(profileId.value, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
informaData.value = await res.data.result;
|
informaData.value = await res.data.result;
|
||||||
|
|
@ -271,7 +271,10 @@ async function getData() {
|
||||||
id.value = informaData.value.id;
|
id.value = informaData.value.id;
|
||||||
|
|
||||||
if (informaData.value.birthDate) {
|
if (informaData.value.birthDate) {
|
||||||
|
console.log("birthDate===>", informaData.value.birthDate);
|
||||||
|
|
||||||
age.value = calculateAge(informaData.value.birthDate);
|
age.value = calculateAge(informaData.value.birthDate);
|
||||||
|
console.log("age===>", age.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -312,6 +315,8 @@ async function editData() {
|
||||||
function onClickOpenDialog() {
|
function onClickOpenDialog() {
|
||||||
if (!informaData.value) return;
|
if (!informaData.value) return;
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
|
console.log("onClickOpenDialog birthDate===>", informaData.value.birthDate);
|
||||||
|
|
||||||
id.value = informaData.value.id;
|
id.value = informaData.value.id;
|
||||||
age.value = calculateAge(informaData.value.birthDate);
|
age.value = calculateAge(informaData.value.birthDate);
|
||||||
formData.citizenId = informaData.value.citizenId;
|
formData.citizenId = informaData.value.citizenId;
|
||||||
|
|
@ -378,6 +383,8 @@ function changeCardID(citizenId: string | number | null) {
|
||||||
watch(
|
watch(
|
||||||
() => formData.birthDate,
|
() => formData.birthDate,
|
||||||
(v) => {
|
(v) => {
|
||||||
|
console.log("v===>", v);
|
||||||
|
|
||||||
if (v) {
|
if (v) {
|
||||||
age.value = calculateAge(v);
|
age.value = calculateAge(v);
|
||||||
}
|
}
|
||||||
|
|
@ -385,12 +392,12 @@ watch(
|
||||||
);
|
);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (store.Ops.prefixOps && store.Ops.prefixOps.length === 0) {
|
await getData();
|
||||||
|
|
||||||
|
if (store.Ops && store.Ops.prefixOps && store.Ops.prefixOps.length === 0) {
|
||||||
fetchPerson();
|
fetchPerson();
|
||||||
}
|
}
|
||||||
|
|
||||||
await getData();
|
|
||||||
|
|
||||||
// store.Ops.prefixOps.length === 0 ||
|
// store.Ops.prefixOps.length === 0 ||
|
||||||
// store.Ops.genderOps.length === 0 ||
|
// store.Ops.genderOps.length === 0 ||
|
||||||
// store.Ops.bloodOps.length === 0 ||
|
// store.Ops.bloodOps.length === 0 ||
|
||||||
|
|
@ -622,9 +629,7 @@ onMounted(async () => {
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
class="inputgreen"
|
class="inputgreen"
|
||||||
:model-value="
|
:model-value="
|
||||||
formData.birthDate != null
|
formData.birthDate ? date2Thai(formData.birthDate) : null
|
||||||
? date2Thai(formData.birthDate)
|
|
||||||
: null
|
|
||||||
"
|
"
|
||||||
:label="dataLabel.birthDate"
|
:label="dataLabel.birthDate"
|
||||||
:rules="[
|
:rules="[
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue