changes
This commit is contained in:
@@ -256,7 +256,10 @@ async function update() {
|
||||
if (checkError()) return;
|
||||
if (!record.value.id) {
|
||||
if (record.value.phone) record.value.phone = record.value.phone.trim();
|
||||
let obj = await $getdata("company", { phone: record.value.phone }, undefined, true);
|
||||
const obj = await $getdata("company", {
|
||||
first: true,
|
||||
filter: { phone: record.value.phone },
|
||||
});
|
||||
if (obj) {
|
||||
existedCustomer = obj;
|
||||
errors.phone = "Số điện thoại đã tồn tại trong hệ thống.";
|
||||
@@ -271,7 +274,10 @@ async function update() {
|
||||
if (rs === "error") return;
|
||||
if (!record.value.id) $snackbar(`Khách hàng đã được khởi tạo với mã <b>${rs.code}</b>`, "Success");
|
||||
record.value.id = rs.id;
|
||||
let ele = await $getdata("company", { id: rs.id }, null, true);
|
||||
let ele = await $getdata("company", {
|
||||
first: true,
|
||||
filter: { id: rs.id },
|
||||
});
|
||||
emit("update", ele);
|
||||
emit("modalevent", { name: "dataevent", data: ele });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user