fix
This commit is contained in:
@ -17,51 +17,7 @@ import {
|
||||
Box,
|
||||
} from "lucide-react";
|
||||
|
||||
// Мок данные для поставок на Ozon
|
||||
const mockOzonSupplies = [
|
||||
{
|
||||
id: "1",
|
||||
supplyId: "OZ-SP-240113-001",
|
||||
warehouse: "Тверь",
|
||||
deliveryDate: "2024-01-16",
|
||||
status: "awaiting_packaging",
|
||||
totalItems: 120,
|
||||
totalBoxes: 10,
|
||||
estimatedValue: 380000,
|
||||
products: [
|
||||
{ name: "Телефон Samsung A54", quantity: 40, price: 6500 },
|
||||
{ name: "Чехол силиконовый", quantity: 80, price: 850 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
supplyId: "OZ-SP-240112-002",
|
||||
warehouse: "Казань",
|
||||
deliveryDate: "2024-01-15",
|
||||
status: "sent_to_delivery",
|
||||
totalItems: 75,
|
||||
totalBoxes: 6,
|
||||
estimatedValue: 295000,
|
||||
products: [
|
||||
{ name: "Наушники беспроводные", quantity: 25, price: 4200 },
|
||||
{ name: "Зарядное устройство", quantity: 50, price: 1800 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
supplyId: "OZ-SP-240111-003",
|
||||
warehouse: "Екатеринбург",
|
||||
deliveryDate: "2024-01-14",
|
||||
status: "delivered",
|
||||
totalItems: 180,
|
||||
totalBoxes: 14,
|
||||
estimatedValue: 520000,
|
||||
products: [
|
||||
{ name: "Планшет Xiaomi Pad", quantity: 60, price: 4800 },
|
||||
{ name: "Клавиатура беспроводная", quantity: 120, price: 1650 },
|
||||
],
|
||||
},
|
||||
];
|
||||
// Удалены моковые данные - теперь используются только реальные данные
|
||||
|
||||
export function OzonSuppliesTab() {
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
@ -115,19 +71,8 @@ export function OzonSuppliesTab() {
|
||||
);
|
||||
};
|
||||
|
||||
const filteredSupplies = mockOzonSupplies.filter((supply) => {
|
||||
const matchesSearch =
|
||||
supply.supplyId.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||
supply.warehouse.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||
supply.products.some((p) =>
|
||||
p.name.toLowerCase().includes(searchTerm.toLowerCase())
|
||||
);
|
||||
|
||||
const matchesStatus =
|
||||
statusFilter === "all" || supply.status === statusFilter;
|
||||
|
||||
return matchesSearch && matchesStatus;
|
||||
});
|
||||
// Теперь используются только реальные данные, моковые данные удалены
|
||||
const filteredSupplies: any[] = [];
|
||||
|
||||
const getTotalValue = () => {
|
||||
return filteredSupplies.reduce(
|
||||
@ -247,83 +192,26 @@ export function OzonSuppliesTab() {
|
||||
{/* Список поставок */}
|
||||
<div className="flex-1 overflow-hidden">
|
||||
<div className="h-full overflow-y-auto space-y-2 xl:space-y-3">
|
||||
{filteredSupplies.map((supply) => (
|
||||
{filteredSupplies.length === 0 ? (
|
||||
<div className="flex items-center justify-center h-full">
|
||||
<div className="text-center">
|
||||
<Package className="h-12 w-12 text-white/20 mx-auto mb-4" />
|
||||
<p className="text-white/60 mb-2">Поставок пока нет</p>
|
||||
<p className="text-white/40 text-sm">
|
||||
Создайте свою первую поставку на Ozon
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
filteredSupplies.map((supply) => (
|
||||
<Card
|
||||
key={supply.id}
|
||||
className="glass-card p-2 xl:p-4 hover:bg-white/10 transition-colors"
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex-1">
|
||||
<div className="flex items-center gap-3 mb-3">
|
||||
<div className="w-6 h-6 bg-blue-500 rounded flex items-center justify-center">
|
||||
<span className="text-white text-xs font-bold">O</span>
|
||||
</div>
|
||||
<h3 className="text-white font-medium">
|
||||
{supply.supplyId}
|
||||
</h3>
|
||||
{getStatusBadge(supply.status)}
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4 text-sm mb-3">
|
||||
<div>
|
||||
<p className="text-white/60">Склад Ozon</p>
|
||||
<p className="text-white">{supply.warehouse}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-white/60">Дата доставки</p>
|
||||
<p className="text-white flex items-center gap-1">
|
||||
<Calendar className="h-3 w-3" />
|
||||
{formatDate(supply.deliveryDate)}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-white/60">Товаров / Коробок</p>
|
||||
<p className="text-white font-semibold">
|
||||
{supply.totalItems} / {supply.totalBoxes}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-white/60">Стоимость</p>
|
||||
<p className="text-green-400 font-semibold">
|
||||
{formatCurrency(supply.estimatedValue)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Список товаров в поставке */}
|
||||
<div className="bg-white/5 rounded-lg p-3">
|
||||
<p className="text-white/80 text-xs mb-2">
|
||||
Товары в поставке:
|
||||
</p>
|
||||
<div className="space-y-1">
|
||||
{supply.products.map((product, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex items-center justify-between text-xs"
|
||||
>
|
||||
<span className="text-white/70">{product.name}</span>
|
||||
<span className="text-white/60">
|
||||
{product.quantity} шт. ×{" "}
|
||||
{formatCurrency(product.price)}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 ml-4">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="text-white/60 hover:text-white hover:bg-white/10"
|
||||
>
|
||||
<Eye className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
{/* Здесь будет отображение реальных поставок */}
|
||||
</Card>
|
||||
))}
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -17,51 +17,7 @@ import {
|
||||
Box,
|
||||
} from "lucide-react";
|
||||
|
||||
// Мок данные для поставок на Wildberries
|
||||
const mockWbSupplies = [
|
||||
{
|
||||
id: "1",
|
||||
supplyId: "WB-SP-240113-001",
|
||||
warehouse: "Коледино",
|
||||
deliveryDate: "2024-01-15",
|
||||
status: "created",
|
||||
totalItems: 150,
|
||||
totalBoxes: 12,
|
||||
estimatedValue: 450000,
|
||||
products: [
|
||||
{ name: "Футболка базовая", quantity: 100, price: 1200 },
|
||||
{ name: "Джинсы классические", quantity: 50, price: 3500 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
supplyId: "WB-SP-240112-002",
|
||||
warehouse: "Электросталь",
|
||||
deliveryDate: "2024-01-14",
|
||||
status: "confirmed",
|
||||
totalItems: 85,
|
||||
totalBoxes: 8,
|
||||
estimatedValue: 320000,
|
||||
products: [
|
||||
{ name: "Кроссовки спортивные", quantity: 35, price: 4500 },
|
||||
{ name: "Рюкзак молодежный", quantity: 50, price: 2800 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
supplyId: "WB-SP-240111-003",
|
||||
warehouse: "Подольск",
|
||||
deliveryDate: "2024-01-13",
|
||||
status: "shipped",
|
||||
totalItems: 200,
|
||||
totalBoxes: 15,
|
||||
estimatedValue: 680000,
|
||||
products: [
|
||||
{ name: "Платье летнее", quantity: 80, price: 2200 },
|
||||
{ name: "Блузка офисная", quantity: 120, price: 3800 },
|
||||
],
|
||||
},
|
||||
];
|
||||
// Удалены моковые данные - теперь используются только реальные данные
|
||||
|
||||
export function WildberriesSuppliesTab() {
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
@ -111,19 +67,8 @@ export function WildberriesSuppliesTab() {
|
||||
);
|
||||
};
|
||||
|
||||
const filteredSupplies = mockWbSupplies.filter((supply) => {
|
||||
const matchesSearch =
|
||||
supply.supplyId.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||
supply.warehouse.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||
supply.products.some((p) =>
|
||||
p.name.toLowerCase().includes(searchTerm.toLowerCase())
|
||||
);
|
||||
|
||||
const matchesStatus =
|
||||
statusFilter === "all" || supply.status === statusFilter;
|
||||
|
||||
return matchesSearch && matchesStatus;
|
||||
});
|
||||
// Теперь используются только реальные данные, моковые данные удалены
|
||||
const filteredSupplies: any[] = [];
|
||||
|
||||
const getTotalValue = () => {
|
||||
return filteredSupplies.reduce(
|
||||
@ -243,83 +188,26 @@ export function WildberriesSuppliesTab() {
|
||||
{/* Список поставок */}
|
||||
<div className="flex-1 overflow-hidden">
|
||||
<div className="h-full overflow-y-auto space-y-2 xl:space-y-3">
|
||||
{filteredSupplies.map((supply) => (
|
||||
{filteredSupplies.length === 0 ? (
|
||||
<div className="flex items-center justify-center h-full">
|
||||
<div className="text-center">
|
||||
<Package className="h-12 w-12 text-white/20 mx-auto mb-4" />
|
||||
<p className="text-white/60 mb-2">Поставок пока нет</p>
|
||||
<p className="text-white/40 text-sm">
|
||||
Создайте свою первую поставку на Wildberries
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
filteredSupplies.map((supply) => (
|
||||
<Card
|
||||
key={supply.id}
|
||||
className="glass-card p-2 xl:p-4 hover:bg-white/10 transition-colors"
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex-1">
|
||||
<div className="flex items-center gap-3 mb-3">
|
||||
<div className="w-6 h-6 bg-purple-500 rounded flex items-center justify-center">
|
||||
<span className="text-white text-xs font-bold">W</span>
|
||||
</div>
|
||||
<h3 className="text-white font-medium">
|
||||
{supply.supplyId}
|
||||
</h3>
|
||||
{getStatusBadge(supply.status)}
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4 text-sm mb-3">
|
||||
<div>
|
||||
<p className="text-white/60">Склад WB</p>
|
||||
<p className="text-white">{supply.warehouse}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-white/60">Дата доставки</p>
|
||||
<p className="text-white flex items-center gap-1">
|
||||
<Calendar className="h-3 w-3" />
|
||||
{formatDate(supply.deliveryDate)}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-white/60">Товаров / Коробок</p>
|
||||
<p className="text-white font-semibold">
|
||||
{supply.totalItems} / {supply.totalBoxes}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-white/60">Стоимость</p>
|
||||
<p className="text-green-400 font-semibold">
|
||||
{formatCurrency(supply.estimatedValue)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Список товаров в поставке */}
|
||||
<div className="bg-white/5 rounded-lg p-3">
|
||||
<p className="text-white/80 text-xs mb-2">
|
||||
Товары в поставке:
|
||||
</p>
|
||||
<div className="space-y-1">
|
||||
{supply.products.map((product, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex items-center justify-between text-xs"
|
||||
>
|
||||
<span className="text-white/70">{product.name}</span>
|
||||
<span className="text-white/60">
|
||||
{product.quantity} шт. ×{" "}
|
||||
{formatCurrency(product.price)}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 ml-4">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="text-white/60 hover:text-white hover:bg-white/10"
|
||||
>
|
||||
<Eye className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
{/* Здесь будет отображение реальных поставок */}
|
||||
</Card>
|
||||
))}
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user