Update invoice data handling to include onCapFocus parameter and adjust focus function and timing for input fields
This commit is contained in:
@@ -97,7 +97,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
'update_invoice' => false,
|
'update_invoice' => false,
|
||||||
'scanned_quantity'=> $scanSQuan
|
'scanned_quantity'=> $scanSQuan
|
||||||
]);
|
]);
|
||||||
$this->dispatch('refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId);
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId, onCapFocus: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
->send();
|
->send();
|
||||||
$this->dispatch('playNotificationSound');
|
$this->dispatch('playNotificationSound');
|
||||||
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
||||||
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId); //$this->invoiceNumber
|
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false); //$this->invoiceNumber
|
||||||
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
|
|
||||||
if ($updateStatus == '1')
|
if ($updateStatus == '1')
|
||||||
@@ -852,7 +852,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
'scanned_quantity'=> $scanSQuan,
|
'scanned_quantity'=> $scanSQuan,
|
||||||
]);
|
]);
|
||||||
//$hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
//$hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
||||||
// $this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
// $this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
|
||||||
|
|
||||||
if ($totQuan == $scanSQuan)
|
if ($totQuan == $scanSQuan)
|
||||||
{
|
{
|
||||||
@@ -893,7 +893,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
->seconds(1)
|
->seconds(1)
|
||||||
->send();
|
->send();
|
||||||
$this->dispatch('playNotificationSound');
|
$this->dispatch('playNotificationSound');
|
||||||
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
|
||||||
|
|
||||||
if ($updateStatus == '1')
|
if ($updateStatus == '1')
|
||||||
{
|
{
|
||||||
@@ -1284,8 +1284,8 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
||||||
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId); //$this->invoiceNumber
|
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false); //$this->invoiceNumber
|
||||||
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1894,7 +1894,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
||||||
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId); //$this->invoiceNumber
|
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false); //$this->invoiceNumber
|
||||||
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2270,8 +2270,8 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
||||||
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId); //$this->invoiceNumber
|
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false); //$this->invoiceNumber
|
||||||
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2343,7 +2343,16 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$hasRecords = $hasInvoice->stickerMasterRelation->material_type ?? null;
|
$hasRecords = $hasInvoice->stickerMasterRelation->material_type ?? null;
|
||||||
$this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId);
|
//$this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId);
|
||||||
|
|
||||||
|
if (!empty($hasRecords) && $hasRecords)
|
||||||
|
{
|
||||||
|
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId, onCapFocus: false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2459,7 +2468,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
'scanned_quantity'=> $scanMQuan,
|
'scanned_quantity'=> $scanMQuan,
|
||||||
]);
|
]);
|
||||||
//$hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
//$hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
||||||
$this->dispatch( 'refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pattern1 = '/^(?<item_code>[^|]+)\|(?<batch_number>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>[^|]+)\/(?<batch_quantity>.+)$/i';
|
$pattern1 = '/^(?<item_code>[^|]+)\|(?<batch_number>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>[^|]+)\/(?<batch_quantity>.+)$/i';
|
||||||
@@ -3209,7 +3218,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
'update_invoice' => false,
|
'update_invoice' => false,
|
||||||
'scanned_quantity'=> $scannedMQuantity,
|
'scanned_quantity'=> $scannedMQuantity,
|
||||||
]);
|
]);
|
||||||
$this->dispatch( 'refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -3259,7 +3268,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
'scanned_quantity'=> $scanSQuan,
|
'scanned_quantity'=> $scanSQuan,
|
||||||
]);
|
]);
|
||||||
//$hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
//$hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
|
||||||
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
///^([a-zA-Z0-9]{6,})\|([1-9][a-zA-Z0-9]{8,})(?:\/[MmPpCc])?\|?$/
|
///^([a-zA-Z0-9]{6,})\|([1-9][a-zA-Z0-9]{8,})(?:\/[MmPpCc])?\|?$/
|
||||||
@@ -3695,7 +3704,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
|
||||||
// $this->refreshInvoiceTable();
|
// $this->refreshInvoiceTable();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -3871,7 +3880,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
|
||||||
// $this->refreshInvoiceTable();
|
// $this->refreshInvoiceTable();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -3971,11 +3980,9 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
'scanned_quantity'=> $scannedQuantity,
|
'scanned_quantity'=> $scannedQuantity,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: true);
|
||||||
$this->dispatch('focus-capacitor-input');
|
|
||||||
// $this->refreshInvoiceTable();
|
// $this->refreshInvoiceTable();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ($isMarkPs)
|
else if ($isMarkPs)
|
||||||
{
|
{
|
||||||
@@ -4150,7 +4157,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
|
||||||
// $this->refreshInvoiceTable();
|
// $this->refreshInvoiceTable();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ class InvoiceDataTable extends Component
|
|||||||
|
|
||||||
public bool $isSerial = false;
|
public bool $isSerial = false;
|
||||||
|
|
||||||
|
public bool $onCapFocus = false;
|
||||||
|
|
||||||
public bool $emptyInvoice = false;
|
public bool $emptyInvoice = false;
|
||||||
|
|
||||||
public bool $hasSearched = false;
|
public bool $hasSearched = false;
|
||||||
@@ -39,7 +41,7 @@ class InvoiceDataTable extends Component
|
|||||||
'refreshEmptyInvoice' => 'loadEmptyData',
|
'refreshEmptyInvoice' => 'loadEmptyData',
|
||||||
'refreshInvoiceData' => 'loadData',
|
'refreshInvoiceData' => 'loadData',
|
||||||
'refreshMaterialInvoiceData' => 'loadMaterialData',
|
'refreshMaterialInvoiceData' => 'loadMaterialData',
|
||||||
'openCapacitorModal' => 'showCapacitorInputBox',
|
'openCapacitorModal' => 'showCapacitorInputBox'
|
||||||
];
|
];
|
||||||
|
|
||||||
public $capacitorInput = '';
|
public $capacitorInput = '';
|
||||||
@@ -60,6 +62,7 @@ class InvoiceDataTable extends Component
|
|||||||
$this->invoiceNumber = $invoiceNumber;
|
$this->invoiceNumber = $invoiceNumber;
|
||||||
$this->completedInvoice = true;
|
$this->completedInvoice = true;
|
||||||
$this->isSerial = $isSerial;
|
$this->isSerial = $isSerial;
|
||||||
|
$this->onCapFocus = false;
|
||||||
$this->emptyInvoice = false;
|
$this->emptyInvoice = false;
|
||||||
$this->hasSearched = false;
|
$this->hasSearched = false;
|
||||||
$this->materialInvoice = false;
|
$this->materialInvoice = false;
|
||||||
@@ -73,6 +76,7 @@ class InvoiceDataTable extends Component
|
|||||||
$this->plantId = $plantId;
|
$this->plantId = $plantId;
|
||||||
$this->invoiceNumber = $invoiceNumber;
|
$this->invoiceNumber = $invoiceNumber;
|
||||||
$this->completedInvoice = false;
|
$this->completedInvoice = false;
|
||||||
|
$this->onCapFocus = false;
|
||||||
$this->emptyInvoice = true;
|
$this->emptyInvoice = true;
|
||||||
$this->hasSearched = false;
|
$this->hasSearched = false;
|
||||||
$this->materialInvoice = false;
|
$this->materialInvoice = false;
|
||||||
@@ -80,12 +84,13 @@ class InvoiceDataTable extends Component
|
|||||||
// $this->showCapacitorInput = false;
|
// $this->showCapacitorInput = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadData($invoiceNumber, $plantId)
|
public function loadData($invoiceNumber, $plantId, $onCapFocus)
|
||||||
{
|
{
|
||||||
$this->plantId = $plantId;
|
$this->plantId = $plantId;
|
||||||
$this->invoiceNumber = $invoiceNumber;
|
$this->invoiceNumber = $invoiceNumber;
|
||||||
$this->completedInvoice = false;
|
$this->completedInvoice = false;
|
||||||
$this->isSerial = true;
|
$this->isSerial = true;
|
||||||
|
$this->onCapFocus = $onCapFocus;
|
||||||
$this->emptyInvoice = false;
|
$this->emptyInvoice = false;
|
||||||
$this->hasSearched = true;
|
$this->hasSearched = true;
|
||||||
$this->materialInvoice = false;
|
$this->materialInvoice = false;
|
||||||
@@ -179,7 +184,15 @@ class InvoiceDataTable extends Component
|
|||||||
|
|
||||||
$this->packageCount += $stickCount - $scannedCount;
|
$this->packageCount += $stickCount - $scannedCount;
|
||||||
}
|
}
|
||||||
$this->dispatch('focus-serial-number');
|
|
||||||
|
if ($onCapFocus)
|
||||||
|
{
|
||||||
|
$this->dispatch('focus-capacitor-input');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->dispatch('focus-serial-number');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadMaterialData($invoiceNumber, $plantId)
|
public function loadMaterialData($invoiceNumber, $plantId)
|
||||||
@@ -188,6 +201,7 @@ class InvoiceDataTable extends Component
|
|||||||
$this->invoiceNumber = $invoiceNumber;
|
$this->invoiceNumber = $invoiceNumber;
|
||||||
$this->completedInvoice = false;
|
$this->completedInvoice = false;
|
||||||
$this->isSerial = false;
|
$this->isSerial = false;
|
||||||
|
$this->onCapFocus = false;
|
||||||
$this->emptyInvoice = false;
|
$this->emptyInvoice = false;
|
||||||
$this->hasSearched = false;
|
$this->hasSearched = false;
|
||||||
$this->materialInvoice = true;
|
$this->materialInvoice = true;
|
||||||
@@ -234,11 +248,6 @@ class InvoiceDataTable extends Component
|
|||||||
$this->dispatch('focus-serial-number');
|
$this->dispatch('focus-serial-number');
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function showCapacitorInputBox()
|
|
||||||
// {
|
|
||||||
// $this->showCapacitorInput = true;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public function showCapacitorInputBox($itemCode, $serialNumber, $plantId)
|
public function showCapacitorInputBox($itemCode, $serialNumber, $plantId)
|
||||||
{
|
{
|
||||||
$this->plantId = $plantId;
|
$this->plantId = $plantId;
|
||||||
@@ -248,6 +257,7 @@ class InvoiceDataTable extends Component
|
|||||||
// $this->capacitorInput = '';
|
// $this->capacitorInput = '';
|
||||||
$this->completedInvoice = false;
|
$this->completedInvoice = false;
|
||||||
$this->isSerial = true;
|
$this->isSerial = true;
|
||||||
|
$this->onCapFocus = false;
|
||||||
$this->emptyInvoice = false;
|
$this->emptyInvoice = false;
|
||||||
$this->hasSearched = false;
|
$this->hasSearched = false;
|
||||||
$this->materialInvoice = false;
|
$this->materialInvoice = false;
|
||||||
@@ -407,7 +417,7 @@ class InvoiceDataTable extends Component
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->loadData($matchingValidation->invoice_number, $matchingValidation->plant_id);
|
$this->loadData($matchingValidation->invoice_number, $matchingValidation->plant_id, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -201,7 +201,7 @@
|
|||||||
input.focus();
|
input.focus();
|
||||||
input.select();
|
input.select();
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 50);
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('focus-invoice-number', () => {
|
window.addEventListener('focus-invoice-number', () => {
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
input.focus();
|
input.focus();
|
||||||
input.select();
|
input.select();
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 50);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user