add button report payment voucher

This commit is contained in:
Hanan Askarim
2026-07-21 09:52:01 +07:00
parent 927d009c15
commit 90602d4aa7

View File

@@ -192,25 +192,43 @@
</v-chip>
</td>
<template v-if="props.item.PaymentVoucherStatus == 'Draft'">
<td class="text-xs-center pa-2"
<td class="text-xs-center pa-2" style="white-space: nowrap;"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)"
>
<v-icon small @click="openUpdateVoucher(props.item)"
>edit</v-icon
<v-btn
style="min-width: 25px; height: 25px; margin: 0;"
@click.stop="openUpdateVoucher(props.item)"
small title="Edit"
color="black"
>
<v-icon small @click="deleteVoucher(props.item)"
>delete</v-icon
<v-icon small color="white">edit</v-icon>
</v-btn>
<v-btn
style="min-width: 25px; height: 25px; margin: 0;"
@click.stop="deleteVoucher(props.item)"
small title="Hapus"
color="red"
>
<v-icon small color="white">delete</v-icon>
</v-btn>
</td>
</template>
<template v-else>
<td
class="text-xs-center pa-2"
class="text-xs-center pa-2" style="white-space: nowrap;"
v-bind:class="{
'amber lighten-4': isSelected(props.item),
}"
></td>
>
<v-btn
style="min-width: 25px; height: 25px; margin: 0;"
@click.stop="printout(props.item)"
small title="Cetak PDF"
color="primary"
>
<v-icon small color="white">print</v-icon>
</v-btn>
</td>
</template>
</template>
</v-data-table>
@@ -234,6 +252,15 @@
@forget-dialog-alert="dialogAlertDelete = false"
@close-dialog-alert="closeAndDelete()"
></one-dialog-alert>
<one-dialog-print
:title="printtitle"
:width="printwidth"
:height="600"
:status="openprint"
:urlprint="urlprint"
@close-dialog-print="openprint = false"
></one-dialog-print>
</div>
</template>
@@ -263,10 +290,15 @@ module.exports = {
components: {
"dialog-form-voucher": httpVueLoader("./dialogFormVoucher.vue"),
"one-dialog-alert": httpVueLoader("../../common/oneDialogAlert.vue"),
"one-dialog-error": httpVueLoader("../../common/oneDialogError.vue")
"one-dialog-error": httpVueLoader("../../common/oneDialogError.vue"),
"one-dialog-print": httpVueLoader("../../common/oneDialogPrintX.vue"),
},
data() {
return {
urlprint: "",
printtitle: "",
printwidth: "60%",
openprint: false,
msgAlertDelete: "",
dialogAlertDelete: false,
xPVID: 0,
@@ -306,7 +338,7 @@ module.exports = {
},
{
text: "AKSI",
align: "left",
align: "center",
sortable: false,
value: "status",
width: "15%",
@@ -570,6 +602,15 @@ module.exports = {
this.$store.commit("voucher/update_selected_purchase", this.$store.state.voucher.details);
this.$store.commit("voucher/update_resume_total", {"totalRealitation": data.PaymentVoucherTotal} );
},
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_payment_voucher/pdf?id=" + val.PaymentVoucherID + "&username=" + username + "&tm=" + tm;
this.openprint = true;
}
},
watch: {