penambahan field di table penilaiaan

This commit is contained in:
majid 2024-09-19 11:17:53 +07:00
parent f679b7ea74
commit 32fe243336
6 changed files with 39 additions and 7 deletions

View File

@ -7,8 +7,10 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\PenilaianFactory;
use Modules\Lpj\Models\JenisPenilaian;
use Modules\Lpj\Models\Teams;
use Modules\Lpj\Models\Permohonan;
use Modules\Usermanagement\Models\User;
class Penilaian extends Model
{
@ -17,7 +19,7 @@ class Penilaian extends Model
*/
protected $table = 'penilaian';
protected $fillable = [
'jenis_penilaian_id', 'teams_id', 'user_id', 'tanggal_kunjungan', 'keterangan','permohonan_id',
'jenis_penilaian_id', 'teams_id', 'user_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi','penilaian_id','surveyor_id','penilai_surveyor_id',
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
];
@ -34,5 +36,9 @@ class Penilaian extends Model
return $this->belongsTo(User::class, 'user_id', 'id');
}
public function permohonan(){
return $this->belongsTo(Permohonan::class, 'nomor_registrasi', 'nomor_registrasi');
}
}

View File

@ -5,6 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Modules\Lpj\Models\JenisPenilaian;
use Modules\Lpj\Models\Teams;
use Modules\Lpj\Models\Permohonan;
return new class () extends Migration {
/**
@ -16,11 +17,13 @@ return new class () extends Migration {
$table->id();
$table->foreignIdFor(JenisPenilaian::class);
$table->foreignIdFor(Teams::class);
$table->unsignedBigInteger('user_id');
$table->datetime('tanggal_kunjungan');
$table->text('keterangan')->nullable();
$table->char('status');
$table->integer('permohonan_id');
$table->foreignIdFor(Permohonan::class)->nullable();
$table->integer('penilaian_id');
$table->integer('surveyor_id')->nullable();
$table->integer('penilai_surveyor_id')->nullable();
$table->timestamps();
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();

View File

@ -95,7 +95,7 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Penilai yang di tunjuk
Surveyor yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="user_id" name="user_id"
@ -105,6 +105,29 @@
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Surveyor dan penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="user_id" name="user_id"
class="input @error('user_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Penilai</option>
</select>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="user_id" name="user_id"
class="input @error('user_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Penilai</option>
</select>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">

View File

@ -149,7 +149,7 @@
title: 'Status',
render: (item, data) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-warning " href="penilaian/${data.id}/edit">
<a class="btn btn-sm btn-icon btn-clear btn-warning " href="penilaian/${data.id}/assignment">
<i class="ki-outline ki-eye"></i>
</a>
</div>`;

View File

@ -5,7 +5,7 @@
@endsection
@section('content')
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
{{-- <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> --}}
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<form action="{{ isset($teams->id) ? route('basicdata.teams.update', $teams->id) : route('basicdata.teams.store') }}"

View File

@ -276,7 +276,7 @@ Route::middleware(['auth'])->group(function () {
Route::get('/getUserTeams/{id}', [PenilaianController::class, 'getUserTeams']);
Route::get('/', [PenilaianController::class, 'index'])->name('index');
Route::get('{id}/edit', [PenilaianController::class, 'edit'])->name('edit');
Route::get('{id}/assignment', [PenilaianController::class, 'edit'])->name('edit');
Route::put('{id}', [PenilaianController::class, 'update'])->name('update');
Route::post('create', [PenilaianController::class, 'create'])->name('create');
Route::post('store', [PenilaianController::class, 'store'])->name('store');