feat: доработал заявку перемещение тмц
Tests / frontend-test (push) Successful in 4m45s

This commit is contained in:
Тимур Городецкий
2026-09-10 11:19:16 +05:00
parent c5958c3348
commit 11eb127764
17 changed files with 429 additions and 15 deletions
@@ -8,11 +8,21 @@ export interface ILineItem {
name: string;
/** Инвентарный номер. */
invNumber: string;
/** Номенклатурный код (из справочника, поле code). Необязательное — у строк,
* добавленных вручную/из Excel, может отсутствовать. */
code?: string;
/** Единица измерения (по умолчанию «шт»). */
unit: string;
/** Количество. */
qty: string;
/**
* Id номенклатуры-источника (для строк, предзаполненных из справочника). У
* строк, дописанных пользователем вручную, отсутствует — по наличию поля
* отличают «пришло из номенклатуры» от «добавлено руками». В UI не
* показывается, едет вместе с позицией в ItemsJson.
*/
nomenclatureId?: string;
}
/** Пустая строка позиции (для «Добавить строку»). Ед.изм по умолчанию «шт». */
export const EMPTY_LINE_ITEM: ILineItem = { name: '', invNumber: '', unit: 'шт', qty: '' };
export const EMPTY_LINE_ITEM: ILineItem = { name: '', invNumber: '', code: '', unit: 'шт', qty: '' };
@@ -51,6 +51,7 @@ export const ItemsTable: React.FC<IItemsTableProps> = ({ value, onChange, readOn
<th className={styles.num}>№</th>
<th>Наименование</th>
<th className={styles.inv}>Инв. номер</th>
<th className={styles.inv}>Код</th>
<th className={styles.unit}>Ед.изм</th>
<th className={styles.qty}>Кол-во</th>
</tr>
@@ -58,7 +59,7 @@ export const ItemsTable: React.FC<IItemsTableProps> = ({ value, onChange, readOn
<tbody>
{value.length === 0 ? (
<tr>
<td colSpan={5} className={styles.empty}>Позиции не добавлены</td>
<td colSpan={6} className={styles.empty}>Позиции не добавлены</td>
</tr>
) : (
value.map((row, i) => (
@@ -66,6 +67,7 @@ export const ItemsTable: React.FC<IItemsTableProps> = ({ value, onChange, readOn
<td className={styles.num}>{i + 1}</td>
<td>{row.name}</td>
<td>{row.invNumber}</td>
<td>{row.code}</td>
<td className={styles.unit}>{row.unit}</td>
<td className={styles.qty}>{row.qty}</td>
</tr>
@@ -86,6 +88,7 @@ export const ItemsTable: React.FC<IItemsTableProps> = ({ value, onChange, readOn
<th className={styles.num}>№</th>
<th>Наименование</th>
<th className={styles.inv}>Инв. номер</th>
<th className={styles.inv}>Код</th>
<th className={styles.unit}>Ед.изм</th>
<th className={styles.qty}>Кол-во</th>
<th className={styles.act} aria-label="Действия" />
@@ -94,7 +97,7 @@ export const ItemsTable: React.FC<IItemsTableProps> = ({ value, onChange, readOn
<tbody>
{value.length === 0 ? (
<tr>
<td colSpan={6} className={styles.empty}>
<td colSpan={7} className={styles.empty}>
Нет позиций. Добавьте строку или вставьте из Excel.
</td>
</tr>
@@ -116,6 +119,13 @@ export const ItemsTable: React.FC<IItemsTableProps> = ({ value, onChange, readOn
onChange={(e) => setCell(i, 'invNumber', e.target.value)}
/>
</td>
<td>
<input
className={styles.cell}
value={row.code ?? ''}
onChange={(e) => setCell(i, 'code', e.target.value)}
/>
</td>
<td>
<input
className={`${styles.cell} ${styles.cellCenter}`}