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,130 @@
<template>
<div>
<v-dialog v-model="dialog_receive" persistent width="25vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
Receive Item
</v-card-title>
<v-card-text>
<v-layout row wrap>
<v-flex xs12 v-for="(item, index) in receive_items" :key="item.StockStockNumber">
<v-layout row wrap>
<v-flex v-if="s_suratjalan.i_tftype === 'Persediaan'" xs6 class="pr-2">
<p class="body-2 mb-0">Nomor batch: {{ item.StockBatchNo }}</p>
<p class="body-2 mb-0">Expired: {{ item.StockED }}</p>
</v-flex>
<v-flex v-else xs6 class="pr-2">
<p class="body-2 mb-0">Nomor: {{ item.StockStockNumber }}</p>
</v-flex>
<v-flex xs3 class="pr-1">
<p class="body-2 mb-0">Quantity:</p>
<p class="body-2 mb-0">{{ item.QtyReq }} {{ item.ItemUnitName }}</p>
</v-flex>
<v-flex xs3 class="pl-1">
<v-text-field
single-line type="number" outline hide-details
label="Jumlah" v-model="item.QtyReceive"
></v-text-field>
</v-flex>
</v-layout>
<v-divider v-if="index + 1 < receive_items.length" :key="`divider-${index}`" class="mt-2 mb-2"></v-divider>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" @click="batalItem()">BATAL</v-btn>
<v-btn color="primary" @click="simpanItem()">SIMPAN</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
module.exports = {
data() {
return {
}
},
computed: {
dialog_receive: {
get() {
return this.$store.state.suratjalan.dialog_receive
},
set(val) {
this.$store.commit("suratjalan/update_dialog_receive", val)
}
},
receive_items: {
get() {
return this.$store.state.suratjalan.receive_items
},
set(val) {
this.$store.commit("suratjalan/update_receive_items", val)
}
},
buffer_item: {
get() {
return this.$store.state.suratjalan.buffer_item
},
set(val) {
this.$store.commit("suratjalan/update_buffer_item", val)
}
},
s_suratjalan: {
get() {
return this.$store.state.suratjalan.s_suratjalan
},
set(val) {
this.$store.commit("suratjalan/update_s_suratjalan", val)
}
},
},
methods: {
batalItem() {
this.receive_items = []
this.buffer_item = {}
this.dialog_receive = false
},
simpanItem() {
let current = this.s_suratjalan
let buffer_item = this.buffer_item
let new_item = this.receive_items
let qty = 0
let isError = false
new_item.forEach(element => {
let req = Number(element.QtyReq)
let rec = Number(element.QtyReceive)
if (rec <= 0 || rec > req) {
isError = true
}
qty = qty + rec
});
if (isError) {
let sn = { isOpen: true, color: "error", msg: "[Error] cek jumlah barang yang diterima" }
this.$store.commit("suratjalan/update_snackbar", sn)
return
}
current.detail.forEach(obj => {
if (obj.SuratJalanDetailID === buffer_item.SuratJalanDetailID) {
obj.ItemRequest = new_item
obj.SuratJalanDetailQtyReceived = qty
}
});
this.s_suratjalan = current
this.receive_items = []
this.buffer_item = {}
this.dialog_receive = false
}
},
}
</script>

View File

@@ -0,0 +1,277 @@
<template>
<v-card class="pa-2">
<v-snackbar
v-model="snackbar.isOpen" :timeout="3000" :multi-line="false"
:vertical="false" :top="true" :color="snackbar.color"
>
{{ snackbar.msg }}
<v-btn flat @click="closeSnackbar()">Tutup</v-btn>
</v-snackbar>
<h3>NOMOR : {{ this.s_suratjalan.SuratJalanNumber ?? '-' }}</h3>
<h3>STATUS : {{ this.s_suratjalan.i_status }}</h3>
<!-- form -->
<v-layout row wrap class="mt-2">
<!-- 1st row -->
<v-flex xs6 class="pr-1">
<v-autocomplete
v-model="s_suratjalan.i_tftype" label="Jenis Transfer" outline
hide-details :items="['Persediaan', 'Non Persediaan']" disabled
></v-autocomplete>
</v-flex>
<v-flex xs6 class="pl-1">
<v-autocomplete
v-model="s_suratjalan.i_tfrequest" label="Transfer Request Number"
outline hide-details return-object disabled
:items="l_tfrequest" item-text="T_GoodsTransferNum"
>
<template v-slot:item="data">
<v-list-tile-content>
<v-list-tile-title>
{{ data.item.T_GoodsTransferNum }}
</v-list-tile-title>
<v-list-tile-sub-title>
Type: {{ data.item.T_GoodsTransferType == 'P' ? 'Persediaan' : 'Non Persediaan'}},
Tanggal: {{ data.item.T_GoodsTransferDate }}
</v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<!-- 2nd row -->
<v-flex xs6 class="pr-1 pt-2">
<v-text-field
v-model="sjDateFormated" label="Tanggal"
readonly outline hide-details disabled
></v-text-field>
</v-flex>
<v-flex xs6 class="pl-1 pt-2">
<v-autocomplete
v-model="s_suratjalan.i_isInternal" :items="['Internal', 'Eksternal']"
outline hide-details label="Jenis Kurir" disabled
></v-autocomplete>
</v-flex>
<!-- 3rd row -->
<v-flex xs4 class="pr-1 pt-2">
<v-autocomplete
v-model="s_suratjalan.i_ekspedisi" :items="l_ekspedisi" label="Ekspedisi"
outline hide-details return-object item-text="ExpeditionName" disabled
></v-autocomplete>
</v-flex>
<v-flex xs4 class="px-1 pt-2">
<v-autocomplete
v-model="s_suratjalan.i_staff" :items="l_staff" label="Staff"
outline hide-details return-object item-text="ExpeditionStaffName" disabled
></v-autocomplete>
</v-flex>
<v-flex xs4 class="pl-1 pt-2">
<v-text-field
v-model="s_suratjalan.i_phone" label="Nomor HP"
outline hide-details disabled
></v-text-field>
</v-flex>
<!-- 4th row -->
<v-flex xs12 class="pt-2">
<v-textarea
v-model="s_suratjalan.i_notes" label="Catatan"
outline hide-details disabled
></v-textarea>
</v-flex>
<v-flex xs12 class="pt-2">
<v-autocomplete
v-model="s_suratjalan.i_receivewarehouse" :items="l_warehouse" return-object
label="Gudang Penerima" class="mini-select" item-text="WarehouseName"
:disabled="isVerif()" flat outline hide-no-data hide-details
></v-autocomplete>
</v-flex>
<v-flex xs12 class="pt-2">
<v-textarea
v-model="s_suratjalan.i_receivenotes" label="Catatan Penerima"
outline hide-details :disabled="isVerif()"
></v-textarea>
</v-flex>
</v-layout>
<div>
<v-data-table
:headers="headers" :items="s_suratjalan.detail"
hide-actions class="elevation-1 mb-2 mt-4"
>
<template v-slot:items="props">
<td class="text-xs-center pa-2">{{ (props.index + 1) }}</td>
<td class="text-xs-center pa-2">{{ props.item.M_ItemDesc }}</td>
<td class="text-xs-center pa-2">
<div v-if="s_suratjalan.i_tftype === 'Persediaan'">
<p v-for="obj in props.item.ItemRequest" class="body-1 mb-0">
Batch: {{ obj.StockBatchNo }}, Jumlah: {{ obj.QtyReq }} {{ obj.ItemUnitName }}
</p>
</div>
<div v-else>
<p v-for="obj in props.item.ItemRequest" class="body-1 mb-0">
Nomor: {{ obj.StockStockNumber }}, Jumlah: {{ obj.QtyReq }} {{ obj.ItemUnitName }}
</p>
</div>
</td>
<td class="text-xs-center pa-2">{{ props.item.SuratJalanDetailQty }} {{ props.item.ItemUnitName ?? '-' }}</td>
<td class="text-xs-center pa-2">
<span class="body-2">{{ props.item.SuratJalanDetailQty }} / {{ props.item.SuratJalanDetailQtyReceived }}</span>
<v-btn small icon @click="editBatch(props.item)" :disabled="isdisabled()" class="pl-2">
<v-icon small color="blue">edit</v-icon>
</v-btn>
</td>
<!-- <td class="text-xs-center pa-2">{{ props.item.ItemUnitName ?? '-' }}</td> -->
</template>
</v-data-table>
<v-divider></v-divider>
</div>
<v-layout row wrap>
<v-flex grow class="pr-1 mt-2">
<v-btn
outline color="primary" class="white--text" @click="confirmSJ()"
:disabled="isdisabled()"
>
Confirm
<v-icon v-show="s_suratjalan.i_isConfirmed == 'Y'" right>check_circle</v-icon>
</v-btn>
</v-flex>
<v-flex shrink class="pl-1 mt-2">
<!-- <v-btn outline color="primary" class="white--text" @click="cancelSJ()">Batal</v-btn> -->
<v-btn
color="primary" :disabled="isdisabled()"
class="white--text" @click="simpanDetailSJ()"
>
Simpan
</v-btn>
</v-flex>
</v-layout>
</v-card>
</template>
<script>
module.exports = {
data() {
return {
headers: [
{
text: "No.", align: "center", sortable: false,
value: "requestDate", width: "5%", class: "blue lighten-3 white--text",
},
{
text: "ITEM", align: "center", sortable: false,
value: "requestDate", width: "30%", class: "blue lighten-3 white--text",
},
{
text: "DETAIL", align: "center", sortable: false,
value: "requestDate", width: "30%", class: "blue lighten-3 white--text",
},
{
text: "KUANTITAS", align: "center", sortable: false,
value: "requestDate", width: "15%", class: "blue lighten-3 white--text",
},
{
text: "KUANTITAS DITERIMA", align: "center", sortable: false,
value: "requestDate", width: "20%", class: "blue lighten-3 white--text",
},
]
}
},
computed: {
snackbar: {
get() {
return this.$store.state.suratjalan.snackbar
},
set(val) {
this.$store.commit("suratjalan/update_snackbar", val)
}
},
s_suratjalan: {
get() {
return this.$store.state.suratjalan.s_suratjalan
},
set(val) {
this.$store.commit("suratjalan/update_s_suratjalan", val)
}
},
dialog_receive: {
get() {
return this.$store.state.suratjalan.dialog_receive
},
set(val) {
this.$store.commit("suratjalan/update_dialog_receive", val)
}
},
sjDateFormated() {
return this.formatDate(this.s_suratjalan.i_date)
},
l_ekspedisi() {
return this.$store.state.suratjalan.l_ekspedisi
},
l_staff() {
return this.$store.state.suratjalan.l_staff
},
l_tfrequest() {
return this.$store.state.suratjalan.l_tfrequest
},
l_warehouse() {
return this.$store.state.suratjalan.l_warehouse
},
},
methods: {
closeSnackbar() {
let x = {isOpen: false, color: "", message: ""}
this.snackbar = x
},
formatDate(date) {
if (!date) return null
const [year, month, day] = date.split("-")
return `${day}-${month}-${year}`
},
isVerif() {},
isdisabled() {
const sj = this.s_suratjalan
let len = Object.keys(sj).length
let status = sj.i_status
let confirmed = sj.i_isConfirmed
if (len <= 0 || status !== 'Process' || confirmed === 'Y') {
return true
} else {
return false
}
},
editBatch(item) {
if (Object.keys(item).length <= 0) {
return
}
let copy = JSON.parse(JSON.stringify(item))
this.$store.commit("suratjalan/update_receive_items", copy.ItemRequest)
this.$store.commit("suratjalan/update_buffer_item", copy)
this.dialog_receive = true
},
simpanDetailSJ() {
let sj = this.s_suratjalan
if (Object.keys(sj.i_receivewarehouse).length <= 0) {
return
}
this.$store.dispatch("suratjalan/saveReceveiSJ")
},
confirmSJ() {
let sj = this.s_suratjalan
if (Object.keys(sj.i_receivewarehouse).length <= 0) {
return
}
sj.i_status = "Completed"
this.$store.dispatch("suratjalan/saveReceveiSJ")
// this.$store.dispatch("suratjalan/testinput")
}
},
}
</script>

View File

@@ -0,0 +1,238 @@
<template>
<v-layout class="fill-height" column>
<v-toolbar color="primary" dark>
<v-toolbar-title class="white--text">RECEIVE SURAT JALAN</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card class="pa-2">
<v-layout row wrap>
<v-flex xs2 class="pr-1">
<v-menu
v-model="menuStartDate" lazy offset-y full-width
:close-on-content-click="false" :nudge-right="40"
transition="scale-transition" max-width="290px" min-width="290px"
>
<template v-slot:activator="{on}">
<v-text-field
v-model="startDateFormated" label="Tanggal Akhir"
readonly outline hide-details v-on="on"
></v-text-field>
</template>
<v-date-picker no-title v-model="f_startdate" @input="menuStartDate = false"></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs2 class="px-1">
<v-menu
v-model="menuEndDate" lazy offset-y full-width
:close-on-content-click="false" :nudge-right="40"
transition="scale-transition" max-width="290px" min-width="290px"
>
<template v-slot:activator="{on}">
<v-text-field
v-model="endDateFormated" label="Tanggal Akhir"
readonly outline hide-details v-on="on"
></v-text-field>
</template>
<v-date-picker no-title v-model="f_enddate" @input="menuEndDate = false"></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs3 class="px-1">
<v-autocomplete
v-model="f_cabang" :items="l_cabang" label="Cabang"
outline hide-details return-object item-text="M_BranchName"
></v-autocomplete>
</v-flex>
<v-flex xs2 class="px-1">
<v-autocomplete
v-model="f_status" :items="l_status"
outline hide-details label="status"
></v-autocomplete>
</v-flex>
<v-flex xs2 class="px-1">
<v-text-field
v-model="f_search" label="No Surat Jalan"
outline hide-details
></v-text-field>
</v-flex>
<v-flex xs1 class="pl-1">
<v-btn
dark color="primary" @click="searchSuratJalan()"
style="min-width: 50px; height: 100%; margin: 0;"
>
<v-icon>search</v-icon>
</v-btn>
</v-flex>
</v-layout>
</v-card>
<v-card class="pa-2 mt-2">
<v-data-table :headers="headers" :items="l_suratjalan" hide-actions class="elevation-1 mb-2">
<template v-slot:items="props">
<tr @click="selectSJ(props.item)" :class="{'yellow lighten-4':selected(props.item)}">
<td class="text-xs-center pa-2">{{ props.item.SuratJalanNumber }}</td>
<td class="text-xs-center pa-2">{{ props.item.M_BranchName }}</td>
<td class="text-xs-center pa-2">{{ props.item.M_StaffName }}</td>
<td class="text-xs-center pa-2">{{ props.item.SuratJalanReceivedDate }}</td>
<td class="text-xs-center pa-2">
<span v-if="props.item.SuratJalanReceivedConfirmed == 'N'">Belum Konfirmasi</span>
<span v-else="props.item.SuratJalanReceivedConfirmed == 'Y'">Sudah Konfirmasi</span>
</td>
<td class="text-xs-center pa-2">
<v-chip small text-color="white" :color="statusColor(props.item)">
{{ props.item.SuratJalanStatus }}
</v-chip>
</td>
</tr>
</template>
</v-data-table>
<v-divider></v-divider>
<div class="pa-2 mt-2 text-xs-center">
<v-pagination v-model="paginat" :length="paginat_len" :total-visible="5"></v-pagination>
</div>
</v-card>
</v-layout>
</template>
<script>
module.exports = {
mounted() {
this.$store.dispatch("suratjalan/LookupBranches")
this.$store.dispatch("suratjalan/LookupEkpedisi")
this.$store.dispatch("suratjalan/LookupEkspedisiStaff")
this.$store.dispatch("suratjalan/LookupWarehouse")
// this.$store.dispatch("suratjalan/LookupSuratJalan")
},
data() {
return {
menuStartDate: false,
menuEndDate: false,
headers: [
{
text: "SURAT JALAN", align: "center", sortable: false,
value: "requestDate", width: "15%", class: "blue lighten-3 white--text",
},
{
text: "CABANG", align: "center", sortable: false,
value: "requestDate", width: "20%", class: "blue lighten-3 white--text",
},
{
text: "STAFF PENERIMA", align: "center", sortable: false,
value: "requestDate", width: "20%", class: "blue lighten-3 white--text",
},
{
text: "TANGGAL TERIMA", align: "center", sortable: false,
value: "requestDate", width: "15%", class: "blue lighten-3 white--text",
},
{
text: "KONFIRMASI", align: "center", sortable: false,
value: "requestDate", width: "15%", class: "blue lighten-3 white--text",
},
{
text: "STATUS", align: "center", sortable: false,
value: "requestDate", width: "15%", class: "blue lighten-3 white--text",
}
]
}
},
computed: {
f_startdate: {
get() {
return this.$store.state.suratjalan.f_startdate
},
set(val) {
this.$store.commit("suratjalan/update_f_startdate", val)
}
},
f_enddate: {
get() {
return this.$store.state.suratjalan.f_enddate
},
set(val) {
this.$store.commit("suratjalan/update_f_enddate", val)
}
},
f_cabang: {
get() {
return this.$store.state.suratjalan.f_cabang
},
set(val) {
this.$store.commit("suratjalan/update_f_cabang", val)
}
},
f_status: {
get() {
return this.$store.state.suratjalan.f_status
},
set(val) {
this.$store.commit("suratjalan/update_f_status", val)
}
},
f_search: {
get() {
return this.$store.state.suratjalan.f_search
},
set(val) {
this.$store.commit("suratjalan/update_f_search", val)
}
},
paginat: {
get() {
return this.$store.state.suratjalan.paginat
},
set(val) {
this.$store.commit("suratjalan/update_paginat", val)
this.$store.dispatch("suratjalan/listingSuratJalan");
}
},
paginat_len() {
let total = this.$store.state.suratjalan.l_total_page
if (total === undefined || total == 0) {
return 1
}
return Math.ceil(total/10)
},
startDateFormated() {
return this.formatDate(this.f_startdate)
},
endDateFormated() {
return this.formatDate(this.f_enddate)
},
l_suratjalan() {
return this.$store.state.suratjalan.l_suratjalan
},
l_cabang() {
return this.$store.state.suratjalan.l_cabang
},
l_status() {
return this.$store.state.suratjalan.l_status
},
},
methods: {
formatDate(date) {
if (!date) return null
const [year, month, day] = date.split("-")
return `${day}-${month}-${year}`
},
searchSuratJalan() {
this.$store.dispatch("suratjalan/LookupSuratJalan")
},
selectSJ(item) {
this.$store.dispatch("suratjalan/LookupDetailSuratJalan", {id: item.SuratJalanID})
},
selected(item) {
return item.SuratJalanID == this.$store.state.suratjalan.s_suratjalan.SuratJalanID
},
statusColor(item) {
switch (item.SuratJalanStatus) {
case "Process":
return "warning"
case "Completed":
return "success"
default:
return "gray"
}
}
},
}
</script>