Catalog seeding, blank-unique fix, slides rotation, console repair
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<!-- The tag prefix is shown as a fixed addon so operators type only
|
||||
the number part off the label. -->
|
||||
<div class="entry-input-group">
|
||||
<span class="entry-prefix">{{ LABEL_PREFIX }}</span>
|
||||
<span v-if="LABEL_PREFIX" class="entry-prefix">{{ LABEL_PREFIX }}</span>
|
||||
<input ref="entryInput" v-model="manualCode" class="entry-input has-prefix"
|
||||
inputmode="none" autocomplete="off" placeholder="number"
|
||||
@keydown.enter.prevent="lookupItem(manualCode)" />
|
||||
@@ -92,13 +92,16 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onBeforeUnmount, nextTick } from 'vue'
|
||||
import { printedpartsApi } from '@/api'
|
||||
import { printedpartsApi, settingsApi } from '@/api'
|
||||
import { withBase } from '@/utils/basePath'
|
||||
import TouchKeypad from '@/components/TouchKeypad.vue'
|
||||
|
||||
// Fixed tag prefix shown before the label number at the kiosk. Change here if
|
||||
// the gage lab tags use a different leading string.
|
||||
const LABEL_PREFIX = 'WJ'
|
||||
// Leading text on the physical labels, shown before the number box so operators
|
||||
// type only the digits. It was hardcoded to 'WJ', which is West Jefferson's tag
|
||||
// format and nobody else's - on another site's kiosk it told operators to expect
|
||||
// letters that are not on their labels. Display only: the lookup sends whatever
|
||||
// was typed, unprefixed.
|
||||
const LABEL_PREFIX = ref('')
|
||||
|
||||
const step = ref('item')
|
||||
const item = ref(null)
|
||||
@@ -113,7 +116,20 @@ const scannedRevision = ref(null)
|
||||
const entryInput = ref(null)
|
||||
let resetTimer = null
|
||||
|
||||
onMounted(focusEntry)
|
||||
onMounted(async () => {
|
||||
// A kiosk left running for weeks reads this once at load, which is fine: the
|
||||
// label format is a property of the site's physical tags, not something that
|
||||
// changes during a shift.
|
||||
try {
|
||||
const response = await settingsApi.get('printedparts_label_prefix')
|
||||
LABEL_PREFIX.value = (response.data?.data?.value || '').trim()
|
||||
} catch (err) {
|
||||
// Never block the kiosk over a cosmetic hint. An unreachable or unseeded
|
||||
// setting simply means no prefix is shown.
|
||||
LABEL_PREFIX.value = ''
|
||||
}
|
||||
focusEntry()
|
||||
})
|
||||
onBeforeUnmount(() => clearTimeout(resetTimer))
|
||||
|
||||
function focusEntry(event) {
|
||||
|
||||
@@ -18,6 +18,17 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Kiosk label prefix</label>
|
||||
<input v-model="values.printedparts_label_prefix" type="text"
|
||||
class="form-control" maxlength="8" placeholder="none" />
|
||||
<p class="field-hint">
|
||||
Leading text on this site's physical labels, shown at the kiosk before the
|
||||
number box so operators type only the digits. Leave it empty to show no
|
||||
prefix. This is about the printed tags, not the item codes above.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Default low-stock threshold</label>
|
||||
<input v-model.number="values.printedparts_default_threshold"
|
||||
@@ -103,6 +114,7 @@ import { settingsApi, usersApi, supportteamsApi } from '@/api'
|
||||
|
||||
const KEYS = [
|
||||
'printedparts_code_prefix',
|
||||
'printedparts_label_prefix',
|
||||
'printedparts_default_threshold',
|
||||
'printedparts_unknown_badge',
|
||||
'printedparts_alert_email',
|
||||
@@ -113,6 +125,7 @@ const KEYS = [
|
||||
|
||||
const values = ref({
|
||||
printedparts_code_prefix: '3DP',
|
||||
printedparts_label_prefix: '',
|
||||
printedparts_default_threshold: 5,
|
||||
printedparts_unknown_badge: 'deny',
|
||||
printedparts_alert_email: '',
|
||||
|
||||
Reference in New Issue
Block a user