Compare commits

...

14 Commits

Author SHA1 Message Date
brusnitsyn
2d2c5ec6b4 Исправления в build-docker
Some checks failed
Build and Push Docker Image / build (push) Failing after 26m1s
Build and Push Docker Image / test (push) Failing after 1m26s
2026-03-17 14:53:49 +09:00
brusnitsyn
5d0d80ebc3 Исправления в build-docker 2026-03-17 14:44:09 +09:00
brusnitsyn
40d1af7212 Задача #8
Some checks failed
Build and Push Docker Image / test (push) Failing after 4s
Build and Push Docker Image / build (push) Failing after 25s
Убран фильтр по номеру карты
Добавлена загрузка связи visitResult
Правка размеров колонок
Добавлена колонка исход
Исправлено определение последнего движения в SttMedicalHistory
2026-03-17 14:34:39 +09:00
brusnitsyn
3c32aeabbe Новая модель для задачи #8
Some checks failed
Build and Push Docker Image / test (push) Failing after 11s
Build and Push Docker Image / build (push) Failing after 3m17s
2026-03-17 14:30:19 +09:00
brusnitsyn
05b50cc1c8 Изменен health роут
Some checks failed
Build and Push Docker Image / test (push) Failing after 3s
Build and Push Docker Image / build (push) Failing after 25s
2026-02-27 16:01:08 +09:00
brusnitsyn
758cf666c1 Обновлен docker-compose.yml
Some checks failed
Build and Push Docker Image / test (push) Failing after 3s
Build and Push Docker Image / build (push) Has been cancelled
2026-02-27 16:00:40 +09:00
brusnitsyn
bd5261feb9 Смещение колонки отделения #2
Some checks failed
Build and Push Docker Image / test (push) Failing after 4s
Build and Push Docker Image / build (push) Has been cancelled
2026-02-27 15:59:56 +09:00
brusnitsyn
d93301ff8b Оптимизация Dockerfile
Some checks failed
Build and Push Docker Image / test (push) Failing after 3s
Build and Push Docker Image / build (push) Failing after 25s
2026-02-27 15:36:55 +09:00
brusnitsyn
47543fedba Рефакторинг
Some checks failed
Build and Push Docker Image / test (push) Failing after 3s
Build and Push Docker Image / build (push) Has been cancelled
2026-02-27 15:36:32 +09:00
brusnitsyn
b72a7f0ee1 Проверка на существование движения
Some checks failed
Build and Push Docker Image / test (push) Failing after 3s
Build and Push Docker Image / build (push) Has been cancelled
2026-02-27 15:36:18 +09:00
brusnitsyn
988ef6f519 Добавлена сортировка по имени организации
Some checks failed
Build and Push Docker Image / test (push) Failing after 3s
Build and Push Docker Image / build (push) Has been cancelled
2026-02-27 15:35:50 +09:00
brusnitsyn
5c7d1816e7 Добавлен код при выборе организации и переработана фильтрация
Some checks failed
Build and Push Docker Image / test (push) Failing after 6s
Build and Push Docker Image / build (push) Has been cancelled
2026-02-27 15:35:25 +09:00
brusnitsyn
8790b95d7b Добавлен вывод кода отделения #2
Some checks failed
Build and Push Docker Image / test (push) Failing after 4s
Build and Push Docker Image / build (push) Failing after 24s
2026-02-27 15:14:38 +09:00
brusnitsyn
707d66a532 Добавлена сортировка по номеру архива
Some checks failed
Build and Push Docker Image / test (push) Failing after 4s
Build and Push Docker Image / build (push) Failing after 25s
2026-02-27 15:11:48 +09:00
13 changed files with 170 additions and 202 deletions

View File

@@ -2,10 +2,7 @@ name: Build and Push Docker Image
on: on:
push: push:
branches: [main, master]
tags: ['v*'] tags: ['v*']
pull_request:
branches: [main, master]
env: env:
REGISTRY: registry.brusoff.su REGISTRY: registry.brusoff.su
@@ -19,34 +16,34 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '20' node-version: '20'
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: '8.3' php-version: '8.3'
extensions: mbstring, xml, ctype, iconv, intl, pdo_mysql, pdo_pgsql, gd, redis, zip extensions: mbstring, xml, ctype, iconv, intl, pdo_mysql, pdo_pgsql, gd, redis, zip
coverage: none coverage: none
- name: Validate composer.json - name: Validate composer.json
run: composer validate --strict run: composer validate --strict
- name: Install dependencies - name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest run: composer install --prefer-dist --no-progress --no-suggest
- name: Run PHP tests - name: Run PHP tests
run: vendor/bin/phpunit run: vendor/bin/phpunit
build: build:
runs-on: docker runs-on: docker
#if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) #if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
steps: steps:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Cache Docker layers - name: Cache Docker layers
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@@ -54,14 +51,14 @@ jobs:
key: ${{ runner.os }}-buildx-${{ github.sha }} key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: | restore-keys: |
${{ runner.os }}-buildx- ${{ runner.os }}-buildx-
- name: Login to Registry - name: Login to Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }} username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }} password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Extract metadata - name: Extract metadata
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
@@ -74,7 +71,7 @@ jobs:
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}
type=sha,prefix={{branch}}- type=sha,prefix={{branch}}-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
@@ -87,16 +84,16 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
build-args: | build-args: |
BUILDKIT_INLINE_CACHE=1 BUILDKIT_INLINE_CACHE=1
- name: Scan image for vulnerabilities - name: Scan image for vulnerabilities
uses: aquasecurity/trivy-action@master uses: aquasecurity/trivy-action@master
with: with:
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
format: 'sarif' format: 'sarif'
output: 'trivy-results.sarif' output: 'trivy-results.sarif'
- name: Upload Trivy scan results - name: Upload Trivy scan results
uses: github/codeql-action/upload-sarif@v2 uses: github/codeql-action/upload-sarif@v2
if: always() if: always()
with: with:
sarif_file: 'trivy-results.sarif' sarif_file: 'trivy-results.sarif'

View File

@@ -1,93 +1,63 @@
# Этап 1: PHP зависимости # Этап 1: Сборка PHP зависимостей
FROM dh-mirror.gitverse.ru/php:8.3-fpm AS phpbuild FROM webdevops/php:8.3-alpine AS php-build
# Установка системных зависимостей ENV WEB_DOCUMENT_ROOT=/var/www/html/public
RUN apt-get update && apt-get install -y \ ENV PHP_DATE_TIMEZONE=UTC
ENV PHP_DISPLAY_ERRORS=0
ENV PHP_MEMORY_LIMIT=512M
ENV PHP_MAX_EXECUTION_TIME=300
ENV PHP_OPCACHE_ENABLE=1
ENV PHP_OPCACHE_MEMORY_CONSUMPTION=256
# Проверяем установленные расширения (для отладки)
RUN php -m && \
php -i | grep gd && \
php -i | grep redis
# Установка дополнительных системных зависимостей, если нужно
RUN apk update && apk add --no-cache \
git \ git \
curl \
wget \
unzip \ unzip \
# Для сборки некоторых зависимостей Composer
libzip-dev \ libzip-dev \
libxml2-dev \ oniguruma-dev \
libicu-dev \ && docker-run-bootstrap
libonig-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libwebp-dev \
libpq-dev \
libxslt1-dev \
libexif-dev \
libffi-dev \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Установка PHP расширений
RUN docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
&& docker-php-ext-install -j$(nproc) \
bcmath \
intl \
mbstring \
zip \
opcache \
pdo \
pdo_mysql \
pdo_pgsql \
gd \
exif \
sockets \
xsl \
ffi \
pcntl
# Установка Redis расширения
RUN pecl install redis && docker-php-ext-enable redis
# Настройка opcache для production
RUN echo "opcache.enable=1" >> /usr/local/etc/php/conf.d/opcache.ini && \
echo "opcache.memory_consumption=256" >> /usr/local/etc/php/conf.d/opcache.ini && \
echo "opcache.interned_strings_buffer=32" >> /usr/local/etc/php/conf.d/opcache.ini && \
echo "opcache.max_accelerated_files=32531" >> /usr/local/etc/php/conf.d/opcache.ini && \
echo "opcache.validate_timestamps=0" >> /usr/local/etc/php/conf.d/opcache.ini
# Установка Composer # Установка Composer
COPY --from=dh-mirror.gitverse.ru/composer:2.7 /usr/bin/composer /usr/bin/composer COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer
WORKDIR /var/www WORKDIR /var/www/html
# Копирование файлов для установки зависимостей # Копируем только файлы зависимостей (для лучшего кэширования слоев)
COPY composer.json composer.lock ./ COPY composer.json composer.lock ./
# Установка PHP зависимостей # Установка PHP зависимостей (NO DEV для production)
RUN composer install \ RUN composer install \
--no-interaction \
--no-progress \ --no-progress \
--no-scripts \ --no-scripts \
--prefer-dist \ --prefer-dist \
--optimize-autoloader \ --optimize-autoloader \
--apcu-autoloader --apcu-autoloader \
--no-dev
# Копируем исходный код # Копируем остальной код
COPY . . COPY . .
# Установка прав # Выполняем скрипты post-install
RUN chown -R www-data:www-data /var/www && \ #RUN composer run-script post-install-cmd
chmod -R 775 /var/www/storage /var/www/bootstrap/cache
# Этап 2: Сборка фронтенда (Inertia + Vue 3) # Оптимизируем автозагрузчик
FROM dh-mirror.gitverse.ru/node:20 AS jsbuild RUN composer dump-autoload --optimize
# Установка дополнительных зависимостей для сборки # Устанавливаем права
RUN apt-get update && apt-get install -y \ RUN chown -R application:application /var/www/html && \
python3 \ chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /var/www # Этап 2: Сборка фронтенда
FROM node:20-alpine AS node-build
WORKDIR /var/www/html
# Копируем зависимости Node.js # Копируем зависимости Node.js
COPY package.json package-lock.json* ./ COPY package.json package-lock.json* ./
@@ -99,109 +69,77 @@ RUN npm ci \
# Копируем файлы для сборки фронтенда # Копируем файлы для сборки фронтенда
COPY vite.config.js ./ COPY vite.config.js ./
COPY resources/js ./resources/js/ COPY resources/ ./resources/
COPY resources/css ./resources/css/
# Сборка ассетов Vite # Сборка ассетов
RUN npm run build RUN npm run build
# Этап 3: Финальный образ # Этап 3: Финальный production образ
FROM dh-mirror.gitverse.ru/php:8.3-fpm FROM webdevops/php-nginx:8.3-alpine
# Установка runtime зависимостей # Production настройки
RUN apt-get update && apt-get install -y \ ENV WEB_DOCUMENT_ROOT=/var/www/html/public
libxml2 \ ENV PHP_DATE_TIMEZONE=UTC
libonig5 \ ENV PHP_DISPLAY_ERRORS=0
libpng16-16 \ ENV PHP_MEMORY_LIMIT=512M
libjpeg62-turbo \ ENV PHP_MAX_EXECUTION_TIME=300
libfreetype6 \ ENV PHP_POST_MAX_SIZE=100M
libwebp7 \ ENV PHP_UPLOAD_MAX_FILESIZE=100M
libpq5 \ ENV PHP_OPCACHE_ENABLE=1
libxslt1.1 \ ENV PHP_OPCACHE_MEMORY_CONSUMPTION=256
libexif12 \ ENV PHP_OPCACHE_MAX_ACCELERATED_FILES=32531
libffi8 \ ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS=0
ENV NGINX_WORKER_PROCESSES=auto
ENV NGINX_WORKER_CONNECTIONS=1024
# Включаем дополнительные сервисы
#RUN docker-service enable cron && \
# docker-service enable supervisor
# Устанавливаем дополнительные пакеты, если нужны
RUN apk update && apk add --no-cache \
supervisor \ supervisor \
nginx \ # Для планировщика Laravel
cron \ dcron \
&& rm -rf /var/lib/apt/lists/* # Дополнительные утилиты
nano \
# Установка системных зависимостей htop \
RUN apt-get update && apt-get install -y \ && docker-run-bootstrap
git \
curl \
wget \
unzip \
libzip-dev \
libxml2-dev \
libicu-dev \
libonig-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libwebp-dev \
libpq-dev \
libxslt1-dev \
libexif-dev \
libffi-dev \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Установка PHP расширений
RUN docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
&& docker-php-ext-install -j$(nproc) \
bcmath \
intl \
mbstring \
zip \
opcache \
pdo \
pdo_mysql \
pdo_pgsql \
gd \
exif \
sockets \
xsl \
ffi \
pcntl
# Установка Redis расширения
RUN pecl install redis && docker-php-ext-enable redis
# Настройка opcache для production
RUN echo "opcache.enable=1" >> /usr/local/etc/php/conf.d/opcache.ini && \
echo "opcache.memory_consumption=256" >> /usr/local/etc/php/conf.d/opcache.ini && \
echo "opcache.interned_strings_buffer=32" >> /usr/local/etc/php/conf.d/opcache.ini && \
echo "opcache.max_accelerated_files=32531" >> /usr/local/etc/php/conf.d/opcache.ini && \
echo "opcache.validate_timestamps=0" >> /usr/local/etc/php/conf.d/opcache.ini
# Копируем PHP расширения из первого этапа
#COPY --from=phpbuild /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/
#COPY --from=phpbuild /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ /usr/local/lib/php/extensions/no-debug-non-zts-20230831/
#COPY --from=phpbuild /usr/local/bin/ /usr/local/bin/
# Копируем конфигурации # Копируем конфигурации
COPY docker/nginx.conf /etc/nginx/nginx.conf COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/app.conf /etc/nginx/conf.d/default.conf COPY docker/app.conf /etc/nginx/conf.d/default.conf
COPY docker/supervisord.conf /etc/supervisor/supervisord.conf COPY docker/supervisord.conf /etc/supervisor/supervisord.conf
WORKDIR /var/www WORKDIR /var/www/html
# Копируем приложение # Копируем приложение из этапов сборки
COPY --chown=www-data:www-data --from=phpbuild /var/www . COPY --chown=application:application --from=php-build /var/www/html .
COPY --chown=www-data:www-data --from=jsbuild /var/www/public/build ./public/build COPY --chown=application:application --from=node-build /var/www/html/public/build ./public/build
COPY --chown=www-data:www-data --from=jsbuild /var/www/node_modules ./node_modules
# Настройка прав и оптимизация Laravel # Настраиваем права
RUN mkdir -p /var/log/supervisor && \ RUN chown -R application:application /var/www/html && \
chown -R www-data:www-data /var/www /var/log/supervisor && \ chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
chmod -R 775 /var/www/storage /var/www/bootstrap/cache
# Создание ссылки на Storage # Создаем символические ссылки
RUN php artisan storage:link RUN php artisan storage:link
# Кэшируем конфигурации Laravel для production
#RUN php artisan config:cache && \
# php artisan route:cache && \
# php artisan view:cache
# Удаляем все тестовые файлы PHP (для docker-squash)
# https://github.com/shinsenter/docker-squash
RUN rm -rf /usr/src/php \
&& rm -f /usr/src/php.tar.xz 2>/dev/null || true \
&& rm -rf /usr/local/lib/php/test \
&& rm -rf /usr/local/lib/php/doc
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost/health || exit 1
EXPOSE 80 EXPOSE 80
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
CMD ["supervisord", "-c", "/etc/supervisor.d/supervisord.conf"]

View File

@@ -47,8 +47,6 @@ class IndexController extends Controller
$pageSize $pageSize
); );
// dd($data);
$statuses = ArchiveStatus::all()->map(function ($status) { $statuses = ArchiveStatus::all()->map(function ($status) {
return [ return [
'value' => $status->id, 'value' => $status->id,

View File

@@ -23,7 +23,7 @@ class MedicalHistoryController extends Controller
else $patient = MisSttMedicalHistory::where('MedicalHistoryID', $id)->first(); else $patient = MisSttMedicalHistory::where('MedicalHistoryID', $id)->first();
if($patient instanceof MisSttMedicalHistory) { if($patient instanceof MisSttMedicalHistory) {
if ($patient->archiveHistory->count() === 0) { if ($patient->archiveHistory->count() === 0 && $patient->archiveInfo->foxpro_history_id) {
$foxproCardId = $patient->archiveInfo->foxpro_history_id; $foxproCardId = $patient->archiveInfo->foxpro_history_id;
$foxproPatient = SiSttMedicalHistory::where('keykarta', $foxproCardId)->first(); $foxproPatient = SiSttMedicalHistory::where('keykarta', $foxproCardId)->first();
@@ -44,7 +44,7 @@ class MedicalHistoryController extends Controller
...PatientInfoResource::make($patient)->toArray(request()), ...PatientInfoResource::make($patient)->toArray(request()),
'can_be_issued' => $patient->canBeIssued() 'can_be_issued' => $patient->canBeIssued()
], ],
'journal' => ArchiveHistoryResource::collection($journalHistory), 'journal' => $journalHistory ? ArchiveHistoryResource::collection($journalHistory) : [],
'archiveInfo' => $archiveInfo ? ArchiveInfoResource::make($archiveInfo) : null 'archiveInfo' => $archiveInfo ? ArchiveInfoResource::make($archiveInfo) : null
]; ];

View File

@@ -9,7 +9,7 @@ class OrgController extends Controller
{ {
public function index() public function index()
{ {
$orgs = Org::all(['id', 'name', 'code']); $orgs = Org::orderBy('name')->get(['id', 'name', 'code']);
return response()->json($orgs); return response()->json($orgs);
} }

View File

@@ -57,7 +57,9 @@ class IndexSttMedicalHistoryResource extends JsonResource
? "$archiveInfoMisCardNumber / $archiveInfoFoxproCardNumber" ? "$archiveInfoMisCardNumber / $archiveInfoFoxproCardNumber"
: $archiveInfoMisCardNumber ?? $archiveInfoFoxproCardNumber; : $archiveInfoMisCardNumber ?? $archiveInfoFoxproCardNumber;
$department = $historyType === 'mis' ? $model->outcomeMigration->stationarBranch->department : null; $department = $historyType === 'mis' ? $model->outcomeMigration?->first()?->stationarBranch->department : null;
$visitResult = $historyType === 'mis' ? $this->visitResult->NAME : null;
return [ return [
'id' => $id, 'id' => $id,
@@ -71,7 +73,8 @@ class IndexSttMedicalHistoryResource extends JsonResource
'dr' => $formattedBirthDate, 'dr' => $formattedBirthDate,
'daterecipient' => $formattedDateRecipient, 'daterecipient' => $formattedDateRecipient,
'dateextract' => $formattedDateExtract, 'dateextract' => $formattedDateExtract,
'department' => $department?->DepartmentNAME, 'department' => $department ? '[' . $department->DepartmentCODE . '] ' . $department->DepartmentNAME : 'Н/д',
'visitresult' => $visitResult,
// Номера карт // Номера карт
'medcardnum' => $cardNumber, // MIS номер или FoxPro номер 'medcardnum' => $cardNumber, // MIS номер или FoxPro номер

View File

@@ -4,6 +4,7 @@ namespace App\Models\Mis;
use App\Models\ArchiveHistory; use App\Models\ArchiveHistory;
use App\Models\ArchiveInfo; use App\Models\ArchiveInfo;
use App\Models\OmsVisitResult;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
@@ -34,14 +35,14 @@ class SttMedicalHistory extends Model
public function migrations() public function migrations()
{ {
return $this->hasOne(SttMigrationPatient::class, 'rf_MedicalHistoryID', 'MedicalHistoryID'); return $this->hasMany(SttMigrationPatient::class, 'rf_MedicalHistoryID', 'MedicalHistoryID');
} }
public function outcomeMigration() public function outcomeMigration()
{ {
return $this->migrations() return $this->migrations()
->where('rf_kl_VisitResultID', 1) ->whereDate('DateOut', '<>', '2222-01-01')
->whereDate('DateOut', '<>', '2222-01-01'); ->orderBy('DateOut', 'desc');
} }
/** /**
@@ -77,4 +78,9 @@ class SttMedicalHistory extends Model
->latest('issue_at') ->latest('issue_at')
->first(); ->first();
} }
public function visitResult()
{
return $this->hasOne(OmsVisitResult::class, 'kl_VisitResultID', 'rf_kl_VisitResultID');
}
} }

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class OmsVisitResult extends Model
{
protected $table = 'oms_kl_visitresult';
protected $primaryKey = 'kl_VisitResultID';
}

View File

@@ -78,6 +78,7 @@ class ArchiveCardService
// Приоритет MIS истории // Приоритет MIS истории
if ($archiveInfo->misHistory) { if ($archiveInfo->misHistory) {
$history = $archiveInfo->misHistory; $history = $archiveInfo->misHistory;
$history->load('visitResult');
$history->history_type = 'mis'; $history->history_type = 'mis';
} else { } else {
$history = $archiveInfo->foxproHistory; $history = $archiveInfo->foxproHistory;

View File

@@ -10,7 +10,7 @@ return Application::configure(basePath: dirname(__DIR__))
web: __DIR__.'/../routes/web.php', web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php', api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php', commands: __DIR__.'/../routes/console.php',
health: '/up', health: '/health',
) )
->withMiddleware(function (Middleware $middleware): void { ->withMiddleware(function (Middleware $middleware): void {
$middleware->web(append: [ $middleware->web(append: [

View File

@@ -1,15 +1,15 @@
services: services:
#PHP Service #PHP Service
app: app:
image: registry.brusoff.su/kartoteka:1.0 image: registry.brusoff.su/kartoteka:2026.02-prod
build: . build: .
container_name: kartoteka_app container_name: kartoteka_app
restart: unless-stopped restart: unless-stopped
ports: ports:
- "8090:80" - "8090:80"
working_dir: /var/www working_dir: /var/www/html
volumes: volumes:
- ./.env:/var/www/.env - ./.env:/var/www/html/.env
- ./docker/php.ini:/usr/local/etc/php/conf.d/app.ini - ./docker/php.ini:/usr/local/etc/php/conf.d/app.ini
- ./docker/blocked_ips.map:/etc/nginx/blocked_ips.map - ./docker/blocked_ips.map:/etc/nginx/blocked_ips.map
- ./storage/logs:/var/www/storage/logs - ./storage/logs:/var/www/storage/logs

View File

@@ -63,7 +63,10 @@ const onCloseWithoutSave = () => {
const loadArchiveHistoryData = async () => { const loadArchiveHistoryData = async () => {
try { try {
await axios.get('/api/orgs').then(res => { await axios.get('/api/orgs').then(res => {
orgs.value = res.data orgs.value = res.data.map(org => ({
...org,
name: `${org.code} - ${org.name}`
}))
}) })
if (!props.archiveHistoryId) return if (!props.archiveHistoryId) return
@@ -100,6 +103,10 @@ const submit = () => {
} }
} }
const filterOrg = (pattern, option) => {
return option.name.startsWith(pattern)
}
// Наблюдаем за изменением archiveHistoryId // Наблюдаем за изменением archiveHistoryId
watch(() => props.archiveHistoryId, async (newId) => { watch(() => props.archiveHistoryId, async (newId) => {
if (!props.isCreateNew) { if (!props.isCreateNew) {
@@ -123,7 +130,7 @@ watch(() => props.archiveHistoryId, async (newId) => {
<NDatePicker v-model:value="archiveHistory.return_at" format="dd.MM.yyyy" /> <NDatePicker v-model:value="archiveHistory.return_at" format="dd.MM.yyyy" />
</NFormItem> </NFormItem>
<NFormItem label="Организация"> <NFormItem label="Организация">
<NSelect v-model:value="archiveHistory.org_id" :options="orgs" label-field="name" value-field="id" filterable /> <NSelect v-model:value="archiveHistory.org_id" :filter="(pattern, option) => filterOrg(pattern, option)" :options="orgs" label-field="name" value-field="id" filterable />
</NFormItem> </NFormItem>
<NFormItem label="Имя сотрудника"> <NFormItem label="Имя сотрудника">
<NInput v-model:value="archiveHistory.employee_name" /> <NInput v-model:value="archiveHistory.employee_name" />

View File

@@ -44,15 +44,27 @@ const columns = ref([
{ {
title: '№ карты', title: '№ карты',
key: 'medcardnum', key: 'medcardnum',
width: 100, width: 80,
render: (row) => h(NEllipsis, null, { default: () => row.medcardnum }) render: (row) => h(NEllipsis, null, { default: () => row.medcardnum })
}, },
{ {
title: 'ФИО', title: 'ФИО',
key: 'fullname', key: 'fullname',
width: 250, width: 200,
render: (row) => h(NEllipsis, null, { default: () => row.fullname }) render: (row) => h(NEllipsis, null, { default: () => row.fullname })
}, },
{
title: 'Исход',
key: 'visitresult',
width: 60,
render: (row) => h(NEllipsis, null, { default: () => row.visitresult ?? 'Н/д' })
},
{
title: 'Отделение',
key: 'department',
width: 220,
render: (row) => h(NEllipsis, null, { default: () => row.department })
},
{ {
title: 'Дата рождения', title: 'Дата рождения',
key: 'dr', key: 'dr',
@@ -68,31 +80,25 @@ const columns = ref([
{ {
title: 'Дата выписки', title: 'Дата выписки',
key: 'dateextract', key: 'dateextract',
width: 100, width: 80,
render: (row) => h(NEllipsis, null, { default: () => row.dateextract }) render: (row) => h(NEllipsis, null, { default: () => row.dateextract })
}, },
{
title: 'Отделение',
key: 'department',
width: 180,
render: (row) => h(NEllipsis, null, { default: () => row.department })
},
{ {
title: '№ архива', title: '№ архива',
key: 'card_num', key: 'card_num',
width: 120, width: 80,
render: (row) => h(NEllipsis, null, { default: () => row.card_num || '-' }) render: (row) => h(NEllipsis, null, { default: () => row.card_num || '-' })
}, },
{ {
title: 'Дата архива', title: 'Дата архива',
key: 'datearhiv', key: 'datearhiv',
width: 130, width: 80,
render: (row) => h(NEllipsis, null, { default: () => row.datearhiv }) render: (row) => h(NEllipsis, null, { default: () => row.datearhiv })
}, },
{ {
title: 'Статус', title: 'Статус',
key: 'status', key: 'status',
width: 100, width: 60,
render: (row) => archiveStatusColumn(row.status) render: (row) => archiveStatusColumn(row.status)
} }
]) ])
@@ -152,6 +158,7 @@ watch(() => archiveCardStore.isOpenArchiveCard, (isOpen) => {
<template> <template>
<NDataTable remote <NDataTable remote
:single-line="false"
striped striped
:loading="isLoading" :loading="isLoading"
:row-props="rowProps" :row-props="rowProps"