mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 00:11:06 +03:30
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1916fac447 | ||
|
|
056160bca5 | ||
|
|
a5136a341f | ||
|
|
47aab06e49 | ||
|
|
f9023086c9 | ||
|
|
6311e2af70 | ||
|
|
4492db15cf | ||
|
|
62a353ef80 | ||
|
|
bae730e402 | ||
|
|
6c8054edac | ||
|
|
ac19e51d28 | ||
|
|
9832fbe81a | ||
|
|
24aa9fb7f2 | ||
|
|
4f25abbf36 | ||
|
|
6de8d2dbae | ||
|
|
1bd5970a58 | ||
|
|
accf16c184 | ||
|
|
540f9a1d65 | ||
|
|
4a9010d2c7 | ||
|
|
76c9ec4c8f | ||
|
|
f5e1ff198e | ||
|
|
abd611cdcf | ||
|
|
8a90d3bce4 | ||
|
|
af876a5e07 | ||
|
|
06850ca736 | ||
|
|
62fc5dc977 | ||
|
|
8ee7bb56b7 | ||
|
|
b4d3134230 | ||
|
|
322c080028 | ||
|
|
0d1b0360ac | ||
|
|
1ee3585674 | ||
|
|
1d98af0113 | ||
|
|
034000bcef | ||
|
|
5fe7474227 | ||
|
|
71e493ec10 | ||
|
|
b0b6d700ba | ||
|
|
2d1df25b0e | ||
|
|
0170cb1258 | ||
|
|
8046611c01 | ||
|
|
9c9f40d06e | ||
|
|
32a477548e | ||
|
|
505c176dad | ||
|
|
e5253f7eda | ||
|
|
96de1c2fbe | ||
|
|
117a1cb160 | ||
|
|
9bf95438b7 | ||
|
|
a4392b74c9 | ||
|
|
869e3e0c59 |
+11
-18
@@ -8,12 +8,12 @@ clone:
|
|||||||
# npm config set _auth token add command
|
# npm config set _auth token add command
|
||||||
steps:
|
steps:
|
||||||
- name: clone
|
- name: clone
|
||||||
image: docker.willaspace.com/repository/docker-hosted/alpine/git
|
image: docker.meshkee.com/repository/docker-hosted/alpine/git
|
||||||
commands:
|
commands:
|
||||||
- git clone $DRONE_GIT_HTTP_URL .
|
- git clone $DRONE_GIT_HTTP_URL .
|
||||||
- git checkout $DRONE_COMMIT
|
- git checkout $DRONE_COMMIT
|
||||||
- name: Build docker image
|
- name: Build docker image
|
||||||
image: docker.willaspace.com/repository/docker-hosted/plugins/docker
|
image: docker.meshkee.com/repository/docker-hosted/plugins/docker
|
||||||
environment:
|
environment:
|
||||||
REGISTRY_USER_NAME:
|
REGISTRY_USER_NAME:
|
||||||
from_secret: registry_username
|
from_secret: registry_username
|
||||||
@@ -24,8 +24,8 @@ steps:
|
|||||||
- latest
|
- latest
|
||||||
- ${DRONE_BUILD_NUMBER}
|
- ${DRONE_BUILD_NUMBER}
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
registry: docker.willaspace.com
|
registry: docker.meshkee.com
|
||||||
repo: docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back
|
repo: docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back
|
||||||
build_args_from_env:
|
build_args_from_env:
|
||||||
- REGISTRY_USER_NAME
|
- REGISTRY_USER_NAME
|
||||||
- REGISTRY_PASSWORD
|
- REGISTRY_PASSWORD
|
||||||
@@ -36,18 +36,16 @@ steps:
|
|||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
event:
|
|
||||||
- push
|
|
||||||
|
|
||||||
- name: Build docker nginx image
|
- name: Build docker nginx image
|
||||||
image: docker.willaspace.com/repository/docker-hosted/plugins/docker
|
image: docker.meshkee.com/repository/docker-hosted/plugins/docker
|
||||||
settings:
|
settings:
|
||||||
tags:
|
tags:
|
||||||
- nginx-latest
|
- nginx-latest
|
||||||
- nginx-${DRONE_BUILD_NUMBER}
|
- nginx-${DRONE_BUILD_NUMBER}
|
||||||
dockerfile: Dockerfile.nginx
|
dockerfile: Dockerfile.nginx
|
||||||
registry: docker.willaspace.com
|
registry: docker.meshkee.com
|
||||||
repo: docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back
|
repo: docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back
|
||||||
username:
|
username:
|
||||||
from_secret: registry_username
|
from_secret: registry_username
|
||||||
password:
|
password:
|
||||||
@@ -55,11 +53,9 @@ steps:
|
|||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
event:
|
|
||||||
- push
|
|
||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
image: docker.willaspace.com/repository/docker-hosted/pelotech/drone-helm3:latest
|
image: pelotech/drone-helm3:latest
|
||||||
environment:
|
environment:
|
||||||
USERNAME:
|
USERNAME:
|
||||||
from_secret: registry_username
|
from_secret: registry_username
|
||||||
@@ -77,20 +73,17 @@ steps:
|
|||||||
release: cssd-production-back
|
release: cssd-production-back
|
||||||
namespace: cssd
|
namespace: cssd
|
||||||
add_repos:
|
add_repos:
|
||||||
- willaspace=https://$USERNAME:$PASSWORD@repo.willaspace.com/repository/willaspace-charts/
|
- willaspace=https://$USERNAME:$PASSWORD@repo.meshkee.com/repository/willaspace-charts/
|
||||||
values_files:
|
values_files:
|
||||||
- .values.yaml
|
- .values.yaml
|
||||||
values:
|
values:
|
||||||
- deployment.image.tag=nginx-$DRONE_BUILD_NUMBER
|
- deployment.image.tag=nginx-$DRONE_BUILD_NUMBER
|
||||||
- deployment.additionalContainers[0].image=docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back:$DRONE_BUILD_NUMBER
|
- deployment.additionalContainers[0].image=docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back:$DRONE_BUILD_NUMBER
|
||||||
- deployment.initContainers.init-artisan.image=docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back:$DRONE_BUILD_NUMBER
|
- deployment.initContainers.init-artisan.image=docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back:$DRONE_BUILD_NUMBER
|
||||||
timeout: 3000
|
timeout: 3000
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
event:
|
|
||||||
- pull_request
|
|
||||||
- push
|
|
||||||
|
|
||||||
|
|
||||||
image_pull_secrets:
|
image_pull_secrets:
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ APP_DEBUG=
|
|||||||
APP_URL=
|
APP_URL=
|
||||||
LOG_CHANNEL=
|
LOG_CHANNEL=
|
||||||
BROADCAST_DRIVER=
|
BROADCAST_DRIVER=
|
||||||
CACHE_DRIVER=
|
CACHE_DRIVER=file
|
||||||
QUEUE_CONNECTION=
|
QUEUE_CONNECTION=
|
||||||
SESSION_DRIVER=
|
SESSION_DRIVER=
|
||||||
SESSION_LIFETIME=
|
SESSION_LIFETIME=
|
||||||
|
|||||||
+4
-4
@@ -84,7 +84,7 @@ deployment:
|
|||||||
name: cssd-production-back-configmap
|
name: cssd-production-back-configmap
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: cssd-production-back-secret
|
name: cssd-production-back-secret
|
||||||
image: docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back:latest
|
image: docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back:latest
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
|
|
||||||
# Additional labels for Deployment
|
# Additional labels for Deployment
|
||||||
@@ -193,7 +193,7 @@ deployment:
|
|||||||
|
|
||||||
# Image of the app container
|
# Image of the app container
|
||||||
image:
|
image:
|
||||||
repository: docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back
|
repository: docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back
|
||||||
tag: nginx-latest
|
tag: nginx-latest
|
||||||
digest: '' # if set to a non empty value, digest takes precedence on the tag
|
digest: '' # if set to a non empty value, digest takes precedence on the tag
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
@@ -258,7 +258,7 @@ deployment:
|
|||||||
# Add additional containers besides init and app containers
|
# Add additional containers besides init and app containers
|
||||||
additionalContainers:
|
additionalContainers:
|
||||||
- name: php-fpm
|
- name: php-fpm
|
||||||
image: docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back:latest
|
image: docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back:latest
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
@@ -315,7 +315,7 @@ deployment:
|
|||||||
podLabels:
|
podLabels:
|
||||||
# env: prod
|
# env: prod
|
||||||
|
|
||||||
image: docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back:latest
|
image: docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back:latest
|
||||||
command:
|
command:
|
||||||
- /usr/bin/supervisord
|
- /usr/bin/supervisord
|
||||||
- -n
|
- -n
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM docker.willaspace.com/repository/docker-hosted/standard-laravel:8.2-fpm
|
FROM docker.meshkee.com/repository/docker-hosted/standard-laravel:8.2-fpm
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ COPY database /var/www/html/database
|
|||||||
|
|
||||||
COPY composer.* /var/www/html/
|
COPY composer.* /var/www/html/
|
||||||
|
|
||||||
RUN composer config --global http-basic.repo.willaspace.com $REGISTRY_USER_NAME $REGISTRY_PASSWORD
|
RUN composer config --global http-basic.repo.meshkee.com $REGISTRY_USER_NAME $REGISTRY_PASSWORD
|
||||||
|
|
||||||
RUN composer install --no-scripts
|
RUN composer install --no-scripts
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# Use the official PHP image as the base image
|
||||||
|
FROM 'docker-proxy.meshkee.com/php:8.2-fpm'
|
||||||
|
|
||||||
|
# Set working directory inside the container
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
# Install system dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
git \
|
||||||
|
curl \
|
||||||
|
libpng-dev \
|
||||||
|
libonig-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
zip \
|
||||||
|
unzip \
|
||||||
|
libzip-dev \
|
||||||
|
libpq-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libicu-dev \
|
||||||
|
g++ \
|
||||||
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd \
|
||||||
|
&& docker-php-ext-install pdo_mysql pdo_pgsql mbstring exif pcntl bcmath opcache intl zip
|
||||||
|
|
||||||
|
# Install Composer
|
||||||
|
COPY --from=docker-proxy.meshkee.com/composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
|
# Copy application code into the container
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install PHP dependencies
|
||||||
|
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
|
# Set permissions for the Laravel project
|
||||||
|
RUN chown -R www-data:www-data /var/www/html \
|
||||||
|
&& chmod -R 777 /var/www/html/storage /var/www/html/bootstrap/cache
|
||||||
|
|
||||||
|
# Expose port 9000 for PHP-FPM
|
||||||
|
EXPOSE 9000
|
||||||
+12
-2
@@ -1,3 +1,13 @@
|
|||||||
FROM docker.willaspace.com/repository/docker-hosted/nginx:alpine
|
FROM node:14-alpine AS builder
|
||||||
|
|
||||||
COPY public /var/www/html/public
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
COPY . /var/www/html/
|
||||||
|
|
||||||
|
RUN npm i
|
||||||
|
|
||||||
|
RUN npm run production
|
||||||
|
|
||||||
|
FROM docker.meshkee.com/repository/docker-hosted/nginx:alpine
|
||||||
|
|
||||||
|
COPY --from=builder /var/www/html/public /var/www/html/public
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ class StatusTypeEnum
|
|||||||
{
|
{
|
||||||
const APPROVED = "approved";
|
const APPROVED = "approved";
|
||||||
const REJECTED = "rejected";
|
const REJECTED = "rejected";
|
||||||
const SUSPENDED = "suspended";
|
const PENDING = "pending";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Events;
|
||||||
|
|
||||||
|
use App\Models\Cycle;
|
||||||
|
use Illuminate\Broadcasting\Channel;
|
||||||
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
|
use Illuminate\Broadcasting\PresenceChannel;
|
||||||
|
use Illuminate\Broadcasting\PrivateChannel;
|
||||||
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||||
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
|
class CycleSaved
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new event instance.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public Cycle $cycle;
|
||||||
|
|
||||||
|
public function __construct(Cycle $cycle)
|
||||||
|
{
|
||||||
|
$this->cycle = $cycle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the channels the event should broadcast on.
|
||||||
|
*
|
||||||
|
* @return array<int, \Illuminate\Broadcasting\Channel>
|
||||||
|
*/
|
||||||
|
public function broadcastOn(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// new PrivateChannel('channel-name'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (!function_exists('pluckValues')) {
|
||||||
|
/**
|
||||||
|
* Extracts the values of a given key from an array of associative arrays.
|
||||||
|
*
|
||||||
|
* @param array $array The input array of associative arrays.
|
||||||
|
* @param string $key The key whose values need to be extracted.
|
||||||
|
* @return array An array containing the values of the specified key.
|
||||||
|
*/
|
||||||
|
function pluckValues(array $array, string $key): array
|
||||||
|
{
|
||||||
|
return array_map(function ($item) use ($key) {
|
||||||
|
return $item[$key] ?? null;
|
||||||
|
}, $array);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Packages\Messaging\src\Facades\MessageResponse;
|
use Packages\Messaging\src\Facades\MessageResponse;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
|
||||||
class RegisterController extends Controller
|
class RegisterController extends Controller
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Events\CycleSaved;
|
||||||
use App\Http\Requests\StoreCycleRequest;
|
use App\Http\Requests\StoreCycleRequest;
|
||||||
use App\Http\Resources\CycleResource;
|
use App\Http\Resources\CycleResource;
|
||||||
use App\Interfaces\CycleRepositoryInterface;
|
use App\Interfaces\CycleRepositoryInterface;
|
||||||
@@ -72,6 +73,8 @@ class CycleController extends Controller
|
|||||||
foreach ( $Labels as $Label => $Count ) {
|
foreach ( $Labels as $Label => $Count ) {
|
||||||
$CycleObj->labels()->attach( array( $Label ) , [ 'count' => $Count ] );
|
$CycleObj->labels()->attach( array( $Label ) , [ 'count' => $Count ] );
|
||||||
}
|
}
|
||||||
|
event(new CycleSaved($CycleObj));
|
||||||
|
|
||||||
return MessageResponse::success( trans( 'messages.success' ) );
|
return MessageResponse::success( trans( 'messages.success' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +112,7 @@ class CycleController extends Controller
|
|||||||
foreach ( $Labels as $Label => $Count ) {
|
foreach ( $Labels as $Label => $Count ) {
|
||||||
$Cycle->labels()->attach( array( $Label ) , [ 'count' => $Count ] );
|
$Cycle->labels()->attach( array( $Label ) , [ 'count' => $Count ] );
|
||||||
}
|
}
|
||||||
|
event(new CycleSaved($Cycle));
|
||||||
return MessageResponse::success( trans( 'messages.success' ) );
|
return MessageResponse::success( trans( 'messages.success' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +131,7 @@ class CycleController extends Controller
|
|||||||
public function verifyCycle( Cycle $Cycle )
|
public function verifyCycle( Cycle $Cycle )
|
||||||
{
|
{
|
||||||
if ( auth( 'api' )->user()->cant( 'verifyCycle' , $Cycle ) ) {
|
if ( auth( 'api' )->user()->cant( 'verifyCycle' , $Cycle ) ) {
|
||||||
return MessageResponse::error( trans( 'You dont have permission' ) );
|
return MessageResponse::error( trans( 'messages.access_denied' ) );
|
||||||
}
|
}
|
||||||
if ( $Cycle->verified == 'Verified' ) {
|
if ( $Cycle->verified == 'Verified' ) {
|
||||||
$Cycle->verified = 'NotVerified';
|
$Cycle->verified = 'NotVerified';
|
||||||
|
|||||||
@@ -45,11 +45,7 @@ class ItemController extends Controller
|
|||||||
] );
|
] );
|
||||||
|
|
||||||
$user = auth( 'api' )->user();
|
$user = auth( 'api' )->user();
|
||||||
if ( $user->hasRole( 'User' ) ) {
|
if ( $user->hasRole( 'User' ) or $user->hasRole( 'Supervisor' ) ) {
|
||||||
$Items = $Items->whereHas( 'user' , function ( $query ) use ( $user ) {
|
|
||||||
$query->where( 'medical_center_id' , $user->medical_center_id );
|
|
||||||
} )->where( "status" , StatusTypeEnum::APPROVED );
|
|
||||||
} elseif ( $user->hasRole( 'Supervisor' ) ) {
|
|
||||||
$Items = $Items->whereHas( 'user' , function ( $query ) use ( $user ) {
|
$Items = $Items->whereHas( 'user' , function ( $query ) use ( $user ) {
|
||||||
$query->where( 'medical_center_id' , $user->medical_center_id );
|
$query->where( 'medical_center_id' , $user->medical_center_id );
|
||||||
} );
|
} );
|
||||||
@@ -111,13 +107,13 @@ class ItemController extends Controller
|
|||||||
|
|
||||||
public function getItems()
|
public function getItems()
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
$userId = auth('api')->id();
|
||||||
$medicalCenterId = optional(optional($user)->medical_center)->id;
|
// $medicalCenterId = optional(optional($user)->medical_center)->id;
|
||||||
$userIds = User::where('medical_center_id', $medicalCenterId)->pluck('id')->toArray();
|
// $userIds = User::where('medical_center_id', $medicalCenterId)->pluck('id')->toArray();
|
||||||
|
|
||||||
$Items = Item::where( "status" , StatusTypeEnum::APPROVED )
|
$Items = Item::where( "status" , StatusTypeEnum::APPROVED )
|
||||||
->where( "package_id" , null )
|
->where( "package_id" , null )
|
||||||
->whereIn('creator_id', $userIds)
|
->where('user_id', $userId)
|
||||||
->orderByDesc( 'id' )
|
->orderByDesc( 'id' )
|
||||||
->isNotRepaired()
|
->isNotRepaired()
|
||||||
->get();
|
->get();
|
||||||
@@ -161,7 +157,7 @@ class ItemController extends Controller
|
|||||||
'specific' => $request->specific ,
|
'specific' => $request->specific ,
|
||||||
'note' => $request->note ,
|
'note' => $request->note ,
|
||||||
'udi' => $request->udi ,
|
'udi' => $request->udi ,
|
||||||
'status' => StatusTypeEnum::SUSPENDED ,
|
'status' => StatusTypeEnum::PENDING ,
|
||||||
'user_id' => auth( 'api' )->user()->id ,
|
'user_id' => auth( 'api' )->user()->id ,
|
||||||
'creator_id' => auth( 'api' )->user()->id
|
'creator_id' => auth( 'api' )->user()->id
|
||||||
] );
|
] );
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class LabelController extends Controller
|
|||||||
$query->where('medical_center_id', $user->medical_center_id);
|
$query->where('medical_center_id', $user->medical_center_id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})->get();
|
})->where('enabled',true)->get();
|
||||||
|
|
||||||
return MessageResponse::data($Labels);
|
return MessageResponse::data($Labels);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class PackageController extends Controller
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$Packages = $Packages->orderByDesc('id')->get();
|
$Packages = $Packages->orderByDesc('id')->paginate(10);
|
||||||
|
|
||||||
return PackageResource::collection($Packages);
|
return PackageResource::collection($Packages);
|
||||||
}
|
}
|
||||||
@@ -77,6 +77,7 @@ class PackageController extends Controller
|
|||||||
public function getPackages()
|
public function getPackages()
|
||||||
{
|
{
|
||||||
$Packages = Package::where("status", StatusTypeEnum::APPROVED)
|
$Packages = Package::where("status", StatusTypeEnum::APPROVED)
|
||||||
|
->where("user_id", auth('api')->id())
|
||||||
->orderByDesc('id')
|
->orderByDesc('id')
|
||||||
->get();
|
->get();
|
||||||
return PackageResource::collection($Packages);
|
return PackageResource::collection($Packages);
|
||||||
@@ -114,16 +115,16 @@ class PackageController extends Controller
|
|||||||
$PackageData = [
|
$PackageData = [
|
||||||
'name' => $request->name,
|
'name' => $request->name,
|
||||||
'note' => $request->note,
|
'note' => $request->note,
|
||||||
'status' => StatusTypeEnum::SUSPENDED,
|
'status' => StatusTypeEnum::PENDING,
|
||||||
'user_id' => auth('api')->user()->id,
|
'user_id' => auth('api')->user()->id,
|
||||||
'creator_id' => auth('api')->user()->id
|
'creator_id' => auth('api')->user()->id
|
||||||
];
|
];
|
||||||
$Package = Package::create($PackageData);
|
$Package = Package::create($PackageData);
|
||||||
foreach ($request->items as $itemId) {
|
foreach ($request->items as $itemNameAndId) {
|
||||||
$item = Item::where("id", $itemId)->first();
|
$item = Item::where("id", $itemNameAndId['id'])->first();
|
||||||
if ($item) {
|
if ($item) {
|
||||||
$item->update([
|
$item->update([
|
||||||
"package_id" => $Package->id
|
'package_id' => $Package->id
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,8 +141,8 @@ class PackageController extends Controller
|
|||||||
{
|
{
|
||||||
$Package->update($request->except(['items']));
|
$Package->update($request->except(['items']));
|
||||||
|
|
||||||
foreach ($request->items as $itemId) {
|
foreach ($request->items as $itemNameAndId) {
|
||||||
$item = Item::where("id", $itemId)->first();
|
$item = Item::where("id", $itemNameAndId['id'])->first();
|
||||||
if ($item) {
|
if ($item) {
|
||||||
$item->update([
|
$item->update([
|
||||||
"package_id" => $Package->id
|
"package_id" => $Package->id
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ class TestResultController extends Controller
|
|||||||
public function verifyTestResult(TestResult $TestResult, $Value)
|
public function verifyTestResult(TestResult $TestResult, $Value)
|
||||||
{
|
{
|
||||||
if (auth('api')->user()->cant('verifyTestResult', $TestResult)) {
|
if (auth('api')->user()->cant('verifyTestResult', $TestResult)) {
|
||||||
return MessageResponse::error(trans('You dont have permission or this test result belongs to another medical center'));
|
return MessageResponse::error('messages.access_denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
$TestResult->verified = $Value;
|
$TestResult->verified = $Value;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class TransferItemController extends Controller
|
|||||||
{
|
{
|
||||||
$data = Transfer::query()
|
$data = Transfer::query()
|
||||||
->whereHasMorph( 'transferable' , [ Item::class ] )
|
->whereHasMorph( 'transferable' , [ Item::class ] )
|
||||||
->where( "status" , StatusTypeEnum::SUSPENDED )
|
->where( "status" , StatusTypeEnum::PENDING )
|
||||||
->with( [ "user" , "transferable" , "transferable.user" ] );
|
->with( [ "user" , "transferable" , "transferable.user" ] );
|
||||||
|
|
||||||
$user = auth( 'api' )->user();
|
$user = auth( 'api' )->user();
|
||||||
@@ -41,7 +41,7 @@ class TransferItemController extends Controller
|
|||||||
if ( auth( 'api' )->user()->cant( 'changeStatus' , [ Transfer::class , $Transfer ] ) ) {
|
if ( auth( 'api' )->user()->cant( 'changeStatus' , [ Transfer::class , $Transfer ] ) ) {
|
||||||
return MessageResponse::error( trans( 'messages.access_denied' ) );
|
return MessageResponse::error( trans( 'messages.access_denied' ) );
|
||||||
}
|
}
|
||||||
if ( $Transfer->status == StatusTypeEnum::SUSPENDED ) {
|
if ( $Transfer->status == StatusTypeEnum::PENDING ) {
|
||||||
if ( $request->status == StatusTypeEnum::APPROVED ) {
|
if ( $request->status == StatusTypeEnum::APPROVED ) {
|
||||||
$item = $Transfer->transferable;
|
$item = $Transfer->transferable;
|
||||||
if ( $item->transferActive ) $item->transferActive()->update( [ "to_date" => Carbon::now() ] );
|
if ( $item->transferActive ) $item->transferActive()->update( [ "to_date" => Carbon::now() ] );
|
||||||
@@ -58,7 +58,7 @@ class TransferItemController extends Controller
|
|||||||
|
|
||||||
public function transfer( StoreTransferRequest $request , Item $Item )
|
public function transfer( StoreTransferRequest $request , Item $Item )
|
||||||
{
|
{
|
||||||
if ( auth( 'api' )->user()->cant( 'transferItem' , [ Transfer::class , $Item ] ) ) {
|
if ( auth( 'api' )->user()->cant( 'transferItem' , [ auth()->user() , $Item ] ) ) {
|
||||||
return MessageResponse::error( trans( 'messages.access_denied' ) );
|
return MessageResponse::error( trans( 'messages.access_denied' ) );
|
||||||
}
|
}
|
||||||
if ( $Item->user_id != $request->user_id ) {
|
if ( $Item->user_id != $request->user_id ) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class TransferPackageController extends Controller
|
|||||||
{
|
{
|
||||||
$data = Transfer::query()
|
$data = Transfer::query()
|
||||||
->whereHasMorph( 'transferable' , [ Package::class ] )
|
->whereHasMorph( 'transferable' , [ Package::class ] )
|
||||||
->where( "status" , StatusTypeEnum::SUSPENDED )
|
->where( "status" , StatusTypeEnum::PENDING )
|
||||||
->with( [ "user" , "transferable" , "transferable.user" ] );
|
->with( [ "user" , "transferable" , "transferable.user" ] );
|
||||||
|
|
||||||
$user = auth( 'api' )->user();
|
$user = auth( 'api' )->user();
|
||||||
@@ -41,7 +41,7 @@ class TransferPackageController extends Controller
|
|||||||
if ( auth( 'api' )->user()->cant( 'changeStatus' , [ Transfer::class , $Transfer ] ) ) {
|
if ( auth( 'api' )->user()->cant( 'changeStatus' , [ Transfer::class , $Transfer ] ) ) {
|
||||||
return MessageResponse::error( trans( 'messages.access_denied' ) );
|
return MessageResponse::error( trans( 'messages.access_denied' ) );
|
||||||
}
|
}
|
||||||
if ( $Transfer->status == StatusTypeEnum::SUSPENDED ) {
|
if ( $Transfer->status == StatusTypeEnum::PENDING ) {
|
||||||
if ( $request->status == StatusTypeEnum::APPROVED ) {
|
if ( $request->status == StatusTypeEnum::APPROVED ) {
|
||||||
$package = $Transfer->transferable;
|
$package = $Transfer->transferable;
|
||||||
if ( $package->transferActive ) $package->transferActive()->update( [ "to_date" => Carbon::now() ] );
|
if ( $package->transferActive ) $package->transferActive()->update( [ "to_date" => Carbon::now() ] );
|
||||||
|
|||||||
@@ -179,14 +179,14 @@ class UserController extends Controller
|
|||||||
if ( auth( 'api' )->user()->cant( 'getByMedicalCenter' , $MedicalCenter ) ) {
|
if ( auth( 'api' )->user()->cant( 'getByMedicalCenter' , $MedicalCenter ) ) {
|
||||||
return MessageResponse::error( trans( 'messages.failed' ) );
|
return MessageResponse::error( trans( 'messages.failed' ) );
|
||||||
}
|
}
|
||||||
if ($user->hasRole('Admin')){
|
// if ($user->hasRole('Admin')){
|
||||||
$MedicalCenter = MedicalCenter::with(['users' => function ($query) {
|
// $MedicalCenter = MedicalCenter::with(['users' => function ($query) {
|
||||||
$query->select('id', 'medical_center_id', 'name', 'cell_number', 'status')
|
// $query->select('id', 'medical_center_id', 'name', 'cell_number', 'status')
|
||||||
->whereDoesntHave('roles', function ($roleQuery) {
|
// ->whereDoesntHave('roles', function ($roleQuery) {
|
||||||
$roleQuery->where('name', 'Admin');
|
// $roleQuery->where('name', 'Admin');
|
||||||
});
|
// });
|
||||||
}, 'users.roles'])->get();
|
// }, 'users.roles'])->get();
|
||||||
}else{
|
// }else{
|
||||||
$MedicalCenter = $MedicalCenter->load( [ 'users' => function ( $query ) use ( $user ) {
|
$MedicalCenter = $MedicalCenter->load( [ 'users' => function ( $query ) use ( $user ) {
|
||||||
if ( $user->hasRole( 'User' ) ) {
|
if ( $user->hasRole( 'User' ) ) {
|
||||||
return $query->select( [ 'id' , 'medical_center_id' , 'name' , 'cell_number' , 'status' ] )->where( 'id' , $user->id );
|
return $query->select( [ 'id' , 'medical_center_id' , 'name' , 'cell_number' , 'status' ] )->where( 'id' , $user->id );
|
||||||
@@ -197,7 +197,7 @@ class UserController extends Controller
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} , 'users.roles' ] );
|
} , 'users.roles' ] );
|
||||||
}
|
// }
|
||||||
|
|
||||||
return MessageResponse::data( $MedicalCenter );
|
return MessageResponse::data( $MedicalCenter );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Requests;
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
use App\Models\Cycle;
|
use App\Models\Cycle;
|
||||||
|
use App\Rules\ValidEnabledLabels;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
|
||||||
@@ -25,9 +26,10 @@ class StoreCycleRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'date' => 'required',
|
'date' => 'required',
|
||||||
'sterilizer_id' => 'required',
|
'sterilizer_id' => 'required',
|
||||||
'cycle_number' => 'required',
|
'cycle_number' => 'required|unique:cycles,cycle_number',
|
||||||
'note' => 'nullable',
|
'note' => 'nullable',
|
||||||
'labels.*.id' => 'required|numeric|exists:labels,id',
|
'labels.*.id' => 'required|numeric|exists:labels,id',
|
||||||
|
'labels' => ['required','array','distinct',new ValidEnabledLabels()],
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -37,9 +39,10 @@ class StoreCycleRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'date' => 'required',
|
'date' => 'required',
|
||||||
'sterilizer_id' => 'required',
|
'sterilizer_id' => 'required',
|
||||||
'cycle_number' => 'required',
|
'cycle_number' => 'required|unique:cycles,cycle_number',
|
||||||
'note' => 'nullable',
|
'note' => 'nullable',
|
||||||
'labels.*.id' => 'required|numeric|exists:labels,id',
|
'labels.*.id' => 'required|numeric|exists:labels,id',
|
||||||
|
'labels' => ['required','array','distinct',new ValidEnabledLabels()],
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests;
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use App\Rules\ValidateItemOwnership;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
class StorePackageRequest extends FormRequest
|
class StorePackageRequest extends FormRequest
|
||||||
@@ -23,7 +24,8 @@ class StorePackageRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'name' => 'required|max:250',
|
'name' => 'required|max:250',
|
||||||
'note' => 'nullable',
|
'note' => 'nullable',
|
||||||
'items' => 'required',
|
'items' => 'required|array|min:1',
|
||||||
|
'items.*.id' => ['exists:items,id','integer',new ValidateItemOwnership()],
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -33,7 +35,8 @@ class StorePackageRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'name' => 'required|max:250',
|
'name' => 'required|max:250',
|
||||||
'note' => 'nullable',
|
'note' => 'nullable',
|
||||||
'items' => 'required',
|
'items' => 'required|array|min:1',
|
||||||
|
'items.*.id' => ['exists:items,id','integer',new ValidateItemOwnership()],
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Listeners;
|
||||||
|
|
||||||
|
use App\Events\CycleSaved;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
|
||||||
|
class UpdateLabelsCycleNumber
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create the event listener.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the event.
|
||||||
|
*/
|
||||||
|
public function handle(CycleSaved $event): void
|
||||||
|
{
|
||||||
|
$cycle = $event->cycle;
|
||||||
|
$cycleNumber = $cycle->cycle_number;
|
||||||
|
|
||||||
|
$cycle->labels()->update(['cycle_number' => $cycleNumber, 'enabled' => false]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Events\CycleSaved;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
@@ -14,6 +15,7 @@ class Cycle extends Model
|
|||||||
'date', 'user_id', 'cycle_number', 'sterilizer_id', 'note', 'verified', 'unique_id'
|
'date', 'user_id', 'cycle_number', 'sterilizer_id', 'note', 'verified', 'unique_id'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
public function user(): BelongsTo
|
public function user(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class);
|
return $this->belongsTo(User::class);
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ class User extends Authenticatable
|
|||||||
'email_verified_at' => 'datetime',
|
'email_verified_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
protected function getDefaultGuardName(): string { return 'api'; }
|
||||||
|
|
||||||
public function medical_center(): BelongsTo
|
public function medical_center(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(MedicalCenter::class);
|
return $this->belongsTo(MedicalCenter::class);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
|
use App\Constants\StatusTypeEnum;
|
||||||
use App\Models\Item;
|
use App\Models\Item;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
|
||||||
@@ -17,11 +18,12 @@ class ItemPolicy
|
|||||||
{
|
{
|
||||||
if ($user->hasRole('Admin')) {
|
if ($user->hasRole('Admin')) {
|
||||||
return true;
|
return true;
|
||||||
} elseif ($user->hasRole('Supervisor')) {
|
} elseif ($user->hasRole('Supervisor') && $Item->user()->medical_center_id == $user->medical_center_id) {
|
||||||
if ($Item->status == 0) {
|
return true;
|
||||||
|
} elseif ($user->hasRole('User') && $Item->user_id == $user->id && $Item->status != StatusTypeEnum::APPROVED) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(User $user, Item $Item)
|
public function update(User $user, Item $Item)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class TransferPolicy
|
|||||||
|
|
||||||
public function transferItem(User $user, Item $Item)
|
public function transferItem(User $user, Item $Item)
|
||||||
{
|
{
|
||||||
|
if(is_null($Item->package_id)){
|
||||||
if ($user->hasRole('Admin')) {
|
if ($user->hasRole('Admin')) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -30,6 +31,9 @@ class TransferPolicy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function transferPackage(User $user, Package $Package)
|
public function transferPackage(User $user, Package $Package)
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
Registered::class => [
|
Registered::class => [
|
||||||
SendEmailVerificationNotification::class,
|
SendEmailVerificationNotification::class,
|
||||||
],
|
],
|
||||||
|
\App\Events\CycleSaved::class => [
|
||||||
|
\App\Listeners\UpdateLabelsCycleNumber::class,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ class CycleRepository implements CycleRepositoryInterface
|
|||||||
->whereHas('user', function ($query) use ($user) {
|
->whereHas('user', function ($query) use ($user) {
|
||||||
$query->where('medical_center_id', $user->medical_center_id);
|
$query->where('medical_center_id', $user->medical_center_id);
|
||||||
})
|
})
|
||||||
->where("user_id", $user->id)
|
|
||||||
->orderByDesc('id')
|
->orderByDesc('id')
|
||||||
->paginate(10);
|
->paginate(10);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ class LabelRepository implements LabelRepositoryInterface
|
|||||||
->whereHas('user', function ($query) use ($user) {
|
->whereHas('user', function ($query) use ($user) {
|
||||||
$query->where('medical_center_id', $user->medical_center_id);
|
$query->where('medical_center_id', $user->medical_center_id);
|
||||||
})
|
})
|
||||||
->where("user_id", $user->id)
|
|
||||||
->orderByDesc('id')
|
->orderByDesc('id')
|
||||||
->paginate(10);
|
->paginate(10);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,10 +28,9 @@ class PackageRepository implements PackageRepositoryInterface
|
|||||||
},
|
},
|
||||||
])
|
])
|
||||||
->whereHas('user', function ($query) use ($user) {
|
->whereHas('user', function ($query) use ($user) {
|
||||||
$query->where('medical_center_id', $user->medical_center_id);
|
$query->where('users.medical_center_id', $user->medical_center_id);
|
||||||
})
|
})
|
||||||
->where("user_id", $user->id)
|
// ->where("status", StatusTypeEnum::APPROVED)
|
||||||
->orWhere("status", StatusTypeEnum::APPROVED)
|
|
||||||
->orderByDesc('id')
|
->orderByDesc('id')
|
||||||
->paginate(10);
|
->paginate(10);
|
||||||
}
|
}
|
||||||
@@ -55,7 +54,7 @@ class PackageRepository implements PackageRepositoryInterface
|
|||||||
$query->select('id', 'name', 'address', 'phone_number');
|
$query->select('id', 'name', 'address', 'phone_number');
|
||||||
},
|
},
|
||||||
])->whereHas('user', function ($query) use ($user) {
|
])->whereHas('user', function ($query) use ($user) {
|
||||||
$query->where('medical_center_id', $user->medical_center_id);
|
$query->where('users.medical_center_id', $user->medical_center_id);
|
||||||
})
|
})
|
||||||
->orderByDesc('id')
|
->orderByDesc('id')
|
||||||
->paginate(10);
|
->paginate(10);
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Rules;
|
||||||
|
|
||||||
|
use App\Models\Label;
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
|
||||||
|
class ValidEnabledLabels implements ValidationRule
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the validation rule.
|
||||||
|
*
|
||||||
|
* @param \Closure(string, ?string=): \Illuminate\Translation\PotentiallyTranslatedString $fail
|
||||||
|
*/
|
||||||
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
|
{
|
||||||
|
$formattedVal = pluckValues($value,'id');
|
||||||
|
$validIds = Label::whereIn('id', $formattedVal)
|
||||||
|
->where('enabled', true)
|
||||||
|
->pluck('id')
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
if(count(array_diff($formattedVal, $validIds)) !== 0)
|
||||||
|
{
|
||||||
|
$fail('the :attribute must be enabled.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Rules;
|
||||||
|
|
||||||
|
use App\Models\Item;
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
|
||||||
|
class ValidateItemOwnership implements ValidationRule
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the validation rule.
|
||||||
|
*
|
||||||
|
* @param \Closure(string, ?string=): \Illuminate\Translation\PotentiallyTranslatedString $fail
|
||||||
|
*/
|
||||||
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
|
{
|
||||||
|
$item = Item::find($value);
|
||||||
|
if(!($item && $item->user_id === auth()->id())){
|
||||||
|
$fail(":attribute have invalid ownership");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-1
@@ -50,7 +50,10 @@
|
|||||||
"Packages\\": "packages/",
|
"Packages\\": "packages/",
|
||||||
"Database\\Factories\\": "database/factories/",
|
"Database\\Factories\\": "database/factories/",
|
||||||
"Database\\Seeders\\": "database/seeders/"
|
"Database\\Seeders\\": "database/seeders/"
|
||||||
}
|
},
|
||||||
|
"files": [
|
||||||
|
"app/Helpers/helpers.php"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class CreateTransfersTable extends Migration
|
|||||||
$table->foreign('user_id')->references('id')->on('users');
|
$table->foreign('user_id')->references('id')->on('users');
|
||||||
$table->dateTime('from_date')->nullable();
|
$table->dateTime('from_date')->nullable();
|
||||||
$table->dateTime('to_date')->nullable();
|
$table->dateTime('to_date')->nullable();
|
||||||
$table->enum( 'status' , [ StatusTypeEnum::APPROVED , StatusTypeEnum::REJECTED , StatusTypeEnum::SUSPENDED ] )->default( StatusTypeEnum::SUSPENDED );
|
$table->enum( 'status' , [ StatusTypeEnum::APPROVED , StatusTypeEnum::REJECTED , StatusTypeEnum::PENDING ] )->default( StatusTypeEnum::PENDING );
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class UpdateItemsTable4 extends Migration
|
|||||||
{
|
{
|
||||||
Schema::drop('item_package');
|
Schema::drop('item_package');
|
||||||
Schema::table('items', function (Blueprint $table) {
|
Schema::table('items', function (Blueprint $table) {
|
||||||
$table->unsignedBigInteger('package_id')->nullable()->after("id");
|
$table->unsignedBigInteger('package_id')->nullable()->after("id")->nullOnDelete();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class AddStatusToItemsTable extends Migration
|
|||||||
$table->dropColumn( 'status' );
|
$table->dropColumn( 'status' );
|
||||||
} );
|
} );
|
||||||
Schema::table( 'items' , function ( Blueprint $table ) {
|
Schema::table( 'items' , function ( Blueprint $table ) {
|
||||||
$table->enum( 'status' , [ StatusTypeEnum::APPROVED , StatusTypeEnum::REJECTED , StatusTypeEnum::SUSPENDED ] )->default( StatusTypeEnum::SUSPENDED );
|
$table->enum( 'status' , [ StatusTypeEnum::APPROVED , StatusTypeEnum::REJECTED , StatusTypeEnum::PENDING ] )->default( StatusTypeEnum::PENDING );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class AddStatusToPackagesTable extends Migration
|
|||||||
$table->dropColumn( 'verified' );
|
$table->dropColumn( 'verified' );
|
||||||
} );
|
} );
|
||||||
Schema::table( 'packages' , function ( Blueprint $table ) {
|
Schema::table( 'packages' , function ( Blueprint $table ) {
|
||||||
$table->enum( 'status' , [ StatusTypeEnum::APPROVED , StatusTypeEnum::REJECTED , StatusTypeEnum::SUSPENDED ] )->default( StatusTypeEnum::SUSPENDED );
|
$table->enum( 'status' , [ StatusTypeEnum::APPROVED , StatusTypeEnum::REJECTED , StatusTypeEnum::PENDING ] )->default( StatusTypeEnum::PENDING );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('labels', function (Blueprint $table) {
|
||||||
|
$table->boolean('enable')->default(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('labels', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('enable');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('labels', function (Blueprint $table) {
|
||||||
|
$table->renameColumn('enable', 'enabled');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('labels', function (Blueprint $table) {
|
||||||
|
$table->renameColumn('enabled', 'enable');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -15,7 +15,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$this->call([
|
$this->call([
|
||||||
TableSeeder::class
|
// FakerSeeder::class
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ namespace Database\Seeders;
|
|||||||
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
class TableSeeder extends Seeder
|
class FakerSeeder extends Seeder
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Seed the application's database.
|
* Seed the application's database.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
index index.php index.html;
|
||||||
|
server_name localhost;
|
||||||
|
root /var/www/html/public;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_pass app:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
include fastcgi_params;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.ht {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
image: cssd_app
|
||||||
|
container_name: cssd_app
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
volumes:
|
||||||
|
- .:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
- redis
|
||||||
|
networks:
|
||||||
|
- cssd-network
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
image: nginx:alpine
|
||||||
|
ports:
|
||||||
|
- "8089:80"
|
||||||
|
volumes:
|
||||||
|
- .:/var/www/html
|
||||||
|
- ./developement/nginx.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
- mysql
|
||||||
|
networks:
|
||||||
|
- cssd-network
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
image: 'docker-proxy.meshkee.com/mysql/mysql-server:8.0'
|
||||||
|
container_name: cssd_mysql
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "3312:3306"
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: "${DB_DATABASE:-cssd}"
|
||||||
|
MYSQL_PORT: "${DB_PORT:-3306}"
|
||||||
|
MYSQL_USERNAME: "${DB_USERNAME:-root}"
|
||||||
|
MYSQL_PASSWORD: "${DB_PASSWORD:-secret}"
|
||||||
|
MYSQL_ROOT_PASSWORD: "${DB_PASSWORD:-secret}"
|
||||||
|
volumes:
|
||||||
|
- db_volume:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- cssd-network
|
||||||
|
redis:
|
||||||
|
image: 'docker-proxy.meshkee.com/redis:alpine'
|
||||||
|
container_name: cssd_redis
|
||||||
|
ports:
|
||||||
|
- "6385:6379"
|
||||||
|
networks:
|
||||||
|
- cssd-network
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db_volume:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
cssd-network:
|
||||||
|
driver: bridge
|
||||||
|
|
||||||
|
|
||||||
Generated
-17224
File diff suppressed because it is too large
Load Diff
Vendored
+4
-2
@@ -3,10 +3,12 @@ const urls = {
|
|||||||
return `/ShowTestResult/${id}`;
|
return `/ShowTestResult/${id}`;
|
||||||
},
|
},
|
||||||
showItem: function(id) {
|
showItem: function(id) {
|
||||||
return `/ShowItem/${id}`;
|
// return `/ShowItem/${id}`;
|
||||||
|
return `/api/show-item/${id}`;
|
||||||
|
|
||||||
},
|
},
|
||||||
showPackage: function(id) {
|
showPackage: function(id) {
|
||||||
return `/ShowPackage/${id}`;
|
return `/api/show-package/${id}`;
|
||||||
},
|
},
|
||||||
showLabel: function(id) {
|
showLabel: function(id) {
|
||||||
return `/ShowLabel/${id}`;
|
return `/ShowLabel/${id}`;
|
||||||
|
|||||||
Vendored
+10
-5
@@ -16,26 +16,31 @@ export default [
|
|||||||
{
|
{
|
||||||
path: '/Show/Item/:item',
|
path: '/Show/Item/:item',
|
||||||
name: 'ShowItem',
|
name: 'ShowItem',
|
||||||
view: 'Item/ShowItem'
|
view: 'Item/ShowItem',
|
||||||
|
meta: {public: true}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/Show/Package/:package',
|
path: '/Show/Package/:package',
|
||||||
name: 'ShowPackage',
|
name: 'ShowPackage',
|
||||||
view: 'Package/ShowPackage'
|
view: 'Package/ShowPackage',
|
||||||
|
meta: { public: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/Show/Label/:label',
|
path: '/Show/Label/:label',
|
||||||
name: 'ShowLabel',
|
name: 'ShowLabel',
|
||||||
view: 'Label/ShowLabel'
|
view: 'Label/ShowLabel',
|
||||||
|
meta: { public: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/Show/Cycle/:cycle',
|
path: '/Show/Cycle/:cycle',
|
||||||
name: 'ShowCycle',
|
name: 'ShowCycle',
|
||||||
view: 'Cycle/ShowCycle'
|
view: 'Cycle/ShowCycle',
|
||||||
|
meta: { public: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/Show/TestResult/:id',
|
path: '/Show/TestResult/:id',
|
||||||
name: 'ShowTestResult',
|
name: 'ShowTestResult',
|
||||||
view: 'TestResult/ShowTestResult'
|
view: 'TestResult/ShowTestResult',
|
||||||
|
meta: { public: true }
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container grid-list-xs>
|
<v-container grid-list-xs>
|
||||||
<material-card color="black" title="Show Item">
|
<material-card color="black" title="Show Item">
|
||||||
<v-layout align-left id="printMe" justify-left wrap class="px-5 my-3">
|
<v-layout align-left id="printMe" justify-left wrap class="my-3">
|
||||||
<h3 class="ml-3 CSSD-font"> Item - {{ MedicalCenter }}</h3>
|
<h3 class="ml-3 CSSD-font"> Item - {{ MedicalCenter }}</h3>
|
||||||
<v-flex xs12>
|
<v-flex xs12>
|
||||||
<hr class="v-divider theme--light">
|
<hr class="v-divider theme--light">
|
||||||
@@ -10,42 +10,54 @@
|
|||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class>
|
<div class>
|
||||||
<span class="title CSSD-font">Item ID :</span>
|
<span class="title CSSD-font">Item ID :</span>
|
||||||
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{ data.id }}</span>
|
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">
|
||||||
|
{{ data.id }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class>
|
<div class>
|
||||||
<span class="title CSSD-font">Name :</span>
|
<span class="title CSSD-font">Name :</span>
|
||||||
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{ data.name }}</span>
|
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">
|
||||||
|
{{ data.name }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class>
|
<div class>
|
||||||
<span class="title CSSD-font">Size :</span>
|
<span class="title CSSD-font">Size :</span>
|
||||||
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{ data.size }}</span>
|
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">
|
||||||
|
{{ data.size }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class>
|
<div class>
|
||||||
<span class="title CSSD-font">Specific :</span>
|
<span class="title CSSD-font">Specific :</span>
|
||||||
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{ data.specific }}</span>
|
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">
|
||||||
|
{{ data.specific }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class>
|
<div class>
|
||||||
<span class="title CSSD-font">Register User :</span>
|
<span class="title CSSD-font">Register User :</span>
|
||||||
<span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">{{ data.user ? data.user.name : '' }}</span>
|
<span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">
|
||||||
|
{{ data.user ? data.user.name : '' }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class>
|
<div class>
|
||||||
<span class="title CSSD-font">Date Register:</span>
|
<span class="title CSSD-font">Date Register:</span>
|
||||||
<span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">{{ data.created_at }}</span>
|
<span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">
|
||||||
|
{{ data.created_at }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
|
|
||||||
</v-layout>
|
</v-layout>
|
||||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
<v-layout align-left justify-left wrap class="my-3">
|
||||||
<h3 class="ml-3 CSSD-font">Barcode And QRCode Image</h3>
|
<h3 class="ml-3 CSSD-font">Barcode And QRCode Image</h3>
|
||||||
<v-flex xs12>
|
<v-flex xs12>
|
||||||
<hr class="v-divider theme--light">
|
<hr class="v-divider theme--light">
|
||||||
@@ -83,17 +95,11 @@
|
|||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data: () => ({
|
|
||||||
data: {}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import {urls} from "@show/config/urls";
|
import {urls} from "@show/config/urls";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data: () => ({
|
data: () => ({
|
||||||
data: {},
|
data: {},
|
||||||
@@ -103,13 +109,18 @@ export default {
|
|||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
async load(id) {
|
async load(id) {
|
||||||
|
try {
|
||||||
const result = await axios.get(urls.showItem(id));
|
const result = await axios.get(urls.showItem(id));
|
||||||
|
|
||||||
if (result.status == 200) {
|
if (result.status == 200) {
|
||||||
this.data = result.data.data;
|
this.data = result.data.data;
|
||||||
|
if(this.data){
|
||||||
this.generateBarcode(this.data.id);
|
this.generateBarcode(this.data.id);
|
||||||
this.MedicalCenter = this.data.user.medical_center.name;
|
this.MedicalCenter = this.data.user.medical_center.name;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error loading data:", error);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async generateBarcode(itemId) {
|
async generateBarcode(itemId) {
|
||||||
@@ -161,7 +172,6 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.$route.params.item) {
|
if (this.$route.params.item) {
|
||||||
// console.log(this.$route.params.item);
|
|
||||||
this.load(this.$route.params.item);
|
this.load(this.$route.params.item);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
<v-expansion-panel class="WM-Panel" v-for="item in data.package.items" :key="item.key">
|
<v-expansion-panel class="WM-Panel" v-for="item in data.package.items" :key="item.key">
|
||||||
<v-expansion-panel-content>
|
<v-expansion-panel-content>
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<div>{{ item.name }} ({{ item.pivot.count }})</div>
|
<div>{{ item.name }} <span v-if="item.pivot">({{ item.pivot.count }})</span></div>
|
||||||
</template>
|
</template>
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-card-text>note : {{ item.note }}</v-card-text>
|
<v-card-text>note : {{ item.note }}</v-card-text>
|
||||||
@@ -228,7 +228,6 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.$route.params.label) {
|
if (this.$route.params.label) {
|
||||||
console.log(this.$route.params);
|
|
||||||
this.load(this.$route.params.label);
|
this.load(this.$route.params.label);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<v-container grid-list-xs>
|
<v-container grid-list-xs>
|
||||||
<material-card color="black" title="Show Package">
|
<material-card color="black" title="Show Package">
|
||||||
<v-layout id="printMe" align-left justify-left wrap class="px-5 my-3">
|
<v-layout id="printMe" align-left justify-left wrap class="px-5 my-3">
|
||||||
<h3 class="ml-3 CSSD-font">Package - {{ MedicalCenter }}</h3>
|
<h3 class="ml-3 CSSD-font"> {{ data.name }} - MC {{ MedicalCenter }}</h3>
|
||||||
<v-flex xs12>
|
<v-flex xs12>
|
||||||
<hr class="v-divider theme--light">
|
<hr class="v-divider theme--light">
|
||||||
</v-flex>
|
</v-flex>
|
||||||
@@ -10,25 +10,32 @@
|
|||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class="WM-d-flex">
|
<div class="WM-d-flex">
|
||||||
<v-icon class="WMi-info"></v-icon>
|
<v-icon class="WMi-info"></v-icon>
|
||||||
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{ data.name }}</span>
|
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">
|
||||||
|
{{ data.name }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class="WM-d-flex">
|
<div class="WM-d-flex">
|
||||||
<v-icon class="WMi-Industry"></v-icon>
|
<v-icon class="WMi-Industry"></v-icon>
|
||||||
<span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">{{ data.created_at }}</span>
|
<span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">
|
||||||
|
{{ data.created_at }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class="WM-d-flex">
|
<div class="WM-d-flex">
|
||||||
<v-icon class="WMi-user"></v-icon>
|
<v-icon class="WMi-user"></v-icon>
|
||||||
<span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">{{ data.user ? data.user.name : '' }}</span>
|
<span class="headline ml-2 CSSD-font"
|
||||||
|
style="letter-spacing:0 !important">{{ data.user ? data.user.name : '' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 md6 sm6>
|
<v-flex xs12 md6 sm6>
|
||||||
<div class="WM-d-flex">
|
<div class="WM-d-flex">
|
||||||
<v-icon class="WMi-pencil"></v-icon>
|
<v-icon class="WMi-pencil"></v-icon>
|
||||||
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{ data.note }}</span>
|
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">
|
||||||
|
{{ data.note }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
@@ -59,9 +66,7 @@
|
|||||||
<v-layout row wrap class="ml-4">
|
<v-layout row wrap class="ml-4">
|
||||||
<template>
|
<template>
|
||||||
<v-expansion-panel class="WM-Panel">
|
<v-expansion-panel class="WM-Panel">
|
||||||
<v-expansion-panel-content
|
<v-expansion-panel-content v-for="(item, key) in data.items" :key="key">
|
||||||
v-for="(item, key) in data.items" :key="key"
|
|
||||||
>
|
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<div>{{ key + 1 + ": " + item.name }} ({{ item.pivot.count }})</div>
|
<div>{{ key + 1 + ": " + item.name }} ({{ item.pivot.count }})</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -74,7 +79,6 @@
|
|||||||
|
|
||||||
</v-layout>
|
</v-layout>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
|
|
||||||
<v-layout row wrap align-center justify-center style="text-align:center">
|
<v-layout row wrap align-center justify-center style="text-align:center">
|
||||||
<v-flex class xs12 md12 sm12>
|
<v-flex class xs12 md12 sm12>
|
||||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black" @click="addPackage()">
|
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black" @click="addPackage()">
|
||||||
@@ -91,7 +95,6 @@
|
|||||||
</v-btn>
|
</v-btn>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
|
|
||||||
</material-card>
|
</material-card>
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
@@ -99,6 +102,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {urls} from "@show/config/urls";
|
import {urls} from "@show/config/urls";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data: () => ({
|
data: () => ({
|
||||||
data: {},
|
data: {},
|
||||||
@@ -112,9 +116,11 @@ export default {
|
|||||||
|
|
||||||
if (result.status == 200) {
|
if (result.status == 200) {
|
||||||
this.data = result.data.data;
|
this.data = result.data.data;
|
||||||
|
if (this.data) {
|
||||||
this.generateBarcode(this.data.id);
|
this.generateBarcode(this.data.id);
|
||||||
this.MedicalCenter = this.data.user.medical_center.name;
|
this.MedicalCenter = this.data.user.medical_center.name;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async generateBarcode(packageId) {
|
async generateBarcode(packageId) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container grid-list-xs>
|
<v-container grid-list-xs>
|
||||||
<material-card color="black" title="Show Test Result" id="printMe">
|
<material-card color="black" title="Show Test Result" id="printMe">
|
||||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
<v-layout align-left justify-left wrap class="my-3">
|
||||||
<h3 class="ml-3 CSSD-font">Test Type : {{ TestType }}</h3>
|
<h3 class="ml-3 CSSD-font">Test Type : {{ TestType }}</h3>
|
||||||
<v-flex xs12>
|
<v-flex xs12>
|
||||||
<hr class="v-divider theme--light" />
|
<hr class="v-divider theme--light" />
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
<v-layout align-left justify-left wrap class="my-3">
|
||||||
<h3 class="ml-3 CSSD-font">Special Info</h3>
|
<h3 class="ml-3 CSSD-font">Special Info</h3>
|
||||||
<v-flex xs12>
|
<v-flex xs12>
|
||||||
<hr class="v-divider theme--light" />
|
<hr class="v-divider theme--light" />
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
<v-layout align-left justify-left wrap class="my-3">
|
||||||
<h3 class="ml-3 CSSD-font">Image</h3>
|
<h3 class="ml-3 CSSD-font">Image</h3>
|
||||||
<v-flex xs12>
|
<v-flex xs12>
|
||||||
<hr class="v-divider theme--light" />
|
<hr class="v-divider theme--light" />
|
||||||
|
|||||||
Vendored
+1
@@ -117,6 +117,7 @@ export default [
|
|||||||
view: 'TestResult/Show',
|
view: 'TestResult/Show',
|
||||||
meta: {
|
meta: {
|
||||||
public: true,
|
public: true,
|
||||||
|
title:'Show Test Result | CSSD Dashboard'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ Route::middleware('auth:api')->group(function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('/show-item/{Item}',[ItemController::class, 'show'])->middleware('guest');
|
||||||
|
Route::get('/show-package/{Package}',[PackageController::class, 'show'])->middleware('guest');
|
||||||
Route::post('/BarCode/{Code}/{Type?}', [BarCodeController::class, 'generateBarcode']);
|
Route::post('/BarCode/{Code}/{Type?}', [BarCodeController::class, 'generateBarcode']);
|
||||||
Route::post('Package/Barcode/{Code}', [BarCodeController::class, 'generatePackageBarcode']);
|
Route::post('Package/Barcode/{Code}', [BarCodeController::class, 'generatePackageBarcode']);
|
||||||
Route::post('Package/QRCode/{Package}', [BarCodeController::class, 'generatePackageQRCode']);
|
Route::post('Package/QRCode/{Package}', [BarCodeController::class, 'generatePackageQRCode']);
|
||||||
|
|||||||
Reference in New Issue
Block a user