@7365admin1/layer-common 4.90.2-staging.495 → 4.90.2-staging.496
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -60,8 +60,9 @@
|
|
|
60
60
|
</template>
|
|
61
61
|
|
|
62
62
|
<!-- Colleagues' open drafts (same company): any technician can take one over and finish it from their own stock. -->
|
|
63
|
-
<template v-if="
|
|
63
|
+
<template v-if="colleagueDraftsOffered">
|
|
64
64
|
<div class="text-subtitle-2 mb-2">Colleagues' jobs in progress ({{ colleagueDrafts.length }})</div>
|
|
65
|
+
<div v-if="!colleagueDrafts.length" class="text-body-2 text-medium-emphasis mb-3">No unfinished jobs from your colleagues right now.</div>
|
|
65
66
|
<AppCard v-for="d in colleagueDrafts" :key="d._id" class="pa-3 mb-2 d-flex flex-wrap align-center ga-3" style="border-left: 4px solid rgb(var(--v-theme-secondary))">
|
|
66
67
|
<InventoryPhotoThumbs :photos="{ before: d.photos?.before ?? [] }" :before-at="d.photosBeforeAt" :size="44" />
|
|
67
68
|
<div class="flex-grow-1" style="min-width: 200px">
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
</div>
|
|
94
95
|
<div class="d-flex flex-column ga-1">
|
|
95
96
|
<v-btn v-if="(h.free ?? h.qty) > 0 && ctl.recordUsage" class="text-none screen-btn-primary" variant="flat" size="small" @click="use(h)">Record usage</v-btn>
|
|
96
|
-
<v-btn v-if="h
|
|
97
|
+
<v-btn v-if="freeOf(h) > 0" class="text-none screen-btn-ghost" variant="outlined" size="small" @click="openGive(h)">Give to colleague</v-btn>
|
|
97
98
|
<v-btn v-if="stepsLive && freeOf(h) > 0" class="text-none screen-btn-ghost" variant="outlined" size="small" @click="openReturn(h)">Return to store</v-btn>
|
|
98
99
|
<v-btn v-if="stepsLive && ctl.recordUsage && freeOf(h) > 0" class="text-none" variant="text" size="small" prepend-icon="mdi-delete-alert-outline" @click="openWriteOff(h)">Write off</v-btn>
|
|
99
100
|
<v-btn class="text-none" variant="text" size="small" prepend-icon="mdi-history" @click="openHistory(h)">History</v-btn>
|
|
@@ -146,7 +147,7 @@
|
|
|
146
147
|
</v-card-title>
|
|
147
148
|
<v-card-text class="screen-modal__body">
|
|
148
149
|
<p class="text-body-2 text-medium-emphasis mb-3">
|
|
149
|
-
{{ give.holding?.itemName }}:
|
|
150
|
+
{{ give.holding?.itemName }}: {{ holdText(give.holding) }}. It moves to your colleague once they confirm they received it.
|
|
150
151
|
</p>
|
|
151
152
|
<v-form ref="giveForm" validate-on="blur invalid-input">
|
|
152
153
|
<InputLabel title="Colleague" required class="mb-1" />
|
|
@@ -159,6 +160,7 @@
|
|
|
159
160
|
placeholder="Search a name"
|
|
160
161
|
density="comfortable"
|
|
161
162
|
no-filter
|
|
163
|
+
no-data-text="No colleague from your company works at this property."
|
|
162
164
|
:rules="[(v: string) => !!v || 'Choose who you are giving it to']"
|
|
163
165
|
@update:search="searchColleagues"
|
|
164
166
|
/>
|
|
@@ -235,7 +237,7 @@ import useUtils from "../composables/useUtils";
|
|
|
235
237
|
import useLocalAuth from "../composables/useLocalAuth";
|
|
236
238
|
import { inventoryControls } from "../utils/inventory-presets";
|
|
237
239
|
import { colleagueDraftText, draftCardText } from "../utils/inventory-usage";
|
|
238
|
-
import { ackText, inventoryStepsLive, qtyUnit } from "../utils/inventory-ack";
|
|
240
|
+
import { ackText, holdText, inventoryStepsLive, qtyUnit } from "../utils/inventory-ack";
|
|
239
241
|
|
|
240
242
|
const props = defineProps({
|
|
241
243
|
store: { type: Object as PropType<TInventoryStore>, required: true },
|
|
@@ -334,6 +336,7 @@ async function loadDrafts() {
|
|
|
334
336
|
}
|
|
335
337
|
}
|
|
336
338
|
const colleagueDrafts = ref<TInventoryUsageDraft[]>([]);
|
|
339
|
+
const colleagueDraftsOffered = computed(() => ctl.value.recordUsage && stepsLive.value);
|
|
337
340
|
async function loadColleagueDrafts() {
|
|
338
341
|
// stepsLive = the API knows ?colleagues (an older API ignores it and returns my own, hence the mine/holder filter too).
|
|
339
342
|
if (!ctl.value.recordUsage || !stepsLive.value) return (colleagueDrafts.value = []);
|
|
@@ -97,13 +97,13 @@
|
|
|
97
97
|
</template>
|
|
98
98
|
<template #item.onHand="{ item }">
|
|
99
99
|
<!-- Owner 2026-10-03: what is requested comes off this number at once (set aside), so everyone sees what is really left. -->
|
|
100
|
-
<span :class="item.lowStock ? 'text-error font-weight-bold' : 'font-weight-medium'">{{ availableQty(item) }}</span>
|
|
101
|
-
<span class="text-medium-emphasis ml-1">{{ item.unit }}</span>
|
|
100
|
+
<span :class="item.lowStock ? 'text-error font-weight-bold' : 'font-weight-medium'">{{ qtyUnit(availableQty(item), item.unit) }}</span>
|
|
102
101
|
<v-chip v-if="item.lowStock" size="x-small" color="error" variant="tonal" class="ml-2">Low</v-chip>
|
|
103
102
|
<v-chip v-if="item.status === 'inactive'" size="x-small" variant="tonal" class="ml-2">Not in use</v-chip>
|
|
104
103
|
<div v-if="item.reserved" class="text-caption text-medium-emphasis">+ {{ item.reserved }} set aside for requests (still on the shelf)</div>
|
|
105
104
|
<div v-if="item.awaitingReceipt" class="text-caption text-medium-emphasis">{{ item.awaitingReceipt }} handed out, waiting for Received</div>
|
|
106
|
-
|
|
105
|
+
<!-- Acknowledge / PO details are for the people who handle the store; a technician sees only the Low chip. -->
|
|
106
|
+
<div v-if="item.lowStockAlert && canAckLow" class="text-caption text-error" @click.stop>
|
|
107
107
|
{{ lowStockAlertText(item.lowStockAlert, standardFormatDate) }}
|
|
108
108
|
<a v-if="canAckLow && !item.lowStockAlert.poNumber" href="#" class="text-primary ml-1" @click.prevent.stop="openAck(item)">Acknowledge</a>
|
|
109
109
|
</div>
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "4.90.2-staging.
|
|
5
|
+
"version": "4.90.2-staging.496",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|
package/utils/inventory-ack.ts
CHANGED
|
@@ -27,6 +27,12 @@ export function qtyUnit(qty: number | string | null | undefined, unit?: string |
|
|
|
27
27
|
return `${qty ?? ""} ${word}`.trim();
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/** "you hold 2 pcs" or, while some still wait for Received, "you hold 2 pcs (2 waiting for you to tap Received)". */
|
|
31
|
+
export function holdText(h: { qty?: number; unit?: string; unacknowledged?: number } | null | undefined) {
|
|
32
|
+
const locked = Math.min(Number(h?.unacknowledged ?? 0), Number(h?.qty ?? 0));
|
|
33
|
+
return `you hold ${qtyUnit(h?.qty ?? 0, h?.unit)}${locked > 0 ? ` (${locked} waiting for you to tap Received)` : ""}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
30
36
|
/** What can still be requested: `available` from the API, else what is on the shelf. */
|
|
31
37
|
export function availableQty(item: { onHand: number; available?: number }) {
|
|
32
38
|
return item.available ?? item.onHand;
|