Merge pull request 'ranjith-dev' (#1017) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #1017
This commit was merged in pull request #1017.
This commit is contained in:
@@ -32,6 +32,8 @@ public $records = [];
|
||||
|
||||
public bool $selectForNotOk = false;
|
||||
|
||||
public $remark;
|
||||
|
||||
// public $skipChecklistValidation = false;
|
||||
|
||||
// protected $listeners = ['focus-item-id' => 'handleFocus', 'trigger-create' => 'doCreate',];
|
||||
@@ -83,6 +85,18 @@ public $records = [];
|
||||
}
|
||||
}
|
||||
|
||||
if($this->selectForNotOk){
|
||||
|
||||
if (empty($this->remark) || $this->remark == '') {
|
||||
Notification::make()
|
||||
->title('Remark Mandatory')
|
||||
->body("Remark can't be empty!")
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$item = Item::where('code', $this->data['item_id'])->first();
|
||||
|
||||
if (! $item) {
|
||||
@@ -350,6 +364,7 @@ public $records = [];
|
||||
'status' => $status,
|
||||
'inspection_status' => $finalInspectionStatus ?? null,
|
||||
'inspection_lot_number' => $this->data['inspection_lot_number'] ?? null,
|
||||
'remark' => $this->remark ?? null,
|
||||
'created_by' => $this->data['created_by'] ?? null,
|
||||
'updated_by' => $this->data['updated_by'] ?? null,
|
||||
]);
|
||||
@@ -393,6 +408,7 @@ public $records = [];
|
||||
$mail->send(new PanelBoxNotOkAlert(
|
||||
$plantName,
|
||||
$code ?? null,
|
||||
$this->remark ?? null,
|
||||
$this->data['serial_number'] ?? null,
|
||||
$this->data['panel_box_supplier'] ?? null,
|
||||
$notOkCharacteristics
|
||||
|
||||
@@ -20,13 +20,16 @@ class PanelBoxNotOkAlert extends Mailable
|
||||
|
||||
public $supplier;
|
||||
|
||||
public $remark;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct($plant,$itemCode,$serialNumber,$supplier, $characteristics)
|
||||
public function __construct($plant,$itemCode,$remark, $serialNumber,$supplier, $characteristics)
|
||||
{
|
||||
$this->plant = $plant;
|
||||
$this->itemCode = $itemCode;
|
||||
$this->remark = $remark;
|
||||
$this->serialNumber = $serialNumber;
|
||||
$this->supplier = $supplier;
|
||||
$this->characteristics = $characteristics;
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
@else
|
||||
<p>No records found.</p>
|
||||
@endif
|
||||
<div class="border-t mt-6 pt-4 flex justify-end gap-3">
|
||||
<div class="border-t mt-6 pt-4 flex justify-end gap-3 items-center">
|
||||
|
||||
<label class="flex items-center gap-2">
|
||||
<input
|
||||
@@ -127,6 +127,22 @@
|
||||
<span>Select for Not Ok</span>
|
||||
</label>
|
||||
|
||||
@if($selectForNotOk)
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">
|
||||
Remark
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
wire:model="remark"
|
||||
rows="3"
|
||||
class="w-full rounded-lg border-gray-300 shadow-sm focus:border-primary-500 focus:ring-primary-500"
|
||||
placeholder="Enter remark..."
|
||||
></input>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<button
|
||||
type="button"
|
||||
wire:click="cancel"
|
||||
|
||||
@@ -134,6 +134,20 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td
|
||||
style="padding:12px 15px; font-size:14px;
|
||||
color:#666666;">
|
||||
Remark
|
||||
</td>
|
||||
|
||||
<td
|
||||
style="padding:12px 15px; font-size:14px;
|
||||
font-weight:bold; color:#222222;">
|
||||
{{ $remark }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user