2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

feat: add item through barcode scan

This commit is contained in:
akshayitzme 2024-01-02 12:38:31 +05:30
parent bcb602e299
commit 8cb126851e

View File

@ -35,22 +35,33 @@
>
<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 justify-between">
<!-- Item Search -->
<Link
class="border-r 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
@item-selected="
async (name: string) => {
await addItem(await getItem(name));
}
"
/>
</div>
<ItemsTable @add-item="addItem" />
</div>
</div>
@ -199,6 +210,7 @@ import {
validateShipment,
validateSinv,
} from 'src/utils/pos';
import Barcode from 'src/components/Controls/Barcode.vue';
export default defineComponent({
name: 'POS',
@ -213,6 +225,7 @@ export default defineComponent({
PageHeader,
PaymentModal,
SelectedItemTable,
Barcode,
},
provide() {
return {