This commit is contained in:
Viet An
2026-07-03 09:24:05 +07:00
parent f519573c19
commit 4404c4654b
22 changed files with 59 additions and 39 deletions

View File

@@ -31,12 +31,11 @@ export default {
};
},
async created() {
if (!this.approvalcode && this.$store.state.login.approval_code)
this.approvalcode = this.$store.state.login.approval_code;
if (!this.approvalcode && this.$store.login.approval_code) this.approvalcode = this.$store.login.approval_code;
if (!this.approvalcode) {
const user = await this.$getdata("user", {
first: true,
filter: { id: this.$store.state.login.id },
filter: { id: this.$store.login.id },
});
this.approvalcode = user.approval_code;
}
@@ -47,7 +46,7 @@ export default {
computed: {
approvalcode: {
get() {
return this.$store.state["approvalcode"];
return this.$store.approvalcode;
},
set(val) {
this.$store.commit("updateStore", { name: "approvalcode", data: val });

View File

@@ -46,7 +46,7 @@ export default {
if (this.setdeleted) {
let record = await this.$getdata(name, { first: true, filter: { id } });
record.deleted = 1;
result = await this.$patchapi(name, record);
result = await this.$patchapi(name, { data: record });
} else result = await this.$deleteapi(name, id);
if (result === "error") return this.$dialog("Đã xảy ra lỗi, xóa dữ liệu thất bại", "Lỗi", "Error");
this.$snackbar("Dữ liệu đã được xoá khỏi hệ thống", "Success");