diff --git a/Views/Admin/Transport/SpjAdmin/Scan/Index.cshtml b/Views/Admin/Transport/SpjAdmin/Scan/Index.cshtml index c429c04..657c132 100644 --- a/Views/Admin/Transport/SpjAdmin/Scan/Index.cshtml +++ b/Views/Admin/Transport/SpjAdmin/Scan/Index.cshtml @@ -384,6 +384,10 @@ processScanCode(code) { this.showModal('loading', 'Memproses...', 'Sedang memverifikasi kode SPJ...', false); + // Testing mode - uncomment untuk testing tanpa backend + // this.mockResponse(code); + // return; + $.ajax({ url: '@Url.Action("ProcessScan", "Scan")', // nanti tinggal ganti aja yaa type: 'POST', @@ -417,6 +421,24 @@ }); } + // Mock response untuk testing + mockResponse(code) { + setTimeout(() => { + // Simulasi SPJ yang ada + const validCodes = ['SPJ001', 'SPJ002', 'TEST123', '12345', 'ABCDEF']; + + if (validCodes.includes(code.toUpperCase())) { + this.showModal('success', 'Scan Berhasil!', `SPJ ${code} berhasil ditemukan dan diproses.`, true); + setTimeout(() => { + this.hideResult(); + this.manualInput.value = ''; + }, 2000); + } else { + this.showModal('error', 'SPJ Tidak Ditemukan', `Kode SPJ "${code}" tidak ditemukan dalam database.`, true); + } + }, 1500); // Simulasi delay network + } + async retryScan() { this.hideResult(); this.hideError();