This commit is contained in:
Viet An
2026-06-05 20:12:34 +07:00
parent 3254c64f7d
commit 541f99f82a
13 changed files with 47 additions and 83 deletions

View File

@@ -205,7 +205,7 @@ var props = defineProps({
row: Object,
});
const store = useStore();
const { $find, $getdata, $updateapi, $insertapi, $findapi, $getapi, $empty, $errPhone, $resetNull, $snackbar } =
const { $find, $getdata, $patchapi, $insertapi, $findapi, $getapi, $empty, $errPhone, $resetNull, $snackbar } =
useNuxtApp();
const emit = defineEmits(["update", "dataevent"]);
var viewport = store.viewport;
@@ -271,7 +271,7 @@ async function update() {
record.value.updater = store.login.id;
record.update_time = new Date();
let rs = record.value.id
? await $updateapi("company", record.value)
? await $patchapi("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");