Merge pull request #31 from arieeefajar/fix/assessment-history-officer
fix(assessmnet-history-officer): function show details
This commit is contained in:
commit
9710c1305c
|
@ -15,7 +15,8 @@ public function index()
|
|||
|
||||
public function officer()
|
||||
{
|
||||
$evaluations = Evaluation::with('land', 'evaluationDetails.indicator')->where('user_id', auth()->user()->id)->orderBy('created_at', 'desc')->get();
|
||||
$evaluations = Evaluation::with('land', 'evaluationDetails.indicator.rules')->where('user_id', auth()->user()->id)->orderBy('created_at', 'desc')->get();
|
||||
// dd($evaluations);
|
||||
return view('assessment.officer', compact('evaluations'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,36 +6,25 @@ function detailData(data) {
|
|||
|
||||
if (Array.isArray(data)) {
|
||||
data.forEach((item) => {
|
||||
let options = `<option value="" disabled ${
|
||||
item.cf_e === null ? "selected" : ""
|
||||
}>Pilih Jawaban</option>`;
|
||||
|
||||
item.indicator.rules.forEach((rule) => {
|
||||
options += `<option value="${rule.cf}" ${
|
||||
item.cf_e == rule.cf ? "selected" : ""
|
||||
}>
|
||||
${rule.parameter_type}
|
||||
</option>`;
|
||||
});
|
||||
|
||||
let row = `<div class="mb-3">
|
||||
<label for="indicator-${
|
||||
item.indicator.id
|
||||
}" class="form-label">${item.indicator.name}</label>
|
||||
<select name="indicator" class="form-control" id="indicator-${
|
||||
item.indicator.id
|
||||
}" disabled>
|
||||
<option value="" disabled ${
|
||||
item.md_value === null ? "selected" : ""
|
||||
}>Pilih Jawaban</option>
|
||||
<option value="0" ${
|
||||
item.md_value == 0 ? "selected" : ""
|
||||
}>Tidak</option>
|
||||
<option value="0.2" ${
|
||||
item.md_value == 0.2 ? "selected" : ""
|
||||
}>Tidak Tahu</option>
|
||||
<option value="0.4" ${
|
||||
item.md_value == 0.4 ? "selected" : ""
|
||||
}>Mungkin</option>
|
||||
<option value="0.6" ${
|
||||
item.md_value == 0.6 ? "selected" : ""
|
||||
}>Kemungkinan Besar</option>
|
||||
<option value="0.8" ${
|
||||
item.md_value == 0.8 ? "selected" : ""
|
||||
}>Hampir Pasti</option>
|
||||
<option value="1" ${
|
||||
item.md_value == 1 ? "selected" : ""
|
||||
}>Pasti</option>
|
||||
</select>
|
||||
</div>`;
|
||||
<label for="indicator-${item.indicator.id}" class="form-label">${item.indicator.name}</label>
|
||||
<select name="indicator" class="form-control" id="indicator-${item.indicator.id}" disabled>
|
||||
${options}
|
||||
</select>
|
||||
</div>`;
|
||||
|
||||
detailModal.innerHTML += row;
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue