Added audio in panel box inspection stock page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Pint / pint (pull_request) Successful in 2m34s
Laravel Larastan / larastan (pull_request) Failing after 4m36s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Laravel Pint / pint (pull_request) Successful in 2m34s
Laravel Larastan / larastan (pull_request) Failing after 4m36s
This commit is contained in:
@@ -450,9 +450,10 @@ class PanelBoxInspectionStock extends Page
|
|||||||
if ($serialExists) {
|
if ($serialExists) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Duplicate Serial Number')
|
->title('Duplicate Serial Number')
|
||||||
->body("Serial number already exists '$serialNumber' with supplier number '$supplier'.")
|
->body("Serial number already exists '$serialNumber' with supplier number '$supplier'.<br>Please scan this serial number in Invoice Validation.")
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->send();
|
||||||
|
$this->dispatch('play-error-sound');
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
'line_id' => $lineId,
|
'line_id' => $lineId,
|
||||||
|
|||||||
@@ -6,4 +6,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<audio id="error-sound" src="{{ asset('sounds/scan_serial_tamil.mp3') }}" preload="auto"></audio>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener('livewire:init', () => {
|
||||||
|
Livewire.on('play-error-sound', () => {
|
||||||
|
const audio = document.getElementById('error-sound');
|
||||||
|
|
||||||
|
if (audio) {
|
||||||
|
audio.currentTime = 0;
|
||||||
|
audio.play().catch(error => {
|
||||||
|
console.log('Could not play error sound:', error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</x-filament-panels::page>
|
</x-filament-panels::page>
|
||||||
|
|||||||
Reference in New Issue
Block a user