Skip to content

Commit 6b09637

Browse files
committed
code improvement
1 parent ec7bb28 commit 6b09637

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

vue3/src/pages/InventoryBookingPage.vue

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,8 @@
4141
<model-select model="InventoryLocation" allow-create v-model="inventoryLocation" v-if="['add','move'].includes(bookingMode)"></model-select>
4242
<v-text-field :label="$t('SubLocation')" :hint="$t('SubLocationHelp')" v-model="subLocation" v-if="['add','move'].includes(bookingMode)"></v-text-field>
4343

44-
<v-text-field :label="$t('Code')" v-model="code" v-if="['add'].includes(bookingMode)">
45-
<template #append-inner>
46-
<v-tooltip location="top" :text="$t('CodeHelp')">
47-
<template v-slot:activator="{ props }">
48-
<v-icon v-bind="props" icon="$help"></v-icon>
49-
</template>
50-
</v-tooltip>
51-
</template>
52-
</v-text-field>
44+
<closable-help-alert :text="$t('CodeHelp')" class="mb-2"></closable-help-alert>
45+
<v-text-field :label="$t('Code')" v-model="code" v-if="['add'].includes(bookingMode)"></v-text-field>
5346

5447
<v-number-input :label="$t('Amount')" :precision="2" v-model="amount"></v-number-input>
5548
<model-select model="Unit" allow-create v-model="unit" v-if="['add'].includes(bookingMode)"></model-select>
@@ -135,7 +128,7 @@
135128

136129
<p class="text-disabled mt-4">{{ $t('Code') }}</p>
137130
<p class="text-h3 text-pre">
138-
{{ bookingConfirmEntry.code }}
131+
#{{ bookingConfirmEntry.code }}
139132
</p>
140133

141134
<template v-if="bookingConfirmEntry.expires">
@@ -179,6 +172,7 @@ import {ingredientToString} from "@/utils/model_utils.ts";
179172
import FreezerExpiryDialog from "@/components/dialogs/FreezerExpiryDialog.vue";
180173
import InventoryEntryLogDialog from "@/components/dialogs/InventoryEntryLogDialog.vue";
181174
import VClosableCardTitle from "@/components/dialogs/VClosableCardTitle.vue";
175+
import ClosableHelpAlert from "@/components/display/ClosableHelpAlert.vue";
182176
183177
const {t} = useI18n()
184178
@@ -255,7 +249,8 @@ function addInventory() {
255249
subLocation: subLocation.value,
256250
amount: amount.value,
257251
unit: unit.value,
258-
expires: expires.value
252+
expires: expires.value,
253+
code: code.value,
259254
} as InventoryEntry
260255
261256
api.apiInventoryEntryCreate({inventoryEntry: inventoryEntry}).then(r => {

0 commit comments

Comments
 (0)