Compare commits
4 Commits
caac5ad7eb
...
efba8af539
| Author | SHA1 | Date | |
|---|---|---|---|
| efba8af539 | |||
|
|
2acd3c8bb4 | ||
|
|
d511b915e2 | ||
|
|
8315b835b1 |
@@ -10,6 +10,7 @@ use App\Models\Item;
|
|||||||
use App\Models\Line;
|
use App\Models\Line;
|
||||||
use App\Models\Machine;
|
use App\Models\Machine;
|
||||||
use App\Models\Plant;
|
use App\Models\Plant;
|
||||||
|
use App\Models\ProductCharacteristicsMaster;
|
||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Components\DateTimePicker;
|
use Filament\Forms\Components\DateTimePicker;
|
||||||
@@ -228,7 +229,7 @@ class CharacteristicValueResource extends Resource
|
|||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('item.code')
|
Tables\Columns\TextColumn::make('item.code')
|
||||||
->label('Item')
|
->label('Item Code')
|
||||||
->searchable()
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
@@ -247,6 +248,17 @@ class CharacteristicValueResource extends Resource
|
|||||||
->searchable()
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('machine.name')
|
||||||
|
->label('Spec. Value')
|
||||||
|
// ->searchable()
|
||||||
|
->formatStateUsing(function ($record) {
|
||||||
|
$specVal = ProductCharacteristicsMaster::where('plant_id', $record->plant_id)->where('item_id', $record->item_id)->where('line_id', $record->line_id)->where('machine_id', $record->machine_id)->first();
|
||||||
|
|
||||||
|
// return $record?->plant_id.'-'.$record?->item_id.'-'.$record->line_id.'-'.$record?->machine_id;
|
||||||
|
return $specVal?->lower.' - '.$specVal?->upper;
|
||||||
|
})
|
||||||
|
->alignCenter()
|
||||||
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('observed_value')
|
Tables\Columns\TextColumn::make('observed_value')
|
||||||
->label('Observed value')
|
->label('Observed value')
|
||||||
->searchable()
|
->searchable()
|
||||||
@@ -255,6 +267,15 @@ class CharacteristicValueResource extends Resource
|
|||||||
Tables\Columns\TextColumn::make('status')
|
Tables\Columns\TextColumn::make('status')
|
||||||
->label('Status')
|
->label('Status')
|
||||||
->searchable()
|
->searchable()
|
||||||
|
// ->formatStateUsing(function ($record) {
|
||||||
|
// return empty($record->status == 'Ok') ? 'Ok' : 'Not Ok';
|
||||||
|
// })
|
||||||
|
->color(fn (string $state): string => match ($state) {
|
||||||
|
'Ok' => 'success',
|
||||||
|
'Not Ok' => 'danger',
|
||||||
|
'NotOk' => 'danger',
|
||||||
|
default => 'gray',
|
||||||
|
})
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('created_by')
|
Tables\Columns\TextColumn::make('created_by')
|
||||||
|
|||||||
@@ -112,9 +112,9 @@ class CharacteristicsController extends Controller
|
|||||||
'characteristics_type',
|
'characteristics_type',
|
||||||
'name',
|
'name',
|
||||||
'inspection_type',
|
'inspection_type',
|
||||||
'upper',
|
|
||||||
'lower',
|
'lower',
|
||||||
'middle',
|
'middle',
|
||||||
|
'upper',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($characteristics->count() == 0) {
|
if ($characteristics->count() == 0) {
|
||||||
@@ -2284,9 +2284,9 @@ class CharacteristicsController extends Controller
|
|||||||
'name' => $charMaster?->name ?? '',
|
'name' => $charMaster?->name ?? '',
|
||||||
'inspection_type' => $charMaster?->inspection_type ?? '',
|
'inspection_type' => $charMaster?->inspection_type ?? '',
|
||||||
'characteristics_type' => $charMaster?->characteristics_type ?? '',
|
'characteristics_type' => $charMaster?->characteristics_type ?? '',
|
||||||
'upper' => (string) $charMaster?->upper ?? '',
|
|
||||||
'lower' => (string) $charMaster?->lower ?? '',
|
'lower' => (string) $charMaster?->lower ?? '',
|
||||||
'middle' => (string) $charMaster?->middle ?? '',
|
'middle' => (string) $charMaster?->middle ?? '',
|
||||||
|
'upper' => (string) $charMaster?->upper ?? '',
|
||||||
];
|
];
|
||||||
|
|
||||||
return response()->json($output, 200);
|
return response()->json($output, 200);
|
||||||
|
|||||||
@@ -23,15 +23,24 @@ class CharacteristicApprovalMail extends Mailable
|
|||||||
public $pdfPath;
|
public $pdfPath;
|
||||||
public $tableData;
|
public $tableData;
|
||||||
|
|
||||||
|
public $pendingApprovers;
|
||||||
|
|
||||||
|
public $approverNameFromMaster;
|
||||||
|
|
||||||
|
public $subjectLine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new message instance.
|
* Create a new message instance.
|
||||||
*/
|
*/
|
||||||
public function __construct($request, $approverName, $level, $pdfPath = null, $characteristics = [])
|
public function __construct($request, $approverName, $level, $pdfPath = null, $pendingApprovers, $approverNameFromMaster, $subjectLine, $characteristics = [])
|
||||||
{
|
{
|
||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
$this->approverName = $approverName;
|
$this->approverName = $approverName;
|
||||||
$this->level = $level;
|
$this->level = $level;
|
||||||
$this->pdfPath = $pdfPath;
|
$this->pdfPath = $pdfPath;
|
||||||
|
$this->pendingApprovers = $pendingApprovers;
|
||||||
|
$this->approverNameFromMaster = $approverNameFromMaster;
|
||||||
|
$this->subjectLine = $subjectLine;
|
||||||
$this->tableData = $characteristics;
|
$this->tableData = $characteristics;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +50,7 @@ class CharacteristicApprovalMail extends Mailable
|
|||||||
public function envelope(): Envelope
|
public function envelope(): Envelope
|
||||||
{
|
{
|
||||||
return new Envelope(
|
return new Envelope(
|
||||||
subject: 'Characteristic Approval Mail',
|
subject: $this->subjectLine,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +65,10 @@ class CharacteristicApprovalMail extends Mailable
|
|||||||
'company' => 'CRI Digital Manufacturing Solutions',
|
'company' => 'CRI Digital Manufacturing Solutions',
|
||||||
'greeting' => 'Dear ' . $this->approverName . ',',
|
'greeting' => 'Dear ' . $this->approverName . ',',
|
||||||
'request' => $this->request,
|
'request' => $this->request,
|
||||||
|
'level' => $this->level,
|
||||||
'tableData' => $this->tableData,
|
'tableData' => $this->tableData,
|
||||||
|
'pendingApprovers' => $this->pendingApprovers,
|
||||||
|
'approverNameFromMaster' => $this->approverNameFromMaster,
|
||||||
'approveUrl' => $this->approveUrl(),
|
'approveUrl' => $this->approveUrl(),
|
||||||
'holdUrl' => $this->holdUrl(),
|
'holdUrl' => $this->holdUrl(),
|
||||||
'rejectUrl' => $this->rejectUrl(),
|
'rejectUrl' => $this->rejectUrl(),
|
||||||
@@ -112,4 +124,7 @@ class CharacteristicApprovalMail extends Mailable
|
|||||||
)->as(basename($this->pdfPath)),
|
)->as(basename($this->pdfPath)),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user