fix exclude is_valid false and clickable dashboard simbg
This commit is contained in:
@@ -14,3 +14,6 @@ BigdataResume::generateResumeData(253,2025,"simbg");
|
|||||||
exit
|
exit
|
||||||
BigdataResume::generateResumeData(253,2025,"simbg");
|
BigdataResume::generateResumeData(253,2025,"simbg");
|
||||||
exit
|
exit
|
||||||
|
Bigdataresume::generateResumeData(253,2025,'simbg');
|
||||||
|
BigdataResume::generateResumeData(253,2025,'simbg');
|
||||||
|
exit
|
||||||
|
|||||||
@@ -25,7 +25,17 @@ class RequestAssignmentController extends Controller
|
|||||||
// Build base query for counting (without relationships to avoid duplicates)
|
// Build base query for counting (without relationships to avoid duplicates)
|
||||||
$baseQuery = PbgTask::query();
|
$baseQuery = PbgTask::query();
|
||||||
|
|
||||||
// Apply filters to base query
|
// Filter only valid data (is_valid = true)
|
||||||
|
$baseQuery->where('is_valid', true);
|
||||||
|
|
||||||
|
// Apply year filter if provided (to match BigdataResume behavior)
|
||||||
|
if ($request->has('year') && !empty($request->get('year'))) {
|
||||||
|
$year = $request->get('year');
|
||||||
|
$baseQuery->whereYear('task_created_at', $year);
|
||||||
|
Log::info('RequestAssignmentController year filter applied', ['year' => $year]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply filters to base query (matching BigdataResume logic exactly)
|
||||||
if ($request->has('filter') && !empty($request->get('filter'))) {
|
if ($request->has('filter') && !empty($request->get('filter'))) {
|
||||||
$filter = strtolower(trim($request->get('filter')));
|
$filter = strtolower(trim($request->get('filter')));
|
||||||
|
|
||||||
@@ -34,6 +44,7 @@ class RequestAssignmentController extends Controller
|
|||||||
|
|
||||||
switch ($filter) {
|
switch ($filter) {
|
||||||
case 'non-business':
|
case 'non-business':
|
||||||
|
// Match BigdataResume non-business logic exactly
|
||||||
$baseQuery->where(function ($q) {
|
$baseQuery->where(function ($q) {
|
||||||
$q->where(function ($q2) {
|
$q->where(function ($q2) {
|
||||||
$q2->where(function ($q3) {
|
$q2->where(function ($q3) {
|
||||||
@@ -47,6 +58,7 @@ class RequestAssignmentController extends Controller
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'business':
|
case 'business':
|
||||||
|
// Match BigdataResume business logic exactly
|
||||||
$baseQuery->where(function ($q) {
|
$baseQuery->where(function ($q) {
|
||||||
$q->where(function ($q2) {
|
$q->where(function ($q2) {
|
||||||
$q2->whereRaw("LOWER(TRIM(function_type)) LIKE ?", ['%fungsi usaha%'])
|
$q2->whereRaw("LOWER(TRIM(function_type)) LIKE ?", ['%fungsi usaha%'])
|
||||||
@@ -57,25 +69,35 @@ class RequestAssignmentController extends Controller
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'verified':
|
case 'verified':
|
||||||
|
// Match BigdataResume verified logic exactly
|
||||||
$baseQuery->whereIn("status", PbgTaskStatus::getVerified());
|
$baseQuery->whereIn("status", PbgTaskStatus::getVerified());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'non-verified':
|
case 'non-verified':
|
||||||
|
// Match BigdataResume non-verified logic exactly
|
||||||
$baseQuery->whereIn("status", PbgTaskStatus::getNonVerified());
|
$baseQuery->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'potention':
|
case 'potention':
|
||||||
|
// Match BigdataResume potention logic exactly
|
||||||
$baseQuery->whereIn("status", PbgTaskStatus::getPotention());
|
$baseQuery->whereIn("status", PbgTaskStatus::getPotention());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'issuance-realization-pbg':
|
case 'issuance-realization-pbg':
|
||||||
|
// Match BigdataResume issuance realization logic exactly
|
||||||
$baseQuery->whereIn("status", PbgTaskStatus::getIssuanceRealizationPbg());
|
$baseQuery->whereIn("status", PbgTaskStatus::getIssuanceRealizationPbg());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'process-in-technical-office':
|
case 'process-in-technical-office':
|
||||||
|
// Match BigdataResume process in technical office logic exactly
|
||||||
$baseQuery->whereIn("status", PbgTaskStatus::getProcessInTechnicalOffice());
|
$baseQuery->whereIn("status", PbgTaskStatus::getProcessInTechnicalOffice());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'waiting-click-dpmptsp':
|
case 'waiting-click-dpmptsp':
|
||||||
|
// Match BigdataResume waiting click DPMPTSP logic exactly
|
||||||
$baseQuery->whereIn("status", PbgTaskStatus::getWaitingClickDpmptsp());
|
$baseQuery->whereIn("status", PbgTaskStatus::getWaitingClickDpmptsp());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Log unrecognized filter for debugging
|
// Log unrecognized filter for debugging
|
||||||
Log::warning('Unrecognized filter value', ['filter' => $filter, 'original' => $request->get('filter')]);
|
Log::warning('Unrecognized filter value', ['filter' => $filter, 'original' => $request->get('filter')]);
|
||||||
@@ -124,11 +146,18 @@ class RequestAssignmentController extends Controller
|
|||||||
Log::info('RequestAssignmentController final result', [
|
Log::info('RequestAssignmentController final result', [
|
||||||
'filter' => $request->get('filter'),
|
'filter' => $request->get('filter'),
|
||||||
'search' => $request->get('search'),
|
'search' => $request->get('search'),
|
||||||
|
'year' => $request->get('year'),
|
||||||
'accurate_count' => $accurateCount,
|
'accurate_count' => $accurateCount,
|
||||||
'request_url' => $request->fullUrl(),
|
'request_url' => $request->fullUrl(),
|
||||||
'all_params' => $request->all()
|
'all_params' => $request->all()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Cross-validation with BigdataResume logic (for debugging consistency)
|
||||||
|
if ($request->has('filter') && $request->has('year') &&
|
||||||
|
!empty($request->get('filter')) && !empty($request->get('year'))) {
|
||||||
|
$this->validateConsistencyWithBigdataResume($request->get('filter'), $request->get('year'), $accurateCount);
|
||||||
|
}
|
||||||
|
|
||||||
// Additional logging for potention filter
|
// Additional logging for potention filter
|
||||||
if ($request->get('filter') === 'potention') {
|
if ($request->get('filter') === 'potention') {
|
||||||
$rejectedCount = PbgTask::whereIn('status', PbgTaskStatus::getRejected())->count();
|
$rejectedCount = PbgTask::whereIn('status', PbgTaskStatus::getRejected())->count();
|
||||||
@@ -141,7 +170,7 @@ class RequestAssignmentController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Also log to console for immediate debugging
|
// Also log to console for immediate debugging
|
||||||
if ($request->has('filter')) {
|
if ($request->has('filter') && !empty($request->get('filter'))) {
|
||||||
error_log('RequestAssignment Filter Debug: ' . $request->get('filter') . ' -> Count: ' . $accurateCount);
|
error_log('RequestAssignment Filter Debug: ' . $request->get('filter') . ' -> Count: ' . $accurateCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,4 +272,141 @@ class RequestAssignmentController extends Controller
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate consistency with BigdataResume logic for debugging
|
||||||
|
*/
|
||||||
|
private function validateConsistencyWithBigdataResume(?string $filter, $year, int $actualCount)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
// Validate input parameters
|
||||||
|
if (empty($filter) || empty($year)) {
|
||||||
|
Log::info('Skipping consistency validation - empty filter or year', [
|
||||||
|
'filter' => $filter,
|
||||||
|
'year' => $year
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert year to integer
|
||||||
|
$year = (int) $year;
|
||||||
|
if ($year <= 0) {
|
||||||
|
Log::warning('Invalid year provided for consistency validation', ['year' => $year]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$bigdataResumeCount = null;
|
||||||
|
|
||||||
|
// Calculate expected count using BigdataResume logic
|
||||||
|
switch ($filter) {
|
||||||
|
case 'verified':
|
||||||
|
$bigdataResumeCount = PbgTask::whereIn('status', PbgTaskStatus::getVerified())
|
||||||
|
->where('is_valid', true)
|
||||||
|
->whereYear('task_created_at', $year)
|
||||||
|
->count();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'non-verified':
|
||||||
|
$bigdataResumeCount = PbgTask::whereIn('status', PbgTaskStatus::getNonVerified())
|
||||||
|
->where('is_valid', true)
|
||||||
|
->whereYear('task_created_at', $year)
|
||||||
|
->count();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'business':
|
||||||
|
$bigdataResumeCount = PbgTask::where(function ($q) {
|
||||||
|
$q->where(function ($q2) {
|
||||||
|
$q2->whereRaw("LOWER(TRIM(function_type)) LIKE ?", ['%fungsi usaha%'])
|
||||||
|
->orWhereRaw("LOWER(TRIM(function_type)) LIKE ?", ['%sebagai tempat usaha%']);
|
||||||
|
})
|
||||||
|
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
|
})
|
||||||
|
->where('is_valid', true)
|
||||||
|
->whereYear('task_created_at', $year)
|
||||||
|
->count();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'non-business':
|
||||||
|
$bigdataResumeCount = PbgTask::where(function ($q) {
|
||||||
|
$q->where(function ($q2) {
|
||||||
|
$q2->where(function ($q3) {
|
||||||
|
$q3->whereRaw("LOWER(TRIM(function_type)) NOT LIKE ?", ['%fungsi usaha%'])
|
||||||
|
->whereRaw("LOWER(TRIM(function_type)) NOT LIKE ?", ['%sebagai tempat usaha%']);
|
||||||
|
})
|
||||||
|
->orWhereNull('function_type');
|
||||||
|
})
|
||||||
|
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
|
})
|
||||||
|
->where('is_valid', true)
|
||||||
|
->whereYear('task_created_at', $year)
|
||||||
|
->count();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'potention':
|
||||||
|
$bigdataResumeCount = PbgTask::whereIn('status', PbgTaskStatus::getPotention())
|
||||||
|
->where('is_valid', true)
|
||||||
|
->whereYear('task_created_at', $year)
|
||||||
|
->count();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'waiting-click-dpmptsp':
|
||||||
|
$bigdataResumeCount = PbgTask::whereIn('status', PbgTaskStatus::getWaitingClickDpmptsp())
|
||||||
|
->where('is_valid', true)
|
||||||
|
->whereYear('task_created_at', $year)
|
||||||
|
->count();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'issuance-realization-pbg':
|
||||||
|
$bigdataResumeCount = PbgTask::whereIn('status', PbgTaskStatus::getIssuanceRealizationPbg())
|
||||||
|
->where('is_valid', true)
|
||||||
|
->whereYear('task_created_at', $year)
|
||||||
|
->count();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'process-in-technical-office':
|
||||||
|
$bigdataResumeCount = PbgTask::whereIn('status', PbgTaskStatus::getProcessInTechnicalOffice())
|
||||||
|
->where('is_valid', true)
|
||||||
|
->whereYear('task_created_at', $year)
|
||||||
|
->count();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Log::info('Unknown filter for consistency validation', [
|
||||||
|
'filter' => $filter,
|
||||||
|
'year' => $year
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($bigdataResumeCount !== null) {
|
||||||
|
$isConsistent = ($actualCount === $bigdataResumeCount);
|
||||||
|
|
||||||
|
Log::info('RequestAssignment vs BigdataResume consistency check', [
|
||||||
|
'filter' => $filter,
|
||||||
|
'year' => $year,
|
||||||
|
'request_assignment_count' => $actualCount,
|
||||||
|
'bigdata_resume_count' => $bigdataResumeCount,
|
||||||
|
'is_consistent' => $isConsistent,
|
||||||
|
'difference' => $actualCount - $bigdataResumeCount
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (!$isConsistent) {
|
||||||
|
Log::warning('INCONSISTENCY DETECTED between RequestAssignment and BigdataResume', [
|
||||||
|
'filter' => $filter,
|
||||||
|
'year' => $year,
|
||||||
|
'request_assignment_count' => $actualCount,
|
||||||
|
'bigdata_resume_count' => $bigdataResumeCount,
|
||||||
|
'difference' => $actualCount - $bigdataResumeCount
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::error('Error in consistency validation', [
|
||||||
|
'error' => $e->getMessage(),
|
||||||
|
'filter' => $filter,
|
||||||
|
'year' => $year
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,22 +47,29 @@ class BigdataResume extends Model
|
|||||||
|
|
||||||
public static function generateResumeData($import_datasource_id, $year, $resume_type){
|
public static function generateResumeData($import_datasource_id, $year, $resume_type){
|
||||||
// Get accurate counts without joins to avoid duplicates from multiple retributions
|
// Get accurate counts without joins to avoid duplicates from multiple retributions
|
||||||
|
// Filter only valid data (is_valid = true)
|
||||||
$verified_count = PbgTask::whereIn('status', PbgTaskStatus::getVerified())
|
$verified_count = PbgTask::whereIn('status', PbgTaskStatus::getVerified())
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->count();
|
->count();
|
||||||
$non_verified_count = PbgTask::whereIn('status', PbgTaskStatus::getNonVerified())
|
$non_verified_count = PbgTask::whereIn('status', PbgTaskStatus::getNonVerified())
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->count();
|
->count();
|
||||||
$waiting_click_dpmptsp_count = PbgTask::whereIn('status', PbgTaskStatus::getWaitingClickDpmptsp())
|
$waiting_click_dpmptsp_count = PbgTask::whereIn('status', PbgTaskStatus::getWaitingClickDpmptsp())
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->count();
|
->count();
|
||||||
$issuance_realization_pbg_count = PbgTask::whereIn('status', PbgTaskStatus::getIssuanceRealizationPbg())
|
$issuance_realization_pbg_count = PbgTask::whereIn('status', PbgTaskStatus::getIssuanceRealizationPbg())
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->count();
|
->count();
|
||||||
$process_in_technical_office_count = PbgTask::whereIn('status', PbgTaskStatus::getProcessInTechnicalOffice())
|
$process_in_technical_office_count = PbgTask::whereIn('status', PbgTaskStatus::getProcessInTechnicalOffice())
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->count();
|
->count();
|
||||||
$potention_count = PbgTask::whereIn('status', PbgTaskStatus::getPotention())
|
$potention_count = PbgTask::whereIn('status', PbgTaskStatus::getPotention())
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
@@ -74,6 +81,7 @@ class BigdataResume extends Model
|
|||||||
})
|
})
|
||||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
})
|
})
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
@@ -88,6 +96,7 @@ class BigdataResume extends Model
|
|||||||
})
|
})
|
||||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
})
|
})
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
@@ -101,6 +110,7 @@ class BigdataResume extends Model
|
|||||||
})
|
})
|
||||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
})
|
})
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->whereExists(function ($query) {
|
->whereExists(function ($query) {
|
||||||
$query->select(DB::raw(1))
|
$query->select(DB::raw(1))
|
||||||
@@ -133,6 +143,7 @@ class BigdataResume extends Model
|
|||||||
})
|
})
|
||||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
})
|
})
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->whereExists(function ($query) {
|
->whereExists(function ($query) {
|
||||||
$query->select(DB::raw(1))
|
$query->select(DB::raw(1))
|
||||||
@@ -168,6 +179,7 @@ class BigdataResume extends Model
|
|||||||
})
|
})
|
||||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
})
|
})
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->whereExists(function ($query) {
|
->whereExists(function ($query) {
|
||||||
$query->select(DB::raw(1))
|
$query->select(DB::raw(1))
|
||||||
@@ -203,6 +215,7 @@ class BigdataResume extends Model
|
|||||||
})
|
})
|
||||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
})
|
})
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->whereExists(function ($query) {
|
->whereExists(function ($query) {
|
||||||
$query->select(DB::raw(1))
|
$query->select(DB::raw(1))
|
||||||
@@ -238,6 +251,7 @@ class BigdataResume extends Model
|
|||||||
})
|
})
|
||||||
->whereIn("status", PbgTaskStatus::getNonVerified());
|
->whereIn("status", PbgTaskStatus::getNonVerified());
|
||||||
})
|
})
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->whereExists(function ($query) {
|
->whereExists(function ($query) {
|
||||||
$query->select(DB::raw(1))
|
$query->select(DB::raw(1))
|
||||||
@@ -264,6 +278,7 @@ class BigdataResume extends Model
|
|||||||
|
|
||||||
// Debug: Check if there are non-verified tasks and their retribution data
|
// Debug: Check if there are non-verified tasks and their retribution data
|
||||||
$debug_non_verified = PbgTask::whereIn('status', PbgTaskStatus::getNonVerified())
|
$debug_non_verified = PbgTask::whereIn('status', PbgTaskStatus::getNonVerified())
|
||||||
|
->where('is_valid', true)
|
||||||
->whereYear('task_created_at', $year)
|
->whereYear('task_created_at', $year)
|
||||||
->with('pbg_task_retributions')
|
->with('pbg_task_retributions')
|
||||||
->get();
|
->get();
|
||||||
@@ -283,6 +298,7 @@ class BigdataResume extends Model
|
|||||||
|
|
||||||
// Get sum values using proper aggregation to handle multiple retributions
|
// Get sum values using proper aggregation to handle multiple retributions
|
||||||
$stats = PbgTask::leftJoin('pbg_task_retributions as ptr', 'pbg_task.uuid', '=', 'ptr.pbg_task_uid')
|
$stats = PbgTask::leftJoin('pbg_task_retributions as ptr', 'pbg_task.uuid', '=', 'ptr.pbg_task_uid')
|
||||||
|
->where('pbg_task.is_valid', true)
|
||||||
->whereYear('pbg_task.task_created_at', $year)
|
->whereYear('pbg_task.task_created_at', $year)
|
||||||
->selectRaw("
|
->selectRaw("
|
||||||
SUM(CASE WHEN pbg_task.status in (".implode(',', PbgTaskStatus::getVerified()).") THEN COALESCE(ptr.nilai_retribusi_bangunan, 0) ELSE 0 END) AS verified_total,
|
SUM(CASE WHEN pbg_task.status in (".implode(',', PbgTaskStatus::getVerified()).") THEN COALESCE(ptr.nilai_retribusi_bangunan, 0) ELSE 0 END) AS verified_total,
|
||||||
|
|||||||
@@ -43,19 +43,29 @@ class PbgTasks {
|
|||||||
handleFilterDatatable() {
|
handleFilterDatatable() {
|
||||||
const form = document.getElementById("filter-form");
|
const form = document.getElementById("filter-form");
|
||||||
const filterSelect = document.getElementById("filter-select");
|
const filterSelect = document.getElementById("filter-select");
|
||||||
|
const yearSelect = document.getElementById("year-select");
|
||||||
|
const resetBtn = document.getElementById("reset-filter");
|
||||||
|
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
const initialFilter = urlParams.get("filter") || "";
|
const initialFilter = urlParams.get("filter") || "";
|
||||||
|
const initialYear = urlParams.get("year") || "2025"; // Default to 2025
|
||||||
|
|
||||||
this.initTableRequestAssignment(initialFilter); // Initial load with query param
|
// Set initial year if not in URL
|
||||||
|
if (!urlParams.get("year")) {
|
||||||
|
yearSelect.value = "2025";
|
||||||
|
}
|
||||||
|
|
||||||
|
this.initTableRequestAssignment(initialFilter, initialYear); // Initial load with query params
|
||||||
|
|
||||||
form.addEventListener("submit", (e) => {
|
form.addEventListener("submit", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const selectedFilter = filterSelect.value;
|
const selectedFilter = filterSelect.value;
|
||||||
|
const selectedYear = yearSelect.value;
|
||||||
|
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
params.set("filter", selectedFilter);
|
params.set("filter", selectedFilter);
|
||||||
|
params.set("year", selectedYear);
|
||||||
|
|
||||||
// Update the URL without reloading
|
// Update the URL without reloading
|
||||||
window.history.replaceState(
|
window.history.replaceState(
|
||||||
@@ -64,12 +74,27 @@ class PbgTasks {
|
|||||||
`${location.pathname}?${params}`
|
`${location.pathname}?${params}`
|
||||||
);
|
);
|
||||||
|
|
||||||
// Call the method again with the selected filter
|
// Call the method again with the selected filter and year
|
||||||
this.initTableRequestAssignment(selectedFilter);
|
this.initTableRequestAssignment(selectedFilter, selectedYear);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle reset button
|
||||||
|
resetBtn.addEventListener("click", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
// Reset form values
|
||||||
|
filterSelect.value = "";
|
||||||
|
yearSelect.value = "2025";
|
||||||
|
|
||||||
|
// Clear URL parameters
|
||||||
|
window.history.replaceState({}, "", location.pathname);
|
||||||
|
|
||||||
|
// Reload table with default values
|
||||||
|
this.initTableRequestAssignment("", "2025");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
initTableRequestAssignment(filterValue = "") {
|
initTableRequestAssignment(filterValue = "", yearValue = "2025") {
|
||||||
const urlBase = `${GlobalConfig.apiHost}/api/request-assignments`;
|
const urlBase = `${GlobalConfig.apiHost}/api/request-assignments`;
|
||||||
|
|
||||||
// Ambil token
|
// Ambil token
|
||||||
@@ -179,7 +204,7 @@ class PbgTasks {
|
|||||||
},
|
},
|
||||||
sort: true,
|
sort: true,
|
||||||
server: {
|
server: {
|
||||||
url: `${urlBase}?filter=${filterValue}`,
|
url: `${urlBase}?filter=${filterValue}&year=${yearValue}`,
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
@@ -365,7 +390,18 @@ class PbgTasks {
|
|||||||
self.toastMessage.innerText =
|
self.toastMessage.innerText =
|
||||||
"File uploaded successfully!";
|
"File uploaded successfully!";
|
||||||
self.toast.show();
|
self.toast.show();
|
||||||
self.initTableRequestAssignment();
|
|
||||||
|
// Get current filter and year values to refresh table
|
||||||
|
const currentFilter =
|
||||||
|
document.getElementById("filter-select").value ||
|
||||||
|
"";
|
||||||
|
const currentYear =
|
||||||
|
document.getElementById("year-select").value ||
|
||||||
|
"2025";
|
||||||
|
self.initTableRequestAssignment(
|
||||||
|
currentFilter,
|
||||||
|
currentYear
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
dz.on("error", (file, message) => {
|
dz.on("error", (file, message) => {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
'document_id' => 'chart-total-potensi',
|
'document_id' => 'chart-total-potensi',
|
||||||
'visible_small_circle' => true,
|
'visible_small_circle' => true,
|
||||||
'style' => 'left:400px;top:150px;',
|
'style' => 'left:400px;top:150px;',
|
||||||
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'potention'])
|
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'potention', 'year' => date('Y')])
|
||||||
])
|
])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
@@ -82,16 +82,7 @@
|
|||||||
<div class="square dia-top-right-bottom-left" style="top:150px;left:550px;">
|
<div class="square dia-top-right-bottom-left" style="top:150px;left:550px;">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@component('components.circle', [
|
|
||||||
'document_title' => 'Non Usaha',
|
|
||||||
'document_color' => '#399787',
|
|
||||||
'document_type' => 'Berkas',
|
|
||||||
'document_id' => 'chart-non-business',
|
|
||||||
'visible_small_circle' => true,
|
|
||||||
'style' => 'left:900px;top:150px;',
|
|
||||||
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'non-business'])
|
|
||||||
])
|
|
||||||
@endcomponent
|
|
||||||
|
|
||||||
<div class="square dia-top-right-bottom-left" style="top:80px;left:1050px;width:150px;height:150px;">
|
<div class="square dia-top-right-bottom-left" style="top:80px;left:1050px;width:150px;height:150px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -143,6 +134,17 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@component('components.circle', [
|
||||||
|
'document_title' => 'Non Usaha',
|
||||||
|
'document_color' => '#399787',
|
||||||
|
'document_type' => 'Berkas',
|
||||||
|
'document_id' => 'chart-non-business',
|
||||||
|
'visible_small_circle' => true,
|
||||||
|
'style' => 'left:900px;top:150px;',
|
||||||
|
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'non-business', 'year' => date('Y')])
|
||||||
|
])
|
||||||
|
@endcomponent
|
||||||
|
|
||||||
@component('components.circle', [
|
@component('components.circle', [
|
||||||
'document_title' => 'Usaha',
|
'document_title' => 'Usaha',
|
||||||
'document_color' => '#5e7c89',
|
'document_color' => '#5e7c89',
|
||||||
@@ -150,7 +152,7 @@
|
|||||||
'document_id' => 'chart-business',
|
'document_id' => 'chart-business',
|
||||||
'visible_small_circle' => true,
|
'visible_small_circle' => true,
|
||||||
'style' => 'left:900px;top:400px;',
|
'style' => 'left:900px;top:400px;',
|
||||||
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'business'])
|
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'business', 'year' => date('Y')])
|
||||||
])
|
])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
@@ -161,7 +163,7 @@
|
|||||||
'document_id' => 'chart-berkas-terverifikasi',
|
'document_id' => 'chart-berkas-terverifikasi',
|
||||||
'visible_small_circle' => true,
|
'visible_small_circle' => true,
|
||||||
'style' => 'top:300px;left:200px;',
|
'style' => 'top:300px;left:200px;',
|
||||||
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'verified'])
|
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'verified', 'year' => date('Y')])
|
||||||
])
|
])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
@@ -178,7 +180,7 @@
|
|||||||
'document_id' => 'chart-berkas-belum-terverifikasi',
|
'document_id' => 'chart-berkas-belum-terverifikasi',
|
||||||
'visible_small_circle' => true,
|
'visible_small_circle' => true,
|
||||||
'style' => 'top:300px;left:600px;',
|
'style' => 'top:300px;left:600px;',
|
||||||
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'non-verified'])
|
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'non-verified', 'year' => date('Y')])
|
||||||
])
|
])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
@@ -196,7 +198,7 @@
|
|||||||
'document_id' => 'chart-realisasi-tebit-pbg',
|
'document_id' => 'chart-realisasi-tebit-pbg',
|
||||||
'visible_small_circle' => true,
|
'visible_small_circle' => true,
|
||||||
'style' => 'top:550px;left:100px;',
|
'style' => 'top:550px;left:100px;',
|
||||||
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'issuance-realization-pbg'])
|
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'issuance-realization-pbg', 'year' => date('Y')])
|
||||||
])
|
])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
@@ -210,7 +212,7 @@
|
|||||||
'document_id' => 'chart-menunggu-klik-dpmptsp',
|
'document_id' => 'chart-menunggu-klik-dpmptsp',
|
||||||
'visible_small_circle' => true,
|
'visible_small_circle' => true,
|
||||||
'style' => 'top:550px;left:400px',
|
'style' => 'top:550px;left:400px',
|
||||||
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'waiting-click-dpmptsp'])
|
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'waiting-click-dpmptsp', 'year' => date('Y')])
|
||||||
])
|
])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
@@ -224,7 +226,7 @@
|
|||||||
'document_id' => 'chart-proses-dinas-teknis',
|
'document_id' => 'chart-proses-dinas-teknis',
|
||||||
'visible_small_circle' => true,
|
'visible_small_circle' => true,
|
||||||
'style' => 'top:550px;left:700px',
|
'style' => 'top:550px;left:700px',
|
||||||
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'process-in-technical-office'])
|
'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'process-in-technical-office', 'year' => date('Y')])
|
||||||
])
|
])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,9 +44,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="filter-form">
|
<form id="filter-form">
|
||||||
<div class="row pb-3">
|
<div class="row pb-3 align-items-end">
|
||||||
<div class="col-md-4">
|
<div class="col-lg-3 col-md-4 mb-2">
|
||||||
<select name="filter" id="filter-select" class="form-select">
|
<label for="filter-select" class="form-label fw-semibold text-dark">Filter Type</label>
|
||||||
|
<select name="filter" id="filter-select" class="form-select form-select-sm border-2">
|
||||||
@foreach ($filterOptions as $key => $label)
|
@foreach ($filterOptions as $key => $label)
|
||||||
<option value="{{ $key }}" {{ request('filter') == $key ? 'selected' : '' }}>
|
<option value="{{ $key }}" {{ request('filter') == $key ? 'selected' : '' }}>
|
||||||
{{ $label }}
|
{{ $label }}
|
||||||
@@ -55,8 +56,32 @@
|
|||||||
</select>
|
</select>
|
||||||
<input name="menu_id" value="13" type="hidden" />
|
<input name="menu_id" value="13" type="hidden" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-lg-2 col-md-3 mb-2">
|
||||||
<button type="submit" class="btn btn-primary w-100">Apply</button>
|
<label for="year-select" class="form-label fw-semibold text-dark">Tahun</label>
|
||||||
|
<select name="year" id="year-select" class="form-select form-select-sm border-2">
|
||||||
|
@php
|
||||||
|
$currentYear = date('Y');
|
||||||
|
$selectedYear = request('year', 2025); // Default to 2025
|
||||||
|
@endphp
|
||||||
|
@for ($year = $currentYear; $year >= 2020; $year--)
|
||||||
|
<option value="{{ $year }}" {{ $selectedYear == $year ? 'selected' : '' }}>
|
||||||
|
{{ $year }}
|
||||||
|
</option>
|
||||||
|
@endfor
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 col-md-4 mb-2">
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<button type="submit" class="btn btn-primary btn-sm py-2 fw-semibold shadow-sm">
|
||||||
|
<i class="fas fa-filter me-1"></i>Terapkan
|
||||||
|
</button>
|
||||||
|
<button type="button" id="reset-filter" class="btn btn-outline-secondary btn-sm py-2 fw-semibold">
|
||||||
|
<i class="fas fa-undo me-1"></i>Reset
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-1 col-md-0">
|
||||||
|
<!-- Space for additional controls if needed -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user