This commit is contained in:
Warunee Tamkoo 2024-06-28 18:04:16 +07:00
parent e9367dea5c
commit eedddc19ae

View file

@ -140,7 +140,7 @@ const refreshData = async () => {
async () => { async () => {
emit("update:statusEdit", false); emit("update:statusEdit", false);
await props.fetch("Address"); await props.fetch("Address");
fetchProvince() fetchProvince();
edit.value = false; edit.value = false;
onEdit.value = false; onEdit.value = false;
}, },
@ -268,7 +268,7 @@ const fetchProvince = async () => {
const data = res.data.result; const data = res.data.result;
let option: optionData[] = []; let option: optionData[] = [];
data.map((r: any) => { data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() }); option.push({ id: r.id, name: r.name });
}); });
Ops.value.provinceOps = option; Ops.value.provinceOps = option;
OpsFilter.value.provinceOps = option; OpsFilter.value.provinceOps = option;
@ -332,8 +332,7 @@ const fetchProvince = async () => {
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {});
});
}; };
// //
@ -345,7 +344,7 @@ const fetchDistrict = async (id: string | null, position: string) => {
const data = res.data.result.districts; const data = res.data.result.districts;
let option: optionData[] = []; let option: optionData[] = [];
data.map((r: any) => { data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() }); option.push({ id: r.id, name: r.name });
}); });
if (position == "1") { if (position == "1") {
Ops.value.districtOps = option; Ops.value.districtOps = option;
@ -375,8 +374,7 @@ const fetchDistrict = async (id: string | null, position: string) => {
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {});
});
} }
}; };
@ -390,9 +388,9 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
let option: zipCodeOption[] = []; let option: zipCodeOption[] = [];
data.map((r: any) => { data.map((r: any) => {
option.push({ option.push({
id: r.id.toString(), id: r.id,
name: r.name.toString(), name: r.name,
zipCode: r.zipCode.toString(), zipCode: r.zipCode,
}); });
}); });
if (position == "1") { if (position == "1") {