penilaian reviewer seleksi internal

parent 739816cc
......@@ -117,13 +117,16 @@ class JenisPenilaianMonevController extends Controller
for($i=0; $i<count($request->nama); $i++)
{
$uuid = Uuid::generate();
$uuid = decrypt($request->jenis_penilaian_monev_id[$i]);
$data['jenis_penilaian_monev_id'] = $uuid;
$data['jenis_id'] = $id;
$data['nama'] = $request->nama[$i];
$data['bobot'] = $request->bobot[$i];
$data['bobot'] = 1;
JenisPenilaianMonev::create($data);
JenisPenilaianMonev::updateOrCreate([
'jenis_penilaian_monev_id' => $uuid
],
$data);
}
Alert::success('Data berhasil disimpan.')->persistent('Ok');
......
......@@ -21,7 +21,10 @@ use Illuminate\Support\Carbon;
use App\Models\ReviewerProposal;
use App\Http\Controllers\Controller;
use App\Models\DaftarProposalBelmawa;
use App\Models\JenisMonev;
use App\Models\MonevInternal;
use App\Models\ReviewerProposalDetil;
use Illuminate\Support\Facades\Log;
class DaftarSeleksiController extends Controller
{
......@@ -158,7 +161,7 @@ class DaftarSeleksiController extends Controller
if($status_administrasi != 0)
{
if($status_nilai > 0)
if($status_nilai == 0)
{
if($urut == '1')
$aksi = '<h4>'.$nilai_1.'</h4>';
......@@ -241,7 +244,7 @@ class DaftarSeleksiController extends Controller
$urut = DB::select("select ambil_data_reviewer_proposal('".$this->rBiodata->noidentitas."', '".decrypt($id)."', '1')")[0]->ambil_data_reviewer_proposal;
$title = 'Penilaian Proposal Seleksi Internal';
$proposal = DaftarProposal::where('proposal_id', decrypt($id))->first();
$proposal = DaftarProposal::query()->with('proposalUrl')->where('proposal_id', decrypt($id))->first();
$reviewer_proposal = ReviewerProposal::with('rReviewerProposalDetil')->where('proposal_id', decrypt($id))->where('urut', $urut)->first();
$komponen = JenisPenilaianMonev::where('jenis_id', $proposal->jenis_id)->get();
......@@ -276,7 +279,6 @@ class DaftarSeleksiController extends Controller
{
try {
$urut = DB::select("select ambil_data_reviewer_proposal('".$this->rBiodata->noidentitas."', '".decrypt($id)."', '1')")[0]->ambil_data_reviewer_proposal;
$delete = ReviewerProposal::where('proposal_id', Crypt::decrypt($id))->where('urut', $urut)->update(['status_administrasi'=>$status]);
if ($delete) {
......@@ -284,6 +286,8 @@ class DaftarSeleksiController extends Controller
{
$status = 'success';
$message = "Proposal Seleksi Internal Lolos Administrasi.";
$this->createMonevInternal(Crypt::decrypt($id));
}
elseif($status == '2')
{
......@@ -308,4 +312,32 @@ class DaftarSeleksiController extends Controller
]);
}
}
private function createMonevInternal($proposalId)
{
Log::debug('createMonevInternal');
$reviewerProposal = ReviewerProposal::where('proposal_id', $proposalId)->whereIn('urut', [1, 2]);
$count = $reviewerProposal->where('status_administrasi', 1)->count();
$monevInternal = MonevInternal::query()->where('proposal_id', $proposalId)->get();
Log::debug($count);
Log::debug($monevInternal->count());
if($count == 2){
for ($i = 3; $i < 5; $i++) {
$jenis = JenisMonev::query()->where('urut', $i)->first();
$monevInternal->where('jenis_monev_id', $jenis->jenis_monev_id);
if($monevInternal->count() == 0){
Log::debug('create monev');
MonevInternal::query()->create([
'proposal_id' => $proposalId,
'jenis_monev_id' => $jenis->jenis_monev_id,
'created_user' => 'SYSTEM',
]);
}
}
}
}
}
......@@ -9,6 +9,7 @@ class DaftarProposal extends Model
protected $table = 'daftar_proposal';
protected $primaryKey = 'proposal_id';
public $incrementing = false;
protected $keyType = 'string';
protected $fillable = [
'proposal_id', 'jenis_id', 'kode', 'jenis_pkm', 'judul', 'status', 'status_hapus', 'status_administrasi_1', 'status_administrasi_2', 'reviewer_id_1', 'reviewer_id_2', 'status_final', 'nidn_reviewer_id_1', 'nidn_reviewer_id_2', 'upload_dokumen', 'date_upload', 'date_approval', 'identitas_ketua', 'identitas_dospem', 'periode'
......@@ -18,4 +19,9 @@ class DaftarProposal extends Model
{
return $this->hasMany(\App\Models\KelompokDetail::class, 'kelompok_id', 'kelompok_id');
}
public function proposalUrl()
{
return $this->hasMany(ProposalUrl::class, 'proposal_id', 'proposal_id');
}
}
<?php
namespace App\Models;
use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ProposalUrl extends Model
{
use HasFactory;
use UuidTrait;
protected $table = 'proposal_url';
protected $primaryKey = 'id';
public $incrementing = false;
protected $keyType = 'string';
protected $fillable = [
'id',
'url',
'nama',
'deskripsi',
'proposal_id',
'created_at',
'updated_at',
];
}
......@@ -58,7 +58,6 @@
<thead>
<tr>
<th scope="col" width="75%">Komponen</th>
<th scope="col" width="10%">Bobot</th>
<th scope="col" width="15%">Aksi</th>
</tr>
</thead>
......@@ -67,12 +66,10 @@
@foreach ($jenis_penilaian_monev as $key => $val)
<tr>
<td>
<input type="hidden" class="form-control" name="jenis_penilaian_monev_id[]" required value="{{ encrypt($val->jenis_penilaian_monev_id) }}">
<input type="text" class="form-control" name="nama[]" required value="{{ $val->nama }}">
</td>
<td>
<input class="form-control input-mask reqBobot" data-inputmask="'mask': '9', 'repeat': 3, 'greedy' : false" name="bobot[]" maxlength="3" value="{{ $val->bobot }}">
</td>
<td>
<a onclick="$(this).parent().parent().remove();" class="btn btn-danger btn-sm btn-delete">Delete</a>
</td>
</tr>
......@@ -83,27 +80,11 @@
<input type="text" class="form-control" name="nama[]" required>
</td>
<td>
<input class="form-control input-mask reqBobot" data-inputmask="'mask': '9', 'repeat': 3, 'greedy' : false" name="bobot[]" maxlength="3">
</td>
<td>
<a onclick="$(this).parent().parent().remove();" class="btn btn-danger btn-sm btn-delete">Delete</a>
</td>
</tr>
@endif
</tbody>
<tfoot>
<tr>
<td style="text-align: right">
<label>TOTAL BOBOT <span class="badge bg-info">(total bobot harus 100)</span></label>
</td>
<td>
<input class="form-control reqBobotTotal" readonly>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
......@@ -162,33 +143,7 @@
function submitForm()
{
var sum = hitung();
if(sum != '100')
{
Swal.fire({
title: "Gagal",
text: "Total Bobot harus 100",
icon: "error",
confirmButtonColor: "#556ee6"
});
}
else
{
$('#btnSubmit').click();
}
}
function hitung()
{
var sum = 0;
$(".reqBobot").each(function(){
sum += +$(this).val();
});
$(".reqBobotTotal").val(sum);
return sum;
}
</script>
@endsection
......@@ -11,12 +11,10 @@
validate: !0
});
</script>
<input type="hidden" class="form-control" name="jenis_penilaian_monev_id[]" required value="{{ encrypt(Uuid::generate()) }}">
<input type="text" class="form-control" name="nama[]" required>
</td>
<td>
<input class="form-control input-mask reqBobot" data-inputmask="'mask': '9', 'repeat': 3, 'greedy' : false" name="bobot[]" maxlength="3">
</td>
<td>
<a onclick="$(this).parent().parent().remove();" class="btn btn-danger btn-sm btn-delete">Delete</a>
</td>
</tr>
......@@ -57,15 +57,26 @@
@endif
</div>
</div>
<div class="row mb-3" class="dropzone">
<label for="kode" class="col-sm-2 col-form-label">Tautan</label>
<div class="col-sm-10">
<ul>
@foreach ($proposal->proposalUrl as $item)
<li>
<a class="btn btn-link" href="{{ $item->url }}">{{ $item->url_name }}</a>
<p>{{ $item->deskripsi }}</p>
</li>
@endforeach
</ul>
</div>
</div>
<div class="row mb-3">
<label for="kode" class="col-sm-2 col-form-label">Komponen Penilaian : </label>
<div class="col-sm-10">
<table class="table table-striped">
<thead>
<tr style="text-align: center">
<th style="width: 70%">Komponen</th>
<th style="width: 10%">Bobot</th>
<th style="width: 10%">Skor</th>
<th>Komponen</th>
<th style="width: 10%">Nilai</th>
</tr>
</thead>
......@@ -87,18 +98,14 @@
<input type="hidden" name="jenis_penilaian_id[]" value="{{ $val->jenis_penilaian_monev_id }}">
<span>{{ $val->nama }}</span>
</td>
<td><span id="varBobot-{{ $val->jenis_penilaian_monev_id }}">{{ $val->bobot }}</span></td>
<td>
<select name="skor[]" class="hitung_skor" data-id="{{ $val->jenis_penilaian_monev_id }}">
<option value="1" @if($skor == '1') selected="selected" @endif>1</option>
<option value="2" @if($skor == '2') selected="selected" @endif>2</option>
<option value="3" @if($skor == '3') selected="selected" @endif>3</option>
<option value="5" @if($skor == '5') selected="selected" @endif>5</option>
<option value="6" @if($skor == '6') selected="selected" @endif>6</option>
<option value="7" @if($skor == '7') selected="selected" @endif>7</option>
</select>
</td>
<td><span id='varNilai-{{ $val->jenis_penilaian_monev_id }}' class="clsNilai">{{ $nilai }}</span></td>
</tr>
@php
$total += $nilai;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment