From e9e4fbe24fba90944adcbcb982c2ed3af3da16b5 Mon Sep 17 00:00:00 2001 From: Viet An Date: Tue, 30 Jun 2026 15:12:04 +0700 Subject: [PATCH] changes --- app/components/datatable/NewField.vue | 2 +- app/components/datepicker/PickDay.vue | 2 +- app/components/inventory/InventoryRow.vue | 8 +- app/components/inventory/InventoryTable.vue | 8 +- app/components/inventory/SelectedInvItem.vue | 8 +- app/components/orders/OrdersKanban.vue | 2 +- app/components/pos/CartItem.vue | 6 +- app/components/pos/CartTabs.vue | 10 ++- app/components/pos/ChooseIMEIModal.vue | 7 +- app/components/pos/ConfirmOrder.vue | 18 ++-- app/components/pos/POS.vue | 42 ++-------- app/components/pos/VietQR.vue | 2 +- .../pos/composables/useActiveCart.js | 22 +---- app/components/pos/composables/useCartData.js | 22 ----- app/components/pos/composables/useCustomer.js | 24 ------ .../pos/composables/useOrderInfo.js | 19 ++--- .../pos/composables/usePlaceOrder.js | 23 +++--- app/stores/usePosStore.js | 82 +++++++++++++++++++ 18 files changed, 149 insertions(+), 158 deletions(-) delete mode 100644 app/components/pos/composables/useCartData.js delete mode 100644 app/components/pos/composables/useCustomer.js create mode 100644 app/stores/usePosStore.js diff --git a/app/components/datatable/NewField.vue b/app/components/datatable/NewField.vue index 3c478d2..a023d45 100644 --- a/app/components/datatable/NewField.vue +++ b/app/components/datatable/NewField.vue @@ -30,7 +30,7 @@ {{ v.name }} -
+
-
+

{{ invItem.category }}

- {{ invItem.sku }} + {{ invItem.stock }} {{ invItem.preorder }} {{ invItem.available }} - {{ invItem.batch }} - {{ $dayjs(invItem.expired).format("L") }} + Sản phẩm - SKU + Tồn Đặt trước Khả dụng - Batch - Hạn sử dụng + Trạng thái diff --git a/app/components/inventory/SelectedInvItem.vue b/app/components/inventory/SelectedInvItem.vue index 2eef2a6..2ef3aa1 100644 --- a/app/components/inventory/SelectedInvItem.vue +++ b/app/components/inventory/SelectedInvItem.vue @@ -89,7 +89,7 @@ const emit = defineEmits("unselect");

Vị trí lưu kho

-
+

Thông tin lô hàng

-
+

Mã lô

{{ invItem.batch }}

-
+
diff --git a/app/components/orders/OrdersKanban.vue b/app/components/orders/OrdersKanban.vue index baab935..d2427bc 100644 --- a/app/components/orders/OrdersKanban.vue +++ b/app/components/orders/OrdersKanban.vue @@ -34,7 +34,7 @@ const emit = defineEmits(["selectOrder", "unselect"]);


-
+
@@ -69,7 +69,7 @@ async function removeFromCart() {

diff --git a/app/components/pos/POS.vue b/app/components/pos/POS.vue index 956030d..f80d0b2 100644 --- a/app/components/pos/POS.vue +++ b/app/components/pos/POS.vue @@ -3,32 +3,17 @@ import Address from "~/components/pos/Address.vue"; import CartItem from "~/components/pos/CartItem.vue"; import CartTabs from "~/components/pos/CartTabs.vue"; import useActiveCart from "~/components/pos/composables/useActiveCart"; -import useCartData from "~/components/pos/composables/useCartData"; -import useCustomer from "~/components/pos/composables/useCustomer"; import useOrderInfo from "~/components/pos/composables/useOrderInfo"; import SearchBox from "~/components/SearchBox.vue"; const store = useStore(); const { $insertapi, $formatNum } = useNuxtApp(); -const { carts, cartItems, customers, getCarts, isPending } = useCartData(); +const posStore = usePosStore(); +const { carts, isPending, activeCartId, invalidCartItems, addresses, orderInfo } = storeToRefs(posStore); -const { activeCartId, activeCart, activeCartItems, customerIdsWithNoCart, subtotal, invalidCartItems } = useActiveCart({ - carts, - cartItems, - customers, -}); - -const { addresses, getAddresses, isChangingCus, changeCustomer } = useCustomer({ activeCart, getCarts }); - -const { orderInfo, isOrderValid, fullAddress, total } = useOrderInfo({ - activeCartId, - activeCart, - activeCartItems, - addresses, - getAddresses, - subtotal, -}); +const { activeCart, activeCartItems, customerIdsWithNoCart, subtotal } = useActiveCart(); +const { isOrderValid, total } = useOrderInfo(); const showModal = ref(); @@ -57,19 +42,6 @@ function openAddAddressModal() { height: "auto", }; } -provide("pos", { - carts, - activeCartId, - activeCart, - activeCartItems, - invalidCartItems, - isChangingCus, - orderInfo, - fullAddress, - getCarts, - subtotal, - total, -});