wip(freight): migration 0017 + model/column-list groundwork for add-freight-templates
This commit is contained in:
@@ -14,7 +14,6 @@ function statusClass(value: Shipment["status"]): "green" | "blue" | "orange" {
|
||||
return value === "delivered" ? "green" : value === "shipped" ? "blue" : "orange";
|
||||
}
|
||||
|
||||
|
||||
function formatDate(value: string): string {
|
||||
return new Date(value).toLocaleString(locale.value === "zh" ? "zh-CN" : "en-US");
|
||||
}
|
||||
@@ -49,7 +48,7 @@ onMounted(loadShipments);
|
||||
|
||||
<template>
|
||||
<VPage :title="$t('shop.shipmentList')">
|
||||
<div v-if="error" class="my-2 text-sm text-danger" role="alert">{{ error }}</div>
|
||||
<div v-if="error" class="text-danger my-2 text-sm" role="alert">{{ error }}</div>
|
||||
<p v-if="loading" class="text-muted">{{ $t("common.loading") }}</p>
|
||||
<VCard v-else-if="!shipments.length" class="text-muted">{{ $t("common.empty") }}</VCard>
|
||||
<VTable v-else>
|
||||
@@ -67,12 +66,28 @@ onMounted(loadShipments);
|
||||
<tbody>
|
||||
<tr v-for="shipment in shipments" :key="shipment.id">
|
||||
<td>{{ shipment.shipment_no }}</td>
|
||||
<td><NuxtLink :to="`/orders/${shipment.order_id}`" class="text-primary hover:underline">{{ shipment.order_no ?? shipment.order_id }}</NuxtLink></td>
|
||||
<td>
|
||||
<NuxtLink :to="`/orders/${shipment.order_id}`" class="text-primary hover:underline">{{
|
||||
shipment.order_no ?? shipment.order_id
|
||||
}}</NuxtLink>
|
||||
</td>
|
||||
<td>{{ shipment.carrier }}</td>
|
||||
<td>{{ shipment.tracking_no }}</td>
|
||||
<td><VBadge :tone="statusClass(shipment.status)">{{ $t(`shipment.status.${shipment.status}`) }}</VBadge></td>
|
||||
<td>
|
||||
<VBadge :tone="statusClass(shipment.status)">{{
|
||||
$t(`shipment.status.${shipment.status}`)
|
||||
}}</VBadge>
|
||||
</td>
|
||||
<td>{{ formatDate(shipment.created_at) }}</td>
|
||||
<td><VBtn v-if="shipment.status === 'pending'" size="sm" :disabled="actionId === shipment.id" @click="markShipped(shipment)">{{ $t("shipment.markShipped") }}</VBtn></td>
|
||||
<td>
|
||||
<VBtn
|
||||
v-if="shipment.status === 'pending'"
|
||||
size="sm"
|
||||
:disabled="actionId === shipment.id"
|
||||
@click="markShipped(shipment)"
|
||||
>{{ $t("shipment.markShipped") }}</VBtn
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</VTable>
|
||||
|
||||
Reference in New Issue
Block a user