mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-05 03:12:34 -06:00
2801-опция для перетаскивания строк в черновике.
пофиксил синк накладных свайп убрал внешний номер теперь ок
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
RestOutlined,
|
||||
PlusOutlined,
|
||||
FileImageOutlined,
|
||||
SwapOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import dayjs from "dayjs";
|
||||
import { api, getStaticUrl } from "../services/api";
|
||||
@@ -50,6 +51,7 @@ export const InvoiceDraftPage: React.FC = () => {
|
||||
const [updatingItems, setUpdatingItems] = useState<Set<string>>(new Set());
|
||||
const [itemsOrder, setItemsOrder] = useState<Record<string, number>>({});
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
const [isReordering, setIsReordering] = useState(false);
|
||||
|
||||
// Состояние для просмотра фото чека
|
||||
const [previewVisible, setPreviewVisible] = useState(false);
|
||||
@@ -386,7 +388,7 @@ export const InvoiceDraftPage: React.FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Правая часть хедера: Кнопка чека и Кнопка удаления */}
|
||||
{/* Правая часть хедера: Кнопка чека, Кнопка перетаскивания и Кнопка удаления */}
|
||||
<div style={{ display: "flex", gap: 8 }}>
|
||||
{/* Кнопка просмотра чека (только если есть URL) */}
|
||||
{draft.photo_url && (
|
||||
@@ -399,6 +401,16 @@ export const InvoiceDraftPage: React.FC = () => {
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{/* Кнопка переключения режима перетаскивания */}
|
||||
<Button
|
||||
type={isReordering ? "primary" : "default"}
|
||||
icon={<SwapOutlined rotate={90} />}
|
||||
onClick={() => setIsReordering(!isReordering)}
|
||||
size="small"
|
||||
>
|
||||
{isReordering ? "Ок" : ""}
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
danger={isCanceled}
|
||||
type={isCanceled ? "primary" : "default"}
|
||||
@@ -549,6 +561,7 @@ export const InvoiceDraftPage: React.FC = () => {
|
||||
onDelete={(itemId) => deleteItemMutation.mutate(itemId)}
|
||||
isUpdating={updatingItems.has(item.id)}
|
||||
recommendations={recommendationsQuery.data || []}
|
||||
isReordering={isReordering}
|
||||
/>
|
||||
))}
|
||||
{provided.placeholder}
|
||||
|
||||
Reference in New Issue
Block a user