Compare commits
4 Commits
renovate/a
...
d72f4c89fd
| Author | SHA1 | Date | |
|---|---|---|---|
| d72f4c89fd | |||
|
|
b698493e1a | ||
| 4c07abe394 | |||
|
|
9fd451bbda |
@@ -48,6 +48,7 @@ class ProductionPlanResource extends Resource
|
||||
Section::make('')
|
||||
->schema([
|
||||
Forms\Components\Select::make('plant_id')
|
||||
->label('Plant')
|
||||
->relationship('plant', 'name')
|
||||
->required()
|
||||
// ->nullable()
|
||||
@@ -79,6 +80,7 @@ class ProductionPlanResource extends Resource
|
||||
->hint(fn ($get) => $get('ppPlantError') ? $get('ppPlantError') : null)
|
||||
->hintColor('danger'),
|
||||
Forms\Components\Select::make('line_id')
|
||||
->label('Line')
|
||||
->relationship('line', 'name')
|
||||
->required()
|
||||
// ->nullable()
|
||||
@@ -437,7 +439,7 @@ class ProductionPlanResource extends Resource
|
||||
->sortable()
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('line.name')
|
||||
->label('Plant')
|
||||
->label('Line')
|
||||
->alignCenter()
|
||||
->sortable()
|
||||
->searchable(),
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"alperenersoy/filament-export": "^3.0",
|
||||
"althinect/filament-spatie-roles-permissions": "^3.0",
|
||||
"althinect/filament-spatie-roles-permissions": "^2.3",
|
||||
"erag/laravel-pwa": "^1.9",
|
||||
"filament/filament": "^3.3",
|
||||
"intervention/image": "^3.11",
|
||||
|
||||
@@ -64,36 +64,6 @@ 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) {
|
||||
let totalDays = new Date(
|
||||
date.getFullYear(),
|
||||
@@ -102,19 +72,49 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
).getDate();
|
||||
|
||||
let workingDays = totalDays - selectedDates.length;
|
||||
// document.querySelector('input[name="working_days"]').value = workingDays;
|
||||
|
||||
// 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(',');
|
||||
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'));
|
||||
|
||||
// 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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user