This commit is contained in:
Viet An
2026-06-04 13:57:27 +07:00
parent 2981d9790a
commit 2a1f85c2af
44 changed files with 99 additions and 102 deletions

View File

@@ -270,7 +270,9 @@ async function update() {
if (!record.value.creator) record.value.creator = store.login.id;
record.value.updater = store.login.id;
record.update_time = new Date();
let rs = record.value.id ? await $updateapi("company", record.value) : await $insertapi("company", record.value);
let rs = record.value.id
? await $updateapi("company", record.value)
: await $insertapi("company", { data: record.value });
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;