поправила доступ для исполнителй дфипа, отсупы для смет и - вместо 0 в SummaryTable (проекты)

This commit is contained in:
PotapovaA 2026-09-16 12:15:54 +03:00
parent 614b5c9abe
commit 7bbc1189ec
3 changed files with 52 additions and 47 deletions

View File

@ -68,7 +68,7 @@ export function HeaderSwitch() {
</div>
<span>Задачи</span>
</StyledNavLink>
{(user.is_executor_rf || user.role_id === ROLES_NAME_ID.admin || user.role_id === ROLES_NAME_ID.executor_durrs) &&
{(user.is_executor_rf || user.role_id === ROLES_NAME_ID.admin || user.role_id === ROLES_NAME_ID.executor_durrs || user.role_id === ROLES_NAME_ID.executor_dfip) &&
<StyledNavLink to='/projects' className={location.pathname.startsWith(projectsPaths) ? 'active' : ''}>
<div className='img'>
@ -95,7 +95,7 @@ export function HeaderSwitch() {
<span>Администрирование</span>
</StyledNavLink>
)}
{(user.is_executor_rf || user.role_id === ROLES_NAME_ID.admin) &&
{(user.is_executor_rf || user.role_id === ROLES_NAME_ID.admin || user.role_id === ROLES_NAME_ID.executor_dfip) &&
<StyledNavLink to='/dicts-navigator' className={location.pathname.startsWith(dictPaths) ? 'active' : ''}>
<div className='img'>
<DictSvg fill={location.pathname.startsWith(dictPaths) ? '#258141' : '#99A1AF'} />

View File

@ -141,7 +141,7 @@ const CellComponent = ({ cell, row, column, onClick, globalFilter, columnFilter,
const isLocked = useCellLock(cellKey);
const isVspDropdown = column?.columnDef?.editType === 'vsp_dropdown';
const nameIndent = column.id === 'data.header.name' ? 8 + row.depth * 16 : 8;
const nameIndent = column.id === 'data.header.name' || column.id === 'data.name' ? 8 + row.depth * 16 : 8;
const { rawValue, displayValue, isNumeric } = useMemo(() => {
const value = cell.getValue();

View File

@ -210,25 +210,25 @@ export const secondColumns = [
accessorKey: 'data.financing.ahr',
header: 'АХР',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.financing.ahr_limit',
header: 'АХР лимит',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.financing.ahr_current',
header: 'АХР текущие',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.financing.kv',
header: 'кв.',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -240,25 +240,25 @@ export const secondColumns = [
accessorKey: 'data.base_q1.ahr',
header: 'АХР',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.base_q1.ahr_limit',
header: 'АХР лимит',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.base_q1.ahr_current',
header: 'АХР текущие',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.base_q1.kv',
header: 'кв.',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -270,25 +270,25 @@ export const secondColumns = [
accessorKey: 'data.corrected_q2.ahr',
header: 'АХР',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.corrected_q2.ahr_limit',
header: 'АХР лимит',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.corrected_q2.ahr_current',
header: 'АХР текущие',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.corrected_q2.kv',
header: 'кв.',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -300,25 +300,25 @@ export const secondColumns = [
accessorKey: 'data.corrected_q3.ahr',
header: 'АХР',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.corrected_q3.ahr_limit',
header: 'АХР лимит',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.corrected_q3.ahr_current',
header: 'АХР текущие',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.corrected_q3.kv',
header: 'кв.',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -330,25 +330,25 @@ export const secondColumns = [
accessorKey: 'data.corrected_q4.ahr',
header: 'АХР',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.corrected_q4.ahr_limit',
header: 'АХР лимит',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.corrected_q4.ahr_current',
header: 'АХР текущие',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.corrected_q4.kv',
header: 'кв.',
size: 100,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -363,19 +363,19 @@ export const secondColumns = [
accessorKey: 'data.actual_ahr.q1.ahr',
header: 'Фактические расходы',
size: 120,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_ahr.q1.ahr_limit',
header: 'Лимит',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_ahr.q1.ahr_current',
header: 'Текущие',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -386,19 +386,19 @@ export const secondColumns = [
accessorKey: 'data.actual_ahr.q2.ahr',
header: 'Фактические расходы',
size: 120,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_ahr.q2.ahr_limit',
header: 'Лимит',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_ahr.q2.ahr_current',
header: 'Текущие',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -409,19 +409,19 @@ export const secondColumns = [
accessorKey: 'data.actual_ahr.q3.ahr',
header: 'Фактические расходы',
size: 120,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_ahr.q3.ahr_limit',
header: 'Лимит',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_ahr.q3.ahr_current',
header: 'Текущие',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -432,19 +432,19 @@ export const secondColumns = [
accessorKey: 'data.actual_ahr.q4.ahr',
header: 'Фактические расходы',
size: 120,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_ahr.q4.ahr_limit',
header: 'Лимит',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_ahr.q4.ahr_current',
header: 'Текущие',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -461,19 +461,19 @@ export const secondColumns = [
accessorKey: 'data.actual_kv.q1.kv',
header: 'Фактические расходы',
size: 120,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_kv.q1.kv_limit',
header: 'Лимит',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_kv.q1.kv_current',
header: 'Текущие',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -484,19 +484,19 @@ export const secondColumns = [
accessorKey: 'data.actual_kv.q2.kv',
header: 'Фактические расходы',
size: 120,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_kv.q2.kv_limit',
header: 'Лимит',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_kv.q2.kv_current',
header: 'Текущие',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -507,19 +507,19 @@ export const secondColumns = [
accessorKey: 'data.actual_kv.q3.kv',
header: 'Фактические расходы',
size: 120,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_kv.q3.kv_limit',
header: 'Лимит',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_kv.q3.kv_current',
header: 'Текущие',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -530,19 +530,19 @@ export const secondColumns = [
accessorKey: 'data.actual_kv.q4.kv',
header: 'Фактические расходы',
size: 120,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_kv.q4.kv_limit',
header: 'Лимит',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
{
accessorKey: 'data.actual_kv.q4.kv_current',
header: 'Текущие',
size: 80,
Cell: ({ cell }) => formatNumber(cell.getValue()),
Cell: ({ cell }) => formatSummaryNumber(cell.getValue()),
},
],
},
@ -565,3 +565,8 @@ const formatNumber = (value) => {
const number = Number(value);
return Number.isNaN(number) ? value : number.toLocaleString('ru-RU');
};
const formatSummaryNumber = (value) => {
if (value !== null && value !== undefined && value !== '' && Number(value) === 0) return '-';
return formatNumber(value);
};