施肥散布実績機能を実装し運搬・作業記録・在庫連携を追加

This commit is contained in:
Akira
2026-03-17 19:28:52 +09:00
parent 865d53ed9a
commit 140d5e5a4d
31 changed files with 2053 additions and 248 deletions

View File

@@ -2,7 +2,7 @@
import { useEffect, useState, useMemo, useCallback } from 'react';
import { useRouter } from 'next/navigation';
import { Plus, X, ChevronUp, ChevronDown, Pencil, Check, Truck, ArrowLeft } from 'lucide-react';
import { Plus, X, ChevronUp, ChevronDown, Pencil, Check, Truck, ArrowLeft, Sprout } from 'lucide-react';
import Navbar from '@/components/Navbar';
import { DeliveryPlan, DeliveryAllEntry } from '@/types';
import { api } from '@/lib/api';
@@ -676,9 +676,20 @@ export default function DeliveryEditPage({ planId }: Props) {
</button>
<h1 className="text-xl font-bold text-gray-900 mb-6">
{isEdit ? '運搬計画を編集' : '運搬計画を新規作成'}
</h1>
<div className="mb-6 flex items-center justify-between gap-4">
<h1 className="text-xl font-bold text-gray-900">
{isEdit ? '運搬計画を編集' : '運搬計画を新規作成'}
</h1>
{isEdit && planId && (
<button
onClick={() => router.push(`/fertilizer/spreading?year=${year}&delivery_plan=${planId}`)}
className="flex items-center gap-2 rounded-md border border-emerald-300 px-4 py-2 text-sm text-emerald-700 hover:bg-emerald-50"
>
<Sprout className="h-4 w-4" />
</button>
)}
</div>
{saveError && (
<div className="flex items-start gap-2 bg-red-50 border border-red-300 text-red-700 rounded-md px-4 py-3 mb-4 text-sm">

View File

@@ -2,7 +2,7 @@
import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import { Truck, Plus, FileDown, Pencil, Trash2, X } from 'lucide-react';
import { Truck, Plus, FileDown, Pencil, Trash2, X, Sprout } from 'lucide-react';
import Navbar from '@/components/Navbar';
import { api } from '@/lib/api';
import { DeliveryPlanListItem } from '@/types';
@@ -75,13 +75,22 @@ export default function DeliveryListPage() {
<Truck className="h-7 w-7 text-green-700" />
<h1 className="text-2xl font-bold text-gray-900"></h1>
</div>
<button
onClick={() => router.push('/distribution/new')}
className="flex items-center gap-2 px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors text-sm font-medium"
>
<Plus className="h-4 w-4" />
</button>
<div className="flex items-center gap-3">
<button
onClick={() => router.push('/fertilizer/spreading')}
className="flex items-center gap-2 rounded-md border border-emerald-300 px-4 py-2 text-sm font-medium text-emerald-700 hover:bg-emerald-50 transition-colors"
>
<Sprout className="h-4 w-4" />
</button>
<button
onClick={() => router.push('/distribution/new')}
className="flex items-center gap-2 px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors text-sm font-medium"
>
<Plus className="h-4 w-4" />
</button>
</div>
</div>
{/* 年度セレクタ */}