Update invoice data handling to include onCapFocus parameter and adjust focus function and timing for input fields
This commit is contained in:
@@ -24,6 +24,8 @@ class InvoiceDataTable extends Component
|
||||
|
||||
public bool $isSerial = false;
|
||||
|
||||
public bool $onCapFocus = false;
|
||||
|
||||
public bool $emptyInvoice = false;
|
||||
|
||||
public bool $hasSearched = false;
|
||||
@@ -39,7 +41,7 @@ class InvoiceDataTable extends Component
|
||||
'refreshEmptyInvoice' => 'loadEmptyData',
|
||||
'refreshInvoiceData' => 'loadData',
|
||||
'refreshMaterialInvoiceData' => 'loadMaterialData',
|
||||
'openCapacitorModal' => 'showCapacitorInputBox',
|
||||
'openCapacitorModal' => 'showCapacitorInputBox'
|
||||
];
|
||||
|
||||
public $capacitorInput = '';
|
||||
@@ -60,6 +62,7 @@ class InvoiceDataTable extends Component
|
||||
$this->invoiceNumber = $invoiceNumber;
|
||||
$this->completedInvoice = true;
|
||||
$this->isSerial = $isSerial;
|
||||
$this->onCapFocus = false;
|
||||
$this->emptyInvoice = false;
|
||||
$this->hasSearched = false;
|
||||
$this->materialInvoice = false;
|
||||
@@ -73,6 +76,7 @@ class InvoiceDataTable extends Component
|
||||
$this->plantId = $plantId;
|
||||
$this->invoiceNumber = $invoiceNumber;
|
||||
$this->completedInvoice = false;
|
||||
$this->onCapFocus = false;
|
||||
$this->emptyInvoice = true;
|
||||
$this->hasSearched = false;
|
||||
$this->materialInvoice = false;
|
||||
@@ -80,12 +84,13 @@ class InvoiceDataTable extends Component
|
||||
// $this->showCapacitorInput = false;
|
||||
}
|
||||
|
||||
public function loadData($invoiceNumber, $plantId)
|
||||
public function loadData($invoiceNumber, $plantId, $onCapFocus)
|
||||
{
|
||||
$this->plantId = $plantId;
|
||||
$this->invoiceNumber = $invoiceNumber;
|
||||
$this->completedInvoice = false;
|
||||
$this->isSerial = true;
|
||||
$this->onCapFocus = $onCapFocus;
|
||||
$this->emptyInvoice = false;
|
||||
$this->hasSearched = true;
|
||||
$this->materialInvoice = false;
|
||||
@@ -179,7 +184,15 @@ class InvoiceDataTable extends Component
|
||||
|
||||
$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)
|
||||
@@ -188,6 +201,7 @@ class InvoiceDataTable extends Component
|
||||
$this->invoiceNumber = $invoiceNumber;
|
||||
$this->completedInvoice = false;
|
||||
$this->isSerial = false;
|
||||
$this->onCapFocus = false;
|
||||
$this->emptyInvoice = false;
|
||||
$this->hasSearched = false;
|
||||
$this->materialInvoice = true;
|
||||
@@ -234,11 +248,6 @@ class InvoiceDataTable extends Component
|
||||
$this->dispatch('focus-serial-number');
|
||||
}
|
||||
|
||||
// public function showCapacitorInputBox()
|
||||
// {
|
||||
// $this->showCapacitorInput = true;
|
||||
// }
|
||||
|
||||
public function showCapacitorInputBox($itemCode, $serialNumber, $plantId)
|
||||
{
|
||||
$this->plantId = $plantId;
|
||||
@@ -248,6 +257,7 @@ class InvoiceDataTable extends Component
|
||||
// $this->capacitorInput = '';
|
||||
$this->completedInvoice = false;
|
||||
$this->isSerial = true;
|
||||
$this->onCapFocus = false;
|
||||
$this->emptyInvoice = false;
|
||||
$this->hasSearched = false;
|
||||
$this->materialInvoice = false;
|
||||
@@ -407,7 +417,7 @@ class InvoiceDataTable extends Component
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->loadData($matchingValidation->invoice_number, $matchingValidation->plant_id);
|
||||
$this->loadData($matchingValidation->invoice_number, $matchingValidation->plant_id, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user