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

@@ -205,7 +205,7 @@ export default {
this.msgInfo.push({ message, type: "error" });
return (this.isloading = false);
}
let result = await this.$insertapi("upload", thefile.form, undefined, false);
let result = await this.$insertapi("upload", { data: thefile.form, notify: false });
if (result === "error") {
const message = this.$find(
this.$store.syspara,
@@ -393,7 +393,7 @@ export default {
};
try {
const rs = await this.$insertapi("findkey", payload, undefined, false);
const rs = await this.$insertapi("findkey", { data: payload, notify: false });
if (rs === "error") throw new Error();
else {
this.data = rs.data;
@@ -539,7 +539,7 @@ export default {
file: this.fileInfo.name,
fields: this.setting.detail,
};
await this.$insertapi("importlog", importLogPayload);
await this.$insertapi("importlog", { data: importLogPayload });
const interval = setInterval(() => this.getResult(importLogPayload.code), 2000);
// Lọc bản ghi KHÔNG có id (bản ghi mới)
@@ -553,14 +553,12 @@ export default {
// Gửi lên API - Backend sẽ INSERT
let result;
if (this.setting.call_api) {
result = await this.$insertapi(
this.setting.call_api,
{ data: filter, user: this.$store.login.id },
undefined,
importLogPayload.code,
);
result = await this.$insertapi(this.setting.call_api, {
data: { data: filter, user: this.$store.login.id },
notify: importLogPayload.code,
});
} else {
result = await this.$insertapi(this.setting.api, filter, undefined, importLogPayload.code);
result = await this.$insertapi(this.setting.api, { data: filter, notify: importLogPayload.code });
}
this.isloading = false;
@@ -640,7 +638,7 @@ export default {
file: this.fileInfo.name,
fields: this.setting.detail,
};
await this.$insertapi("importlog", importlogPayload);
await this.$insertapi("importlog", { data: importlogPayload });
const interval = setInterval(() => this.getResult(importlogPayload.code), 2000);
// Lọc bản ghi CÓ id (bản ghi tồn tại) VÀ KHÔNG CÓ LỖI
@@ -652,12 +650,10 @@ export default {
this.total = filter.length;
// Gửi lên API - Backend sẽ UPDATE
const result = await this.$insertapi(
this.setting.call_api || this.setting.api,
filter,
undefined,
importlogPayload.code,
);
const result = await this.$insertapi(this.setting.call_api || this.setting.api, {
data: filter,
notify: importlogPayload.code,
});
this.isloading = false;
clearInterval(interval);
this.getResult(importlogPayload.code);