From 8e2dd06def1af24682caea3340d0f6972d4d27ff Mon Sep 17 00:00:00 2001 From: Viet An Date: Wed, 3 Jun 2026 15:34:53 +0700 Subject: [PATCH] changes --- app/components/pos/ChooseIMEIButton.vue | 31 +++++ app/components/pos/ChooseIMEIModal.vue | 135 +++++++++++++++++++ app/components/pos/POS.vue | 75 ++++++++++- app/components/pos/ProductCard.vue | 67 ++++++++++ app/components/pos/ProductSelection.vue | 165 ++++++++++++++++++++++++ app/plugins/02-connection.js | 6 +- app/plugins/04-components.js | 2 + app/stores/index.js | 20 +-- 8 files changed, 480 insertions(+), 21 deletions(-) create mode 100644 app/components/pos/ChooseIMEIButton.vue create mode 100644 app/components/pos/ChooseIMEIModal.vue create mode 100644 app/components/pos/ProductCard.vue create mode 100644 app/components/pos/ProductSelection.vue diff --git a/app/components/pos/ChooseIMEIButton.vue b/app/components/pos/ChooseIMEIButton.vue new file mode 100644 index 0000000..4d2e9df --- /dev/null +++ b/app/components/pos/ChooseIMEIButton.vue @@ -0,0 +1,31 @@ + + + diff --git a/app/components/pos/ChooseIMEIModal.vue b/app/components/pos/ChooseIMEIModal.vue new file mode 100644 index 0000000..8d44693 --- /dev/null +++ b/app/components/pos/ChooseIMEIModal.vue @@ -0,0 +1,135 @@ + + + + diff --git a/app/components/pos/POS.vue b/app/components/pos/POS.vue index 1129805..cade47f 100644 --- a/app/components/pos/POS.vue +++ b/app/components/pos/POS.vue @@ -1,3 +1,74 @@ - + + + diff --git a/app/components/pos/ProductCard.vue b/app/components/pos/ProductCard.vue new file mode 100644 index 0000000..ce1c1a3 --- /dev/null +++ b/app/components/pos/ProductCard.vue @@ -0,0 +1,67 @@ + + + diff --git a/app/components/pos/ProductSelection.vue b/app/components/pos/ProductSelection.vue new file mode 100644 index 0000000..be099bd --- /dev/null +++ b/app/components/pos/ProductSelection.vue @@ -0,0 +1,165 @@ + + + diff --git a/app/plugins/02-connection.js b/app/plugins/02-connection.js index d9686bd..dcbff4a 100644 --- a/app/plugins/02-connection.js +++ b/app/plugins/02-connection.js @@ -1118,7 +1118,11 @@ export default defineNuxtPlugin((nuxtApp) => { name: "IMEI", url: "data/IMEI/", url_detail: "data-detail/IMEI/", - params: {}, + params: { + sort: "id", + values: + "id,code,imei,variant,variant,variant__code,variant__product,variant__product__code,variant__product__name,variant__product__manufacturer,variant__product__os,variant__product__battery,variant__product__screen,variant__product__cpu,variant__product__gpu,variant__product__camera_system,variant__product__sim,variant__product__network_technology,variant__product__charging_technology,variant__product__external_storage,variant__product__ip_rating,variant__product__design,variant__product__creator,variant__product__updater,variant__product__deleted,variant__color,variant__color__code,variant__color__name,variant__color__hex_code,variant__color__deleted,variant__ram,variant__ram__code,variant__ram__capacity,variant__ram__deleted,variant__internal_storage,variant__internal_storage__code,variant__internal_storage__capacity,variant__internal_storage__deleted,variant__image,variant__image__code,variant__image__name,variant__image__path,variant__image__is_active,variant__image__deleted,variant__image__create_time,variant__price,variant__note,variant__creator,variant__updater,variant__deleted,variant__create_time,variant__update_time,deleted,create_time,update_time", + }, }, { name: "Product_Image", diff --git a/app/plugins/04-components.js b/app/plugins/04-components.js index 6664e41..c604e03 100644 --- a/app/plugins/04-components.js +++ b/app/plugins/04-components.js @@ -4,6 +4,7 @@ import Orders from "@/components/orders/Orders.vue"; import Inventory from "@/components/inventory/Inventory.vue"; import Rights from "@/components/rights/Rights.vue"; import POS from "@/components/pos/POS.vue"; +import ChooseIMEIButton from "@/components/pos/ChooseIMEIButton.vue"; import CreateReceipts from "@/components/receipts/CreateReceipts.vue"; import Return from "@/components/receipts/Return.vue"; import Imports from "@/components/imports/Imports.vue"; @@ -137,6 +138,7 @@ const components = { Inventory, Rights, POS, + ChooseIMEIButton, CreateReceipts, Return, Imports, diff --git a/app/stores/index.js b/app/stores/index.js index e93be8d..c97761c 100644 --- a/app/stores/index.js +++ b/app/stores/index.js @@ -14,33 +14,17 @@ export const useStore = defineStore("maindev", { branch: {}, rights: [], product: [], + selectedImeis: [], }), actions: { commit(name, data) { // console.trace("commit", name, data); this[name] = data; }, - - updateProduct(products) { - this.product = products; - }, - - updateSingleProduct(updatedProduct) { - const index = this.product.findIndex((p) => p.id === updatedProduct.id); - if (index !== -1) { - this.product[index] = updatedProduct; - } else { - this.product.push(updatedProduct); - } - }, - - removeProduct(productId) { - this.product = this.product.filter((p) => p.id !== productId); - }, }, persist: { - pick: ["token", "login", "lang"], + pick: ["token", "login", "lang", "selectedImeis"], storage: piniaPluginPersistedstate.localStorage(), }, });