diff --git a/src/components/POS/Modern/ModernPOSSelectedItemTable.vue b/src/components/POS/Modern/ModernPOSSelectedItemTable.vue index a05bc4f5..07b5c1f2 100644 --- a/src/components/POS/Modern/ModernPOSSelectedItemTable.vue +++ b/src/components/POS/Modern/ModernPOSSelectedItemTable.vue @@ -43,7 +43,7 @@ :row="(row as SalesInvoiceItem)" @selected-row="selectedItemRow" @run-sinv-formulas="runSinvFormulas" - @toggle-modal="handleToggleModal" + @toggle-modal="$emit('toggleModal')" /> @@ -135,9 +135,6 @@ export default defineComponent({ }, }, methods: { - handleToggleModal(modal: string) { - this.$emit('toggleModal', modal); - }, async runSinvFormulas() { await this.sinvDoc.runFormulas(); }, diff --git a/src/components/POS/types.ts b/src/components/POS/types.ts index 17f45b92..e377208e 100644 --- a/src/components/POS/types.ts +++ b/src/components/POS/types.ts @@ -17,6 +17,20 @@ export type ModalName = | 'Alert' | 'CouponCode'; +export type PosEmits = + | 'addItem' + | 'toggleView' + | 'toggleModal' + | 'setCashAmount' + | 'setCouponsCount' + | 'routeToSinvList' + | 'setTransferRefNo' + | 'setLoyaltyPoints' + | 'setTransferAmount' + | 'createTransaction' + | 'selectedInvoiceName' + | 'setTransferClearanceDate'; + export interface POSItem { id?: number; image?: string; diff --git a/src/pages/POS/ClassicPOS.vue b/src/pages/POS/ClassicPOS.vue index cf13bb8a..ffc6f547 100644 --- a/src/pages/POS/ClassicPOS.vue +++ b/src/pages/POS/ClassicPOS.vue @@ -3,46 +3,56 @@ + - +
@@ -85,7 +95,7 @@ class="w-1/3" @item-selected=" async (name: string) => { - await selectItem(await getItem(name)); + emitEvent('addItem', await getItem(name) as Item); } " /> @@ -95,14 +105,14 @@ v-if="tableView" :items="items" :item-qty-map="itemQuantityMap as ItemQtyMap" - @add-item="selectItem" + @add-item="(item) => emitEvent('addItem', item)" />
@@ -111,9 +121,9 @@ :loyalty-points="loyaltyPoints" :loyalty-program="loyaltyProgram" :applied-coupons-count="appliedCouponsCount" - @toggle-view="toggleView" - @toggle-modal="toggleModal" - @emit-route-to-sinv-list="emitRouteToSinvList" + @toggle-view="emitEvent('toggleView')" + @emit-route-to-sinv-list="emitEvent('routeToSinvList')" + @toggle-modal="(modalName) => emitEvent('toggleModal', modalName)" />
@@ -199,6 +209,7 @@ :read-only="true" :text-right="true" /> + +