Изменены текстовые метки и комментарии в коде для замены термина "Оптовик" на "Поставщик" во всех компонентах и файлах, включая интерфейсы, мутации и резолверы. Обновлены соответствующие комментарии для улучшения понимания кода и его структуры.
This commit is contained in:
@ -36,7 +36,7 @@ export function CartSummary({
|
||||
return null
|
||||
}
|
||||
|
||||
// Группируем товары по оптовикам
|
||||
// Группируем товары по поставщикам
|
||||
const groupedProducts = selectedProducts.reduce((acc, product) => {
|
||||
if (!acc[product.wholesalerId]) {
|
||||
acc[product.wholesalerId] = {
|
||||
@ -86,7 +86,7 @@ export function CartSummary({
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Группировка по оптовикам */}
|
||||
{/* Группировка по поставщикам */}
|
||||
{Object.entries(groupedProducts).map(([wholesalerId, group]) => (
|
||||
<div key={wholesalerId} className="mb-4 last:mb-0">
|
||||
<div className="flex items-center mb-2 pb-1 border-b border-white/10">
|
||||
|
@ -106,7 +106,7 @@ export function CreateConsumablesSupplyPage() {
|
||||
// Мутация для создания заказа поставки расходников
|
||||
const [createSupplyOrder] = useMutation(CREATE_SUPPLY_ORDER);
|
||||
|
||||
// Фильтруем только поставщиков расходников (оптовиков)
|
||||
// Фильтруем только поставщиков расходников (поставщиков)
|
||||
const consumableSuppliers = (
|
||||
counterpartiesData?.myCounterparties || []
|
||||
).filter((org: ConsumableSupplier) => org.type === "WHOLESALE");
|
||||
|
@ -40,7 +40,7 @@ interface CreateSupplyFormProps {
|
||||
onSupplyCreated: () => void
|
||||
}
|
||||
|
||||
// Моковые данные оптовиков
|
||||
// Моковые данные поставщиков
|
||||
const mockWholesalers: Wholesaler[] = [
|
||||
{
|
||||
id: '1',
|
||||
@ -126,7 +126,7 @@ export function CreateSupplyForm({ onClose, onSupplyCreated }: CreateSupplyFormP
|
||||
Назад
|
||||
</Button>
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Товары оптовика</h2>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Товары поставщика</h2>
|
||||
<p className="text-white/60">{selectedWholesaler.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -140,7 +140,7 @@ export function CreateSupplyForm({ onClose, onSupplyCreated }: CreateSupplyFormP
|
||||
</Button>
|
||||
</div>
|
||||
<div className="text-center py-12">
|
||||
<p className="text-white/60">Компонент товаров оптовика в разработке...</p>
|
||||
<p className="text-white/60">Компонент товаров поставщика в разработке...</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
@ -160,8 +160,8 @@ export function CreateSupplyForm({ onClose, onSupplyCreated }: CreateSupplyFormP
|
||||
Назад
|
||||
</Button>
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Выбор оптовика</h2>
|
||||
<p className="text-white/60">Выберите оптовика для создания поставки</p>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Выбор поставщика</h2>
|
||||
<p className="text-white/60">Выберите поставщика для создания поставки</p>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
@ -294,7 +294,7 @@ export function CreateSupplyForm({ onClose, onSupplyCreated }: CreateSupplyFormP
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
{/* Вариант 2: Оптовик */}
|
||||
{/* Вариант 2: Поставщик */}
|
||||
<Card
|
||||
className="bg-white/10 backdrop-blur border-white/20 p-6 cursor-pointer transition-all hover:bg-white/15 hover:border-white/30"
|
||||
onClick={() => setSelectedVariant('wholesaler')}
|
||||
@ -304,9 +304,9 @@ export function CreateSupplyForm({ onClose, onSupplyCreated }: CreateSupplyFormP
|
||||
<Users className="h-8 w-8 text-green-400" />
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="text-xl font-semibold text-white mb-2">Оптовик</h3>
|
||||
<h3 className="text-xl font-semibold text-white mb-2">Поставщик</h3>
|
||||
<p className="text-white/60 text-sm">
|
||||
Создание поставки через выбор товаров у оптовиков
|
||||
Создание поставки через выбор товаров у поставщиков
|
||||
</p>
|
||||
</div>
|
||||
<Badge className="bg-green-500/20 text-green-300 border-green-500/30">
|
||||
|
@ -604,7 +604,7 @@ export function FulfillmentGoodsTab() {
|
||||
<div className="w-1 h-1 rounded-full bg-green-400 mr-1"></div>
|
||||
<Building2 className="h-3 w-3 text-green-400" />
|
||||
<span className="text-white font-medium text-sm">
|
||||
Оптовик
|
||||
Поставщик
|
||||
</span>
|
||||
</div>
|
||||
<div className="absolute left-0 top-0 w-0.5 h-full bg-green-400/30"></div>
|
||||
|
@ -106,13 +106,13 @@ export function RealSupplyOrdersTab() {
|
||||
}
|
||||
);
|
||||
|
||||
// Получаем ID текущей организации (оптовика)
|
||||
// Получаем ID текущей организации (поставщика)
|
||||
const currentOrganizationId = user?.organization?.id;
|
||||
|
||||
// Фильтруем заказы где текущая организация является поставщиком (заказы К оптовику)
|
||||
// Фильтруем заказы где текущая организация является поставщиком (заказы К поставщику)
|
||||
const incomingSupplyOrders: SupplyOrder[] = (data?.supplyOrders || []).filter(
|
||||
(order: SupplyOrder) => {
|
||||
// Показываем заказы где текущий оптовик указан как поставщик (partnerId)
|
||||
// Показываем заказы где текущий поставщик указан как поставщик (partnerId)
|
||||
return order.partner.id === currentOrganizationId;
|
||||
}
|
||||
);
|
||||
@ -208,7 +208,7 @@ export function RealSupplyOrdersTab() {
|
||||
});
|
||||
};
|
||||
|
||||
// Статистика для оптовика
|
||||
// Статистика для поставщика
|
||||
const totalOrders = incomingSupplyOrders.length;
|
||||
const totalAmount = incomingSupplyOrders.reduce(
|
||||
(sum, order) => sum + order.totalAmount,
|
||||
|
@ -630,7 +630,7 @@ export function SuppliesGoodsTab() {
|
||||
</Button>
|
||||
<Building2 className="h-4 w-4 text-green-400" />
|
||||
<span className="text-white font-medium">
|
||||
Оптовик
|
||||
Поставщик
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -36,8 +36,8 @@ export function ProductGrid({
|
||||
<div className="flex items-center justify-center p-8">
|
||||
<div className="text-center">
|
||||
<Package className="h-12 w-12 text-white/20 mx-auto mb-4" />
|
||||
<p className="text-white/60">У этого оптовика нет товаров</p>
|
||||
<p className="text-white/40 text-sm mt-2">Выберите другого оптовика</p>
|
||||
<p className="text-white/60">У этого поставщика нет товаров</p>
|
||||
<p className="text-white/40 text-sm mt-2">Выберите другого поставщика</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
@ -95,7 +95,7 @@ export function TabsHeader({
|
||||
}`}
|
||||
>
|
||||
<Users className="h-4 w-4 mr-1 inline" />
|
||||
Оптовики
|
||||
Поставщики
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -21,7 +21,7 @@ export function WholesalerGrid({
|
||||
onSearchChange,
|
||||
loading = false
|
||||
}: WholesalerGridProps) {
|
||||
// Фильтруем оптовиков по поисковому запросу
|
||||
// Фильтруем поставщиков по поисковому запросу
|
||||
const filteredWholesalers = wholesalers.filter((wholesaler) =>
|
||||
wholesaler.name?.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||
wholesaler.fullName?.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||
@ -50,7 +50,7 @@ export function WholesalerGrid({
|
||||
<div className="flex items-center justify-center p-8">
|
||||
<div className="text-center">
|
||||
<div className="animate-spin rounded-full h-12 w-12 border-4 border-white border-t-transparent mx-auto mb-4"></div>
|
||||
<p className="text-white/60">Загружаем оптовиков...</p>
|
||||
<p className="text-white/60">Загружаем поставщиков...</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
@ -63,7 +63,7 @@ export function WholesalerGrid({
|
||||
<div className="relative max-w-md">
|
||||
<Search className="absolute left-3 top-3 h-4 w-4 text-white/40" />
|
||||
<Input
|
||||
placeholder="Поиск оптовиков..."
|
||||
placeholder="Поиск поставщиков..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => onSearchChange(e.target.value)}
|
||||
className="pl-10 glass-input text-white placeholder:text-white/40 h-10"
|
||||
@ -75,10 +75,10 @@ export function WholesalerGrid({
|
||||
<div className="text-center p-8">
|
||||
<Users className="h-12 w-12 text-white/20 mx-auto mb-4" />
|
||||
<p className="text-white/60">
|
||||
{searchQuery ? 'Оптовики не найдены' : 'У вас нет контрагентов-оптовиков'}
|
||||
{searchQuery ? 'Поставщики не найдены' : 'У вас нет контрагентов-поставщиков'}
|
||||
</p>
|
||||
<p className="text-white/40 text-sm mt-2">
|
||||
{searchQuery ? 'Попробуйте изменить условия поиска' : 'Добавьте оптовиков в разделе "Партнеры"'}
|
||||
{searchQuery ? 'Попробуйте изменить условия поиска' : 'Добавьте поставщиков в разделе "Партнеры"'}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
|
@ -85,7 +85,7 @@ export function WholesalerProductsPage({
|
||||
Назад
|
||||
</Button>
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold text-white mb-2">Товары оптовика</h1>
|
||||
<h1 className="text-3xl font-bold text-white mb-2">Товары поставщика</h1>
|
||||
<p className="text-white/60">{selectedWholesaler.name} • {products.length} товаров</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -233,7 +233,7 @@ export function WholesalerProducts({ wholesaler, onBack, onClose, onSupplyCreate
|
||||
Назад
|
||||
</Button>
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Товары оптовика</h2>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Товары поставщика</h2>
|
||||
<p className="text-white/60">{wholesaler.name} • {mockProducts.length} товаров</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -35,7 +35,7 @@ interface WholesalerSelectionProps {
|
||||
onSupplyCreated: () => void
|
||||
}
|
||||
|
||||
// Моковые данные оптовиков
|
||||
// Моковые данные поставщиков
|
||||
const mockWholesalers: Wholesaler[] = [
|
||||
{
|
||||
id: '1',
|
||||
@ -129,7 +129,7 @@ export function WholesalerSelection({ onBack, onClose, onSupplyCreated }: Wholes
|
||||
Назад
|
||||
</Button>
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Товары оптовика</h2>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Товары поставщика</h2>
|
||||
<p className="text-white/60">{selectedWholesaler.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -164,8 +164,8 @@ export function WholesalerSelection({ onBack, onClose, onSupplyCreated }: Wholes
|
||||
Назад
|
||||
</Button>
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Выбор оптовика</h2>
|
||||
<p className="text-white/60">Выберите оптовика для создания поставки</p>
|
||||
<h2 className="text-2xl font-bold text-white mb-1">Выбор поставщика</h2>
|
||||
<p className="text-white/60">Выберите поставщика для создания поставки</p>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
|
Reference in New Issue
Block a user