chinh sua theo tieu chuan phan mem BDS_1
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\SalesPhases\Tables;
|
||||
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class SalesPhasesTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('name')
|
||||
->label('Tên đợt')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('code')
|
||||
->label('Mã đợt')
|
||||
->searchable()
|
||||
->copyable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('project.name')
|
||||
->label('Dự án')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('start_date')
|
||||
->label('Bắt đầu')
|
||||
->date('d/m/Y')
|
||||
->sortable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('end_date')
|
||||
->label('Kết thúc')
|
||||
->date('d/m/Y')
|
||||
->placeholder('Không giới hạn'),
|
||||
|
||||
Tables\Columns\TextColumn::make('status')
|
||||
->label('Trạng thái')
|
||||
->badge()
|
||||
->color(fn (string $state): string => match ($state) {
|
||||
'Đang mở bán' => 'success',
|
||||
'Chuẩn bị' => 'warning',
|
||||
'Tạm dừng' => 'danger',
|
||||
'Đã đóng' => 'gray',
|
||||
default => 'gray',
|
||||
}),
|
||||
|
||||
Tables\Columns\TextColumn::make('products_count')
|
||||
->label('Số SP')
|
||||
->counts('products'),
|
||||
|
||||
Tables\Columns\TextColumn::make('paymentTemplate.name')
|
||||
->label('Mẫu TT')
|
||||
->placeholder('Chưa chọn'),
|
||||
])
|
||||
->filters([
|
||||
Tables\Filters\SelectFilter::make('project_id')
|
||||
->label('Dự án')
|
||||
->relationship('project', 'name'),
|
||||
|
||||
Tables\Filters\SelectFilter::make('status')
|
||||
->label('Trạng thái')
|
||||
->options([
|
||||
'Chuẩn bị' => 'Chuẩn bị',
|
||||
'Đang mở bán' => 'Đang mở bán',
|
||||
'Tạm dừng' => 'Tạm dừng',
|
||||
'Đã đóng' => 'Đã đóng',
|
||||
]),
|
||||
])
|
||||
->defaultSort('start_date', 'desc');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user