This commit is contained in:
Viet An
2026-06-30 15:12:04 +07:00
parent 8b3da71895
commit e9e4fbe24f
18 changed files with 149 additions and 158 deletions

View File

@@ -2,11 +2,11 @@
import AddIMEIForm from "~/components/imports/AddIMEIForm.vue";
import ImportData from "~/components/parameter/ImportData.vue";
import { remove } from "es-toolkit";
import useActiveCart from "~/components/pos/composables/useActiveCart";
const props = defineProps({
variant: Object,
});
const store = useStore();
const { $getdata, $insertapi, $snackbar } = useNuxtApp();
const emit = defineEmits(["close"]);
@@ -22,7 +22,8 @@ function toggleSelected(imeiRec) {
}
}
const { activeCart, activeCartItems, getCarts } = inject("pos");
const posStore = usePosStore();
const { activeCart, activeCartItems } = useActiveCart();
const isAdding = ref(false);
async function addToCart() {
@@ -41,7 +42,7 @@ async function addToCart() {
});
$snackbar(`Đã thêm ${newCartItems.length} sản phẩm vào giỏ hàng`, "Success");
getCarts();
posStore.getCarts();
emit("close");
} catch (error) {
console.error(error);