From fd03700a58a96952f45e5896208032fbe842f86b Mon Sep 17 00:00:00 2001 From: nns Date: Fri, 9 Oct 2026 06:41:03 +0500 Subject: [PATCH] =?UTF-8?q?feat(web):=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA?= =?UTF-8?q?=D0=B0=20=C2=AB=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D1=82=D1=8C=20?= =?UTF-8?q?=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=82=C2=BB=20=D0=BD=D0=B0?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D0=B4=D1=91=D0=BD=D0=BD=D0=BE?= =?UTF-8?q?=D0=B9=20=D0=BF=D1=80=D0=B8=D1=91=D0=BC=D0=BA=D0=B5=20(=D0=BF.5?= =?UTF-8?q?=20create-based-on)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Проведённая приёмка → «Создать возврат» вызывает from-supply (преднабор строк) и открывает черновик возврата поставщику. Вместе с секцией оплат приёмки (supply→ payment) и ссылками-основаниями в DTO — развивает «создать на основании». Co-Authored-By: Claude Opus 4.8 --- src/food-market.web/src/pages/SupplyEditPage.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/food-market.web/src/pages/SupplyEditPage.tsx b/src/food-market.web/src/pages/SupplyEditPage.tsx index c2528bb..e44cfbf 100644 --- a/src/food-market.web/src/pages/SupplyEditPage.tsx +++ b/src/food-market.web/src/pages/SupplyEditPage.tsx @@ -1,7 +1,7 @@ import { useState, useEffect, useRef, type FormEvent, type ReactNode } from 'react' import { useNavigate, useParams, Link } from 'react-router-dom' import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query' -import { ArrowLeft, Plus, Trash2, Save, CheckCircle } from 'lucide-react' +import { ArrowLeft, Plus, Trash2, Save, CheckCircle, Undo2 } from 'lucide-react' import { api } from '@/lib/api' import { Button } from '@/components/Button' import { Field, TextArea, Select, AsyncSelect, Checkbox, MoneyInput, NumberInput } from '@/components/Field' @@ -216,6 +216,13 @@ export function SupplyEditPage() { meta: { successMessage: 'Удалено' }, }) + // «Создать на основании»: возврат поставщику с преднабором строк приёмки. + const createReturn = useMutation({ + mutationFn: async () => (await api.post<{ id: string }>(`/api/purchases/supplier-returns/from-supply/${id}`)).data, + onSuccess: (d) => { if (d?.id) navigate(`/purchases/supplier-returns/${d.id}`) }, + onError: (e: Error) => setError((e as { response?: { data?: { error?: string } } }).response?.data?.error ?? e.message), + }) + const onSubmit = (e: FormEvent) => { e.preventDefault(); save.mutate() } const addLineFromProduct = (p: Product) => { @@ -326,6 +333,12 @@ export function SupplyEditPage() { Удалить )} + {isPosted && ( + + )} {isDraft && (