@@ -18,7 +18,8 @@
|
||||
v-for="shipment in shipmentList"
|
||||
:key="shipment
|
||||
.id"
|
||||
class="grid grid-cols-6 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200"
|
||||
class="grid grid-cols-6 gap-4 px-4 py-3 text-sm border-t border-slate-200"
|
||||
:class="auth.canUseWorkflow ? 'hover:bg-slate-50 cursor-pointer' : ''"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="goShipment(shipment.id)"
|
||||
@@ -47,9 +48,11 @@
|
||||
<script setup lang="ts">
|
||||
import type {ShipmentData} from "~/services/dto/shipment-data";
|
||||
import {getShipmentList} from "~/services/shipment";
|
||||
import { useAuthStore } from '~/stores/auth'
|
||||
|
||||
const shipmentList = ref<ShipmentData[]>()
|
||||
const router = useRouter()
|
||||
const auth = useAuthStore()
|
||||
|
||||
const formatWeighing = (shipment: ShipmentData) => {
|
||||
const gross = shipment.weights?.find((weight) => weight.type === 'gross')?.weight
|
||||
@@ -76,6 +79,7 @@ const formatShipmentLines = (shipment: ShipmentData) => {
|
||||
}
|
||||
|
||||
const goShipment = (id: number) => {
|
||||
if (!auth.canUseWorkflow) return
|
||||
router.push(`/shipment/update/${id}`)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user