66 lines
2.5 KiB
PHP
66 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Appendices\Schemas;
|
|
|
|
use Filament\Forms\Components\DatePicker;
|
|
use Filament\Forms\Components\KeyValue;
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Schemas\Components\Section;
|
|
use Filament\Schemas\Components\Grid;
|
|
use Filament\Schemas\Schema;
|
|
|
|
class AppendixForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
Grid::make(3)
|
|
->schema([
|
|
Section::make('Thông tin phụ lục')
|
|
->columnSpan(2)
|
|
->columns(2)
|
|
->schema([
|
|
Select::make('contract_id')
|
|
->label('Hợp đồng gốc')
|
|
->relationship('contract', 'contract_number')
|
|
->searchable()
|
|
->preload()
|
|
->required(),
|
|
|
|
Select::make('product_id')
|
|
->label('Sản phẩm')
|
|
->relationship('product', 'code')
|
|
->searchable()
|
|
->preload()
|
|
->required(),
|
|
|
|
TextInput::make('type')
|
|
->label('Loại phụ lục')
|
|
->required(),
|
|
|
|
TextInput::make('apply_from_order')
|
|
->label('Áp dụng từ CN thứ')
|
|
->numeric()
|
|
->default(0)
|
|
->required(),
|
|
|
|
DatePicker::make('signing_date')
|
|
->label('Ngày ký phụ lục')
|
|
->required(),
|
|
]),
|
|
|
|
Section::make('Dữ liệu bổ sung')
|
|
->columnSpan(1)
|
|
->schema([
|
|
KeyValue::make('custom_data')
|
|
->label('Thông tin bổ sung')
|
|
->keyLabel('Thông tin')
|
|
->valueLabel('Giá trị'),
|
|
]),
|
|
]),
|
|
]);
|
|
}
|
|
}
|