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,364 @@
<template>
<v-dialog v-model="dialog_confirm" persistent width="70vw">
<v-card>
<v-card-title class="headline grey lighten-2">KONFIRMASI PO JASA</v-card-title>
<v-card-text style="max-height: 80vh; overflow-y: auto;">
<!-- first row -->
<v-layout row wrap>
<v-flex xs4>
<v-text-field
v-model="formattedPODate" hide-details
label="Tanggal PO" readonly outline
></v-text-field>
</v-flex>
<v-flex xs4 pl-2>
<v-text-field
v-model="selected_pojasa.SupplierName" hide-details
label="Vendor" readonly outline
></v-text-field>
</v-flex>
<v-flex xs4 pl-2>
<v-text-field
v-model="selected_pojasa.reference" hide-details
label="Referensi" readonly outline
></v-text-field>
</v-flex>
</v-layout>
<!-- second row -->
<v-layout row wrap mt-2>
<v-flex xs4>
<v-text-field
v-model="selected_pojasa.M_BranchName"
label="Cabang" readonly outline hide-details
></v-text-field>
</v-flex>
<v-flex xs2 pl-2>
<v-text-field
v-model="selected_pojasa.typepajak" hide-details
label="Pajak (PPN)" readonly outline
></v-text-field>
</v-flex>
<v-flex xs2 pl-2>
<v-text-field
v-if="selected_pojasa.typepajak == 'percent'"
v-model="selected_pojasa.valuepajak" hide-details
label="Jumlah Pajak" readonly outline suffix="%"
></v-text-field>
<v-text-field
v-else hide-details outline prefix="Rp."
v-model="formattedPajak"
label="Jumlah Pajak" readonly
></v-text-field>
</v-flex>
<v-flex xs2 pl-2>
<v-text-field
v-model="selected_pojasa.typediskon" hide-details
label="Diskon" readonly outline
></v-text-field>
</v-flex>
<v-flex xs2 pl-2>
<v-text-field
v-if="selected_pojasa.typediskon == 'percent'"
v-model="selected_pojasa.valuediskon" hide-details
label="Jumlah Diskon" readonly outline suffix="%"
></v-text-field>
<v-text-field
v-else hide-details outline prefix="Rp."
v-model="formattedDiskon"
label="Jumlah Diskon" readonly
></v-text-field>
</v-flex>
</v-layout>
<!-- third row -->
<v-layout row wrap mt-2>
<v-flex xs3>
<v-text-field
v-model="selected_pojasa.typekontrak" outline
label="Jenis Kontrak" readonly hide-details
></v-text-field>
</v-flex>
<v-flex xs3 pl-2>
<v-text-field
v-model="formattedKontrakStartDate" hide-details
label="Tanggal Mulai Kontrak" readonly outline
></v-text-field>
</v-flex>
<v-flex xs3 pl-2>
<v-text-field
v-model="formattedKontrakEndDate" hide-details
label="Tanggal Akhir Kontrak" readonly outline
></v-text-field>
</v-flex>
<v-flex xs3 pl-2>
<v-text-field
v-model="selected_pojasa.PIOutQty" hide-details
label="Jumlah PI keluar" readonly outline
></v-text-field>
</v-flex>
</v-layout>
<v-textarea
v-model="selected_pojasa.catatan" auto-grow readonly
rows="1" outline label="Catatan" hide-details class="mt-2"
></v-textarea>
<!-- detail table -->
<v-layout row wrap class="mt-2">
<v-flex xs12>
<v-data-table
:headers="headers" :items="selected_pojasa.detail" :expand="expand"
class="elevation-1" hide-actions item-key="M_ItemCode"
>
<template v-slot:items="props">
<tr @click="props.expanded = !props.expanded">
<td class="text-xs-center pa-2">
<v-icon>{{ props.expanded
? "keyboard_arrow_down"
: "keyboard_arrow_right"
}}</v-icon>
</td>
<td class="text-xs-center pa-2">{{ props.item.M_ItemDesc }}</td>
<td class="text-xs-center pa-2">{{ props.item.RequestQty }}</td>
<td class="text-xs-center pa-2">
Rp. {{ formatCurrency(props.item.SupplierPrice) }}
</td>
<td class="text-xs-center pa-2">
Rp. {{ formatCurrency(props.item.DiskonAmount) }}
</td>
<td class="text-xs-center pa-2">
Rp. {{ formatCurrency(props.item.EndPrice) }}
</td>
<td class="text-xs-center pa-2">
Rp. {{ formatCurrency(props.item.TempTotal) }}
</td>
</tr>
</template>
<template v-slot:expand="props">
<v-card flat>
<v-card-text>
<v-data-table
:headers="headers_detail" class="elevation-0"
:items="props.item.detail" hide-actions
>
<template v-slot:items="obj">
<tr>
<td class="text-xs-center pa-2">{{ obj.item.M_ItemDesc }}</td>
<td class="text-xs-center pa-2">{{ obj.item.PurchaseRequestNumber }}</td>
<td class="text-xs-center pa-2">{{ obj.item.M_BranchName }}</td>
<td class="text-xs-center pa-2">{{ obj.item.RequestQty }}</td>
<td class="text-xs-center pa-2">{{ obj.item.ItemUnitName }}</td>
<td class="text-xs-center pa-2">
{{ formatCurrency(obj.item.SupplierPrice) }}
</td>
</tr>
</template>
</v-data-table>
</v-card-text>
</v-card>
</template>
<template v-slot:footer>
<tr>
<td colspan="1" class="text-xs-left pa-2"></td>
<td colspan="5" class="text-xs-left pa-2">
<strong>JUMLAH</strong>
</td>
<td colspan="1" class="text-xs-center pa-2">
<strong>Rp. {{ formatCurrency(selected_pojasa.summary.subtotal) }}</strong>
</td>
</tr>
<tr>
<td colspan="1" class="text-xs-left pa-2"></td>
<td colspan="5" class="text-xs-left pa-2">
<strong>DISKON</strong>
</td>
<td colspan="1" class="text-xs-center pa-2">
<strong>Rp. {{ formatCurrency(selected_pojasa.summary.diskon) }}</strong>
</td>
</tr>
<tr>
<td colspan="1" class="text-xs-left pa-2"></td>
<td colspan="5" class="text-xs-left pa-2">
<strong>PAJAK</strong>
</td>
<td colspan="1" class="text-xs-center pa-2">
<strong>Rp. {{ formatCurrency(selected_pojasa.summary.pajak) }}</strong>
</td>
</tr>
<tr>
<td colspan="1" class="text-xs-left pa-2"></td>
<td colspan="5" class="text-xs-left pa-2">
<strong>TOTAL</strong>
</td>
<td colspan="1" class="text-xs-center pa-2">
<strong>Rp. {{ formatCurrency(selected_pojasa.summary.total) }}</strong>
</td>
</tr>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-btn @click="viewAttachment()" color="info" class="white--text">Attachment</v-btn>
<v-spacer></v-spacer>
<v-btn @click="batalKonfirmasi()" color="error" class="white--text">Batal</v-btn>
<v-btn v-if="!detail_view" @click="KonfirmasiJasa()" color="primary" class="white--text">
{{ selected_pojasa.verifiedby == '0' ? "Verifikasi" : "Approve" }}
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
expand: false,
headers: [
{
text: "", align: "center", sortable: false,
value: "item", width: "5%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "ITEM", align: "center", sortable: false,
value: "item", width: "20%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JUMLAH", align: "center", sortable: false,
value: "qty", width: "10%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "HARGA", align: "center", sortable: false,
value: "price", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "DISKON", align: "center", sortable: false,
value: "disc", width: "20%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "HARGA SETELAH DISKON", align: "center", sortable: false,
value: "disc", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "TOTAL", align: "center", sortable: false,
value: "disc", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
],
headers_detail: [
{
text: "NAMA PRODUK", align: "center", sortable: false,
value: "prod", width: "25%", class: "pa-1 blue lighten-4 black--text",
},
{
text: "NO REQUEST", align: "center", sortable: false,
value: "noreq", width: "20%", class: "pa-1 blue lighten-4 black--text",
},
{
text: "REQUESTER", align: "center", sortable: false,
value: "req", width: "20%", class: "pa-1 blue lighten-4 black--text",
},
{
text: "JUMLAH", align: "center", sortable: false,
value: "qty", width: "10%", class: "pa-1 blue lighten-4 black--text",
},
{
text: "UNIT", align: "center", sortable: false,
value: "unit", width: "10%", class: "pa-1 blue lighten-4 black--text",
},
{
text: "HARGA", align: "center", sortable: false,
value: "price", width: "15%", class: "pa-1 blue lighten-4 black--text",
}
]
}
},
computed: {
loading_process() {
return this.$store.state.poservice.loading_process
},
selected_pojasa() {
return this.$store.state.poservice.selected_pojasa
},
formattedPODate() {
return this.formatDate(this.selected_pojasa.podate)
},
formattedKontrakStartDate() {
return this.formatDate(this.selected_pojasa.kontrakstart)
},
formattedKontrakEndDate() {
return this.formatDate(this.selected_pojasa.kontrakend)
},
formattedPajak() {
return this.formatCurrency(this.selected_pojasa.valuepajak)
},
formattedDiskon() {
return this.formatCurrency(this.selected_pojasa.valuediskon)
},
detail_view() {
return this.$store.state.poservice.detail_view
},
dialog_confirm: {
get() {
return this.$store.state.poservice.dialog_confirm
},
set(val) {
this.$store.commit("poservice/update_dialog_confirm", val)
}
},
snackbar: {
get() {
return this.$store.state.poservice.snackbar
},
set(val) {
this.$store.commit("poservice/update_snackbar", val)
}
}
},
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, ".");
},
viewAttachment() {
let item = this.selected_pojasa
let param = {
TJasaID: item.T_KontrakJasaID,
poID: item.PurchaseOrderID
}
this.$store.dispatch("poservice/lookupAttachment", param)
this.$store.commit("poservice/update_dialog_attachment", true)
},
batalKonfirmasi() {
this.$store.commit("poservice/update_selected_pojasa", {
summary: {
subtotal: 0.00,
diskon: 0.00,
pajak: 0.00,
total: 0.00
}
})
this.dialog_confirm = false
},
KonfirmasiJasa() {
if (!this.loading_process) {
this.$store.dispatch("poservice/updateApprovePO");
} else {
let snac = {color: 'warning', msg: 'proses sedang berjalan', state: true}
this.snackbar = snac
}
}
}
}
</script>

View File

@@ -0,0 +1,104 @@
<template>
<div>
<v-dialog v-model="dialog_attachment" persistent max-width="60vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
VIEW ATTACHMENT
</v-card-title>
<v-card-text>
<v-layout row wrap>
<v-flex
v-for="(nota) in prview_attachment"
xs4 class="pa-2" :key="nota.attach_id"
>
<div style="position: relative; padding-bottom: 35px;">
<v-img
:src="makeImageURL(nota)" aspect-ratio="1" contain
class="grey lighten-2" @click="fullview(nota)"
></v-img>
</div>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn @click="tutupViewAttachment()" color="error" class="white--text">Tutup</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialog_fullview" persistent max-width="60vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
{{ view_title }}
</v-card-title>
<v-card-text style="max-height: 80vh; overflow-y: auto;">
<div class="pa-2">
<v-img :src="view_url" contain class="grey lighten-2"></v-img>
</div>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn class="mr-2" color="red" flat outline @click="dialog_fullview = false">
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<style>
.close-button {
position: absolute;
top: 5px;
right: 5px;
z-index: 1;
cursor: pointer;
}
</style>
<script>
module.exports = {
data() {
return {
dialog_fullview: false,
view_title: "",
view_url: ""
}
},
computed: {
dialog_attachment: {
get() {
return this.$store.state.poservice.dialog_attachment
},
set(val) {
this.$store.commit("poservice/update_dialog_attachment", val)
}
},
prview_attachment() {
return this.$store.state.poservice.prview_attachment
}
},
methods: {
makeImageURL(nota) {
const year = new Date(nota.created).getFullYear();
const baseURL = BASE_URL + `/one-media/order-jasa/${year}/`;
return baseURL + nota.img_url;
},
fullview(nota) {
this.view_title = nota.img_url;
this.view_url = this.makeImageURL(nota)
this.dialog_fullview = true;
},
tutupViewAttachment() {
this.view_title = ""
this.view_url = ""
this.dialog_attachment = false
}
},
watch: {
},
}
</script>

View File

@@ -0,0 +1,275 @@
<template>
<div>
<v-toolbar color="primary" dark>
<v-toolbar-title class="white--text">APPROVE PURCHASE ORDER JASA</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="filterjasa.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="filterjasa.enddate" no-title
@input="menuEnddateFilter = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs3 pl-2>
<v-autocomplete
:items="liststatus" hide-details outline
v-model="filterjasa.status" label="Status"
></v-autocomplete>
</v-flex>
<v-flex xs3 pl-2>
<v-text-field
v-model="filterjasa.search" hide-details outline
label="Cari" placeholder="cai nomor po..."
></v-text-field>
</v-flex>
</v-layout>
</v-card>
<v-card class="pa-2 mt-2">
<v-data-table
:headers="headers" :items="list_pojasa.records"
class="elevation-1" hide-actions
>
<template v-slot:items="props">
<tr>
<td class="text-xs-center pa-2">{{ props.item.PurchaseOrderNumber }}</td>
<td class="text-xs-center pa-2">{{ props.item.PurchaseOrderDate }}</td>
<td class="text-xs-center pa-2">{{ props.item.SupplierName }}</td>
<td class="text-xs-center pa-2">{{ props.item.M_BranchName }}</td>
<td class="text-xs-center pa-2">{{ props.item.PurchaseOrderNote }}</td>
<td class="text-xs-center pa-2">
Rp. {{ formatCurrency(props.item.PurchaseOrderGrandTotal) }}
</td>
<td class="text-xs-center pa-2">{{ props.item.PurchaseOrderStatus }}</td>
<td class="text-xs-center pa-2">
<v-layout
v-if="props.item.PurchaseOrderStatus != 'Draft'"
align-center justify-center row
>
<v-flex shrink pr-1>
<v-btn
color="warning" @click="viewdetail(props.item)" small
>
detail
<v-icon small right>list_alt</v-icon>
</v-btn>
<v-chip
v-if="props.item.approvedby != '0'"
label color="success" text-color="white"
>
APPROVED
</v-chip>
</v-flex>
<v-flex pl-1 v-if="props.item.approvedby == '0'">
<v-btn
color="info" @click="updateStatusPO(props.item)" small
:disabled="userinfo.M_UserM_ApproveLevelID != '1'"
:outline="props.item.verifiedby == '0'"
>
verifikasi
<v-icon small right>done</v-icon>
</v-btn>
<v-btn
color="success" @click="updateStatusPO(props.item)" small
:disabled="userinfo.M_UserM_ApproveLevelID != '2'"
:outline="props.item.PurchaseOrderStatus != 'Approved'"
>
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="po-2 mt-1 text-xs-center">
<v-pagination v-model="currpage" :length="pagelength" :total-visible="10"></v-pagination>
</div>
</v-card>
<v-snackbar v-model="snackbar.state" multi-line top :timeout="3000" :color="snackbar.color">
{{ snackbar.msg }}
<v-btn class="ml-2" round flat @click="snackbar.state = false">Tutup</v-btn>
</v-snackbar>
<dialog-confirm></dialog-confirm>
<dialog-attachs></dialog-attachs>
</div>
</template>
<script>
module.exports = {
components: {
'dialog-confirm': httpVueLoader('./dialog-confirm.vue'),
'dialog-attachs': httpVueLoader('./dialog-view-attachment.vue')
},
mounted() {
this.$store.dispatch("poservice/lookupVendor")
this.$store.dispatch("poservice/lookupCabang")
this.$store.dispatch("poservice/lookupPOJasa")
this.$store.dispatch("poservice/lookupUserApproveLevel")
},
data() {
return {
menuStartdateFilter: false,
menuEnddateFilter: false,
headers: [
{
text: "No PO", align: "center", sortable: false,
value: "action", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "TANGGAL", align: "center", sortable: false,
value: "date", width: "10%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "VENDOR", align: "center", sortable: false,
value: "supplier", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "CABANG", align: "center", sortable: false,
value: "branch", width: "10%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "KETERANGAN", align: "center", sortable: false,
value: "note", width: "20%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "TOTAL", align: "center", sortable: false,
value: "total", width: "10%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "STATUS", align: "center", sortable: false,
value: "status", width: "7%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "AKSI", align: "center", sortable: false,
value: "action", width: "13%", class: "pa-1 blue lighten-3 white--text",
},
]
}
},
computed: {
filterjasa: {
get() {
return this.$store.state.poservice.filterjasa;
},
set(val) {
this.$store.commit("poservice/update_filterjasa", val);
}
},
formattedStartdate() {
return this.formatDate(this.filterjasa.startdate)
},
formattedEnddate() {
return this.formatDate(this.filterjasa.enddate)
},
liststatus() {
return this.$store.state.poservice.liststatus
},
list_pojasa() {
return this.$store.state.poservice.list_pojasa
},
pagelength() {
let total = this.list_pojasa.total
if (total === undefined || total < 1) return 1
return Math.ceil(total/10)
},
userinfo() {
return this.$store.state.poservice.userinfo
},
loading_process() {
return this.$store.state.poservice.loading_process
},
currpage: {
get() {
return this.$store.state.poservice.currpage
},
set(val) {
this.$store.commit("poservice/update_currpage", val)
this.$store.dispatch("poservice/lookupPOJasa")
}
},
snackbar: {
get() {
return this.$store.state.poservice.snackbar
},
set(val) {
this.$store.commit("poservice/update_snackbar", val)
}
}
},
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, ".");
},
updateStatusPO(item) {
let poid = item.PurchaseOrderID
let userlevel = this.userinfo.M_UserM_ApproveLevelID
if (item.verifiedby == '0' || userlevel != '1') {
this.$store.dispatch("poservice/lookupDetailPO", poid)
this.$store.commit("poservice/update_detail_view", false)
this.$store.commit("poservice/update_dialog_confirm", true)
} else {
let snac = {color: 'info', msg: 'po sudah diverifikasi', state: true}
this.snackbar = snac
}
},
viewdetail(item) {
this.$store.dispatch("poservice/lookupDetailPO", item.PurchaseOrderID)
this.$store.commit("poservice/update_detail_view", true)
this.$store.commit("poservice/update_dialog_confirm", true)
}
},
watch: {
filterjasa: {
handler(val) {
this.$store.dispatch("poservice/lookupPOJasa")
},
deep: true
}
},
}
</script>