Skip to content

Commit

Permalink
refactor(Price add): Improve barcode manual input by prefilling with …
Browse files Browse the repository at this point in the history
…current code (#949)
  • Loading branch information
raphodn authored Oct 9, 2024
1 parent 8042b82 commit a10c514
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/BarcodeManualInputDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@

<script>
export default {
props: {
preFillValue: {
type: String,
default: ''
}
},
emits: ['barcode', 'close'],
data() {
return {
Expand All @@ -49,6 +55,9 @@ export default {
}
},
mounted() {
if (this.preFillValue) {
this.barcodeForm.barcode = this.preFillValue
}
this.$refs.barcodeInput.focus()
},
methods: {
Expand Down
1 change: 1 addition & 0 deletions src/components/ProductInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<BarcodeManualInputDialog
v-if="barcodeManualInputDialog"
v-model="barcodeManualInputDialog"
:preFillValue="productForm.product_code"
@barcode="setProductCode($event)"
@close="barcodeManualInputDialog = false"
/>
Expand Down

0 comments on commit a10c514

Please sign in to comment.