This commit is contained in:
Viet An
2026-05-25 15:23:12 +07:00
parent 5f2a98977b
commit 6685a43360
48 changed files with 732 additions and 2901 deletions

View File

@@ -339,7 +339,10 @@ async function update() {
if (!record.value.id) {
if (record.value.phone) {
record.value.phone = record.value.phone.trim();
let obj = await $getdata("people", { phone: record.value.phone }, undefined, true);
let obj = await $getdata("people", {
first: true,
filter: { phone: record.value.phone },
});
if (obj) {
existedPeople = obj;
errors.value.phone = "Số điện thoại đã tồn tại.";
@@ -368,7 +371,7 @@ async function update() {
record.image.map((v) => arr.push({ ref: record.value.id, file: v }));
await $insertapi("customerfile", arr, undefined, false);
}
let ele = await $getdata("people", { id: rs.id }, undefined, true);
let ele = await $getdata("people", { first: true, filter: { id: rs.id } });
emit("update", ele);
emit("modalevent", { name: "dataevent", data: ele });
if (props.pagename) $updatepage(props.pagename, ele);