designed full screen mode for production quantity chart
This commit is contained in:
@@ -46,6 +46,7 @@ class ProductionQuantityResource extends Resource
|
|||||||
->required()
|
->required()
|
||||||
// ->nullable()
|
// ->nullable()
|
||||||
->reactive()
|
->reactive()
|
||||||
|
->columnSpan(1)
|
||||||
// ->default(fn () => optional(ProductionQuantity::latest()->first())->plant_id)
|
// ->default(fn () => optional(ProductionQuantity::latest()->first())->plant_id)
|
||||||
->default(function () {
|
->default(function () {
|
||||||
return optional(ProductionQuantity::latest()->first())->plant_id;
|
return optional(ProductionQuantity::latest()->first())->plant_id;
|
||||||
@@ -99,6 +100,7 @@ class ProductionQuantityResource extends Resource
|
|||||||
Forms\Components\Select::make('block_name')
|
Forms\Components\Select::make('block_name')
|
||||||
->required()
|
->required()
|
||||||
// ->nullable()
|
// ->nullable()
|
||||||
|
->columnSpan(1)
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
if (!$get('plant_id')) {
|
if (!$get('plant_id')) {
|
||||||
return [];
|
return [];
|
||||||
@@ -830,11 +832,10 @@ class ProductionQuantityResource extends Resource
|
|||||||
->hidden()
|
->hidden()
|
||||||
->readOnly(),
|
->readOnly(),
|
||||||
])
|
])
|
||||||
->columns(2),
|
->columns(6),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function table(Table $table): Table
|
public static function table(Table $table): Table
|
||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
@@ -883,7 +884,8 @@ class ProductionQuantityResource extends Resource
|
|||||||
->headerActions([
|
->headerActions([
|
||||||
ImportAction::make()
|
ImportAction::make()
|
||||||
->importer(ProductionQuantityImporter::class)
|
->importer(ProductionQuantityImporter::class)
|
||||||
->maxRows(100000),
|
->chunkSize(1000),
|
||||||
|
// ->maxRows(100000),
|
||||||
ExportAction::make()
|
ExportAction::make()
|
||||||
->exporter(ProductionQuantityExporter::class),
|
->exporter(ProductionQuantityExporter::class),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -11,11 +11,62 @@ use Filament\Facades\Filament;
|
|||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
use Filament\Resources\Pages\CreateRecord;
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
use Livewire\Livewire;
|
use Livewire\Livewire;
|
||||||
|
use Route;
|
||||||
|
|
||||||
class CreateProductionQuantity extends CreateRecord
|
class CreateProductionQuantity extends CreateRecord
|
||||||
{
|
{
|
||||||
protected static string $resource = ProductionQuantityResource::class;
|
protected static string $resource = ProductionQuantityResource::class;
|
||||||
|
|
||||||
|
// public function getTitle(): string
|
||||||
|
// {
|
||||||
|
// return 'Create'; // This should display in the breadcrumb as "Production Quantities > Create"
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Hide only the big H1 heading on the page
|
||||||
|
public function getHeading(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
Filament::registerRenderHook(
|
||||||
|
'panels::body.start',
|
||||||
|
function () {
|
||||||
|
if (str_contains(Route::currentRouteName(), 'filament.admin.resources.production-quantities')) {
|
||||||
|
echo <<<HTML
|
||||||
|
<style>
|
||||||
|
/* Hide sidebar and topbar */
|
||||||
|
.fi-sidebar,
|
||||||
|
.fi-topbar {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Expand main container to full screen */
|
||||||
|
.fi-main {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
height: 100vh;
|
||||||
|
overflow-y: auto; /* Allow vertical scrolling */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Expand page area fully */
|
||||||
|
.fi-main > .fi-page {
|
||||||
|
padding: 0 !important;
|
||||||
|
max-width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Allow scroll on body again */
|
||||||
|
body {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
HTML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected function getFooterWidgets(): array
|
protected function getFooterWidgets(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -35,9 +86,10 @@ class CreateProductionQuantity extends CreateRecord
|
|||||||
public function getFormActions(): array
|
public function getFormActions(): array
|
||||||
{
|
{
|
||||||
// return parent::getFormActions(); //return [];
|
// return parent::getFormActions(); //return [];
|
||||||
return [
|
// return [
|
||||||
$this->getCancelFormAction(),
|
// $this->getCancelFormAction(),
|
||||||
];
|
// ];
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processAllValues($formData)
|
public function processAllValues($formData)
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ class ProductionQuantity extends Model
|
|||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
public static $importing = false; // Add this flag
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
"plant_id",
|
"plant_id",
|
||||||
"shift_id",
|
"shift_id",
|
||||||
@@ -42,6 +44,11 @@ class ProductionQuantity extends Model
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::created(function ($productionQuantity) {
|
static::created(function ($productionQuantity) {
|
||||||
|
|
||||||
|
if (static::$importing) { // Check flag here
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$productionPlan = ProductionPlan::where('plant_id', $productionQuantity->plant_id)
|
$productionPlan = ProductionPlan::where('plant_id', $productionQuantity->plant_id)
|
||||||
->where('shift_id', $productionQuantity->shift_id)
|
->where('shift_id', $productionQuantity->shift_id)
|
||||||
->where('line_id', $productionQuantity->line_id)
|
->where('line_id', $productionQuantity->line_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user