fix(ct): оповещения на финале+ починил загрузку по ссылке, сузил блок решения
This commit is contained in:
@@ -178,7 +178,12 @@ const CtCreateForm: React.FC<ICtCreateFormProps> = ({ context, userDisplayName,
|
|||||||
markStepComplete(4);
|
markStepComplete(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).catch(() => undefined);
|
}).catch((err) => {
|
||||||
|
// Раньше ошибка глоталась молча → при сбое любого запроса форма оставалась
|
||||||
|
// на устаревшем статусе из session storage (напр. «Сформирована» вместо
|
||||||
|
// «На согласовании»). Теперь хотя бы видно, какой запрос упал.
|
||||||
|
console.error("[CtCreateForm] загрузка СТ по ссылке упала:", err);
|
||||||
|
});
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
@@ -614,10 +614,15 @@ export class CtService {
|
|||||||
|
|
||||||
async notifyActiveApprover(ctId: string): Promise<void> {
|
async notifyActiveApprover(ctId: string): Promise<void> {
|
||||||
const rows = await this.approval.getForRequest(parseInt(ctId, 10));
|
const rows = await this.approval.getForRequest(parseInt(ctId, 10));
|
||||||
|
if (rows.length === 0) return;
|
||||||
|
// Есть активный согласующий → уведомляем его («поступила на согласование»).
|
||||||
|
// Иначе финал (все согласовали / кто-то отклонил): активной строки уже нет, но поток
|
||||||
|
// сам выбирает получателя (инициатора) по статусу СТ — ему нужен лишь любой RowID этой СТ,
|
||||||
|
// чтобы выйти на саму СТ и её автора. Берём последнюю строку маршрута. Без этого
|
||||||
|
// «Согласовано»/«Отклонено» инициатору не уходили (поток вообще не вызывался).
|
||||||
const active = rows.filter((r) => r.status === REQUEST_STATUS.onApproval)[0];
|
const active = rows.filter((r) => r.status === REQUEST_STATUS.onApproval)[0];
|
||||||
if (active) {
|
const rowToNotify = active ?? rows[rows.length - 1];
|
||||||
await this.triggerApprovalNotification(active.id);
|
await this.triggerApprovalNotification(rowToNotify.id);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async triggerApprovalNotification(spItemId: number): Promise<void> {
|
async triggerApprovalNotification(spItemId: number): Promise<void> {
|
||||||
@@ -750,10 +755,11 @@ export class CtService {
|
|||||||
const filter = positionSpIds
|
const filter = positionSpIds
|
||||||
.map((id) => `positionId eq ${id}`)
|
.map((id) => `positionId eq ${id}`)
|
||||||
.join(" or ");
|
.join(" or ");
|
||||||
// offerIdId — SP REST raw-ID suffix for Lookup fields; offerId fallback for plain Number fields
|
// offerId — обычное числовое поле (SP-Id строки файла КП), НЕ лукап. Раньше в $select
|
||||||
|
// ошибочно был offerIdId (raw-ID суффикс лукапа) — такого поля нет, и SP валил запрос 400.
|
||||||
const url =
|
const url =
|
||||||
`${this._li(LISTS.OFFERS)}` +
|
`${this._li(LISTS.OFFERS)}` +
|
||||||
`?$select=supplierId,offerIdId,offerId` +
|
`?$select=supplierId,offerId` +
|
||||||
`&$filter=${filter}` +
|
`&$filter=${filter}` +
|
||||||
`&$top=2000`;
|
`&$top=2000`;
|
||||||
const res = await this.http.get(url, SPHttpClient.configurations.v1);
|
const res = await this.http.get(url, SPHttpClient.configurations.v1);
|
||||||
@@ -764,7 +770,7 @@ export class CtService {
|
|||||||
const pairs: Array<{ supplierSpId: number; offerSpId: number }> = [];
|
const pairs: Array<{ supplierSpId: number; offerSpId: number }> = [];
|
||||||
for (const item of data.value ?? []) {
|
for (const item of data.value ?? []) {
|
||||||
const supplierSpId = Number(item["supplierId"]);
|
const supplierSpId = Number(item["supplierId"]);
|
||||||
const offerSpId = Number(item["offerIdId"] ?? item["offerId"] ?? 0);
|
const offerSpId = Number(item["offerId"] ?? 0);
|
||||||
if (!offerSpId || !supplierSpId || seen.has(supplierSpId)) continue;
|
if (!offerSpId || !supplierSpId || seen.has(supplierSpId)) continue;
|
||||||
seen.add(supplierSpId);
|
seen.add(supplierSpId);
|
||||||
pairs.push({ supplierSpId, offerSpId });
|
pairs.push({ supplierSpId, offerSpId });
|
||||||
|
|||||||
@@ -6,6 +6,14 @@
|
|||||||
background: $white;
|
background: $white;
|
||||||
border: 1px solid $gray-200;
|
border: 1px solid $gray-200;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
// Не на всю ширину — гармонично с карточкой «Маршрут согласования» (.matrixWrap).
|
||||||
|
max-width: 720px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.panel {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
|||||||
Reference in New Issue
Block a user