Catalog seeding, blank-unique fix, slides rotation, console repair

This commit is contained in:
2026-08-05 13:19:51 -04:00
parent 9c530a70db
commit d3e7311376
13 changed files with 3721 additions and 219 deletions

View File

@@ -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) {