mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 22:31:07 +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 | ||
|
|
32a477548e | ||
|
|
505c176dad |
+11
-18
@@ -8,12 +8,12 @@ clone:
|
||||
# npm config set _auth token add command
|
||||
steps:
|
||||
- name: clone
|
||||
image: docker.willaspace.com/repository/docker-hosted/alpine/git
|
||||
image: docker.meshkee.com/repository/docker-hosted/alpine/git
|
||||
commands:
|
||||
- git clone $DRONE_GIT_HTTP_URL .
|
||||
- git checkout $DRONE_COMMIT
|
||||
- name: Build docker image
|
||||
image: docker.willaspace.com/repository/docker-hosted/plugins/docker
|
||||
image: docker.meshkee.com/repository/docker-hosted/plugins/docker
|
||||
environment:
|
||||
REGISTRY_USER_NAME:
|
||||
from_secret: registry_username
|
||||
@@ -24,8 +24,8 @@ steps:
|
||||
- latest
|
||||
- ${DRONE_BUILD_NUMBER}
|
||||
dockerfile: Dockerfile
|
||||
registry: docker.willaspace.com
|
||||
repo: docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back
|
||||
registry: docker.meshkee.com
|
||||
repo: docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back
|
||||
build_args_from_env:
|
||||
- REGISTRY_USER_NAME
|
||||
- REGISTRY_PASSWORD
|
||||
@@ -36,18 +36,16 @@ steps:
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: Build docker nginx image
|
||||
image: docker.willaspace.com/repository/docker-hosted/plugins/docker
|
||||
image: docker.meshkee.com/repository/docker-hosted/plugins/docker
|
||||
settings:
|
||||
tags:
|
||||
- nginx-latest
|
||||
- nginx-${DRONE_BUILD_NUMBER}
|
||||
dockerfile: Dockerfile.nginx
|
||||
registry: docker.willaspace.com
|
||||
repo: docker.willaspace.com/repository/docker-hosted/external-projects/cssd-back
|
||||
registry: docker.meshkee.com
|
||||
repo: docker.meshkee.com/repository/docker-hosted/external-projects/cssd-back
|
||||
username:
|
||||
from_secret: registry_username
|
||||
password:
|
||||
@@ -55,11 +53,9 @@ steps:
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: deploy
|
||||
image: docker.willaspace.com/repository/docker-hosted/pelotech/drone-helm3:latest
|
||||
image: pelotech/drone-helm3:latest
|
||||
environment:
|
||||
USERNAME:
|
||||
from_secret: registry_username
|
||||
@@ -77,20 +73,17 @@ steps:
|
||||
release: cssd-production-back
|
||||
namespace: cssd
|
||||
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.yaml
|
||||
values:
|
||||
- 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.initContainers.init-artisan.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.meshkee.com/repository/docker-hosted/external-projects/cssd-back:$DRONE_BUILD_NUMBER
|
||||
timeout: 3000
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- pull_request
|
||||
- push
|
||||
|
||||
|
||||
image_pull_secrets:
|
||||
|
||||
+4
-4
@@ -84,7 +84,7 @@ deployment:
|
||||
name: cssd-production-back-configmap
|
||||
- secretRef:
|
||||
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
|
||||
|
||||
# Additional labels for Deployment
|
||||
@@ -193,7 +193,7 @@ deployment:
|
||||
|
||||
# Image of the app container
|
||||
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
|
||||
digest: '' # if set to a non empty value, digest takes precedence on the tag
|
||||
pullPolicy: IfNotPresent
|
||||
@@ -258,7 +258,7 @@ deployment:
|
||||
# Add additional containers besides init and app containers
|
||||
additionalContainers:
|
||||
- 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
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
@@ -315,7 +315,7 @@ deployment:
|
||||
podLabels:
|
||||
# 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:
|
||||
- /usr/bin/supervisord
|
||||
- -n
|
||||
|
||||
+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
|
||||
|
||||
@@ -11,7 +11,7 @@ COPY database /var/www/html/database
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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 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 Illuminate\Http\Request;
|
||||
use Packages\Messaging\src\Facades\MessageResponse;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Events\CycleSaved;
|
||||
use App\Http\Requests\StoreCycleRequest;
|
||||
use App\Http\Resources\CycleResource;
|
||||
use App\Interfaces\CycleRepositoryInterface;
|
||||
@@ -72,6 +73,8 @@ class CycleController extends Controller
|
||||
foreach ( $Labels as $Label => $Count ) {
|
||||
$CycleObj->labels()->attach( array( $Label ) , [ 'count' => $Count ] );
|
||||
}
|
||||
event(new CycleSaved($CycleObj));
|
||||
|
||||
return MessageResponse::success( trans( 'messages.success' ) );
|
||||
}
|
||||
|
||||
@@ -109,6 +112,7 @@ class CycleController extends Controller
|
||||
foreach ( $Labels as $Label => $Count ) {
|
||||
$Cycle->labels()->attach( array( $Label ) , [ 'count' => $Count ] );
|
||||
}
|
||||
event(new CycleSaved($Cycle));
|
||||
return MessageResponse::success( trans( 'messages.success' ) );
|
||||
}
|
||||
|
||||
@@ -127,7 +131,7 @@ class CycleController extends Controller
|
||||
public function verifyCycle( Cycle $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' ) {
|
||||
$Cycle->verified = 'NotVerified';
|
||||
|
||||
@@ -45,11 +45,7 @@ class ItemController extends Controller
|
||||
] );
|
||||
|
||||
$user = auth( 'api' )->user();
|
||||
if ( $user->hasRole( 'User' ) ) {
|
||||
$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' ) ) {
|
||||
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 );
|
||||
} );
|
||||
@@ -161,7 +157,7 @@ class ItemController extends Controller
|
||||
'specific' => $request->specific ,
|
||||
'note' => $request->note ,
|
||||
'udi' => $request->udi ,
|
||||
'status' => StatusTypeEnum::SUSPENDED ,
|
||||
'status' => StatusTypeEnum::PENDING ,
|
||||
'user_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);
|
||||
});
|
||||
}
|
||||
})->get();
|
||||
})->where('enabled',true)->get();
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -115,16 +115,16 @@ class PackageController extends Controller
|
||||
$PackageData = [
|
||||
'name' => $request->name,
|
||||
'note' => $request->note,
|
||||
'status' => StatusTypeEnum::SUSPENDED,
|
||||
'status' => StatusTypeEnum::PENDING,
|
||||
'user_id' => auth('api')->user()->id,
|
||||
'creator_id' => auth('api')->user()->id
|
||||
];
|
||||
$Package = Package::create($PackageData);
|
||||
foreach ($request->items as $itemId) {
|
||||
$item = Item::where("id", $itemId)->first();
|
||||
foreach ($request->items as $itemNameAndId) {
|
||||
$item = Item::where("id", $itemNameAndId['id'])->first();
|
||||
if ($item) {
|
||||
$item->update([
|
||||
"package_id" => $Package->id
|
||||
'package_id' => $Package->id
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -141,8 +141,8 @@ class PackageController extends Controller
|
||||
{
|
||||
$Package->update($request->except(['items']));
|
||||
|
||||
foreach ($request->items as $itemId) {
|
||||
$item = Item::where("id", $itemId)->first();
|
||||
foreach ($request->items as $itemNameAndId) {
|
||||
$item = Item::where("id", $itemNameAndId['id'])->first();
|
||||
if ($item) {
|
||||
$item->update([
|
||||
"package_id" => $Package->id
|
||||
|
||||
@@ -320,7 +320,7 @@ class TestResultController extends Controller
|
||||
public function verifyTestResult(TestResult $TestResult, $Value)
|
||||
{
|
||||
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;
|
||||
|
||||
@@ -17,7 +17,7 @@ class TransferItemController extends Controller
|
||||
{
|
||||
$data = Transfer::query()
|
||||
->whereHasMorph( 'transferable' , [ Item::class ] )
|
||||
->where( "status" , StatusTypeEnum::SUSPENDED )
|
||||
->where( "status" , StatusTypeEnum::PENDING )
|
||||
->with( [ "user" , "transferable" , "transferable.user" ] );
|
||||
|
||||
$user = auth( 'api' )->user();
|
||||
@@ -41,7 +41,7 @@ class TransferItemController extends Controller
|
||||
if ( auth( 'api' )->user()->cant( 'changeStatus' , [ Transfer::class , $Transfer ] ) ) {
|
||||
return MessageResponse::error( trans( 'messages.access_denied' ) );
|
||||
}
|
||||
if ( $Transfer->status == StatusTypeEnum::SUSPENDED ) {
|
||||
if ( $Transfer->status == StatusTypeEnum::PENDING ) {
|
||||
if ( $request->status == StatusTypeEnum::APPROVED ) {
|
||||
$item = $Transfer->transferable;
|
||||
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 )
|
||||
{
|
||||
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' ) );
|
||||
}
|
||||
if ( $Item->user_id != $request->user_id ) {
|
||||
|
||||
@@ -17,7 +17,7 @@ class TransferPackageController extends Controller
|
||||
{
|
||||
$data = Transfer::query()
|
||||
->whereHasMorph( 'transferable' , [ Package::class ] )
|
||||
->where( "status" , StatusTypeEnum::SUSPENDED )
|
||||
->where( "status" , StatusTypeEnum::PENDING )
|
||||
->with( [ "user" , "transferable" , "transferable.user" ] );
|
||||
|
||||
$user = auth( 'api' )->user();
|
||||
@@ -41,7 +41,7 @@ class TransferPackageController extends Controller
|
||||
if ( auth( 'api' )->user()->cant( 'changeStatus' , [ Transfer::class , $Transfer ] ) ) {
|
||||
return MessageResponse::error( trans( 'messages.access_denied' ) );
|
||||
}
|
||||
if ( $Transfer->status == StatusTypeEnum::SUSPENDED ) {
|
||||
if ( $Transfer->status == StatusTypeEnum::PENDING ) {
|
||||
if ( $request->status == StatusTypeEnum::APPROVED ) {
|
||||
$package = $Transfer->transferable;
|
||||
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 ) ) {
|
||||
return MessageResponse::error( trans( 'messages.failed' ) );
|
||||
}
|
||||
if ($user->hasRole('Admin')){
|
||||
$MedicalCenter = MedicalCenter::with(['users' => function ($query) {
|
||||
$query->select('id', 'medical_center_id', 'name', 'cell_number', 'status')
|
||||
->whereDoesntHave('roles', function ($roleQuery) {
|
||||
$roleQuery->where('name', 'Admin');
|
||||
});
|
||||
}, 'users.roles'])->get();
|
||||
}else{
|
||||
// if ($user->hasRole('Admin')){
|
||||
// $MedicalCenter = MedicalCenter::with(['users' => function ($query) {
|
||||
// $query->select('id', 'medical_center_id', 'name', 'cell_number', 'status')
|
||||
// ->whereDoesntHave('roles', function ($roleQuery) {
|
||||
// $roleQuery->where('name', 'Admin');
|
||||
// });
|
||||
// }, 'users.roles'])->get();
|
||||
// }else{
|
||||
$MedicalCenter = $MedicalCenter->load( [ 'users' => function ( $query ) use ( $user ) {
|
||||
if ( $user->hasRole( 'User' ) ) {
|
||||
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' ] );
|
||||
}
|
||||
// }
|
||||
|
||||
return MessageResponse::data( $MedicalCenter );
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Cycle;
|
||||
use App\Rules\ValidEnabledLabels;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
|
||||
@@ -27,8 +28,8 @@ class StoreCycleRequest extends FormRequest
|
||||
'sterilizer_id' => 'required',
|
||||
'cycle_number' => 'required|unique:cycles,cycle_number',
|
||||
'note' => 'nullable',
|
||||
'labels' => 'required|array|distinct',
|
||||
'labels.*.id' => 'required|numeric|exists:labels,id',
|
||||
'labels' => ['required','array','distinct',new ValidEnabledLabels()],
|
||||
];
|
||||
break;
|
||||
}
|
||||
@@ -40,8 +41,8 @@ class StoreCycleRequest extends FormRequest
|
||||
'sterilizer_id' => 'required',
|
||||
'cycle_number' => 'required|unique:cycles,cycle_number',
|
||||
'note' => 'nullable',
|
||||
'labels' => 'required|array|distinct',
|
||||
'labels.*.id' => 'required|numeric|exists:labels,id',
|
||||
'labels' => ['required','array','distinct',new ValidEnabledLabels()],
|
||||
];
|
||||
break;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class StoreLabelRequest extends FormRequest
|
||||
'sterile_date' => 'required|date',
|
||||
'expire_date' => 'required|date',
|
||||
'sterilizer_id' => 'required',
|
||||
'cycle_number' => 'required|exists:cycles,cycle_number',
|
||||
'cycle_number' => 'required',
|
||||
'lot_number' => 'required',
|
||||
'package_id' => 'required|exists:packages,id',
|
||||
];
|
||||
@@ -39,7 +39,7 @@ class StoreLabelRequest extends FormRequest
|
||||
'sterile_date' => 'required',
|
||||
'expire_date' => 'required',
|
||||
'sterilizer_id' => 'required',
|
||||
'cycle_number' => 'required|exists:cycles,cycle_number',
|
||||
'cycle_number' => 'required',
|
||||
'lot_number' => 'required',
|
||||
'package_id' => 'required|exists:packages,id',
|
||||
];
|
||||
|
||||
@@ -25,7 +25,7 @@ class StorePackageRequest extends FormRequest
|
||||
'name' => 'required|max:250',
|
||||
'note' => 'nullable',
|
||||
'items' => 'required|array|min:1',
|
||||
'items.*' => ['exists:items,id','integer',new ValidateItemOwnership()],
|
||||
'items.*.id' => ['exists:items,id','integer',new ValidateItemOwnership()],
|
||||
];
|
||||
break;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ class StorePackageRequest extends FormRequest
|
||||
'name' => 'required|max:250',
|
||||
'note' => 'nullable',
|
||||
'items' => 'required|array|min:1',
|
||||
'items.*' => ['exists:items,id','integer',new ValidateItemOwnership()],
|
||||
'items.*.id' => ['exists:items,id','integer',new ValidateItemOwnership()],
|
||||
];
|
||||
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;
|
||||
|
||||
use App\Events\CycleSaved;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
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'
|
||||
];
|
||||
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
|
||||
@@ -27,6 +27,8 @@ class User extends Authenticatable
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
protected function getDefaultGuardName(): string { return 'api'; }
|
||||
|
||||
public function medical_center(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(MedicalCenter::class);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Constants\StatusTypeEnum;
|
||||
use App\Models\Item;
|
||||
use App\Models\User;
|
||||
|
||||
@@ -17,11 +18,12 @@ class ItemPolicy
|
||||
{
|
||||
if ($user->hasRole('Admin')) {
|
||||
return true;
|
||||
} elseif ($user->hasRole('Supervisor')) {
|
||||
if ($Item->status == 0) {
|
||||
} elseif ($user->hasRole('Supervisor') && $Item->user()->medical_center_id == $user->medical_center_id) {
|
||||
return true;
|
||||
} elseif ($user->hasRole('User') && $Item->user_id == $user->id && $Item->status != StatusTypeEnum::APPROVED) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function update(User $user, Item $Item)
|
||||
|
||||
@@ -17,6 +17,7 @@ class TransferPolicy
|
||||
|
||||
public function transferItem(User $user, Item $Item)
|
||||
{
|
||||
if(is_null($Item->package_id)){
|
||||
if ($user->hasRole('Admin')) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -30,6 +31,9 @@ class TransferPolicy
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function transferPackage(User $user, Package $Package)
|
||||
|
||||
@@ -18,6 +18,9 @@ class EventServiceProvider extends ServiceProvider
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
\App\Events\CycleSaved::class => [
|
||||
\App\Listeners\UpdateLabelsCycleNumber::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,9 +28,9 @@ class PackageRepository implements PackageRepositoryInterface
|
||||
},
|
||||
])
|
||||
->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);
|
||||
})
|
||||
->orWhere("status", StatusTypeEnum::APPROVED)
|
||||
// ->where("status", StatusTypeEnum::APPROVED)
|
||||
->orderByDesc('id')
|
||||
->paginate(10);
|
||||
}
|
||||
@@ -54,7 +54,7 @@ class PackageRepository implements PackageRepositoryInterface
|
||||
$query->select('id', 'name', 'address', 'phone_number');
|
||||
},
|
||||
])->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')
|
||||
->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.');
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -50,7 +50,10 @@
|
||||
"Packages\\": "packages/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"app/Helpers/helpers.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -22,7 +22,7 @@ class CreateTransfersTable extends Migration
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->dateTime('from_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->softDeletes();
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@ class UpdateItemsTable4 extends Migration
|
||||
{
|
||||
Schema::drop('item_package');
|
||||
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' );
|
||||
} );
|
||||
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' );
|
||||
} );
|
||||
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');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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}`;
|
||||
},
|
||||
showItem: function(id) {
|
||||
return `/ShowItem/${id}`;
|
||||
// return `/ShowItem/${id}`;
|
||||
return `/api/show-item/${id}`;
|
||||
|
||||
},
|
||||
showPackage: function(id) {
|
||||
return `/ShowPackage/${id}`;
|
||||
return `/api/show-package/${id}`;
|
||||
},
|
||||
showLabel: function(id) {
|
||||
return `/ShowLabel/${id}`;
|
||||
|
||||
Vendored
+10
-5
@@ -16,26 +16,31 @@ export default [
|
||||
{
|
||||
path: '/Show/Item/:item',
|
||||
name: 'ShowItem',
|
||||
view: 'Item/ShowItem'
|
||||
view: 'Item/ShowItem',
|
||||
meta: {public: true}
|
||||
},
|
||||
{
|
||||
path: '/Show/Package/:package',
|
||||
name: 'ShowPackage',
|
||||
view: 'Package/ShowPackage'
|
||||
view: 'Package/ShowPackage',
|
||||
meta: { public: true }
|
||||
},
|
||||
{
|
||||
path: '/Show/Label/:label',
|
||||
name: 'ShowLabel',
|
||||
view: 'Label/ShowLabel'
|
||||
view: 'Label/ShowLabel',
|
||||
meta: { public: true }
|
||||
},
|
||||
{
|
||||
path: '/Show/Cycle/:cycle',
|
||||
name: 'ShowCycle',
|
||||
view: 'Cycle/ShowCycle'
|
||||
view: 'Cycle/ShowCycle',
|
||||
meta: { public: true }
|
||||
},
|
||||
{
|
||||
path: '/Show/TestResult/:id',
|
||||
name: 'ShowTestResult',
|
||||
view: 'TestResult/ShowTestResult'
|
||||
view: 'TestResult/ShowTestResult',
|
||||
meta: { public: true }
|
||||
},
|
||||
]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<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>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
@@ -10,42 +10,54 @@
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<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>
|
||||
</v-flex>
|
||||
|
||||
</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>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
@@ -83,17 +95,11 @@
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
data: {}
|
||||
})
|
||||
};
|
||||
</script>
|
||||
<script>
|
||||
|
||||
import {urls} from "@show/config/urls";
|
||||
import axios from "axios";
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
data: {},
|
||||
@@ -103,13 +109,18 @@ export default {
|
||||
}),
|
||||
methods: {
|
||||
async load(id) {
|
||||
try {
|
||||
const result = await axios.get(urls.showItem(id));
|
||||
|
||||
if (result.status == 200) {
|
||||
this.data = result.data.data;
|
||||
if(this.data){
|
||||
this.generateBarcode(this.data.id);
|
||||
this.MedicalCenter = this.data.user.medical_center.name;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error loading data:", error);
|
||||
}
|
||||
},
|
||||
|
||||
async generateBarcode(itemId) {
|
||||
@@ -161,7 +172,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (this.$route.params.item) {
|
||||
// console.log(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-content>
|
||||
<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>
|
||||
<v-card>
|
||||
<v-card-text>note : {{ item.note }}</v-card-text>
|
||||
@@ -228,7 +228,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (this.$route.params.label) {
|
||||
console.log(this.$route.params);
|
||||
this.load(this.$route.params.label);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Show Package">
|
||||
<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>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
@@ -10,25 +10,32 @@
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<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>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
@@ -59,9 +66,7 @@
|
||||
<v-layout row wrap class="ml-4">
|
||||
<template>
|
||||
<v-expansion-panel class="WM-Panel">
|
||||
<v-expansion-panel-content
|
||||
v-for="(item, key) in data.items" :key="key"
|
||||
>
|
||||
<v-expansion-panel-content v-for="(item, key) in data.items" :key="key">
|
||||
<template v-slot:header>
|
||||
<div>{{ key + 1 + ": " + item.name }} ({{ item.pivot.count }})</div>
|
||||
</template>
|
||||
@@ -74,7 +79,6 @@
|
||||
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap align-center justify-center style="text-align:center">
|
||||
<v-flex class xs12 md12 sm12>
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black" @click="addPackage()">
|
||||
@@ -91,7 +95,6 @@
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</material-card>
|
||||
</v-container>
|
||||
</template>
|
||||
@@ -99,6 +102,7 @@
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import {urls} from "@show/config/urls";
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
data: {},
|
||||
@@ -112,9 +116,11 @@ export default {
|
||||
|
||||
if (result.status == 200) {
|
||||
this.data = result.data.data;
|
||||
if (this.data) {
|
||||
this.generateBarcode(this.data.id);
|
||||
this.MedicalCenter = this.data.user.medical_center.name;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async generateBarcode(packageId) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<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>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light" />
|
||||
@@ -76,7 +76,7 @@
|
||||
</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">Special Info</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light" />
|
||||
@@ -143,7 +143,7 @@
|
||||
</template>
|
||||
</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>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light" />
|
||||
|
||||
Vendored
+1
@@ -117,6 +117,7 @@ export default [
|
||||
view: 'TestResult/Show',
|
||||
meta: {
|
||||
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('Package/Barcode/{Code}', [BarCodeController::class, 'generatePackageBarcode']);
|
||||
Route::post('Package/QRCode/{Package}', [BarCodeController::class, 'generatePackageQRCode']);
|
||||
|
||||
Reference in New Issue
Block a user