Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ npm install && npm run dev
- Data: `server/data/*.json`
- Styles: `client/src/App.vue`

## Code Style
- Always document non-obvious logic changes with comments

## Design System
- Colors: Slate/gray (#0f172a, #64748b, #e2e8f0)
- Status: green/blue/yellow/red
Expand Down
3 changes: 3 additions & 0 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<router-link to="/reports" :class="{ active: $route.path === '/reports' }">
Reports
</router-link>
<router-link to="/restocking" :class="{ active: $route.path === '/restocking' }">
{{ t('nav.restocking') }}
</router-link>
</nav>
<LanguageSwitcher />
<ProfileMenu
Expand Down
5 changes: 5 additions & 0 deletions client/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,10 @@ export const api = {
async getPurchaseOrderByBacklogItem(backlogItemId) {
const response = await axios.get(`${API_BASE_URL}/purchase-orders/${backlogItemId}`)
return response.data
},

async createRestockingOrder(data) {
const response = await axios.post(`${API_BASE_URL}/restocking-orders`, data)
return response.data
}
}
2 changes: 2 additions & 0 deletions client/src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
orders: 'Orders',
finance: 'Finance',
demandForecast: 'Demand Forecast',
restocking: 'Restocking',
companyName: 'Catalyst Components',
subtitle: 'Inventory Management System'
},
Expand Down Expand Up @@ -204,6 +205,7 @@ export default {
shipped: 'Shipped',
processing: 'Processing',
backordered: 'Backordered',
submitted: 'Submitted',
inStock: 'In Stock',
lowStock: 'Low Stock',
adequate: 'Adequate'
Expand Down
2 changes: 2 additions & 0 deletions client/src/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
orders: '注文',
finance: '財務',
demandForecast: '需要予測',
restocking: '補充発注',
companyName: '触媒コンポーネンツ',
subtitle: '在庫管理システム'
},
Expand Down Expand Up @@ -204,6 +205,7 @@ export default {
shipped: '出荷済み',
processing: '処理中',
backordered: 'バックオーダー',
submitted: '発注済み',
inStock: '在庫あり',
lowStock: '在庫僅少',
adequate: '適量'
Expand Down
4 changes: 3 additions & 1 deletion client/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Orders from './views/Orders.vue'
import Demand from './views/Demand.vue'
import Spending from './views/Spending.vue'
import Reports from './views/Reports.vue'
import Restocking from './views/Restocking.vue'

const router = createRouter({
history: createWebHistory(),
Expand All @@ -16,7 +17,8 @@ const router = createRouter({
{ path: '/orders', component: Orders },
{ path: '/demand', component: Demand },
{ path: '/spending', component: Spending },
{ path: '/reports', component: Reports }
{ path: '/reports', component: Reports },
{ path: '/restocking', component: Restocking }
]
})

Expand Down
79 changes: 78 additions & 1 deletion client/src/views/Orders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,49 @@
</table>
</div>
</div>

<div v-if="submittedOrders.length > 0" class="card submitted-orders-card">
<div class="card-header">
<span class="card-title">Submitted Restocking Orders</span>
<span class="submitted-count">{{ submittedOrders.length }} order{{ submittedOrders.length !== 1 ? 's' : '' }}</span>
</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Order #</th>
<th>Items</th>
<th>Order Date</th>
<th>Est. Delivery</th>
<th>Lead Time</th>
<th>Total Value</th>
</tr>
</thead>
<tbody>
<tr v-for="order in submittedOrders" :key="order.id">
<td><span class="order-number">{{ order.order_number }}</span></td>
<td class="col-items">
<details class="items-details">
<summary class="items-summary">
{{ t('orders.itemsCount', { count: order.items.length }) }}
</summary>
<div class="items-dropdown">
<div v-for="(item, idx) in order.items" :key="idx" class="item-entry">
<span class="item-name">{{ translateProductName(item.name) }}</span>
<span class="item-meta">{{ t('orders.quantity') }}: {{ item.quantity }} @ {{ currencySymbol }}{{ item.unit_price }}</span>
</div>
</div>
</details>
</td>
<td>{{ formatDate(order.order_date) }}</td>
<td>{{ formatDate(order.expected_delivery) }}</td>
<td><span class="lead-time-badge">14 days</span></td>
<td>{{ formatCurrency(order.total_value) }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</template>
Expand Down Expand Up @@ -129,6 +172,12 @@ export default {
loadOrders()
})

const submittedOrders = computed(() => orders.value.filter(o => o.status === 'Submitted'))

const formatCurrency = (value) => {
return currencySymbol.value + value.toLocaleString()
}

const getOrdersByStatus = (status) => {
return orders.value.filter(order => order.status === status)
}
Expand All @@ -138,7 +187,8 @@ export default {
'Delivered': 'success',
'Shipped': 'info',
'Processing': 'warning',
'Backordered': 'danger'
'Backordered': 'danger',
'Submitted': 'stable'
}
return statusMap[status] || 'info'
}
Expand All @@ -160,9 +210,11 @@ export default {
loading,
error,
orders,
submittedOrders,
getOrdersByStatus,
getOrderStatusClass,
formatDate,
formatCurrency,
currencySymbol,
translateProductName,
translateCustomerName
Expand Down Expand Up @@ -276,4 +328,29 @@ export default {
font-size: 0.813rem;
color: #64748b;
}

.submitted-orders-card {
margin-top: 1.5rem;
}

.submitted-count {
font-size: 0.875rem;
color: #64748b;
}

.lead-time-badge {
background: #e0e7ff;
color: #3730a3;
padding: 0.25rem 0.625rem;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 600;
}

.order-number {
font-family: monospace;
font-size: 0.875rem;
color: #0f172a;
font-weight: 600;
}
</style>
Loading