sk-hasil-belajar can only be printed once

This commit is contained in:
Gregorio Chiko Putra
2019-05-16 09:55:49 +07:00
parent 30a93871e5
commit f8d4d1df98
4 changed files with 71 additions and 23 deletions

View File

@@ -61,7 +61,7 @@ var component = {
nisn: e.target.elements.nisn.value,
tanggalLahir: e.target.elements.tanggalLahir.value,
src: 'sk-hasil-belajar',
with: 'hasilBelajar',
with: ['hasilBelajar', 'accessLog'],
});
}
},
@@ -89,7 +89,8 @@ var component = {
])),
_isEmpty(Siswa.current) ? null : m('.letter', [
m('span.mobile-info', 'Untuk mencetak surat ini, harap gunakan browser di desktop PC.'),
m('button.print-button', {
!_isEmpty(Siswa.current.access_log) ? null
: m('button.print-button', {
onclick: () => {
if (confirm('Surat Keterangan ini hanya dapat dicetak satu kali. Lanjutkan?')) {
AccessLog.create({siswaId: Siswa.current.id, src: 'sk-hasil-belajar'}).then(() => {