Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: POS: add items by barcode scan and input #794

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 30 additions & 16 deletions src/pages/POS/POS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,34 @@
>
<div class="bg-white border col-span-5 rounded-md">
<div class="rounded-md p-4 col-span-5">
<!-- Item Search -->
<Link
class="border-r flex-shrink-0 w-full"
:df="{
label: t`Search an Item`,
fieldtype: 'Link',
fieldname: 'item',
target: 'Item',
}"
:border="true"
:value="itemSearchTerm"
@keyup.enter="
async () => await addItem(await getItem(itemSearchTerm))
"
@change="(item: string) =>itemSearchTerm= item"
/>
<div class="flex gap-x-2">
<!-- Item Search -->
<Link
class="flex-shrink-0 w-2/3"
:df="{
label: t`Search an Item`,
fieldtype: 'Link',
fieldname: 'item',
target: 'Item',
}"
:border="true"
:value="itemSearchTerm"
@keyup.enter="
async () => await addItem(await getItem(itemSearchTerm))
"
@change="(item: string) =>itemSearchTerm= item"
/>

<Barcode
class="w-1/3"
@item-selected="
async (name: string) => {
await addItem(await getItem(name));
}
"
/>
</div>

<ItemsTable @add-item="addItem" />
</div>
</div>
Expand Down Expand Up @@ -199,6 +211,7 @@ import {
validateShipment,
validateSinv,
} from 'src/utils/pos';
import Barcode from 'src/components/Controls/Barcode.vue';

export default defineComponent({
name: 'POS',
Expand All @@ -213,6 +226,7 @@ export default defineComponent({
PageHeader,
PaymentModal,
SelectedItemTable,
Barcode,
},
provide() {
return {
Expand Down
Loading