Compare commits
8 Commits
renovate/a
...
85bfb99273
| Author | SHA1 | Date | |
|---|---|---|---|
| 85bfb99273 | |||
|
|
6010cf5998 | ||
| 2f2faa3019 | |||
|
|
f818a8c44b | ||
| d72f4c89fd | |||
|
|
b698493e1a | ||
| 4c07abe394 | |||
|
|
9fd451bbda |
@@ -31,47 +31,6 @@ class ProductionTarget extends Page
|
|||||||
->schema([
|
->schema([
|
||||||
Section::make('')
|
Section::make('')
|
||||||
->schema([
|
->schema([
|
||||||
Select::make('plant_id')
|
|
||||||
->label('Plant')
|
|
||||||
->relationship('plant', 'name')
|
|
||||||
->reactive()
|
|
||||||
// ->searchable()
|
|
||||||
->options(function (callable $get) {
|
|
||||||
$userHas = Filament::auth()->user()->plant_id;
|
|
||||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
|
||||||
})
|
|
||||||
->required()
|
|
||||||
->afterStateUpdated(function ($state, callable $get, $set) {
|
|
||||||
// dd($state);
|
|
||||||
$set('line_id', null);
|
|
||||||
$set('year', null);
|
|
||||||
$set('month', null);
|
|
||||||
$this->dispatch('loadData',$state, '', '', '');
|
|
||||||
}),
|
|
||||||
Select::make('line_id')
|
|
||||||
->label('Line')
|
|
||||||
->required()
|
|
||||||
->relationship('line', 'name')
|
|
||||||
// ->searchable()
|
|
||||||
->columnSpan(1)
|
|
||||||
->options(function (callable $get) {
|
|
||||||
if (!$get('plant_id')) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return \App\Models\Line::where('plant_id', $get('plant_id'))
|
|
||||||
->pluck('name', 'id')
|
|
||||||
->toArray();
|
|
||||||
})
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, callable $get, $set) {
|
|
||||||
$plantId = $get('plant_id');
|
|
||||||
|
|
||||||
|
|
||||||
$set('year', null);
|
|
||||||
$set('month', null);
|
|
||||||
$this->dispatch('loadData',$plantId, $state, '', '');
|
|
||||||
}),
|
|
||||||
Select::make('year')
|
Select::make('year')
|
||||||
->label('Year')
|
->label('Year')
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -97,9 +56,13 @@ class ProductionTarget extends Page
|
|||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function ($state, callable $get, $set) {
|
->afterStateUpdated(function ($state, callable $get, $set) {
|
||||||
$set('month', null);
|
$set('month', null);
|
||||||
|
$set('plant_id', null);
|
||||||
|
$set('line_id', null);
|
||||||
|
$set('category', null);
|
||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
$lineId = $get('line_id');
|
$lineId = $get('line_id');
|
||||||
$this->dispatch('loadData',$plantId, $lineId, $state, '');
|
// $this->dispatch('loadData',$plantId, $lineId, $state, '');
|
||||||
|
$this->dispatch('loadData',$state, '', '', '', '');
|
||||||
}),
|
}),
|
||||||
|
|
||||||
Select::make('month')
|
Select::make('month')
|
||||||
@@ -121,23 +84,86 @@ class ProductionTarget extends Page
|
|||||||
'12' => 'December',
|
'12' => 'December',
|
||||||
])
|
])
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function ($state, callable $get) {
|
->afterStateUpdated(function ($state, callable $get, $set) {
|
||||||
|
|
||||||
|
$set('plant_id', null);
|
||||||
|
$set('line_id', null);
|
||||||
|
$set('category', null);
|
||||||
|
|
||||||
|
$year = $get('year');
|
||||||
|
|
||||||
|
$this->dispatch('loadData',$year, $state, '', '', '');
|
||||||
|
|
||||||
|
// $plantId = $get('plant_id');
|
||||||
|
// $lineId = $get('line_id');
|
||||||
|
// // $month = $get('month');
|
||||||
|
// $year = $get('year');
|
||||||
|
|
||||||
|
// $month = (int) $get('month');
|
||||||
|
|
||||||
|
// if (!$month) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// $this->dispatch('loadData', $plantId, $lineId, $month, $year);
|
||||||
|
}),
|
||||||
|
Select::make('plant_id')
|
||||||
|
->label('Plant')
|
||||||
|
->relationship('plant', 'name')
|
||||||
|
->reactive()
|
||||||
|
// ->searchable()
|
||||||
|
->options(function (callable $get) {
|
||||||
|
$userHas = Filament::auth()->user()->plant_id;
|
||||||
|
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
||||||
|
})
|
||||||
|
->required()
|
||||||
|
->afterStateUpdated(function ($state, callable $get, $set) {
|
||||||
|
// dd($state);
|
||||||
|
$set('line_id', null);
|
||||||
|
$set('category', null);
|
||||||
|
$this->dispatch('loadData',$state, '', '', '', '');
|
||||||
|
}),
|
||||||
|
Select::make('line_id')
|
||||||
|
->label('Line')
|
||||||
|
->required()
|
||||||
|
->relationship('line', 'name')
|
||||||
|
// ->searchable()
|
||||||
|
->columnSpan(1)
|
||||||
|
->options(function (callable $get) {
|
||||||
|
if (!$get('plant_id')) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return \App\Models\Line::where('plant_id', $get('plant_id'))
|
||||||
|
->pluck('name', 'id')
|
||||||
|
->toArray();
|
||||||
|
})
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function ($state, callable $get, $set) {
|
||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
$lineId = $get('line_id');
|
$lineId = $get('line_id');
|
||||||
// $month = $get('month');
|
// $month = $get('month');
|
||||||
$year = $get('year');
|
$year = $get('year');
|
||||||
|
|
||||||
$month = (int) $get('month');
|
$month = (int) $get('month');
|
||||||
|
$this->dispatch('loadData',$year, $month, $plantId, $lineId, '');
|
||||||
|
}),
|
||||||
|
|
||||||
if (!$month) {
|
TextInput::make('category')
|
||||||
return;
|
->label('Category')
|
||||||
}
|
->reactive()
|
||||||
$this->dispatch('loadData', $plantId, $lineId, $month, $year);
|
->afterStateUpdated(function ($state, callable $get, $set) {
|
||||||
|
$plantId = $get('plant_id');
|
||||||
|
$lineId = $get('line_id');
|
||||||
|
// $month = $get('month');
|
||||||
|
$year = $get('year');
|
||||||
|
|
||||||
|
$month = (int) $get('month');
|
||||||
|
$category = $get('category');
|
||||||
|
$this->dispatch('loadData',$year, $month, $plantId, $lineId, $category);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
])
|
])
|
||||||
->columns(4)
|
->columns(5)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ class GrMasterResource extends Resource
|
|||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('item.code')
|
Tables\Columns\TextColumn::make('item.code')
|
||||||
->label('Item Code')
|
->label('Item')
|
||||||
->searchable()
|
->searchable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class ProductionPlanResource extends Resource
|
|||||||
Section::make('')
|
Section::make('')
|
||||||
->schema([
|
->schema([
|
||||||
Forms\Components\Select::make('plant_id')
|
Forms\Components\Select::make('plant_id')
|
||||||
|
->label('Plant')
|
||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
->required()
|
->required()
|
||||||
// ->nullable()
|
// ->nullable()
|
||||||
@@ -79,6 +80,7 @@ class ProductionPlanResource extends Resource
|
|||||||
->hint(fn ($get) => $get('ppPlantError') ? $get('ppPlantError') : null)
|
->hint(fn ($get) => $get('ppPlantError') ? $get('ppPlantError') : null)
|
||||||
->hintColor('danger'),
|
->hintColor('danger'),
|
||||||
Forms\Components\Select::make('line_id')
|
Forms\Components\Select::make('line_id')
|
||||||
|
->label('Line')
|
||||||
->relationship('line', 'name')
|
->relationship('line', 'name')
|
||||||
->required()
|
->required()
|
||||||
// ->nullable()
|
// ->nullable()
|
||||||
@@ -437,7 +439,7 @@ class ProductionPlanResource extends Resource
|
|||||||
->sortable()
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
Tables\Columns\TextColumn::make('line.name')
|
Tables\Columns\TextColumn::make('line.name')
|
||||||
->label('Plant')
|
->label('Line')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable()
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class ProductionTargetPlan extends Component
|
|||||||
|
|
||||||
protected $listeners = [
|
protected $listeners = [
|
||||||
'loadData' => 'loadProductionData',
|
'loadData' => 'loadProductionData',
|
||||||
|
'loadCategoryData' => 'loadProductionDataCategory',
|
||||||
'loadData1' => 'exportProductionData',
|
'loadData1' => 'exportProductionData',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -175,7 +176,7 @@ class ProductionTargetPlan extends Component
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function loadProductionData($plantId, $lineId, $month, $year)
|
public function loadProductionData($year, $month, $plantId, $lineId, $category)
|
||||||
{
|
{
|
||||||
if (!$plantId || !$lineId || !$month || !$year) {
|
if (!$plantId || !$lineId || !$month || !$year) {
|
||||||
$this->records = [];
|
$this->records = [];
|
||||||
@@ -195,6 +196,9 @@ class ProductionTargetPlan extends Component
|
|||||||
->where('production_plans.line_id', $lineId)
|
->where('production_plans.line_id', $lineId)
|
||||||
->whereMonth('production_plans.created_at', $month)
|
->whereMonth('production_plans.created_at', $month)
|
||||||
->whereYear('production_plans.created_at', $year)
|
->whereYear('production_plans.created_at', $year)
|
||||||
|
->when($category, function ($query) use ($category) {
|
||||||
|
$query->where('items.category', $category);
|
||||||
|
})
|
||||||
->select(
|
->select(
|
||||||
'production_plans.item_id',
|
'production_plans.item_id',
|
||||||
'production_plans.plant_id',
|
'production_plans.plant_id',
|
||||||
@@ -203,6 +207,7 @@ class ProductionTargetPlan extends Component
|
|||||||
'production_plans.working_days',
|
'production_plans.working_days',
|
||||||
'production_plans.leave_dates',
|
'production_plans.leave_dates',
|
||||||
'items.code as item_code',
|
'items.code as item_code',
|
||||||
|
'items.category as category',
|
||||||
'items.description as item_description',
|
'items.description as item_description',
|
||||||
'lines.name as line_name',
|
'lines.name as line_name',
|
||||||
'lines.line_capacity as line_capacity',
|
'lines.line_capacity as line_capacity',
|
||||||
@@ -229,6 +234,11 @@ class ProductionTargetPlan extends Component
|
|||||||
->where('line_id', $lineId)
|
->where('line_id', $lineId)
|
||||||
->whereMonth('created_at', $month)
|
->whereMonth('created_at', $month)
|
||||||
->whereYear('created_at', $year)
|
->whereYear('created_at', $year)
|
||||||
|
->when($category, function ($query) use ($category) {
|
||||||
|
$query->whereHas('item', function ($q) use ($category) {
|
||||||
|
$q->where('category', $category);
|
||||||
|
});
|
||||||
|
})
|
||||||
->groupBy('plant_id', 'line_id', 'item_id', DB::raw('DATE(created_at)'))
|
->groupBy('plant_id', 'line_id', 'item_id', DB::raw('DATE(created_at)'))
|
||||||
->get()
|
->get()
|
||||||
->groupBy(fn($row) =>
|
->groupBy(fn($row) =>
|
||||||
@@ -249,7 +259,7 @@ class ProductionTargetPlan extends Component
|
|||||||
$lineCapacity = (float) ($row['line_capacity'] ?? 0);
|
$lineCapacity = (float) ($row['line_capacity'] ?? 0);
|
||||||
$dailyLineCapacity = (float) ($row['line_capacity'] ?? 0);
|
$dailyLineCapacity = (float) ($row['line_capacity'] ?? 0);
|
||||||
|
|
||||||
|
$row['category'] = $row['category'] ?? '-';
|
||||||
$row['daily_line_capacity'] = [];
|
$row['daily_line_capacity'] = [];
|
||||||
$row['daily_target_dynamic'] = [];
|
$row['daily_target_dynamic'] = [];
|
||||||
$row['produced_quantity'] = [];
|
$row['produced_quantity'] = [];
|
||||||
@@ -291,6 +301,122 @@ class ProductionTargetPlan extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// public function loadProductionDataCategory($year, $month, $plantId, $lineId, $category)
|
||||||
|
// {
|
||||||
|
// if (!$plantId || !$lineId || !$month || !$year || !$category) {
|
||||||
|
// $this->records = [];
|
||||||
|
// $this->dates = [];
|
||||||
|
// $this->leaveDates = [];
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $dates = $this->getMonthDates($month, $year);
|
||||||
|
// $this->dates = $dates;
|
||||||
|
|
||||||
|
// $plans = ProductionPlan::query()
|
||||||
|
// ->join('items', 'items.id', '=', 'production_plans.item_id')
|
||||||
|
// ->join('lines', 'lines.id', '=', 'production_plans.line_id')
|
||||||
|
// ->join('plants', 'plants.id', '=', 'production_plans.plant_id')
|
||||||
|
// ->where('production_plans.plant_id', $plantId)
|
||||||
|
// ->where('production_plans.line_id', $lineId)
|
||||||
|
// ->whereMonth('production_plans.created_at', $month)
|
||||||
|
// ->whereYear('production_plans.created_at', $year)
|
||||||
|
// ->select(
|
||||||
|
// 'production_plans.item_id',
|
||||||
|
// 'production_plans.plant_id',
|
||||||
|
// 'production_plans.line_id',
|
||||||
|
// 'production_plans.plan_quantity',
|
||||||
|
// 'production_plans.working_days',
|
||||||
|
// 'production_plans.leave_dates',
|
||||||
|
// 'items.code as item_code',
|
||||||
|
// 'items.description as item_description',
|
||||||
|
// 'lines.name as line_name',
|
||||||
|
// 'lines.line_capacity as line_capacity',
|
||||||
|
// 'plants.name as plant_name'
|
||||||
|
// )
|
||||||
|
// ->get();
|
||||||
|
|
||||||
|
// $leaveDates = [];
|
||||||
|
|
||||||
|
// if ($plans->isNotEmpty() && $plans[0]->leave_dates) {
|
||||||
|
// $leaveDates = array_map('trim', explode(',', $plans[0]->leave_dates));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $this->leaveDates = $leaveDates;
|
||||||
|
|
||||||
|
// $producedData = ProductionQuantity::selectRaw("
|
||||||
|
// plant_id,
|
||||||
|
// line_id,
|
||||||
|
// item_id,
|
||||||
|
// DATE(created_at) as prod_date,
|
||||||
|
// COUNT(*) as total_qty
|
||||||
|
// ")
|
||||||
|
// ->where('plant_id', $plantId)
|
||||||
|
// ->where('line_id', $lineId)
|
||||||
|
// ->whereMonth('created_at', $month)
|
||||||
|
// ->whereYear('created_at', $year)
|
||||||
|
// ->groupBy('plant_id', 'line_id', 'item_id', DB::raw('DATE(created_at)'))
|
||||||
|
// ->get()
|
||||||
|
// ->groupBy(fn($row) =>
|
||||||
|
// $row->plant_id . '_' . $row->line_id . '_' . $row->item_id
|
||||||
|
// )
|
||||||
|
// ->map(fn($group) => $group->keyBy('prod_date'));
|
||||||
|
|
||||||
|
|
||||||
|
// $records = [];
|
||||||
|
|
||||||
|
// foreach ($plans as $plan) {
|
||||||
|
|
||||||
|
// $row = $plan->toArray();
|
||||||
|
|
||||||
|
// $remainingQty = (float) $row['plan_quantity'];
|
||||||
|
// $remainingDays = (int) ($row['working_days'] ?? 0);
|
||||||
|
|
||||||
|
// $lineCapacity = (float) ($row['line_capacity'] ?? 0);
|
||||||
|
// $dailyLineCapacity = (float) ($row['line_capacity'] ?? 0);
|
||||||
|
|
||||||
|
|
||||||
|
// $row['daily_line_capacity'] = [];
|
||||||
|
// $row['daily_target_dynamic'] = [];
|
||||||
|
// $row['produced_quantity'] = [];
|
||||||
|
|
||||||
|
// $key = $row['plant_id'].'_'.$row['line_id'].'_'.$row['item_id'];
|
||||||
|
|
||||||
|
// foreach ($dates as $date) {
|
||||||
|
|
||||||
|
// // Skip leave dates fast
|
||||||
|
// if (isset($leaveDates) && in_array($date, $leaveDates)) {
|
||||||
|
// $row['daily_line_capacity'][$date] = '-';
|
||||||
|
// $row['daily_target_dynamic'][$date] = '-';
|
||||||
|
// $row['produced_quantity'][$date] = '-';
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $todayTarget = $remainingDays > 0
|
||||||
|
// ? round($remainingQty / $remainingDays, 2)
|
||||||
|
// : 0;
|
||||||
|
|
||||||
|
// $producedQty = $producedData[$key][$date]->total_qty ?? 0;
|
||||||
|
|
||||||
|
// $row['daily_target_dynamic'][$date] = $todayTarget;
|
||||||
|
// $row['produced_quantity'][$date] = $producedQty;
|
||||||
|
// $row['daily_line_capacity'][$date] = $dailyLineCapacity;
|
||||||
|
|
||||||
|
// // Carry forward remaining qty
|
||||||
|
// $remainingQty = max(0, $remainingQty - $producedQty);
|
||||||
|
|
||||||
|
// if ($remainingDays > 0) {
|
||||||
|
// $remainingDays--;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $records[] = $row;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $this->records = $records;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
public function exportProductionData()
|
public function exportProductionData()
|
||||||
{
|
{
|
||||||
return Excel::download(
|
return Excel::download(
|
||||||
|
|||||||
@@ -64,57 +64,57 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// function updateWorkingDays(date) {
|
|
||||||
// let totalDays = new Date(
|
|
||||||
// date.getFullYear(),
|
|
||||||
// date.getMonth()+1,
|
|
||||||
// 0
|
|
||||||
// ).getDate();
|
|
||||||
|
|
||||||
// let workingDays = totalDays - selectedDates.length;
|
|
||||||
// // document.querySelector('input[name="working_days"]').value = workingDays;
|
|
||||||
|
|
||||||
// const input = document.querySelector('#working_days');
|
|
||||||
|
|
||||||
// input.value = workingDays;
|
|
||||||
|
|
||||||
// input.dispatchEvent(new Event('input'));
|
|
||||||
|
|
||||||
// const monthInput = document.querySelector('#month');
|
|
||||||
// monthInput.value = date.getMonth() + 1; // 1–12 month number
|
|
||||||
// monthInput.dispatchEvent(new Event('input'));
|
|
||||||
|
|
||||||
// const yearInput = document.querySelector('#year');
|
|
||||||
// yearInput.value = date.getFullYear();
|
|
||||||
// yearInput.dispatchEvent(new Event('input'));
|
|
||||||
|
|
||||||
// const selectedDatesInput = document.querySelector('#selected_dates');
|
|
||||||
// selectedDatesInput.value = selectedDates.join(',');
|
|
||||||
// selectedDatesInput.dispatchEvent(new Event('input'));
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
function updateWorkingDays(date) {
|
function updateWorkingDays(date) {
|
||||||
let totalDays = new Date(
|
let totalDays = new Date(
|
||||||
date.getFullYear(),
|
date.getFullYear(),
|
||||||
date.getMonth() + 1,
|
date.getMonth()+1,
|
||||||
0
|
0
|
||||||
).getDate();
|
).getDate();
|
||||||
|
|
||||||
let workingDays = totalDays - selectedDates.length;
|
let workingDays = totalDays - selectedDates.length;
|
||||||
|
// document.querySelector('input[name="working_days"]').value = workingDays;
|
||||||
|
|
||||||
// Set values only
|
const input = document.querySelector('#working_days');
|
||||||
document.querySelector('#working_days').value = workingDays;
|
|
||||||
document.querySelector('#month').value = date.getMonth() + 1;
|
input.value = workingDays;
|
||||||
document.querySelector('#year').value = date.getFullYear();
|
|
||||||
document.querySelector('#selected_dates').value = selectedDates.join(',');
|
input.dispatchEvent(new Event('input'));
|
||||||
|
|
||||||
|
const monthInput = document.querySelector('#month');
|
||||||
|
monthInput.value = date.getMonth() + 1; // 1–12 month number
|
||||||
|
monthInput.dispatchEvent(new Event('input'));
|
||||||
|
|
||||||
|
const yearInput = document.querySelector('#year');
|
||||||
|
yearInput.value = date.getFullYear();
|
||||||
|
yearInput.dispatchEvent(new Event('input'));
|
||||||
|
|
||||||
|
const selectedDatesInput = document.querySelector('#selected_dates');
|
||||||
|
selectedDatesInput.value = selectedDates.join(',');
|
||||||
|
selectedDatesInput.dispatchEvent(new Event('input'));
|
||||||
|
|
||||||
// Trigger only ONE update (important)
|
|
||||||
document
|
|
||||||
.querySelector('#selected_dates')
|
|
||||||
.dispatchEvent(new Event('input'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function updateWorkingDays(date) {
|
||||||
|
// let totalDays = new Date(
|
||||||
|
// date.getFullYear(),
|
||||||
|
// date.getMonth() + 1,
|
||||||
|
// 0
|
||||||
|
// ).getDate();
|
||||||
|
|
||||||
|
// let workingDays = totalDays - selectedDates.length;
|
||||||
|
|
||||||
|
// // Set values only
|
||||||
|
// document.querySelector('#working_days').value = workingDays;
|
||||||
|
// document.querySelector('#month').value = date.getMonth() + 1;
|
||||||
|
// document.querySelector('#year').value = date.getFullYear();
|
||||||
|
// document.querySelector('#selected_dates').value = selectedDates.join(',');
|
||||||
|
|
||||||
|
// // Trigger only ONE update (important)
|
||||||
|
// document
|
||||||
|
// .querySelector('#selected_dates')
|
||||||
|
// .dispatchEvent(new Event('input'));
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
calendar.render();
|
calendar.render();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,10 +6,11 @@
|
|||||||
<table class="w-full divide-y divide-gray-200 text-sm text-center">
|
<table class="w-full divide-y divide-gray-200 text-sm text-center">
|
||||||
<thead class="bg-gray-100 text-s font-semibold uppercase text-gray-700">
|
<thead class="bg-gray-100 text-s font-semibold uppercase text-gray-700">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="border px-4 py-2" rowspan="3">No</th>
|
<th class="border px-4 py-2" rowspan="4">No</th>
|
||||||
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Plant</th>
|
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Plant</th>
|
||||||
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Line</th>
|
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Line</th>
|
||||||
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Item Code</th>
|
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Item Code</th>
|
||||||
|
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Category</th>
|
||||||
|
|
||||||
<th class="border px-4 py-2 whitespace-nowrap" colspan="{{ count($dates) * 3 }}" class="text-center">
|
<th class="border px-4 py-2 whitespace-nowrap" colspan="{{ count($dates) * 3 }}" class="text-center">
|
||||||
Production Plan Dates
|
Production Plan Dates
|
||||||
@@ -45,6 +46,7 @@
|
|||||||
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['plant_name'] }}</td>
|
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['plant_name'] }}</td>
|
||||||
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['line_name'] }}</td>
|
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['line_name'] }}</td>
|
||||||
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['item_code'] }}</td>
|
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['item_code'] }}</td>
|
||||||
|
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['category'] }}</td>
|
||||||
|
|
||||||
{{-- @foreach($dates as $date)
|
{{-- @foreach($dates as $date)
|
||||||
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['target_plan'][$date] ?? '-' }}</td>
|
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['target_plan'][$date] ?? '-' }}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user