fix
@@ -6,6 +6,7 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class KelulusanController extends Controller
|
class KelulusanController extends Controller
|
||||||
@@ -88,7 +89,7 @@ class KelulusanController extends Controller
|
|||||||
{
|
{
|
||||||
$imageName = time().'.'.$request->image->extension();
|
$imageName = time().'.'.$request->image->extension();
|
||||||
|
|
||||||
$request->image->move(public_path('kelulusanpb'), $imageName);
|
$request->image->move(public_path('storage\kelulusanpb'), $imageName);
|
||||||
|
|
||||||
$updatelulus = Http::put(config('api.url') . '/admin/permohonan/updatepb',[
|
$updatelulus = Http::put(config('api.url') . '/admin/permohonan/updatepb',[
|
||||||
'amaun_lulus' => $request->amaun_lulus,
|
'amaun_lulus' => $request->amaun_lulus,
|
||||||
@@ -104,4 +105,9 @@ class KelulusanController extends Controller
|
|||||||
return response(1);
|
return response(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function download(Request $request)
|
||||||
|
{
|
||||||
|
return Storage::download('public/kelulusanpb/'.$request->image);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ return [
|
|||||||
'public' => [
|
'public' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'root' => storage_path('app/public'),
|
'root' => storage_path('app/public'),
|
||||||
'url' => env('APP_URL').'/storage',
|
'url' => env('APP_URL').'/public',
|
||||||
'visibility' => 'public',
|
'visibility' => 'public',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 943 KiB |
|
Before Width: | Height: | Size: 943 KiB |
|
Before Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 111 KiB |
@@ -238,8 +238,8 @@
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
<button @click="DownloadBukti" class="border border-blue-600 text-blue-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-blue-600 hover:text-white transition-all duration-300">
|
<button @click="DownloadBukti(mohon.kelulusanpbimage)" class="border border-blue-600 text-blue-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-blue-600 hover:text-white transition-all duration-300">
|
||||||
CETAK
|
MUAT TURUN
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@@ -320,254 +320,22 @@ export default {
|
|||||||
return 'Bayaran Balik'
|
return 'Bayaran Balik'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async funcbatal(mohonid) {
|
DownloadBukti: function (image) {
|
||||||
|
axios.get("/api/check/muatturun?image=" + image, {
|
||||||
let refer = this;
|
responseType: 'blob'
|
||||||
const {
|
})
|
||||||
value: katalaluan
|
.then(response => {
|
||||||
} = await this.$swal({
|
const url = window.URL.createObjectURL(new Blob([response.data]));
|
||||||
title: 'Masukkan Katalaluan Semula',
|
const link = document.createElement('a');
|
||||||
input: 'password',
|
link.href = url;
|
||||||
inputPlaceholder: 'Katalaluan',
|
link.setAttribute('download', image);
|
||||||
confirmButtonText: 'Hantar',
|
document.body.appendChild(link);
|
||||||
showCancelButton: true,
|
link.click();
|
||||||
cancelButtonText: 'Batal',
|
})
|
||||||
allowOutsideClick: false
|
.catch(e => {
|
||||||
})
|
console.log(e);
|
||||||
|
|
||||||
if (katalaluan !== undefined)
|
|
||||||
await this.axios.get('/mintasemulakelulusan', {
|
|
||||||
params: {
|
|
||||||
passsemula: katalaluan
|
|
||||||
}
|
|
||||||
}).then(response => {
|
|
||||||
|
|
||||||
if (response.data === 1) {
|
|
||||||
|
|
||||||
if (this.userroles === "operasi") {
|
|
||||||
this.axios.put(this.$hostname + '/admin/permohonan/updateoperasi', {
|
|
||||||
kelulusan: "Batal",
|
|
||||||
mohonid: mohonid,
|
|
||||||
namaoperasi: this.username
|
|
||||||
}).then(response => {
|
|
||||||
if (response.data === 1) {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'success',
|
|
||||||
title: 'Berjaya',
|
|
||||||
text: 'Berjaya mengemaskini maklumat pelanggan',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'warning',
|
|
||||||
title: 'Tidak Berjaya',
|
|
||||||
text: 'Data pelanggan tidak berjaya dikemaskini',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (this.userroles === "akaun") {
|
|
||||||
this.axios.put(this.$hostname + '/admin/permohonan/updateakaun', {
|
|
||||||
kelulusan: "Batal",
|
|
||||||
mohonid: mohonid,
|
|
||||||
namaakaun: this.username
|
|
||||||
}).then(response => {
|
|
||||||
if (response.data === 1) {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'success',
|
|
||||||
title: 'Berjaya',
|
|
||||||
text: 'Berjaya mengemaskini maklumat pelanggan',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'warning',
|
|
||||||
title: 'Tidak Berjaya',
|
|
||||||
text: 'Data pelanggan tidak berjaya dikemaskini',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'warning',
|
|
||||||
title: 'Tidak Berjaya',
|
|
||||||
text: 'Kata Laluan Yang Dimasukkan Salah!!',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
|
||||||
async funcsetuju(mohonid) {
|
|
||||||
|
|
||||||
let refer = this;
|
|
||||||
const {
|
|
||||||
value: katalaluan
|
|
||||||
} = await this.$swal({
|
|
||||||
title: 'Masukkan Katalaluan Semula',
|
|
||||||
input: 'password',
|
|
||||||
inputPlaceholder: 'Katalaluan',
|
|
||||||
confirmButtonText: 'Hantar',
|
|
||||||
showCancelButton: true,
|
|
||||||
cancelButtonText: 'Batal',
|
|
||||||
allowOutsideClick: false
|
|
||||||
})
|
|
||||||
|
|
||||||
if (katalaluan !== undefined)
|
|
||||||
await this.axios.get('/mintasemulakelulusan', {
|
|
||||||
params: {
|
|
||||||
passsemula: katalaluan
|
|
||||||
}
|
|
||||||
}).then(response => {
|
|
||||||
|
|
||||||
if (response.data === 1) {
|
|
||||||
|
|
||||||
if (this.userroles === "operasi") {
|
|
||||||
this.axios.put(this.$hostname + '/admin/permohonan/updateoperasi', {
|
|
||||||
kelulusan: 'Lulus',
|
|
||||||
mohonid: mohonid,
|
|
||||||
namaoperasi: this.username
|
|
||||||
}).then(response => {
|
|
||||||
if (response.data === 1) {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'success',
|
|
||||||
title: 'Berjaya',
|
|
||||||
text: 'Berjaya mengemaskini maklumat pelanggan',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'warning',
|
|
||||||
title: 'Tidak Berjaya',
|
|
||||||
text: 'Data pelanggan tidak berjaya dikemaskini',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (this.userroles === 'akaun') {
|
|
||||||
this.axios.put(this.$hostname + '/admin/permohonan/updateakaun', {
|
|
||||||
kelulusan: 'Lulus',
|
|
||||||
mohonid: mohonid,
|
|
||||||
namaakaun: this.username
|
|
||||||
}).then(response => {
|
|
||||||
if (response.data === 1) {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'success',
|
|
||||||
title: 'Berjaya',
|
|
||||||
text: 'Berjaya mengemaskini maklumat pelanggan',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'warning',
|
|
||||||
title: 'Tidak Berjaya',
|
|
||||||
text: 'Data pelanggan tidak berjaya dikemaskini',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'warning',
|
|
||||||
title: 'Tidak Berjaya',
|
|
||||||
text: 'Kata Laluan Yang Dimasukkan Salah!!',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
getSenaraiMohon(this.currentPage);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
CetakanPB: function (caw, mid) {
|
|
||||||
let refer = this;
|
|
||||||
this.axios.put(this.$hostname + '/admin/permohonan/updatecetak', {
|
|
||||||
mohonid: mid,
|
|
||||||
namaprint: this.username
|
|
||||||
}).then(response => {
|
|
||||||
if (response.data === 1) {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'success',
|
|
||||||
title: 'Berjaya',
|
|
||||||
text: 'Cetakan Berjaya Dijana!',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.$swal({
|
|
||||||
icon: 'warning',
|
|
||||||
title: 'Tidak Berjaya',
|
|
||||||
text: 'Cetakan Tidak Berjaya!',
|
|
||||||
allowOutsideClick: false
|
|
||||||
}).then(function () {
|
|
||||||
refer.getSenaraiMohon(refer.currentPage);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
let route = window.route('permohonan.cetakanpb', {
|
|
||||||
_query: {
|
|
||||||
cawangan: caw,
|
|
||||||
mohonid: mid
|
|
||||||
},
|
|
||||||
});
|
|
||||||
window.open(route, '_blank')
|
|
||||||
},
|
|
||||||
KelulusanPB: function (mid, mohon) {
|
|
||||||
this.$refs.modal.mohonid = mid;
|
|
||||||
this.$refs.modal.amaun_dimohon = mohon;
|
|
||||||
this.$refs.modal.showModal = true;
|
|
||||||
},
|
|
||||||
DepositBank: function (mid) {
|
|
||||||
this.$refs.bankmodal.mohonid = mid;
|
|
||||||
this.$refs.bankmodal.showModal = true;
|
|
||||||
},
|
|
||||||
DownloadBukti: function(){
|
|
||||||
console.log('dassa');
|
|
||||||
}
|
}
|
||||||
// CetakanPenuh: function (caw, mid) {
|
|
||||||
// let route = window.route('permohonan.cetakanpenuh', {
|
|
||||||
// _query: {
|
|
||||||
// cawangan: caw,
|
|
||||||
// mohonid: mid
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// window.open(route, '_blank')
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ Route::group(['prefix' => 'check'], function () {
|
|||||||
|
|
||||||
Route::put('/kelulusan/operasi', 'App\Http\Controllers\KelulusanController@updatekelulusan');
|
Route::put('/kelulusan/operasi', 'App\Http\Controllers\KelulusanController@updatekelulusan');
|
||||||
Route::post('/kelulusan/pb', 'App\Http\Controllers\KelulusanController@updatePB');
|
Route::post('/kelulusan/pb', 'App\Http\Controllers\KelulusanController@updatePB');
|
||||||
|
Route::get('/muatturun', 'App\Http\Controllers\KelulusanController@download');
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||