add button report surat jalan

This commit is contained in:
Hanan Askarim
2026-07-20 16:50:12 +07:00
parent e0536e554d
commit 10719f2efe

View File

@@ -84,13 +84,24 @@
{{ props.item.SuratJalanStatus }} {{ props.item.SuratJalanStatus }}
</v-chip> </v-chip>
</td> </td>
<td class="text-xs-center pa-2"> <td class="text-xs-center pa-2" style="white-space: nowrap;">
<v-icon <v-btn
small @click="deleteSJ(props.item)" color="red" style="min-width: 25px; height: 25px; margin: 0;"
@click="deleteSJ(props.item)"
small title="Hapus"
color="red"
:disabled="props.item.SuratJalanStatus != 'Draft'" :disabled="props.item.SuratJalanStatus != 'Draft'"
> >
delete <v-icon small color="white">delete</v-icon>
</v-icon> </v-btn>
<v-btn
style="min-width: 25px; height: 25px; margin: 0;"
@click="printout(props.item)"
small title="Cetak PDF"
color="primary"
>
<v-icon small color="white">print</v-icon>
</v-btn>
</td> </td>
</tr> </tr>
</template> </template>
@@ -100,18 +111,33 @@
<v-pagination v-model="paginat" :length="paginat_len" :total-visible="5"></v-pagination> <v-pagination v-model="paginat" :length="paginat_len" :total-visible="5"></v-pagination>
</div> </div>
</v-card> </v-card>
<one-dialog-print
:title="printtitle"
:width="printwidth"
:height="600"
:status="openprint"
:urlprint="urlprint"
@close-dialog-print="openprint = false"
></one-dialog-print>
</v-layout> </v-layout>
</template> </template>
<script> <script>
module.exports = { module.exports = {
components: {}, components: {
"one-dialog-print": httpVueLoader("../../common/oneDialogPrintX.vue"),
},
mounted() { mounted() {
this.$store.dispatch("suratjalan/getBranches"); this.$store.dispatch("suratjalan/getBranches");
this.$store.dispatch("suratjalan/listingSuratJalan"); this.$store.dispatch("suratjalan/listingSuratJalan");
}, },
data() { data() {
return { return {
urlprint: "",
printtitle: "",
printwidth: "60%",
openprint: false,
menuStartDate: false, menuStartDate: false,
menuEndDate: false, menuEndDate: false,
headers: [ headers: [
@@ -287,6 +313,15 @@
}, },
newForm() { newForm() {
this.$store.dispatch("suratjalan/newForm") this.$store.dispatch("suratjalan/newForm")
},
printout(val) {
this.printwidth = "60%";
this.printtitle = "";
let user = one_user();
let username = user && user.M_StaffName ? user.M_StaffName : "";
let tm = Date.now();
this.urlprint = BASE_URL + "/one-api/report/rpt_surat_jalan/pdf?id=" + val.SuratJalanID + "&username=" + username + "&tm=" + tm;
this.openprint = true;
} }
}, },
watch: { watch: {