Update printer configuration, label controller, and shared views
This commit is contained in:
parent
5f6cf47689
commit
42d5abc25a
@ -7,29 +7,33 @@ use CodeIgniter\Config\BaseConfig;
|
|||||||
class Printers extends BaseConfig
|
class Printers extends BaseConfig
|
||||||
{
|
{
|
||||||
public array $printers = [
|
public array $printers = [
|
||||||
"lab" => [
|
"zebracs1" => [
|
||||||
|
"name" => "CS 2 Printer",
|
||||||
|
"command" => "copy /B file.txt \\\\glenlis\\zebracs1",
|
||||||
|
],
|
||||||
|
"zebracs2" => [
|
||||||
|
"name" => "CS 4 Printer",
|
||||||
|
"command" => "copy /B file.txt \\\\glenlis\\zebracs2",
|
||||||
|
],
|
||||||
|
"zebracs3" => [
|
||||||
|
"name" => "CS Lab Printer",
|
||||||
|
"command" => "copy /B file.txt \\\\glenlis\\zebracs3",
|
||||||
|
],
|
||||||
|
"zebralab" => [
|
||||||
"name" => "Lab Printer",
|
"name" => "Lab Printer",
|
||||||
"command" => "copy /B file.txt \\\\glenlis\\zebralab",
|
"command" => "copy /B file.txt \\\\glenlis\\zebralab",
|
||||||
],
|
],
|
||||||
"phlebo" => [
|
|
||||||
"name" => "Phlebo Printer",
|
|
||||||
"command" => "copy /B file.txt \\\\print-server\\phlebo-printer",
|
|
||||||
],
|
|
||||||
"reception" => [
|
|
||||||
"name" => "Reception Printer",
|
|
||||||
"command" => 'copy /B file.txt \\\\print-server\\reception-printer',
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public array $roleDefaults = [
|
public array $roleDefaults = [
|
||||||
0 => "lab",
|
0 => "zebracs2",
|
||||||
1 => "lab",
|
1 => "zebralab",
|
||||||
2 => "lab",
|
2 => "zebralab",
|
||||||
3 => "phlebo",
|
3 => "zebracs2",
|
||||||
4 => "reception",
|
4 => "zebracs2",
|
||||||
];
|
];
|
||||||
|
|
||||||
public string $defaultPrinter = "lab";
|
public string $defaultPrinter = "zebracs2";
|
||||||
|
|
||||||
public function getPrinter(string $printerKey): ?array
|
public function getPrinter(string $printerKey): ?array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use CodeIgniter\API\ResponseTrait;
|
||||||
|
|
||||||
class LabelController extends BaseController
|
class LabelController extends BaseController
|
||||||
{
|
{
|
||||||
use ResponseTrait;
|
use ResponseTrait;
|
||||||
|
|||||||
@ -236,7 +236,7 @@ $previewEnabled = $configFile[$configKey]['previewEnabled'] ?? false;
|
|||||||
<span class="text-xs">Ready</span>
|
<span class="text-xs">Ready</span>
|
||||||
</div>
|
</div>
|
||||||
<ul tabindex="0"
|
<ul tabindex="0"
|
||||||
class="dropdown-content menu bg-base-100 rounded-box z-[1] w-40 p-2 shadow-lg border border-base-300 text-xs">
|
class="dropdown-content menu bg-base-100 rounded-box z-50 w-40 p-2 shadow-lg border border-base-300 text-xs">
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="dropdown dropdown-top dropdown-end dropdown-hover">
|
<div class="dropdown dropdown-top dropdown-end dropdown-hover">
|
||||||
<div tabindex="0" role="button"
|
<div tabindex="0" role="button"
|
||||||
@ -246,7 +246,7 @@ $previewEnabled = $configFile[$configKey]['previewEnabled'] ?? false;
|
|||||||
<span class="text-xs" x-text="req.VAL1USER && req.VAL2USER ? 'Ready' : 'Pending'"></span>
|
<span class="text-xs" x-text="req.VAL1USER && req.VAL2USER ? 'Ready' : 'Pending'"></span>
|
||||||
</div>
|
</div>
|
||||||
<ul tabindex="0"
|
<ul tabindex="0"
|
||||||
class="dropdown-content menu bg-base-100 rounded-box z-[1] w-40 p-2 shadow-lg border border-base-300 text-xs">
|
class="dropdown-content menu bg-base-100 rounded-box z-50 w-40 p-2 shadow-lg border border-base-300 text-xs">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<template x-if="req.VAL1USER && req.VAL2USER">
|
<template x-if="req.VAL1USER && req.VAL2USER">
|
||||||
<div>
|
<div>
|
||||||
@ -310,7 +310,7 @@ $previewEnabled = $configFile[$configKey]['previewEnabled'] ?? false;
|
|||||||
<i class="fa fa-cog mr-1"></i> Actions
|
<i class="fa fa-cog mr-1"></i> Actions
|
||||||
</div>
|
</div>
|
||||||
<ul tabindex="0"
|
<ul tabindex="0"
|
||||||
class="dropdown-content menu bg-base-100 rounded-box z-[1] w-48 p-2 shadow-lg border border-base-300 text-xs">
|
class="dropdown-content menu bg-base-100 rounded-box z-50 w-48 p-2 shadow-lg border border-base-300 text-xs">
|
||||||
<li x-show="req.ISVAL == 1 && req.ISPENDING != 1 && (req.VAL1USER == '<?= session('userid'); ?>' || req.VAL2USER == '<?= session('userid'); ?>')">
|
<li x-show="req.ISVAL == 1 && req.ISPENDING != 1 && (req.VAL1USER == '<?= session('userid'); ?>' || req.VAL2USER == '<?= session('userid'); ?>')">
|
||||||
<?php if (session()->get('userlevel') <= 1): ?>
|
<?php if (session()->get('userlevel') <= 1): ?>
|
||||||
<a @click="openUnvalDialog(req.SP_ACCESSNUMBER)" class="text-error hover:bg-error/10">
|
<a @click="openUnvalDialog(req.SP_ACCESSNUMBER)" class="text-error hover:bg-error/10">
|
||||||
|
|||||||
@ -3,16 +3,8 @@
|
|||||||
<div class='flex justify-between items-center mb-2'>
|
<div class='flex justify-between items-center mb-2'>
|
||||||
|
|
||||||
|
|
||||||
<div class='flex items-center gap-2'>
|
|
||||||
<label class="text-xs font-medium text-base-content/70">Printer:</label>
|
|
||||||
<select x-model="selectedPrinter" class="select select-bordered select-xs w-32">
|
|
||||||
<option value="lab">Lab Printer</option>
|
|
||||||
<option value="phlebo">Phlebo Printer</option>
|
|
||||||
<option value="reception">Reception Printer</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class='flex gap-2 ml-auto'>
|
<div class='flex gap-2 ml-auto'>
|
||||||
<template x-if="item.accessnumber">
|
<template x-if="item && item.accessnumber">
|
||||||
<button class="btn btn-xs btn-outline btn-info" @click="openAuditDialog(item.accessnumber)">
|
<button class="btn btn-xs btn-outline btn-info" @click="openAuditDialog(item.accessnumber)">
|
||||||
<i class="fa fa-history"></i> Audit
|
<i class="fa fa-history"></i> Audit
|
||||||
</button>
|
</button>
|
||||||
@ -28,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template x-if="!isSampleLoading">
|
<template x-if="!isSampleLoading && item">
|
||||||
<div>
|
<div>
|
||||||
<table class="table table-xs table-compact w-full mb-4">
|
<table class="table table-xs table-compact w-full mb-4">
|
||||||
<tr>
|
<tr>
|
||||||
@ -56,7 +48,17 @@
|
|||||||
<th>Sample Name</th>
|
<th>Sample Name</th>
|
||||||
<th class='text-center'>Collected</th>
|
<th class='text-center'>Collected</th>
|
||||||
<th class='text-center'>Received</th>
|
<th class='text-center'>Received</th>
|
||||||
<th>Action</th>
|
<th>
|
||||||
|
<div class='flex items-center gap-2'>
|
||||||
|
<span>Action</span>
|
||||||
|
<select x-model="selectedPrinter" class="select select-bordered select-xs w-28">
|
||||||
|
<option value="zebracs1">CS 2 Printer</option>
|
||||||
|
<option value="zebracs2">CS 4 Printer</option>
|
||||||
|
<option value="zebracs3">CS Lab Printer</option>
|
||||||
|
<option value="zebralab">Lab Printer</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
@ -7,7 +7,13 @@ document.addEventListener('alpine:init', () => {
|
|||||||
isLoading: false,
|
isLoading: false,
|
||||||
counters: { Pend: 0, Coll: 0, Recv: 0, Inc: 0, Fin: 0, Total: 0 },
|
counters: { Pend: 0, Coll: 0, Recv: 0, Inc: 0, Fin: 0, Total: 0 },
|
||||||
|
|
||||||
selectedPrinter: 'lab',
|
selectedPrinter: localStorage.getItem('selectedPrinter') || 'zebracs2',
|
||||||
|
|
||||||
|
initSelectedPrinter() {
|
||||||
|
this.$watch('selectedPrinter', value => {
|
||||||
|
localStorage.setItem('selectedPrinter', value);
|
||||||
|
});
|
||||||
|
},
|
||||||
// PDF Generation Dialog
|
// PDF Generation Dialog
|
||||||
isGenerateDialogOpen: false,
|
isGenerateDialogOpen: false,
|
||||||
generateAccessnumber: null,
|
generateAccessnumber: null,
|
||||||
@ -142,8 +148,7 @@ document.addEventListener('alpine:init', () => {
|
|||||||
this.filter.date1 = this.today;
|
this.filter.date1 = this.today;
|
||||||
this.filter.date2 = this.today;
|
this.filter.date2 = this.today;
|
||||||
|
|
||||||
const defaultPrinter = '<?= $config[session()->get("userrole")]["sampleDialog"]["defaultPrinter"] ?? "lab" ?>';
|
this.initSelectedPrinter();
|
||||||
this.selectedPrinter = defaultPrinter || 'lab';
|
|
||||||
|
|
||||||
// Initial load only - no auto-refresh
|
// Initial load only - no auto-refresh
|
||||||
this.fetchList();
|
this.fetchList();
|
||||||
|
|||||||
@ -5,80 +5,14 @@ q400
|
|||||||
Q224,24+0
|
Q224,24+0
|
||||||
I8,A,001
|
I8,A,001
|
||||||
D10
|
D10
|
||||||
A10,3,0,3,1,1,N," CHRISTINA TANJUNG, MS"
|
A10,3,0,3,1,1,N," DANIEL GANADI, MR "
|
||||||
A10,27,0,2,1,1,N,"F 26/Nov/1995 29Y"
|
A10,27,0,2,1,1,N,"M 70Y"
|
||||||
A225,27,0,3,1,1,N,"5111825322"
|
B130,50,0,1,2,8,90,N,"10133381"
|
||||||
B120,50,0,1,2,8,90,N,"5111825322"
|
A380,27,5,3,1,1,N,"10133381"
|
||||||
A80,150,0,2,2,1,N,"01251101328"
|
|
||||||
A10,195,0,1,1,1,N,"HIS : 01251101328"
|
|
||||||
A190,190,0,2,1,1,N,"18/Nov/2025 09:11"
|
|
||||||
P1
|
|
||||||
][
|
|
||||||
N
|
|
||||||
OD
|
|
||||||
q400
|
|
||||||
Q224,24+0
|
|
||||||
I8,A,001
|
|
||||||
D10
|
|
||||||
A10,3,0,3,1,1,N," CHRISTINA TANJUNG, MS "
|
|
||||||
A10,27,0,2,1,1,N,"F 29Y"
|
|
||||||
B130,50,0,1,2,8,90,N,"10125322"
|
|
||||||
A380,27,5,3,1,1,N,"10125322"
|
|
||||||
A10,80,0,2,1,2,R,"EDTA"
|
A10,80,0,2,1,2,R,"EDTA"
|
||||||
A10,150,0,2,1,1,N,"G6PD,DL"
|
A10,150,0,2,1,1,N,"HBA1C"
|
||||||
A10,180,0,1,1,1,N,"LIS : 5111825322"
|
A10,180,0,1,1,1,N,"LIS : 6022633381"
|
||||||
A10,195,0,1,1,1,N,"HIS : 01251101328"
|
A10,195,0,1,1,1,N,"HIS : 01260201721"
|
||||||
A190,190,0,2,1,1,N,"18/Nov/2025 09:11"
|
A190,190,0,2,1,1,N,"26/Feb/2026 05:21"
|
||||||
P1
|
|
||||||
][
|
|
||||||
N
|
|
||||||
OD
|
|
||||||
q400
|
|
||||||
Q224,24+0
|
|
||||||
I8,A,001
|
|
||||||
D10
|
|
||||||
A10,3,0,3,1,1,N," CHRISTINA TANJUNG, MS "
|
|
||||||
A10,27,0,2,1,1,N,"F 29Y"
|
|
||||||
B130,50,0,1,2,8,90,N,"25025322"
|
|
||||||
A380,27,5,3,1,1,N,"25025322"
|
|
||||||
A10,80,0,2,1,2,R,"Serum"
|
|
||||||
A10,150,0,2,1,1,N,"TOXM,RUBM,TPHA,VD25,AHBSM"
|
|
||||||
A10,180,0,1,1,1,N,"LIS : 5111825322"
|
|
||||||
A10,195,0,1,1,1,N,"HIS : 01251101328"
|
|
||||||
A190,190,0,2,1,1,N,"18/Nov/2025 09:11"
|
|
||||||
P1
|
|
||||||
][
|
|
||||||
N
|
|
||||||
OD
|
|
||||||
q400
|
|
||||||
Q224,24+0
|
|
||||||
I8,A,001
|
|
||||||
D10
|
|
||||||
A10,3,0,3,1,1,N," CHRISTINA TANJUNG, MS "
|
|
||||||
A10,27,0,2,1,1,N,"F 29Y"
|
|
||||||
B130,50,0,1,2,8,90,N,"35025322"
|
|
||||||
A380,27,5,3,1,1,N,"35025322"
|
|
||||||
A10,80,0,2,1,2,R,"Urin"
|
|
||||||
A10,150,0,2,1,1,N,"UL"
|
|
||||||
A10,180,0,1,1,1,N,"LIS : 5111825322"
|
|
||||||
A10,195,0,1,1,1,N,"HIS : 01251101328"
|
|
||||||
A190,190,0,2,1,1,N,"18/Nov/2025 09:11"
|
|
||||||
P1
|
|
||||||
][
|
|
||||||
N
|
|
||||||
OD
|
|
||||||
q400
|
|
||||||
Q224,24+0
|
|
||||||
I8,A,001
|
|
||||||
D10
|
|
||||||
A10,3,0,3,1,1,N," CHRISTINA TANJUNG, MS "
|
|
||||||
A10,27,0,2,1,1,N,"F 29Y"
|
|
||||||
B130,50,0,1,2,8,90,N,"90025322"
|
|
||||||
A380,27,5,3,1,1,N,"90025322"
|
|
||||||
A10,80,0,2,1,2,R,"Other"
|
|
||||||
A10,150,0,2,1,1,N,"SFPL"
|
|
||||||
A10,180,0,1,1,1,N,"LIS : 5111825322"
|
|
||||||
A10,195,0,1,1,1,N,"HIS : 01251101328"
|
|
||||||
A190,190,0,2,1,1,N,"18/Nov/2025 09:11"
|
|
||||||
P1
|
P1
|
||||||
]
|
]
|
||||||
Loading…
x
Reference in New Issue
Block a user