add modules folder based on s_menu

This commit is contained in:
2026-06-30 10:16:11 +07:00
parent 315b657ee3
commit a1aab09ac9
625 changed files with 192283 additions and 794 deletions

View File

@@ -0,0 +1,282 @@
<template>
<v-dialog v-model="dialog_detail" persistent width="85vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
DETAIL PAYMENT INSTRUCTION {{ selected_payment.SupplierPaymentNumber ?? "" }}
</v-card-title>
<v-card-text>
<v-layout row wrap>
<v-flex xs3>
<div class="label-value subheading mb-2">
<span class="label">Nomor Payment</span>
</div>
</v-flex>
<v-flex xs9>
<div class="label-value subheading mb-2">
<span class="value">: {{ selected_payment.SupplierPaymentNumber }}</span>
</div>
</v-flex>
<v-flex xs3>
<div class="label-value subheading mb-2">
<span class="label">Tanggal</span>
</div>
</v-flex>
<v-flex xs9>
<div class="label-value subheading mb-2">
<span class="value">
: {{ selected_payment.SupplierPaymentDate }}
</span>
</div>
</v-flex>
<v-flex xs3>
<div class="label-value subheading mb-2">
<span class="label">Nomor PI</span>
</div>
</v-flex>
<v-flex xs9>
<div class="label-value subheading mb-2">
<span class="value">: {{ selected_payment.SupplierInvoiceNumber }}</span>
</div>
</v-flex>
<v-flex xs3>
<div class="label-value subheading mb-2">
<span class="label">Supplier</span>
</div>
</v-flex>
<v-flex xs9>
<div class="label-value subheading mb-2">
<span class="value">: {{ selected_payment.SupplierName }}</span>
</div>
</v-flex>
<v-flex xs3>
<div class="label-value subheading mb-2">
<span class="label">Tanggal Rencana Bayar</span>
</div>
</v-flex>
<v-flex xs9>
<div class="label-value subheading mb-2">
<span class="value">
: {{ selected_payment.SupplierInvoiceDraftPaymentDate }}
</span>
</div>
</v-flex>
<v-flex xs3>
<div class="label-value subheading mb-2">
<span class="label">Total Bayar</span>
</div>
</v-flex>
<v-flex xs9>
<div class="label-value subheading mb-2">
<span class="value">
: Rp. {{ formatCurrency(selected_payment.SupplierPaymentAmount) }}
</span>
</div>
</v-flex>
</v-layout>
<v-divider class="my-1"></v-divider>
<div class="mt-2">
<v-data-table
:headers="headers" :items="payment_items.detail"
hide-actions class="elevation-1"
>
<template v-slot:items="props">
<tr>
<td class="text-xs-center">{{ props.item.M_ItemDesc }}</td>
<td class="text-xs-center">{{ props.item.SupplierInvoiceDetailQty }}</td>
<td class="text-xs-center">
Rp. {{ formatCurrency(props.item.SupplierInvoiceDetailPrice) }}
</td>
<td class="text-xs-center">
Rp. {{ formatCurrency(props.item.SupplierInvoiceDetailDiscountAmount) }}
</td>
<td class="text-xs-center">
Rp. {{ formatCurrency(props.item.DiscountedPrice) }}
</td>
<td class="text-xs-center">
Rp. {{ formatCurrency(props.item.SupplierInvoiceDetailTotal) }}
</td>
</tr>
</template>
<template v-slot:footer>
<tr>
<td :colspan="4">
<strong class="ml-2">SUBTOTAL</strong>
</td>
<td :colspan="2" class="text-xs-right">
<strong>
Rp. {{ formatCurrency(payment_items.SupplierInvoiceSubTotal) }}
</strong>
</td>
</tr>
<tr v-if="payment_items.SupplierInvoiceShippingCost > 0.00">
<td :colspan="4">
<strong class="ml-2">BIAYA PENGIRIMAN</strong>
</td>
<td :colspan="2" class="text-xs-right">
<strong>
Rp. {{ formatCurrency(payment_items.SupplierInvoiceShippingCost) }}
</strong>
</td>
</tr>
<tr>
<td :colspan="4">
<strong class="ml-2">DISKON</strong>
</td>
<td :colspan="2" class="text-xs-right">
<v-chip
v-if="payment_items.SupplierInvoiceDiscountPercent > 0.00" label
>{{ payment_items.SupplierInvoiceDiscountPercent }} %</v-chip>
<strong>
Rp. {{ formatCurrency(payment_items.SupplierInvoiceDiscountAmount) }}
</strong>
</td>
</tr>
<tr>
<td :colspan="4">
<strong class="ml-2">PAJAK</strong>
</td>
<td :colspan="2" class="text-xs-right">
<v-chip
v-if="payment_items.SupplierInvoiceTaxPercentPpn > 0.00" label
>{{ payment_items.SupplierInvoiceTaxPercentPpn }} %</v-chip>
<strong>
Rp. {{ formatCurrency(payment_items.SupplierInvoiceTaxAmountPpn) }}
</strong>
</td>
</tr>
<tr>
<td :colspan="4">
<strong class="ml-2">GRAND TOTAL</strong>
</td>
<td :colspan="2" class="text-xs-right">
<strong>
Rp. {{ formatCurrency(payment_items.SupplierInvoiceGrandTotal) }}
</strong>
</td>
</tr>
</template>
</v-data-table>
</div>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" outline flat @click="dialog_detail = false">TUTUP</v-btn>
<v-btn
v-show="operation_mode == 'update'"
color="success" outline flat
@click="updateStatusPayment()"
>
{{ userinfo.level == '1'
? "VERIFIKASI"
: "APPROVE"
}}
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<style scoped>
.label-value subheading mb-2 {
display: flex;
flex-direction: column;
margin-bottom: 1rem;
}
.label {
font-weight: bold;
margin-bottom: 0.25rem;
}
.value {
font-size: 1rem;
}
</style>
<script>
module.exports = {
data() {
return {
headers: [
{
text: "ITEM", align: "center", sortable: false,
value: "M_ItemCode", width: "25%", class: "blue lighten-3 white--text",
},
{
text: "QTY", align: "center", sortable: false,
value: "PoQty", width: "10%", class: "blue lighten-3 white--text",
},
{
text: "HARGA", align: "center", sortable: false,
value: "price", width: "15%", class: "blue lighten-3 white--text",
},
{
text: "DISKON", align: "center", sortable: false,
value: "price", width: "15%", class: "blue lighten-3 white--text",
},
{
text: "HARGA SETELAH DISKON", align: "center", sortable: false,
value: "price", width: "15%", class: "blue lighten-3 white--text",
},
{
text: "TOTAL", align: "center", sortable: false,
value: "Total", width: "15%", class: "blue lighten-3 white--text",
}
]
}
},
computed: {
dialog_detail: {
get() {
return this.$store.state.suppayment.dialog_detail;
},
set(val) {
this.$store.commit("suppayment/update_dialog_detail", val);
}
},
selected_payment: {
get() {
return this.$store.state.suppayment.selected_payment;
},
set(val) {
this.$store.commit("suppayment/update_selected_payment", val);
}
},
payment_items() {
return this.$store.state.suppayment.payment_items;
},
userinfo() {
return this.$store.state.suppayment.userinfo
},
operation_mode() {
return this.$store.state.suppayment.operation_mode;
},
operation_loading() {
return this.$store.state.suppayment.operation_loading;
}
},
methods: {
formatCurrency(value) {
const num = parseFloat(value);
if (isNaN(num)) return 0;
return num.toFixed(2).replace('.', ',').replace(/\B(?=(\d{3})+(?!\d))/g, ".");
},
updateStatusPayment() {
let loading = this.operation_loading;
if (loading) {
const snack = { state: true, color: 'warning', message: 'proses masih berjalan' }
this.$store.commit("suppayment/update_snackbar", snack)
} else {
this.$store.dispatch("suppayment/updateStatus")
}
}
},
}
</script>

View File

@@ -0,0 +1,264 @@
<template>
<div>
<v-toolbar color="primary" dark>
<v-toolbar-title class="white--text">PAYMENT APPROVAL</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card class="pa-2">
<v-layout row align-center>
<v-flex xs3>
<v-menu
v-model="menuStartdateFilter" offset-y lazy min-width="290px"
transition="scale-transition" max-width="290px" full-width
:nudge-right="40" :close-on-content-click="false"
>
<template v-slot:activator="{on}">
<v-text-field
v-model="formattedStartdate" label="Tanggal Awal"
hide-details readonly v-on="on" outline
></v-text-field>
</template>
<v-date-picker
v-model="filterpay.startdate" no-title
@input="menuStartdateFilter = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs3 pl-2>
<v-menu
v-model="menuEnddatefilter" offset-y lazy min-width="290px"
transition="scale-transition" max-width="290px" full-width
:nudge-right="40" :close-on-content-click="false"
>
<template v-slot:activator="{on}">
<v-text-field
v-model="formattedEnddate" label="Tanggal Akhir"
hide-details readonly v-on="on" outline
></v-text-field>
</template>
<v-date-picker
v-model="filterpay.enddate" no-title
@input="menuEnddatefilter = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs3 pl-2>
<v-autocomplete
:items="list_status" hide-details outline
v-model="filterpay.status" label="Status"
></v-autocomplete>
</v-flex>
<v-flex xs3 pl-2>
<v-text-field
v-model="filterpay.search" hide-details outline
label="Cari" placeholder="No. PI / Pembayaran"
></v-text-field>
</v-flex>
</v-layout>
</v-card>
<v-card class="pa-2 mt-2">
<v-data-table
:headers="headers" class="elevation-1"
:items="list_payment.records" hide-actions
>
<template v-slot:items="props">
<tr>
<td class="text-xs-center">{{ props.item.SupplierInvoiceNumber }}</td>
<td class="text-xs-center">{{ props.item.SupplierPaymentDate }}</td>
<td class="text-xs-center">{{ props.item.SupplierInvoiceDraftPaymentDate }}</td>
<td class="text-xs-center">{{ props.item.SupplierPaymentNumber }}</td>
<td class="text-xs-center">{{ props.item.SupplierName }}</td>
<td class="text-xs-center">
Rp. {{ formatCurrency(props.item.SupplierPaymentAmount) }}
</td>
<td class="text-xs-center">{{ props.item.SupplierPaymentStatus }}</td>
<td class="text-xs-center">
<v-layout align-center justify-center row>
<v-flex shrink pr-1>
<v-btn color="info" @click="viewDetail(props.item)" small>
DETAIL
<v-icon small right>list_alt</v-icon>
</v-btn>
</v-flex>
<v-flex pl-1 v-if="props.item.SupplierPaymentStatus != 'Approved'">
<v-btn
color="success" @click="updateStatusPayment(props.item)"
:disabled="userinfo.level != '1'" small
:outline="props.item.SupplierPaymentIsVerif != 'Y'"
>
{{ props.item.SupplierPaymentIsVerif != 'Y'
? "VERIFIKASI"
: "VERIFIED"
}}
<v-icon small right>done</v-icon>
</v-btn>
<v-btn
color="success" @click="updateStatusPayment(props.item)"
:disabled="userinfo.level != '2'" small
:outline="props.item.SupplierPaymentIsApproved != 'Y'"
>
APPROVE
<v-icon small right>done_all</v-icon>
</v-btn>
</v-flex>
</v-layout>
</td>
</tr>
</template>
</v-data-table>
<v-divider class="my-1"></v-divider>
<div class="pa-2 mt-1 text-xs-center">
<v-pagination
v-model="currentpage" :length="datarowlength"
:total-visible="10"
></v-pagination>
</div>
</v-card>
<v-snackbar v-model="snackbar.state" multi-line top :timeout="3000" :color="snackbar.color">
{{ snackbar.message }}
<v-btn class="ml-2" round flat @click="snackbar.state = false">Tutup</v-btn>
</v-snackbar>
<dialog-detail></dialog-detail>
</div>
</template>
<script>
module.exports = {
components: {
'dialog-detail': httpVueLoader('./dialog-detail.vue'),
},
mounted() {
this.$store.dispatch("suppayment/lookupUserApproveLevel");
this.$store.dispatch("suppayment/lookupPayment");
},
data() {
return {
menuStartdateFilter: false,
menuEnddatefilter: false,
headers: [
{
text: "NO TAGIHAN", align: "center", sortable: false,
value: "no", width: "15%", class: "blue lighten-3 white--text",
},
{
text: "TANGGAL", align: "center", sortable: false,
value: "no", width: "10%", class: "blue lighten-3 white--text",
},
{
text: "TANGGAL RENCANA BAYAR", align: "center", sortable: false,
value: "no", width: "10%", class: "blue lighten-3 white--text",
},
{
text: "NO. INSTRUKSI", align: "center", sortable: false,
value: "no",width: "15%", class: "blue lighten-3 white--text",
},
{
text: "SUPPLIER", align: "center", sortable: false,
value: "no", width: "15%", class: "blue lighten-3 white--text",
},
{
text: "TOTAL BAYAR", align: "center", sortable: false,
value: "", width: "10%", class: "blue lighten-3 white--text",
},
{
text: "STATUS", align: "center", sortable: false,
value: "", width: "5%", class: "blue lighten-3 white--text",
},
{
text: "AKSI", align: "center", sortable: false,
value: "", width: "15%", class: "blue lighten-3 white--text",
},
]
}
},
computed: {
filterpay: {
get() {
return this.$store.state.suppayment.filterpay;
},
set(val) {
this.$store.commit("suppayment/update_filterpay", val);
}
},
currentpage: {
get() {
return this.$store.state.suppayment.currentpage;
},
set(val) {
this.$store.commit("suppayment/update_currentpage", val);
this.$store.dispatch("suppayment/lookupPayment");
}
},
snackbar: {
get() {
return this.$store.state.suppayment.snackbar
},
set(val) {
this.$store.commit("suppayment/update_snackbar", val)
}
},
formattedStartdate() {
return this.formatDate(this.filterpay.startdate);
},
formattedEnddate() {
return this.formatDate(this.filterpay.enddate);
},
list_status() {
return this.$store.state.suppayment.list_status;
},
list_payment() {
return this.$store.state.suppayment.list_payment;
},
datarowlength() {
const total = this.list_payment.total;
if (total === undefined || total < 1) return 1;
return Math.ceil(total/5);
},
userinfo() {
return this.$store.state.suppayment.userinfo
}
},
methods: {
formatDate(date) {
if (!date) return null;
const [year, month, day] = date.split('-');
return `${day}-${month}-${year}`;
},
formatCurrency(value) {
const num = parseFloat(value);
if (isNaN(num)) return 0;
return num.toFixed(2).replace('.', ',').replace(/\B(?=(\d{3})+(?!\d))/g, ".");
},
viewDetail(item) {
this.$store.commit("suppayment/update_operation_mode", 'view');
this.$store.commit("suppayment/update_selected_payment", item);
this.$store.dispatch("suppayment/lookupPaymentItem");
this.$store.commit("suppayment/update_dialog_detail", true);
},
updateStatusPayment(item) {
if (item.SupplierPaymentIsVerif == 'Y' && this.userinfo == "1") {
const snack = { state: true, color: 'info', message: 'sudah diverifikasi' };
this.snackbar = snack;
return;
}
this.$store.commit("suppayment/update_operation_mode", 'update');
this.$store.commit("suppayment/update_selected_payment", item);
this.$store.dispatch("suppayment/lookupPaymentItem");
this.$store.commit("suppayment/update_dialog_detail", true);
}
},
watch: {
filterpay: {
handler(val) {
this.$store.dispatch("suppayment/lookupPayment")
},
deep: true
}
},
}
</script>