add button report pr non persediaan

This commit is contained in:
Hanan Askarim
2026-07-20 16:42:49 +07:00
parent 4c7ef4dce7
commit e0536e554d
4 changed files with 89 additions and 16 deletions

View File

@@ -111,7 +111,7 @@
{{ props.item.PurchaseRequestDirectStatus }} {{ props.item.PurchaseRequestDirectStatus }}
</v-chip> </v-chip>
</td> </td>
<td class="text-xs-center pa-2"> <td class="text-xs-center pa-2" style="white-space: nowrap;">
<div v-if="props.item.PurchaseRequestDirectStatus != 'Draft'"> <div v-if="props.item.PurchaseRequestDirectStatus != 'Draft'">
<v-btn <v-btn
v-if="props.item.PurchaseRequestDirectStatus == 'Pending'" v-if="props.item.PurchaseRequestDirectStatus == 'Pending'"
@@ -400,7 +400,7 @@ module.exports = {
}, },
{ {
text: "TOTAL", align: "left", sortable: false, text: "TOTAL", align: "left", sortable: false,
value: "description", width: "20%", class: "blue lighten-3 white--text", value: "description", width: "15%", class: "blue lighten-3 white--text",
}, },
{ {
text: "STATUS", align: "center", sortable: false, text: "STATUS", align: "center", sortable: false,
@@ -408,7 +408,7 @@ module.exports = {
}, },
{ {
text: "AKSI", align: "center", sortable: false, text: "AKSI", align: "center", sortable: false,
value: "action", width: "10%", class: "blue lighten-3 white--text", value: "action", width: "15%", class: "blue lighten-3 white--text",
}, },
], ],
detail_headers: [ detail_headers: [

View File

@@ -204,6 +204,7 @@
> >
<td <td
class="text-xs-center pa-2" class="text-xs-center pa-2"
style="white-space: nowrap;"
v-bind:class="{ v-bind:class="{
'amber lighten-4': isSelected(props.item), 'amber lighten-4': isSelected(props.item),
}" }"
@@ -229,6 +230,7 @@
<template v-else> <template v-else>
<td <td
class="text-xs-center pa-2" class="text-xs-center pa-2"
style="white-space: nowrap;"
v-bind:class="{ v-bind:class="{
'amber lighten-4': isSelected(props.item), 'amber lighten-4': isSelected(props.item),
}" }"

View File

@@ -101,32 +101,78 @@
</td> </td>
<template v-if="props.item.prStatus == 'Draft'"> <template v-if="props.item.prStatus == 'Draft'">
<td class="text-xs-center pa-2 pr-5" v-bind:class="{ <td class="text-xs-center pa-2" style="white-space: nowrap;" v-bind:class="{
'amber lighten-4': isSelected(props.item), 'amber lighten-4': isSelected(props.item),
}"> }">
<v-icon small @click="editRequest(props.item)">edit</v-icon> <v-btn
<v-icon small @click="deleteRequest(props.item)">delete</v-icon> style="min-width: 25px; height: 25px; margin: 0;"
@click="editRequest(props.item)"
small title="Edit"
color="black"
>
<v-icon small color="white">edit</v-icon>
</v-btn>
<v-btn
style="min-width: 25px; height: 25px; margin: 0;"
@click="deleteRequest(props.item)"
small title="Hapus"
color="red"
>
<v-icon small color="white">delete</v-icon>
</v-btn>
</td> </td>
</template> </template>
<template v-else-if="props.item.prStatus == 'Pending'"> <template v-else-if="props.item.prStatus == 'Pending'">
<td class="text-xs-center pa-2 pr-5" v-bind:class="{ <td class="text-xs-center pa-2" style="white-space: nowrap;" v-bind:class="{
'amber lighten-4': isSelected(props.item), 'amber lighten-4': isSelected(props.item),
}"> }">
<v-icon small @click="previewRequest(props.item)">receipt</v-icon> <v-btn
style="min-width: 25px; height: 25px; margin: 0;"
@click="previewRequest(props.item)"
small title="Preview Request"
color="blue"
>
<v-icon small color="white">receipt</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>
</template> </template>
<template v-else-if="hasHandover(props.item.itemHandedOver)"> <template v-else-if="hasHandover(props.item.itemHandedOver)">
<td class="text-xs-center pa-2 pr-5" <td class="text-xs-center pa-2" style="white-space: nowrap;"
v-bind:class="{ 'amber lighten-4': isSelected(props.item), }"> v-bind:class="{ 'amber lighten-4': isSelected(props.item), }">
<v-btn color="success" prepend-icon="mdi-check-circle" <v-btn color="success" prepend-icon="mdi-check-circle"
@click="confirmHandover(props.item)"> @click="confirmHandover(props.item)">
Konfirmasi Terima Konfirmasi Terima
</v-btn> </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>
</template> </template>
<template v-else> <template v-else>
<td class="text-xs-center pa-2 pr-5" <td class="text-xs-center pa-2" style="white-space: nowrap;"
v-bind:class="{ 'amber lighten-4': isSelected(props.item), }"></td> v-bind:class="{ 'amber lighten-4': isSelected(props.item), }">
<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>
</template> </template>
</template> </template>
</v-data-table> </v-data-table>
@@ -151,6 +197,15 @@
<one-dialog-alert :status="dialogAlertDeleteDetail" :msg="msgAlertDeleteRequest" <one-dialog-alert :status="dialogAlertDeleteDetail" :msg="msgAlertDeleteRequest"
@forget-dialog-alert="dialogAlertDeleteDetail = false" @forget-dialog-alert="dialogAlertDeleteDetail = false"
@close-dialog-alert="closeAndDeleteDetail()"></one-dialog-alert> @close-dialog-alert="closeAndDeleteDetail()"></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> </div>
</template> </template>
@@ -184,9 +239,14 @@ module.exports = {
"dialog-confirm-handover": httpVueLoader("./dialogConfirmHandover.vue"), "dialog-confirm-handover": httpVueLoader("./dialogConfirmHandover.vue"),
"one-dialog-alert": httpVueLoader("../../common/oneDialogAlert.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() { data() {
return { return {
urlprint: "",
printtitle: "",
printwidth: "60%",
openprint: false,
msgAlertDeleteRequest: "", msgAlertDeleteRequest: "",
dialogAlertDeleteRequest: false, dialogAlertDeleteRequest: false,
dialogAlertDeleteDetail: false, dialogAlertDeleteDetail: false,
@@ -225,10 +285,10 @@ module.exports = {
}, },
{ {
text: "AKSI", text: "AKSI",
align: "left", align: "center",
sortable: false, sortable: false,
value: "action", value: "action",
width: "5%", width: "15%",
class: "blue lighten-3 white--text", class: "blue lighten-3 white--text",
}, },
], ],
@@ -692,6 +752,15 @@ module.exports = {
this.$store.commit("requester/updateSelectedMainTable", item); this.$store.commit("requester/updateSelectedMainTable", item);
this.$store.commit("requester/updateDialogConfirmHandover", true); this.$store.commit("requester/updateDialogConfirmHandover", true);
}, },
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_stock_request_np/pdf?id=" + val.prId + "&username=" + username + "&tm=" + tm;
this.openprint = true;
},
}, },
}; };
</script> </script>

View File

@@ -211,7 +211,8 @@
v-if="props.item.prStatus == 'Draft'" v-if="props.item.prStatus == 'Draft'"
> >
<td <td
class="text-xs-center pa-2 pr-5" class="text-xs-center pa-2"
style="white-space: nowrap;"
v-bind:class="{ v-bind:class="{
'amber lighten-4': isSelected(props.item), 'amber lighten-4': isSelected(props.item),
}" }"
@@ -236,7 +237,8 @@
</template> </template>
<template v-else> <template v-else>
<td <td
class="text-xs-center pa-2 pr-5" class="text-xs-center pa-2"
style="white-space: nowrap;"
v-bind:class="{ v-bind:class="{
'amber lighten-4': isSelected(props.item), 'amber lighten-4': isSelected(props.item),
}" }"
@@ -380,7 +382,7 @@ module.exports = {
align: "center", align: "center",
sortable: false, sortable: false,
value: "action", value: "action",
width: "10%", width: "15%",
class: "blue lighten-3 white--text", class: "blue lighten-3 white--text",
}, },
], ],