first commit + add fe component vue accone

This commit is contained in:
2026-05-07 17:10:10 +07:00
parent fd8e4d694b
commit 38a182641a
327 changed files with 263946 additions and 0 deletions

View File

@@ -0,0 +1,162 @@
<template>
<v-dialog v-model="dialog_batch_item" persistent width="30vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
EDIT QTY {{ selected_item_forbatch.M_ItemCode }}
{{ selected_item_forbatch.M_ItemDesc }}
</v-card-title>
<v-card-text>
<p class="font-weight-bold">
Jumlah item yang dapat diterima : {{ selected_item_forbatch.qty }}
{{ selected_item_forbatch.ItemUnitName }}
</p>
<div v-for="(item, index) in item_batch_temp" class="mt-2" :key="index">
<v-layout row wrap>
<v-flex xs2 class="pr-1">
<v-text-field v-model.number="item.qty" type="number" min="0" hide-details label="qty"
outline step="1"></v-text-field>
</v-flex>
</v-layout>
</div>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red" flat @click="tutupDialog()">Tutup</v-btn>
<v-btn color="green" flat @click="simpanBatch()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
}
},
computed: {
dialog_batch_item: {
get() {
return this.$store.state.form.dialog_batch_item;
},
set(val) {
this.$store.commit("form/update_dialog_batch_item", val);
}
},
selected_item_forbatch: {
get() {
return this.$store.state.form.selected_item_forbatch;
},
set(val) {
this.$store.commit("form/update_selected_item_forbatch", val);
}
},
item_batch_temp: {
get() {
return this.$store.state.form.item_batch_temp;
},
set(val) {
this.$store.commit("form/update_item_batch_temp", val);
}
},
form_receive_item: {
get() {
return this.$store.state.form.form_receive_item;
},
set(val) {
this.$store.commit("form/update_form_receive_item", val);
}
}
},
methods: {
tutupDialog() {
this.selected_item_forbatch = {};
this.item_batch_temp = [];
this.dialog_batch_item = false;
},
simpanBatch() {
const temp = this.item_batch_temp;
let curr_item = JSON.parse(JSON.stringify(this.selected_item_forbatch));
let final_arr = [];
const maxQty = Number(curr_item.qty);
let total = 0;
let isError = false;
temp.forEach(item => {
if (curr_item.M_ItemItem_CategoryID == '1') {
if (item.batchno != '' && item.qty > 0) {
total = Number(item.qty) + total;
final_arr.push(item);
} else {
isError = true;
}
} else {
if (Number(item.qty) > 0) {
total = Number(item.qty) + total;
final_arr.push(item);
}
}
});
if (total > maxQty || total <= 0 || isError) {
this.$store.commit("ro/update_snackbar", {
color: 'error',
msg: 'Jumlah total melebihi jumlah yang dapat diterima',
isOpen: true
});
return;
}
let item_received = JSON.parse(JSON.stringify(this.form_receive_item));
item_received.forEach(obj => {
if (obj.keyID === curr_item.keyID) {
obj.batchlist = final_arr;
obj.receivedQty = total;
}
});
this.form_receive_item = item_received;
this.selected_item_forbatch = {};
this.item_batch_temp = [];
this.dialog_batch_item = false;
},
addInputRow() {
const input = {
qty: 0,
batchno: '',
item_category: 0,
menuDate: false
};
this.item_batch_temp.push(input);
},
reAddInputRow(data) {
if (!data.batchlist) {
return;
}
data.batchlist.forEach(element => {
let inputrow = {
qty: element.qty,
batchno: element.batchno,
menuDate: false
};
this.item_batch_temp.push(inputrow);
});
},
removeInputRow(index) {
this.item_batch_temp.splice(index, 1)
}
},
watch: {
selected_item_forbatch(val, old) {
if (val == old) return;
if (!val) return;
this.reAddInputRow(val)
}
},
}
</script>

View File

@@ -0,0 +1,98 @@
<template>
<v-dialog v-model="dialog_handover" persistent width="40vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
SERAH TERIMA BARANG INVENTARIS
</v-card-title>
<v-card-text>
<p>Apakah Anda yakin ingin melakukan serah terima barang inventaris kepada user pemohon di ruangan <b>{{ selected_ro.M_RuanganName }}</b>?</p>
<v-form ref="formhandover" lazy-validation v-model="valid_formhandover">
<v-layout row mt-2>
<v-flex xs6 pr-1>
<v-autocomplete
label="Staff Penerima*" outline
:rules="rules_staff" return-object
v-model="selected_staff" :items="list_staff"
item-text="M_UserUsername" item-value="M_UserID"
></v-autocomplete>
</v-flex>
</v-layout>
</v-form>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red" flat outline @click="closeHandOver()">Batal</v-btn>
<v-btn color="green" flat outline @click="simpanHandOver()">Ya, Serahkan Barang</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
valid_formhandover: true,
rules_staff: [v => (v && Object.keys(v).length > 0) || 'Staff harus diisi'],
}
},
computed: {
dialog_handover: {
get() {
return this.$store.state.ro.dialog_handover
},
set(val) {
this.$store.commit("ro/update_dialog_handover", val)
}
},
selected_staff: {
get() {
return this.$store.state.ro.selected_staff
},
set(val) {
this.$store.commit("ro/update_selected_staff", val)
}
},
selected_item_received: {
get() {
return this.$store.state.form.selected_item_received
},
set(val) {
this.$store.commit("form/update_selected_item_received", val)
}
},
selected_ro: {
get() {
return this.$store.state.ro.selected_ro
},
set(val) {
this.$store.commit("ro/update_selected_ro", val);
}
},
list_staff() {
return this.$store.state.ro.list_staff
}
},
methods: {
closeHandOver() {
this.$store.commit("ro/update_selected_staff", {});
this.dialog_handover = false
this.$refs.formhandover.resetValidation();
},
async simpanHandOver() {
if (this.$refs.formhandover.validate()) {
let prm = {
staffID: this.selected_staff.M_UserID,
receiveOrderPoID: this.selected_ro.ReceiveOrderPoID,
ruanganID: this.selected_ro.M_RuanganID
}
await this.$store.dispatch("ro/saveHandover", prm);
this.$refs.formhandover.resetValidation();
}
},
},
}
</script>

View File

@@ -0,0 +1,177 @@
<template>
<v-dialog v-model="dialog_barcode" persistent max-width="600">
<v-card>
<v-card-title style="color: #fff" class="headline grey darken-1">Cetak Barcode</v-card-title>
<v-card-text>
<v-layout pa-2 class="grey lighten-2" row>
<v-flex xs1>
<v-checkbox style="padding-top: 0; margin-top: 0" hide-details color="grey darken-1"
:indeterminate="indeterminatex" @change="changeCbxAll(bar_chx_all)" v-model="bar_chx_all">
</v-checkbox>
</v-flex>
<v-flex xs5> ITEM </v-flex>
<v-flex xs5> NUMBER BARCODE </v-flex>
<v-flex xs1> CETAK </v-flex>
</v-layout>
<v-layout align-center pa-2 v-for="(vs, idx) in barcodes" :key="vs.id" class="grey lighten-4" row>
<v-flex xs1>
<v-checkbox style="padding-top: 0; margin-top: 0" color="grey darken-1" hide-details v-model="vs.chex"
@change="checkTop()"></v-checkbox>
</v-flex>
<v-flex xs5>
{{ vs.M_ItemDesc }}
</v-flex>
<v-flex xs5>
{{ vs.T_BarcodeBarangNumber }}
</v-flex>
<v-flex xs1>
<span @click="printSingleBarcode(vs)"
class="icon-medium-fill-base-small xs1 white--text grey darken-1 ml-1 icon-print"></span>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="grey darken-1" flat @click="dialog_barcode = false">Tutup</v-btn>
<!-- <v-btn dark color="grey darken-3" @click="printRobo"
>Cetak Robo
</v-btn> -->
<v-btn dark color="grey darken-1" @click="printMultipleBarcode">Cetak terpilih [ {{ selected_barcode.length }}
]</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
valid_formhandover: true
}
},
computed: {
dialog_barcode: {
get() {
return this.$store.state.ro.dialog_barcode
},
set(val) {
this.$store.commit("ro/update_dialog_barcode", val)
}
},
barcodes: {
get() {
return this.$store.state.ro.barcodes
},
set(val) {
this.$store.commit("ro/update_barcodes", val)
}
},
selected_item_received: {
get() {
return this.$store.state.form.selected_item_received
},
set(val) {
this.$store.commit("form/update_selected_item_received", val)
}
},
selected_ro: {
get() {
return this.$store.state.ro.selected_ro
},
set(val) {
this.$store.commit("ro/update_selected_ro", val);
}
},
list_staff() {
return this.$store.state.ro.list_staff
},
urlQrCode: {
get() {
return this.$store.state.ro.urlQrCode;
},
set(val) {
this.$store.commit("ro/update_urlQrCode", val);
},
},
indeterminatex: {
get() {
return this.$store.state.ro.indeterminatex;
},
set(val) {
this.$store.commit("ro/update_indeterminatex", val);
},
},
bar_chx_all: {
get() {
return this.$store.state.ro.bar_chx_all;
},
set(val) {
this.$store.commit("ro/update_bar_chx_all", val);
},
},
selected_barcode: {
get() {
return this.$store.state.ro.selected_barcode;
},
set(val) {
this.$store.commit("ro/update_selected_barcode", val);
},
},
},
methods: {
changeCbxAll(value) {
var arr = this.barcodes;
this.indeterminatex = false;
arr.forEach((el) => {
el.chex = value;
});
var selected = _.filter(arr, function (o) {
return o.chex;
});
this.selected_barcode = selected;
},
checkTop() {
var barcodes = this.barcodes;
var selected = _.filter(barcodes, function (o) {
return o.chex;
});
this.bar_chx_all = false;
this.indeterminatex = false;
if (selected.length > 0 && barcodes.length === selected.length) {
this.bar_chx_all = true;
this.indeterminatex = false;
}
if (selected.length > 0 && barcodes.length > selected.length) {
this.bar_chx_all = false;
this.indeterminatex = true;
}
this.selected_barcode = selected;
console.log(selected);
},
printSingleBarcode(value) {
var inp = {
nama_item: value.M_ItemDesc,
no_inv: value.T_BarcodeBarangNumber,
lokasi: value.M_RuanganName,
cabang: value.M_BranchName
};
one_print_qrcode_inv(inp);
},
printMultipleBarcode() {
var barcodes = this.selected_barcode;
barcodes.forEach(value => {
var inp = {
nama_item: value.M_ItemDesc,
no_inv: value.T_BarcodeBarangNumber,
lokasi: value.M_RuanganName,
cabang: value.M_BranchName
};
one_print_qrcode_inv(inp);
});
},
},
}
</script>

View File

@@ -0,0 +1,96 @@
<template>
<div>
<!-- dialog konfirmasi -->
<v-dialog v-model="dialog_confirmation" persistent width="500">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
KONFIRMASI
<p class="mb-0 p-0">{{ selected_ro.ReceiveOrderPoNumber }}</p>
</v-card-title>
<v-card-text>
<p>
Setelah dikonfirmasi RO
<span class="font-weight-bold">{{ selected_ro.ReceiveOrderPoNumber }}</span>
tidak bisa di edit dan auto buat jurnal, apakah anda yakin ?
</p>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red" flat @click="dialog_confirmation = false">
TIDAK
</v-btn>
<v-btn color="green" flat @click="konfirmRO()">
YA
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- dialog delete -->
<v-dialog v-model="dialog_delete" persistent width="500">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
KONFIRMASI HAPUS
<p class="mb-0 p-0">{{ selected_ro.ReceiveOrderPoNumber }}</p>
</v-card-title>
<v-card-text>
<p>
Apakah anda yakin menghapus data berikut
<span class="font-weight-bold">{{ selected_ro.ReceiveOrderPoNumber }}</span>
?
</p>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red" flat outline @click="dialog_delete = false">
TIDAK
</v-btn>
<v-btn color="green" flat outline @click="deleteRO()">
YA
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
module.exports = {
data() {
return {
}
},
computed: {
dialog_confirmation: {
get() {
return this.$store.state.ro.dialog_confirmation;
},
set(val) {
this.$store.commit("ro/update_dialog_confirmation", val);
}
},
dialog_delete: {
get() {
return this.$store.state.ro.dialog_delete;
},
set(val) {
this.$store.commit("ro/update_dialog_delete", val);
}
},
selected_ro() {
return this.$store.state.ro.selected_ro;
}
},
methods: {
konfirmRO() {
this.$store.dispatch("form/confirmRO");
},
deleteRO() {
this.$store.dispatch("ro/deleteRO");
}
},
}
</script>

View File

@@ -0,0 +1,309 @@
<template>
<v-dialog v-model="dialog_select_item" persistent width="60vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
TAMBAH ITEM
</v-card-title>
<v-card-text>
<v-autocomplete v-model="selected_po" :items="list_po" hide-details return-object flat label="Cari PO"
outline class="mb-3" item-text="PurchaseOrderNumber" @input="searchItem()"></v-autocomplete>
<!-- list item per po -->
<v-data-table v-model="select_item_temp" :headers="headers" :items="display_list_itempo" hide-actions
select-all item-key="PoItemReceiveID" class="elevation-1">
<template v-slot:headers="props">
<tr>
<th width="10%" class="blue lighten-3 white--text">
<v-checkbox :input-value="props.all" :indeterminate="props.indeterminate" primary
hide-details @click.stop="toggleAll(props)"></v-checkbox>
</th>
<th v-for="header in props.headers" :key="header.text" :width="header.width"
:class="header.class">
{{ header.text }}
</th>
</tr>
</template>
<template v-slot:items="props">
<tr :active="props.selected" @click="selectItemRow(props)">
<td>
<v-checkbox v-if="hideCheckbox(props)" :input-value="props.selected" primary
hide-details></v-checkbox>
</td>
<td class="text-xs-center">{{ props.item.M_ItemCode }}</td>
<td class="text-xs-center">
<p class="p-0 mb-0">{{ props.item.M_ItemDesc }}</p>
<p class="p-0 m-0">{{ props.item.WarehouseName }}</p>
</td>
<td class="text-xs-center">
{{ props.item.originalQty }} / {{ props.item.qtyRest }}
{{ props.item.ItemUnitName }}
</td>
<td class="text-xs-center">{{ props.item.qty }}</td>
</tr>
</template>
</v-data-table>
<div class="text-xs-center mt-2">
<v-pagination v-model="itempo_page" :length="total_selected_page" :total-visible="5"></v-pagination>
</div>
<!-- list item selected -->
<v-divider class="my-3"></v-divider>
<h3>ITEM DIPILIH</h3>
<v-data-table :headers="headers_selected" :items="display_selected_item" hide-actions
item-key="PoItemReceiveID" class="elevation-1 mt-3">
<template v-slot:items="props">
<tr>
<td class="text-xs-center">{{ (props.index + 1) }}</td>
<td class="text-xs-left">{{ props.item.PurchaseOrderNumber }}</td>
<td class="text-xs-left">
<p class="p-0 mb-0">{{ props.item.M_ItemCode }}</p>
<p class="p-0 mb-0">{{ props.item.M_ItemDesc }}</p>
<p class="p-0 mb-0">{{ props.item.WarehouseName }}</p>
</td>
<td class="text-xs-center">
{{ props.item.originalQty }} / {{ props.item.qtyRest }}
{{ props.item.ItemUnitName }}
</td>
<td class="text-xs-center">
<v-text-field v-model="props.item.qty" class="my-2" hide-details outline type="number"
min="0" :max="parseInt(props.item.qtyRest)" step="1"></v-text-field>
</td>
<td class="text-xs-center">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn style="min-width: 30px; height: 30px; margin: 0;" outline small
@click="removeItem(props)" color="red lighten-2">
<v-icon small color="red" v-on="on">delete</v-icon>
</v-btn>
</template>
<span>Hapus</span>
</v-tooltip>
</td>
</tr>
</template>
</v-data-table>
<div class="text-xs-center mt-2">
<v-pagination v-model="curr_sel_page" :length="total_selected_page"
:total-visible="5"></v-pagination>
</div>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red" flat @click="tutupDialog()">Tutup</v-btn>
<v-btn color="green" flat @click="simpanItem()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
headers: [
{
text: "ITEM CODE ", align: "left", sortable: false, value: "M_ItemCode",
width: "20%", class: "pa-2 pl-2 blue lighten-3 white--text",
},
{
text: "NAME", align: "left", sortable: false, value: "M_ItemDesc",
width: "30%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY", align: "left", sortable: false, value: "ItemUnitName",
width: "25%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY RECEIVED", align: "left", sortable: false, value: "qty",
width: "25%", class: "pa-2 blue lighten-3 white--text",
},
],
itempo_page: 1,
itempo_perpage: 5,
headers_selected: [
{
text: "NO", align: "center", sortable: false, value: "no",
width: "5%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "No. PO", align: "center", sortable: false, value: "po",
width: "25%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "ITEM", align: "center", sortable: false, value: "ITEM",
width: "25%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY PO", align: "center", sortable: false, value: "qty",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY RECEIVED", align: "center", sortable: false, value: "qty_ro",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "", align: "center", sortable: false, value: "qty_ro",
width: "5%", class: "pa-2 blue lighten-3 white--text",
},
],
curr_sel_page: 1,
sel_perpage: 5
}
},
computed: {
dialog_select_item: {
get() {
return this.$store.state.form.dialog_select_item;
},
set(val) {
this.$store.commit("form/update_dialog_select_item", val);
}
},
selected_po: {
get() {
return this.$store.state.form.selected_po;
},
set(val) {
this.$store.commit("form/update_selected_po", val)
}
},
select_item_temp: {
get() {
return this.$store.state.form.select_item_temp;
},
set(val) {
this.$store.commit("form/update_select_item_temp", val)
}
},
list_po: {
get() {
return this.$store.state.form.list_po;
},
set(val) {
this.$store.commit("form/update_list_po", val)
}
},
list_item_po: {
get() {
return this.$store.state.form.list_item_po;
},
set(val) {
this.$store.commit("form/update_list_item_po", val)
}
},
shipping_info: {
get() {
return this.$store.state.form.shipping_info;
},
set(val) {
this.$store.commit("form/update_shipping_info", val)
}
},
total_itempo_page() {
if (this.list_item_po.length <= 0) {
return 1;
}
return Math.ceil(this.list_item_po.length / this.itempo_perpage);
},
display_list_itempo() {
const start = (this.itempo_page - 1) * this.itempo_perpage;
const end = start + this.itempo_perpage;
return this.list_item_po.slice(start, end);
},
total_selected_page() {
if (this.select_item_temp.length <= 0) {
return 1;
}
return Math.ceil(this.select_item_temp.length / this.sel_perpage);
},
display_selected_item() {
const start = (this.curr_sel_page - 1) * this.sel_perpage;
const end = start + this.sel_perpage;
return this.select_item_temp.slice(start, end);
}
},
methods: {
tutupDialog() {
this.list_po = [];
this.selected_po = {};
this.list_item_po = [];
this.select_item_temp = [];
this.dialog_select_item = false;
},
toggleAll(data) {
if (data.all) {
// this.select_item_temp = []
return
} else {
this.select_item_temp = this.list_item_po.slice()
}
},
selectItemRow(data) {
if (!data.selected) {
data.selected = !data.selected;
};
},
hideCheckbox(data) {
return !data.selected;
},
searchItem() {
this.$store.dispatch("form/getItem");
},
removeItem(props) {
let temp = JSON.parse(JSON.stringify(this.select_item_temp));
this.select_item_temp = temp.filter(ele => ele.PoItemReceiveID !== props.item.PoItemReceiveID);
},
simpanItem() {
let temp = JSON.parse(JSON.stringify(this.select_item_temp));
let shippinginfo = [];
let isError = false
temp.forEach(element => {
if (Number(element.qty) > Number(element.qtyRest)) {
isError = true;
return;
}
let ship = {
num_po: element.PurchaseOrderNumber,
cost: element.PurchaseOrderShippingCost,
isUpfront: element.PurchaseOrderShippingCostStatus
};
const isExist = shippinginfo.some(item => item.num_po == element.PurchaseOrderNumber)
if (!isExist) {
shippinginfo.push(ship);
}
// only for type inventory
let withoutbatch = {
"qty": Number(element.qty),
"batchno": "",
"item_category": "2",
"menuDate": false
}
element.batchlist.push(withoutbatch)
});
if (isError) {
this.$store.commit("ro/update_snackbar", {
color: 'error',
msg: 'qty melebihi item yang dikirim',
isOpen: true
});
return;
}
this.$store.commit("form/update_form_receive_item", temp);
this.shipping_info = shippinginfo;
this.list_po = [];
this.selected_po = {};
this.list_item_po = [];
this.select_item_temp = [];
this.dialog_select_item = false;
}
},
}
</script>

View File

@@ -0,0 +1,232 @@
<template>
<v-dialog v-model="dialog_detail_view" width="80vw" persistent>
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
RECEIVE ITEM INVENTORY
<v-spacer></v-spacer>
</v-card-title>
<v-card-text>
<v-layout row wrap>
<!-- first row -->
<v-flex xs6>
<v-menu v-model="menuReceiveDateForm" lazy offset-y transition="scale-transition"
max-width="290px" min-width="290px" :nudge-right="40" :close-on-content-click="false">
<template v-slot:activator="{ on }">
<v-text-field :Value="receiveDateForm" label="Tanggal" class="mr-2" hide-details outline
readonly></v-text-field>
</template>
<v-date-picker no-title hide-details v-model="selected_ro.ReceiveOrderPoIDate"
@input="menuReceiveDateForm = false" readonly></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs6>
<v-autocomplete :items="list_supplier" :value="selected_ro.SupplierID" item-text="SupplierName"
item-value="SupplierID" class="mr-2" label="Supplier" outline hide-details
readonly></v-autocomplete>
</v-flex>
<!-- <v-flex xs4>
<v-text-field label="Nomor Delivery Order (DO)" class="" readonly outline
v-model="selected_ro.ReceiveOrderPoDONumber" hide-details></v-text-field>
</v-flex> -->
<!-- second row -->
<v-flex xs6>
<v-text-field label="Referensi" class="mr-2" outline readonly hide-details
v-model="selected_ro.ReceiveOrderPoRefNumber" hide-details></v-text-field>
</v-flex>
<v-flex xs6>
<v-autocomplete :items="list_warehouse" :value="selected_ro.WarehouseID"
item-text="WarehouseName" item-value="WarehouseID" label="Gudang" outline hide-details
readonly></v-autocomplete>
</v-flex>
<!-- third row -->
<v-flex xs6>
<v-autocomplete :value="selected_ro.M_RuanganID" class="mr-2 mt-3" :items="list_lokasi" outline
item-value="M_RuanganID" item-text="M_RuanganName" label="Lokasi*" hide-details
readonly></v-autocomplete>
</v-flex>
<v-flex xs6>
<v-text-field label="Biaya Ekspedisi" class="mt-3" outline readonly
v-model="selected_ro.ReceiveOrderShippingCostAmount" hide-details></v-text-field>
</v-flex>
<!-- four row -->
<v-flex xs12>
<v-textarea v-model="selected_ro.ReceiveOrderPoNote" hide-details outline auto-grow rows="1"
label="Catatan" class="mt-3" readonly></v-textarea>
</v-flex>
<!-- shipping info -->
<v-flex xs12 class="mt-3" v-if="shipping_info.length > 0">
<v-layout row wrap>
<v-flex v-for="shp in shipping_info" :key="shp.num_po" xs3>
<v-card class="pa-2 ma-2">
<div>
<span class="font-weight-bold">{{ shp.num_po }}</span><br />
<span>Rp. {{ oneMoney(shp.cost) }}</span><br />
<span v-if="shp.isUpfront === 'Y'" class="green--text">
Biaya Ekspedisi sudah di bayar
</span>
<span v-else class="red--text">
Biaya Ekspedisi belum di bayar
</span>
</div>
</v-card>
</v-flex>
</v-layout>
</v-flex>
<!-- list item received -->
<v-flex xs12 class="my-3">
<v-data-table v-if="form_receive_item.length > 0" :headers="headers" :items="form_receive_item"
hide-actions item-key="keyID" class="elevation-1">
<template v-slot:items="props">
<tr>
<td class="text-xs-left">{{ props.item.PurchaseOrderNumber }}</td>
<td class="text-xs-left">
<p class="p-0 mb-0">{{ props.item.M_ItemCode }}</p>
<p class="p-0 mb-0">{{ props.item.M_ItemDesc }}</p>
<p class="p-0 mb-0">{{ props.item.WarehouseName }}</p>
</td>
<td class="text-xs-center">{{ props.item.qty }} {{ props.item.ItemUnitName }}</td>
<td class="text-xs-center">
<div v-if="props.item.M_ItemItem_CategoryID == 2">
<p class="mb-0 pb-0" v-for="batch in props.item.batchlist">
Qty: {{ batch.qty || '' }}
</p>
</div>
</td>
<td class="text-xs-center"></td>
</tr>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="info" flat outline @click="closeRO()">Tutup</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
menuReceiveDateForm: false,
headers: [
{
text: "PO NUMBER", align: "center", sortable: false, value: "ItemUnitName",
width: "20%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "ITEM", align: "center", sortable: false, value: "M_ItemDesc",
width: "30%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY", align: "center", sortable: false, value: "qty",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "No. Batch & Exp.Date", align: "center", sortable: false, value: "qty",
width: "25%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "AKSI", align: "center", sortable: false, value: "qty",
width: "15%", class: "pa-2 blue lighten-3 white--text",
},
]
}
},
computed: {
dialog_detail_view: {
get() {
return this.$store.state.ro.dialog_detail_view;
},
set(val) {
this.$store.commit("ro/update_dialog_detail_view", val);
}
},
receiveDateForm() {
return this.formatDate(this.selected_ro.ReceiveOrderPoIDate)
},
form_receive: {
get() {
return this.$store.state.form.form_receive;
},
set(val) {
this.$store.commit("form/update_form_receive", val)
}
},
form_receive_item: {
get() {
return this.$store.state.form.form_receive_item;
},
set(val) {
this.$store.commit("form/update_form_receive_item", val)
}
},
selected_ro() {
return this.$store.state.ro.selected_ro
},
list_supplier() {
return this.$store.state.ro.list_supplier
},
list_warehouse() {
return this.$store.state.ro.list_warehouse
},
shipping_info() {
return this.$store.state.form.shipping_info
},
list_lokasi() {
return this.$store.state.ro.list_lokasi
},
},
methods: {
checkObjectEmpty(obj) {
if (obj === null || obj === undefined || typeof obj !== "object") {
return true;
}
return Object.keys(obj).length === 0 && obj.constructor === Object;
},
formatDate(date) {
if (!date) return null;
const [year, month, day] = date.split("-");
return `${day}-${month}-${year}`;
},
oneMoney(value) {
let cleanValue = String(value).replace(/\D/g, '');
const num = parseInt(cleanValue, 10);
if (isNaN(num)) {
return '';
}
return num.toLocaleString('id-ID');
},
pilihItemRO() {
let temp = this.form_receive_item
if (temp.length > 0) {
this.$store.commit("form/update_select_item_temp", temp);
}
this.$store.dispatch("form/getPurchaseOrder");
this.$store.commit("form/update_dialog_select_item", true);
},
removeItem(props) {
let temp = JSON.parse(JSON.stringify(this.form_receive_item));
let newt = temp.filter((item) => item.PoItemReceiveID !== props.item.PoItemReceiveID);
this.form_receive_item = newt;
},
closeRO() {
this.$store.dispatch("form/resetForm");
this.$store.commit("ro/update_selected_ro", {});
this.dialog_detail_view = false;
},
},
}
</script>

View File

@@ -0,0 +1,146 @@
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog_document" persistent max-width="60vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
FORM SURAT JALAN / DOKUMEN DARI SUPPLIER
</v-card-title>
<v-card-text class="pt-2 pb-0">
<v-layout v-if="act_dialog_doc == 'upload'" mr-2 ml-2 style="border:1px solid black" align-center row pa-2 mb-2>
<v-flex xs9>
<input type="file" id="files" ref="files" accept="image/*" multiple v-on:change="handleFileUploads()"/>
</v-flex>
</v-layout>
<p v-show="cekFile" class="error pl-2 pr-2" style="color:#fff">Belum diisi</p>
<v-layout v-if="show_progrees_upload" row align-center mr-2 ml-2>
<v-flex xs12>
<v-progress-linear :indeterminate="true"></v-progress-linear>
</v-flex>
</v-layout>
<v-layout v-if="imagePreviews.length > 0 && !show_progrees_upload" align-center row wrap>
<v-flex
v-for="(img, index) in imagePreviews"
:key="index"
xs6
class="pa-2"
>
<v-img :src="img">
<div class="fill-height bottom-gradient"></div>
</v-img>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" flat @click="closeDiallog()"> Tutup </v-btn>
<v-btn color="primary" v-if="act_dialog_doc == 'upload'" dark @click="saveForm()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<script>
module.exports = {
name: "formDialogDocument",
data() {
return {
};
},
mounted() {
},
computed: {
dialog_document: {
get() {
return this.$store.state.ro.dialog_document;
},
set(val) {
this.$store.commit("ro/update_dialog_document", val);
},
},
show_progrees_upload: {
get() {
return this.$store.state.ro.show_progrees_upload
},
set(val) {
this.$store.commit("ro/update_show_progrees_upload", val)
}
},
imageFiles: {
get() {
return this.$store.state.ro.imageFiles
},
set(val) {
this.$store.commit("ro/update_imageFiles", val)
}
},
imagePreviews: {
get() {
return this.$store.state.ro.imagePreviews
},
set(val) {
this.$store.commit("ro/update_imagePreviews", val)
}
},
cekFile: {
get() {
return this.$store.state.ro.cekFile;
},
set(val) {
this.$store.commit("ro/update_cekFile", val);
},
},
act_dialog_doc: {
get() {
return this.$store.state.ro.act_dialog_doc;
},
set(val) {
this.$store.commit("ro/update_act_dialog_doc", val);
},
},
},
methods: {
closeDiallog() {
this.$store.commit("ro/update_dialog_document", false);
},
handleFileUploads(){
// this.files = this.$refs.files.files
const files = this.$refs.files.files;
this.imagePreviews = [];
this.imageFiles = [];
for (let i = 0; i < files.length; i++) {
const file = files[i];
const url = URL.createObjectURL(file);
this.imagePreviews.push(url);
this.imageFiles.push(file);
}
},
saveForm() {
var formData = new FormData()
// console.log("formData",this.imageFiles.length)
for( var i = 0; i < this.imageFiles.length; i++ ){
let file = this.imageFiles[i]
formData.append('files[' + i + ']', file)
}
var user = one_user()
formData.append('receiveOrderPoID', this.$store.state.ro.selected_ro.ReceiveOrderPoID)
formData.append('receiveOrderPoNumber', this.$store.state.ro.selected_ro.ReceiveOrderPoNumber)
formData.append('userId', user.M_UserID)
this.$store.dispatch('ro/saveFiles', formData)
}
},
watch: {
},
}
</script>

View File

@@ -0,0 +1,250 @@
<template>
<v-dialog v-model="dialog_form_inspeksi" persistent width="40vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
FORM INSPEKSI ITEM {{ selected_item_received.M_ItemDesc }}
</v-card-title>
<v-card-text>
<v-layout row>
<v-flex xs6 pr-1>
<v-text-field label="Jumlah Pesan" type="number" min="0" hide-details
v-model="form_inspeksi.qty_po" outline step="1"></v-text-field>
</v-flex>
<v-flex xs6 pl-1>
<v-text-field label="Jumlah Actual" type="number" min="0" hide-details
v-model="form_inspeksi.qty_ro" outline step="1"></v-text-field>
</v-flex>
</v-layout>
<v-layout row mt-2>
<v-flex xs6 pr-1>
<v-text-field label="Harga Pesan" hide-details outline prefix="Rp."
v-model="form_inspeksi.price_po" @focus="handleFocus(form_inspeksi, 'order')"
@blur="handleBlur(form_inspeksi, 'order')"></v-text-field>
</v-flex>
<v-flex xs6 pl-1>
<v-text-field label="Harga Actual" hide-details outline prefix="Rp."
v-model="form_inspeksi.price_ro" @focus="handleFocus(form_inspeksi, 'arrive')"
@blur="handleBlur(form_inspeksi, 'arrive')"></v-text-field>
</v-flex>
</v-layout>
<v-layout row mt-2>
<v-flex xs6 pr-1>
<v-menu v-model="menuDatePo" lazy offset-y max-width="290px" full-width
transition="scale-transition" min-width="290px" :nudge-right="40"
:close-on-content-click="false">
<template v-slot:activator="{ on }">
<v-text-field :value="form_inspeksi.date_po" v-on="on" readonly
label="Tanggal Terima Pesan" outline hide-details></v-text-field>
</template>
<v-date-picker v-model="form_inspeksi.date_po" no-title
@input="menuDatePo = false"></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs6 pl-1>
<v-menu v-model="menuDateRo" lazy offset-y max-width="290px" full-width
transition="scale-transition" min-width="290px" :nudge-right="40"
:close-on-content-click="false">
<template v-slot:activator="{ on }">
<v-text-field :value="form_inspeksi.date_ro" v-on="on" readonly
label="Tanggal Terima Actual" outline hide-details></v-text-field>
</template>
<v-date-picker v-model="form_inspeksi.date_ro" no-title
@input="menuDateRo = false"></v-date-picker>
</v-menu>
</v-flex>
</v-layout>
<v-layout row mt-2 wrap>
<v-flex xs12>
<v-radio-group v-model="form_inspeksi.condt_kemasan" label="Kondisi Kemasan" row hide-details>
<v-radio label="Baik" value="1"></v-radio>
<v-radio label="Tidak Baik" value="2"></v-radio>
</v-radio-group>
<v-text-field v-if="form_inspeksi.condt_kemasan == '2'" class="mt-2" label="Catatan Kemasan"
outline hide-details v-model="form_inspeksi.catatan_kemasan"></v-text-field>
</v-flex>
<v-flex xs12 mt-2>
<v-radio-group v-model="form_inspeksi.condt_pengiriman" label="Kondisi Pengiriman" row
hide-details>
<v-radio label="Sesuai" value="1"></v-radio>
<v-radio label="Tidak Sesuai" value="2"></v-radio>
</v-radio-group>
<v-text-field v-if="form_inspeksi.condt_pengiriman == '2'" class="mt-2" outline
label="Catatan Pengiriman" hide-details
v-model="form_inspeksi.catatan_kirim"></v-text-field>
</v-flex>
<v-flex xs12 mt-2>
<v-radio-group v-model="form_inspeksi.summary" row label="Kesimpulan" hide-details>
<v-radio label="Diterima" value="accept"></v-radio>
<v-radio label="Ditolak" value="reject"></v-radio>
<v-radio label="Diterima dengan Catatan" value="acceptnote"></v-radio>
</v-radio-group>
</v-flex>
<v-flex xs12 mt-2>
<v-textarea v-if="
form_inspeksi.summary == 'reject' ||
form_inspeksi.summary == 'acceptnote'
" v-model="form_inspeksi.catatan" outline auto-grow rows="1" label="Catatan"
hide-details></v-textarea>
</v-flex>
</v-layout>
<v-layout row mt-2>
<v-flex xs6 pr-1>
<v-autocomplete label="Staff Penerima" outline hide-details v-model="form_inspeksi.pemeriksa"
:items="list_staff" item-text="M_UserUsername" item-value="M_UserID"></v-autocomplete>
</v-flex>
<v-flex xs6 pl-1>
<v-text-field label="Petugas Pengirim" outline hide-details
v-model="form_inspeksi.pengirim"></v-text-field>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red" flat outline @click="closeInspeksi()">Tutup</v-btn>
<v-btn color="green" flat outline @click="simpanInspeksi()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
menuDatePo: false,
menuDateRo: false,
menuExpired: false
};
},
computed: {
dialog_form_inspeksi: {
get() {
return this.$store.state.form.dialog_form_inspeksi;
},
set(val) {
this.$store.commit("form/update_dialog_form_inspeksi", val);
}
},
form_inspeksi: {
get() {
return this.$store.state.form.form_inspeksi;
},
set(val) {
this.$store.commit("form/update_form_inspeksi", val);
}
},
selected_item_received: {
get() {
return this.$store.state.form.selected_item_received;
},
set(val) {
this.$store.commit("form/update_selected_item_received", val);
}
},
form_receive_item: {
get() {
return this.$store.state.form.form_receive_item;
},
set(val) {
this.$store.commit("form/update_form_receive_item", val);
}
},
list_staff() {
return this.$store.state.ro.list_staff;
}
},
methods: {
formatCurrency(value) {
const num = parseFloat(value);
if (isNaN(num)) return 0;
return num
.toFixed(2)
.replace(".", ",")
.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
},
parseCurrency(value) {
let cleanValue = 0;
if (!isNaN(value)) {
cleanValue = value
} else {
cleanValue = String(value).replace(/\./g, '');
cleanValue = cleanValue.replace(',', '.');
}
return parseFloat(cleanValue) || 0;
},
handleFocus(item, name) {
if (name == 'order') {
const current = item.price_po;
const parsed = this.parseCurrency(current);
item.price_po = parsed
}
if (name == 'arrive') {
const current = item.price_ro;
const parsed = this.parseCurrency(current);
item.price_ro = parsed;
}
},
handleBlur(item, name) {
if (name == 'order') {
const current = item.price_po;
const parsed = this.parseCurrency(current);
item.price_po = this.formatCurrency(parsed);
}
if (name == 'arrive') {
const current = item.price_ro;
const parsed = this.parseCurrency(current);
item.price_ro = this.formatCurrency(parsed);
}
},
async closeInspeksi() {
let a = {
qty_po: 0,
qty_ro: 0,
price_po: 0.0,
price_ro: 0.0,
date_po: moment(new Date()).format("YYYY-MM-DD"),
date_ro: moment(new Date()).format("YYYY-MM-DD"),
condt_kemasan: "",
catatan_kemasan: "",
condt_pengiriman: "",
catatan_kirim: "",
summary: "",
catatan: "",
pemeriksa: "",
pengirim: ""
};
this.form_inspeksi = a;
this.selected_item_received = {};
this.dialog_form_inspeksi = false;
},
async simpanInspeksi() {
let data_inspeksi = JSON.parse(JSON.stringify(this.form_inspeksi));
let data_received = JSON.parse(JSON.stringify(this.selected_item_received));
let list_item_received = JSON.parse(JSON.stringify(this.form_receive_item));
data_inspeksi.price_po = this.parseCurrency(data_inspeksi.price_po);
data_inspeksi.price_ro = this.parseCurrency(data_inspeksi.price_ro);
data_received.inspeksi_item = data_inspeksi;
const idxToUpdate = list_item_received.findIndex(
(obj) => obj.keyID == data_received.keyID
);
if (idxToUpdate != -1) {
list_item_received[idxToUpdate].inspeksi_item = data_inspeksi;
}
this.form_receive_item = list_item_received;
this.closeInspeksi();
}
}
};
</script>

View File

@@ -0,0 +1,417 @@
<template>
<v-dialog v-model="dialog_form_receive_item" width="80vw" persistent>
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
RECEIVE ITEM INVENTARIS
<v-spacer></v-spacer>
</v-card-title>
<v-card-text>
<v-form ref="formro" lazy-validation v-model="valid_formro">
<v-layout row>
<v-flex xs6 pr-1>
<v-menu v-model="menuReceiveDateForm" lazy offset-y max-width="290px" full-width
transition="scale-transition" min-width="290px" :nudge-right="40"
:close-on-content-click="false">
<template v-slot:activator="{ on }">
<v-text-field :value="receiveDateForm" label="Tanggal" outline hide-details
v-on="on" readonly></v-text-field>
</template>
<v-date-picker v-model="form_receive.receive_date" no-title
@input="menuReceiveDateForm = false"></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs6 pl-1>
<v-autocomplete v-model="form_receive.supplier" :rules="rules_supplier"
:items="list_supplier" return-object outline item-value="SupplierID"
item-text="SupplierName" label="Supplier*" required></v-autocomplete>
</v-flex>
<!-- <v-flex xs4 pl-1>
<v-text-field label="Nomor Delivery Order (DO)*" outline required
v-model="form_receive.number_do" :rules="rules_do"></v-text-field>
</v-flex> -->
</v-layout>
<v-layout row>
<v-flex xs6 pr-1>
<v-text-field label="Referensi (No Pengiriman/No Supplier)*" :rules="rules_ref"
v-model="form_receive.referensi" outline required
placeholder="salah satu nomor pengiriman / supplier"></v-text-field>
</v-flex>
<v-flex xs6 pl-1>
<v-autocomplete v-model="form_receive.warehouse" :rules="rules_warehouse"
:items="list_warehouse" outline required item-text="WarehouseName" label="Gudang*"
return-object></v-autocomplete>
</v-flex>
</v-layout>
<v-layout>
<v-flex xs6 pr-1>
<v-autocomplete v-model="form_receive.lokasi" :rules="rules_lokasi" :items="list_lokasi"
return-object outline item-value="M_RuanganID" item-text="M_RuanganName"
label="Lokasi/Ruangan*" required></v-autocomplete>
</v-flex>
<v-flex xs6 pl-1>
<v-text-field label="Biaya Ekspedisi" outline prefix="Rp. "
v-model="form_receive.shipping_cost" hide-details></v-text-field>
</v-flex>
</v-layout>
<v-layout row wrap>
<v-flex xs12>
<v-textarea v-model="form_receive.note" hide-details auto-grow rows="1" label="Catatan"
outline></v-textarea>
</v-flex>
<v-flex xs3 pt-2>
<v-btn block color="info" class="mt-2" @click="pilihItemRO()"
:disabled="checkObjectEmpty(form_receive.supplier) || checkObjectEmpty(form_receive.warehouse)">
TAMBAH ITEM
</v-btn>
</v-flex>
</v-layout>
<v-layout row mt-2 wrap>
<v-flex v-for="shp in shipping_info" :key="shp.num_po" xs3>
<v-card class="pa-2">
<div>
<span class="font-weight-bold">{{ shp.num_po }}</span><br />
<span>Rp. {{ oneMoney(shp.cost) }}</span><br />
<span v-if="shp.isUpfront === 'Y'" class="green--text">
Biaya Ekspedisi sudah dibayar
</span>
<span v-else class="red--text">
Biaya Ekspedisi belum dibayar
</span>
</div>
</v-card>
</v-flex>
</v-layout>
<v-layout row mt-4 wrap>
<v-flex xs12>
<v-data-table v-if="form_receive_item.length > 0" :headers="headers"
:items="form_receive_item" hide-actions item-key="keyID" class="elevation-1">
<template v-slot:items="props">
<tr>
<td class="text-xs-left">{{ props.item.PurchaseOrderNumber }}</td>
<td class="text-xs-left">
<p class="p-0 mb-0">{{ props.item.M_ItemCode }}</p>
<p class="p-0 mb-0">{{ props.item.M_ItemDesc }}</p>
<!-- <p class="p-0 mb-0">{{ props.item.WarehouseName }}</p> -->
</td>
<td class="text-xs-center">{{ props.item.qty }} {{ props.item.ItemUnitName }}
</td>
<td class="text-xs-center">
<div v-if="props.item.M_ItemItem_CategoryID == 2">
<p class="mb-0 pb-0" v-for="batch in props.item.batchlist">
Qty: {{ batch.qty || '' }}
</p>
</div>
</td>
<td class="text-xs-center">
<div v-if="props.item.inspeksi_item">
<p v-if="props.item.inspeksi_item.summary == 'accept'">
Diterima
</p>
<p v-else-if="props.item.inspeksi_item.summary == 'reject'"
class="mb-0 pb-0">
Ditolak <br>
{{ props.item.inspeksi_item.catatan }}
</p>
<p v-else class="mb-0 pb-0">
Diterima dengan Catatan <br>
{{ props.item.inspeksi_item.catatan }}
</p>
</div>
</td>
<td class="text-xs-center">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="inspekItem(props)" color="green lighten-2">
<v-icon small color="green" v-on="on">note_add</v-icon>
</v-btn>
</template>
<span>Inspek Item</span>
</v-tooltip>
<!-- <v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="editBatch(props)" color="blue lighten-2">
<v-icon small color="blue" v-on="on">edit</v-icon>
</v-btn>
</template>
<span>Edit</span>
</v-tooltip> -->
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="removeItem(props)" color="red lighten-2">
<v-icon small color="red" v-on="on">delete</v-icon>
</v-btn>
</template>
<span>Hapus</span>
</v-tooltip>
</td>
</tr>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-form>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red" flat outline @click="batalRO()">Batal</v-btn>
<v-btn color="green" flat outline @click="simpanRO()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
components: {},
data() {
return {
menuReceiveDateForm: false,
valid_formro: true,
rules_ref: [v => !!v || 'Tidak boleh kosong / harus diisi'],
rules_supplier: [v => (v && Object.keys(v).length > 0) || 'Supplier harus diisi'],
rules_lokasi: [v => (v && Object.keys(v).length > 0) || 'Lokasi harus diisi'],
rules_warehouse: [v => (v && Object.keys(v).length > 0) || 'Gudang harus diisi'],
headers: [
{
text: "PO NUMBER", align: "center", sortable: false, value: "ItemUnitName",
width: "18%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "ITEM", align: "center", sortable: false, value: "M_ItemDesc",
width: "25%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY", align: "center", sortable: false, value: "qty",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY TO STOCK", align: "center", sortable: false, value: "qty",
width: "22%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "INSPEKSI", align: "center", sortable: false, value: "inspeksi",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "AKSI", align: "center", sortable: false, value: "qty",
width: "15%", class: "pa-2 blue lighten-3 white--text",
},
]
}
},
computed: {
dialog_form_receive_item: {
get() {
return this.$store.state.form.dialog_form_receive_item;
},
set(val) {
this.$store.commit("form/update_dialog_form_receive_item", val);
}
},
receiveDateForm() {
return this.formatDate(this.form_receive.receive_date)
},
form_receive: {
get() {
return this.$store.state.form.form_receive;
},
set(val) {
this.$store.commit("form/update_form_receive", val)
}
},
form_receive_item: {
get() {
return this.$store.state.form.form_receive_item;
},
set(val) {
this.$store.commit("form/update_form_receive_item", val)
}
},
list_supplier() {
return this.$store.state.ro.list_supplier
},
list_warehouse() {
return this.$store.state.ro.list_warehouse
},
shipping_info() {
return this.$store.state.form.shipping_info
},
list_lokasi() {
return this.$store.state.ro.list_lokasi
},
},
methods: {
checkObjectEmpty(obj) {
if (obj === null || obj === undefined || typeof obj !== "object") {
return true;
}
return Object.keys(obj).length === 0 && obj.constructor === Object;
},
formatDate(date) {
if (!date) return null;
const [year, month, day] = date.split("-");
return `${day}-${month}-${year}`;
},
oneMoney(value) {
if (typeof value !== 'number') {
value = parseFloat(value);
}
if (isNaN(value)) return '0,00';
// Bulatkan dulu ke 2 desimal
const fixed = value.toFixed(2); // hasil string, misal "16200000.00" atau "123456.70"
const splitValue = fixed.split(".");
const val = splitValue[0]; // bagian ribuan
const decimal = splitValue[1]; // bagian desimal
const formatted = val.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
return `${formatted},${decimal}`;
},
pilihItemRO() {
let temp = this.form_receive_item
if (temp.length > 0) {
this.$store.commit("form/update_select_item_temp", temp);
}
this.$store.dispatch("form/getPurchaseOrder");
this.$store.commit("form/update_dialog_select_item", true);
},
editBatch(props) {
const curr_item = JSON.parse(JSON.stringify(props.item));
if (!curr_item.batchlist || curr_item.batchlist.length <= 0) {
let val = [
{
qty: 0,
batchno: '',
item_category: curr_item.M_ItemItem_CategoryID,
menuDate: false
}
];
this.$store.commit("form/update_item_batch_temp", val)
}
this.$store.commit("form/update_selected_item_forbatch", curr_item);
this.$store.commit("form/update_dialog_batch_item", true);
},
removeItem(props) {
let temp = JSON.parse(JSON.stringify(this.form_receive_item));
let newt = temp.filter((item) => item.PoItemReceiveID !== props.item.PoItemReceiveID);
let shipInfo = [];
newt.forEach(element => {
let ship = {
num_po: element.PurchaseOrderNumber,
cost: element.PurchaseOrderShippingCost,
isUpfront: element.PurchaseOrderShippingCostStatus
}
const isExist = this.shipping_info.some(
item => item.num_po == element.PurchaseOrderNumber
);
if (!isExist) {
shipInfo.push(ship);
}
});
this.form_receive_item = newt;
this.$store.commit("form/update_shipping_info", shipInfo);
},
inspekItem(props) {
const curr_item = JSON.parse(JSON.stringify(props.item));
this.$store.commit("form/update_selected_item_received", curr_item);
let inspeksi = this.$store.state.form.form_inspeksi
if (curr_item.inspeksi_item) {
inspeksi = curr_item.inspeksi_item
} else {
inspeksi.qty_po = curr_item.originalQty
inspeksi.qty_ro = curr_item.qty
inspeksi.price_po = curr_item.PoItemReceivePrice
inspeksi.price_ro = curr_item.PoItemReceivePrice
}
this.$store.dispatch("ro/getListStaff");
this.$store.commit("form/update_form_inspeksi", inspeksi);
this.$store.commit("form/update_dialog_form_inspeksi", true);
},
batalRO() {
this.$store.dispatch("form/resetForm");
this.$refs.formro.resetValidation()
this.error_num_do = false
this.error_supplier = false
this.error_warehouse = false
this.dialog_form_receive_item = false;
},
simpanRO() {
if (this.$refs.formro.validate()) {
const form_detail = JSON.parse(JSON.stringify(this.form_receive_item));
let empty = this.checkRODetail(form_detail);
if (empty.length == 0) {
for (const element of form_detail) {
let total = element.batchlist.reduce((sum, item) => sum + Number(item.qty), 0);
if (total != Number(element.qty)) {
this.$store.commit("ro/update_snackbar", {
color: 'warning',
msg: `Jumlah item ${element.M_ItemDesc} tidak sama dengan pengaturan batch`,
isOpen: true
}, { root: true });
return;
}
if (!element.inspeksi_item) {
this.$store.commit("ro/update_snackbar", {
color: 'warning',
msg: `Form inspeksi item ${element.M_ItemDesc} belum di-isi`,
isOpen: true
}, { root: true });
return;
}
}
this.$store.dispatch("form/saveRO");
this.$refs.formro.resetValidation();
} else {
const message = empty.map(item => item.M_ItemDesc).join(', ')
this.$store.commit("ro/update_snackbar", {
color: 'warning',
msg: 'QTY to Stock berikut masih belum terisi ' + message,
isOpen: true
}, { root: true });
return;
}
}
},
checkRODetail(data) {
const emptyBatch = data.filter(element => {
return Array.isArray(element.batchlist) && element.batchlist.length === 0;
})
return emptyBatch
}
},
watch: {
dialog_form_receive_item(val) {
if (val) {
this.$nextTick(() => {
this.$refs.formro?.resetValidation();
});
}
}
},
}
</script>

View File

@@ -0,0 +1,400 @@
<template>
<v-dialog v-model="dialog_form_receive_item_edit" width="80vw" persistent>
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
EDIT RECEIVE ITEM INVENTARIS
</v-card-title>
<v-card-text>
<v-layout row>
<v-flex xs6 pr-1>
<v-menu v-model="menuReceiveDateForm" lazy offset-y max-width="290px" full-width
transition="scale-transition" min-width="290px" :nudge-right="40"
:close-on-content-click="false">
<template v-slot:activator="{ on }">
<v-text-field :value="receiveDateForm" label="Tanggal" outline hide-details v-on="on"
readonly></v-text-field>
</template>
<v-date-picker v-model="form_receive.receive_date" no-title
@input="menuReceiveDateForm = false"></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs6 pl-1>
<v-autocomplete v-model="form_receive.supplier" hide-details :items="list_supplier"
return-object outline item-text="SupplierName" label="Supplier"></v-autocomplete>
</v-flex>
<!-- <v-flex xs4 pl-1>
<v-text-field
label="Nomor Delivery Order (DO)" outline
v-model="form_receive.number_do" hide-details
></v-text-field>
</v-flex> -->
</v-layout>
<v-layout row mt-2>
<v-flex xs6 pr-1>
<v-text-field label="Referensi (No Pengiriman/No Supplier)*" v-model="form_receive.referensi"
outline hide-details placeholder="salah satu nomor pengiriman / supplier"></v-text-field>
</v-flex>
<v-flex xs6 pl-1>
<v-autocomplete v-model="form_receive.warehouse" hide-details :items="list_warehouse" outline
return-object item-text="WarehouseName" label="Gudang"></v-autocomplete>
</v-flex>
</v-layout>
<v-layout row mt-2>
<v-flex xs6 pr-1>
<v-autocomplete v-model="form_receive.lokasi" :items="list_lokasi" return-object outline
item-value="M_RuanganID" item-text="M_RuanganName" label="Lokasi*" hide-details
required></v-autocomplete>
</v-flex>
<v-flex xs6 pl-1>
<v-text-field label="Biaya Ekspedisi" outline prefix="Rp. " v-model="form_receive.shipping_cost"
hide-details></v-text-field>
</v-flex>
</v-layout>
<v-layout row mt-2 wrap>
<v-flex xs12>
<v-textarea v-model="form_receive.note" hide-details auto-grow rows="1" label="Catatan"
outline></v-textarea>
</v-flex>
<v-flex xs3 pt-2>
<v-btn block color="info" class="mt-2" @click="pilihItemRO()"
:disabled="checkObjectEmpty(form_receive.supplier) || checkObjectEmpty(form_receive.warehouse)">TAMBAH
ITEM</v-btn>
</v-flex>
</v-layout>
<v-layout row mt-2 wrap>
<v-flex v-for="shp in shipping_info" :key="shp.num_po" xs3>
<v-card class="pa-2">
<div>
<span class="font-weight-bold">{{ shp.num_po }}</span><br />
<span>Rp. {{ oneMoney(shp.cost) }}</span><br />
<span v-if="shp.isUpfront === 'Y'" class="green--text">
Biaya Ekspedisi sudah dibayar
</span>
<span v-else class="red--text">
Biaya Ekspedisi belum dibayar
</span>
</div>
</v-card>
</v-flex>
</v-layout>
<v-layout row mt-4 wrap>
<v-flex xs12>
<v-data-table v-if="form_receive_item.length > 0" :headers="headers" :items="form_receive_item"
hide-actions item-key="keyID" class="elevation-1">
<template v-slot:items="props">
<tr>
<td class="text-xs-left">{{ props.item.PurchaseOrderNumber }}</td>
<td class="text-xs-left">
<p class="p-0 mb-0">{{ props.item.M_ItemCode }}</p>
<p class="p-0 mb-0">{{ props.item.M_ItemDesc }}</p>
<!-- <p class="p-0 mb-0">{{ props.item.WarehouseName }}</p> -->
</td>
<td class="text-xs-center">{{ props.item.qty }} {{ props.item.ItemUnitName }}</td>
<td class="text-xs-center">
<div v-if="props.item.M_ItemItem_CategoryID == 2">
<p class="mb-0 pb-0" v-for="batch in props.item.batchlist">
Qty: {{ batch.qty || '' }}
</p>
</div>
</td>
<td class="text-xs-center">
<div v-if="props.item.inspeksi_item">
<p v-if="props.item.inspeksi_item.summary == 'accept'">
Diterima
</p>
<p v-else-if="props.item.inspeksi_item.summary == 'reject'"
class="mb-0 pb-0">
Ditolak <br>
{{ props.item.inspeksi_item.catatan }}
</p>
<p v-else class="mb-0 pb-0">
Diterima dengan Catatan <br>
{{ props.item.inspeksi_item.catatan }}
</p>
</div>
</td>
<td class="text-xs-center">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn style="min-width: 30px; height: 30px; margin: 0;" outline small
@click="inspekItem(props)" color="green lighten-2">
<v-icon small color="green" v-on="on">note_add</v-icon>
</v-btn>
</template>
<span>Inspek Item</span>
</v-tooltip>
<!-- <v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="editBatch(props)" color="blue lighten-2"
>
<v-icon small color="blue" v-on="on">edit</v-icon>
</v-btn>
</template>
<span>Edit</span>
</v-tooltip> -->
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn style="min-width: 30px; height: 30px; margin: 0;" outline small
@click="removeItem(props)" color="red lighten-2">
<v-icon small color="red" v-on="on">delete</v-icon>
</v-btn>
</template>
<span>Hapus</span>
</v-tooltip>
</td>
</tr>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red" outline flat @click="batalRO()">Batal</v-btn>
<v-btn color="green" outline flat @click="simpanEditRO()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
components: {},
data() {
return {
menuReceiveDateForm: false,
headers: [
{
text: "PO NUMBER", align: "center", sortable: false, value: "ItemUnitName",
width: "18%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "ITEM", align: "center", sortable: false, value: "M_ItemDesc",
width: "25%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY", align: "center", sortable: false, value: "qty",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY TO STOCK", align: "center", sortable: false, value: "qty",
width: "22%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "INSPEKSI", align: "center", sortable: false, value: "inspeksi",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "AKSI", align: "center", sortable: false, value: "qty",
width: "15%", class: "pa-2 blue lighten-3 white--text",
},
]
}
},
computed: {
dialog_form_receive_item_edit: {
get() {
return this.$store.state.form.dialog_form_receive_item_edit
},
set(val) {
this.$store.commit("form/update_dialog_form_receive_item_edit", val);
}
},
form_receive: {
get() {
return this.$store.state.form.form_receive;
},
set(val) {
this.$store.commit("form/update_form_receive", val)
}
},
form_receive_item: {
get() {
return this.$store.state.form.form_receive_item;
},
set(val) {
this.$store.commit("form/update_form_receive_item", val)
}
},
form_receive_item_del: {
get() {
return this.$store.state.form.form_receive_item_del
},
set(val) {
this.$store.commit("form/update_form_receive_item_del", val)
}
},
receiveDateForm() {
return this.formatDate(this.form_receive.receive_date)
},
list_supplier() {
return this.$store.state.ro.list_supplier
},
list_warehouse() {
return this.$store.state.ro.list_warehouse
},
shipping_info() {
return this.$store.state.form.shipping_info
},
list_lokasi() {
return this.$store.state.ro.list_lokasi
},
},
methods: {
checkObjectEmpty(obj) {
if (obj === null || obj === undefined || typeof obj !== "object") {
return true;
}
return Object.keys(obj).length === 0 && obj.constructor === Object;
},
formatDate(date) {
if (!date) return null;
const [year, month, day] = date.split("-");
return `${day}-${month}-${year}`;
},
oneMoney(value) {
if (typeof value !== 'number') {
value = parseFloat(value);
}
if (isNaN(value)) return '0,00';
const fixed = value.toFixed(2);
const splitValue = fixed.split(".");
const val = splitValue[0];
const decimal = splitValue[1];
const formatted = val.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
return `${formatted},${decimal}`
},
batalRO() {
this.$store.dispatch("form/resetForm");
this.form_receive_item_del = [];
this.dialog_form_receive_item_edit = false
},
simpanEditRO() {
const form_detail = JSON.parse(JSON.stringify(this.form_receive_item));
let empty = this.checkRODetail(form_detail);
if (empty.length == 0) {
for (const element of form_detail) {
let total = element.batchlist.reduce((sum, item) => sum + Number(item.qty), 0);
if (total != Number(element.qty)) {
this.$store.commit("ro/update_snackbar", {
color: 'warning',
msg: `Jumlah item ${element.M_ItemDesc} tidak sama dengan pengaturan batch`,
isOpen: true
}, { root: true });
return;
}
if (!element.inspeksi_item) {
this.$store.commit("ro/update_snackbar", {
color: 'warning',
msg: `Form inspeksi item ${element.M_ItemDesc} belum di-isi`,
isOpen: true
}, { root: true });
return;
}
}
this.$store.dispatch("form/saveEditRO");
} else {
const message = empty.map(item => item.M_ItemDesc).join(', ')
this.$store.commit("ro/update_snackbar", {
color: 'warning',
msg: 'Qty to Stock berikut masih belum terisi ' + message,
isOpen: true
}, { root: true });
return;
}
// this.$store.dispatch("form/saveEditRO")
},
checkRODetail(data) {
const emptyBatch = data.filter(element => {
return Array.isArray(element.batchlist) && element.batchlist.length === 0;
})
return emptyBatch
},
pilihItemRO() {
let temp = JSON.parse(JSON.stringify(this.form_receive_item));
if (temp.length > 0) {
this.$store.commit("form/update_select_item_temp", temp);
}
this.$store.dispatch("form/getPurchaseOrder");
this.$store.commit("form/update_dialog_select_item", true);
},
inspekItem(props) {
const curr_item = JSON.parse(JSON.stringify(props.item));
this.$store.commit("form/update_selected_item_received", curr_item);
let inspeksi = this.$store.state.form.form_inspeksi
if (curr_item.inspeksi_item) {
inspeksi = curr_item.inspeksi_item
} else {
inspeksi.qty_po = curr_item.originalQty
inspeksi.qty_ro = curr_item.qty
inspeksi.price_po = curr_item.PoItemReceivePrice
inspeksi.price_ro = curr_item.PoItemReceivePrice
}
this.$store.dispatch("ro/getListStaff");
this.$store.commit("form/update_form_inspeksi", inspeksi);
this.$store.commit("form/update_dialog_form_inspeksi", true);
},
removeItem(props) {
let temp = JSON.parse(JSON.stringify(this.form_receive_item));
let newt = temp.filter((item) => item.PoItemReceiveID !== props.item.PoItemReceiveID);
let del = temp.find((item) => item.PoItemReceiveID === props.item.PoItemReceiveID);
let shipInfo = [];
newt.forEach(element => {
let ship = {
num_po: element.PurchaseOrderNumber,
cost: element.PurchaseOrderShippingCost,
isUpfront: element.PurchaseOrderShippingCostStatus
};
const isExist = this.shipping_info.some(
item => item.num_po == element.PurchaseOrderNumber
);
if (!isExist) {
shipInfo.push(ship)
}
});
this.form_receive_item_del.push(del);
this.form_receive_item = newt;
this.$store.commit("form/update_shipping_info", shipInfo);
},
editBatch(props) {
const curr_item = JSON.parse(JSON.stringify(props.item));
if (!curr_item.batchlist || curr_item.batchlist.length <= 0) {
let val = [
{
qty: 0,
batchno: '',
expiredate: moment(new Date()).format('YYYY-MM-DD'),
menuDate: false
}
];
this.$store.commit("form/update_item_batch_temp", val)
}
this.$store.commit("form/update_selected_item_forbatch", curr_item);
this.$store.commit("form/update_dialog_batch_item", true);
}
},
}
</script>

View File

@@ -0,0 +1,423 @@
<template>
<div style="width: 100%;">
<v-toolbar dark color="primary">
<v-toolbar-title class="white--text">RECEIVE ITEM INVENTARIS</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn flat icon color="white" @click="openDialogReceiveItem()">
<v-icon>add_box</v-icon>
</v-btn>
</v-toolbar>
<!-- Filter Listing -->
<v-card class="pa-2">
<v-layout row wrap>
<v-flex xs4>
<v-menu
v-model="menuStartDateFilter" lazy offset-y
transition="scale-transition" max-width="290px"
min-width="290px" :nudge-right="40"
:close-on-content-click="false"
>
<template v-slot:activator="{ on }">
<v-text-field
:value="startDateFilter" label="Tanggal Mulai"
hide-details readonly outline v-on="on" class="mr-2"
></v-text-field>
</template>
<v-date-picker
no-title hide-details v-model="filter.startdate"
@input="menuStartDateFilter = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs4>
<v-menu
v-model="menuEndDateFilter" lazy offset-y
transition="scale-transition" max-width="290px"
min-width="290px" :nudge-right="40"
:close-on-content-click="false"
>
<template v-slot:activator="{ on }">
<v-text-field
:value="endDateFilter" label="Tanggal Akhir"
hide-details readonly outline v-on="on" class="mr-2"
></v-text-field>
</template>
<v-date-picker
no-title hide-details v-model="filter.enddate"
@input="menuEndDateFilter = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs4>
<v-text-field
label="Cari nomor GR, nomor DO" v-model="filter.search" hide-details outline
></v-text-field>
</v-flex>
</v-layout>
</v-card>
<!-- Table Listing -->
<v-card class="pa-2 mt-2">
<div style="overflow-y: scroll;">
<v-data-table
:items="list_data_ro.records" :headers="headers" :loading="false"
hide-actions class="elevation-1"
>
<template v-slot:items="props">
<tr>
<td class="text-xs-center">{{ props.item.ReceiveOrderPoNumber }}</td>
<td class="text-xs-center"> {{ props.item.ReceiveOrderPoIDate }} </td>
<td class="text-xs-center">{{ props.item.ReceiveOrderPoDONumber }}</td>
<td class="text-xs-center">{{ props.item.SupplierName }}</td>
<td class="text-xs-center">{{ props.item.WarehouseName }}</td>
<td class="text-xs-center">{{ props.item.ReceiveOrderPoNote }}</td>
<td class="text-xs-center">
<div v-if="props.item.ReceiveOrderPoConfirmed === 'Y'">
<v-chip color="green" text-color="white">
KONFIRMASI
</v-chip>
<kbd>{{ props.item.ReceiveOrderPoConfirmedDate }}</kbd>
</div>
<v-chip v-else color="red" text-color="white">
BELUM KONFIRMASI
</v-chip>
</td>
<td class="text-xs-center">
<div v-show="props.item.ReceiveOrderPoConfirmed === 'N'">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="konfirmRO(props.item)" color="green lighten-2"
class="mt-1"
>
<v-icon small color="green" v-on="on">done_all</v-icon>
</v-btn>
</template>
<span>konfirmasi</span>
</v-tooltip>
<span v-if="props.item.hasDocuments == true">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="openViewDoc(props.item)" color="grey lighten-2"
class="mt-1"
>
<v-icon small color="grey" v-on="on">description</v-icon>
</v-btn>
</template>
<span>Lihat surat jalan supplier</span>
</v-tooltip>
</span>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="uploadDoct(props.item)" color="orange lighten-2"
class="mt-1"
>
<v-icon small color="orange" v-on="on">attachment</v-icon>
</v-btn>
</template>
<span>Upload surat jalan supplier</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="openBarcode(props.item)" color="black lighten-2"
class="mt-1 mb-1"
>
<v-icon small color="black" v-on="on">print</v-icon>
</v-btn>
</template>
<span>Barcode</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="editRO(props.item)" color="blue lighten-2"
class="mt-1 mb-1"
>
<v-icon small color="blue" v-on="on">edit</v-icon>
</v-btn>
</template>
<span>Edit</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="deleteRO(props.item)" color="red lighten-2"
class="mt-1 mb-1"
>
<v-icon small color="red" v-on="on">delete</v-icon>
</v-btn>
</template>
<span>Hapus</span>
</v-tooltip>
</div>
<div v-show="props.item.ReceiveOrderPoConfirmed === 'Y'">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="openBarcode(props.item)" color="black lighten-2"
>
<v-icon small color="black" v-on="on">print</v-icon>
</v-btn>
</template>
<span>Barcode</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="detailView(props.item)" color="blue lighten-2"
>
<v-icon small color="blue" v-on="on">visibility</v-icon>
</v-btn>
</template>
<span>Lihat detail</span>
</v-tooltip>
<span v-show="props.item.ReceiveOrderPoIsHandover === 'N'">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
style="min-width: 30px; height: 30px; margin: 0;" outline
small @click="handOverRO(props.item)" color="green lighten-2"
>
<v-icon small color="green" v-on="on">send</v-icon>
</v-btn>
</template>
<span>Serah Terima</span>
</v-tooltip>
</span>
</div>
</td>
</tr>
</template>
</v-data-table>
</div>
<v-divider></v-divider>
<div class="text-xs-center mt-2">
<v-pagination v-model="curr_page" :length="list_data_ro.total"></v-pagination>
</div>
</v-card>
<!-- dialog -->
<one-dialog-form-inspeksi></one-dialog-form-inspeksi>
<one-dialog-form-receive></one-dialog-form-receive>
<one-dialog-form-receive-edit></one-dialog-form-receive-edit>
<one-dialog-item-receive></one-dialog-item-receive>
<one-dialog-item-batch></one-dialog-item-batch>
<one-dialog-ro-layout></one-dialog-ro-layout>
<one-dialog-ro-view></one-dialog-ro-view>
<one-dialog-ro-handover></one-dialog-ro-handover>
<one-dialog-form-document></one-dialog-form-document>
<one-dialog-print-barcode></one-dialog-print-barcode>
<!-- snackbar -->
<v-snackbar
:color="snackbar.color" v-model="snackbar.isOpen"
:timeout="3000" multi-line top
>
{{ snackbar.msg }}
<v-btn class="ml-2" flat @click="snackbar.isOpen = false">Tutup</v-btn>
</v-snackbar>
</div>
</template>
<script>
module.exports = {
components: {
'one-dialog-item-receive': httpVueLoader('./dialogSelectItem.vue'),
'one-dialog-form-receive': httpVueLoader('./formReceiveItem.vue'),
'one-dialog-form-receive-edit': httpVueLoader('./formReceiveItemEdit.vue'),
'one-dialog-form-inspeksi': httpVueLoader('./formInspection.vue'),
'one-dialog-item-batch': httpVueLoader('./dialogBatchItem.vue'),
'one-dialog-ro-layout': httpVueLoader('./dialogRoLayout.vue'),
'one-dialog-ro-view': httpVueLoader('./dialogViewRO.vue'),
'one-dialog-ro-handover': httpVueLoader('./dialogHandOver.vue'),
'one-dialog-form-document': httpVueLoader('./formDialogDocument.vue'),
'one-dialog-print-barcode': httpVueLoader('./dialogPrintBarcode.vue'),
},
mounted() {
this.$store.dispatch("ro/search")
},
data() {
return {
menuStartDateFilter: false,
menuEndDateFilter: false,
headers: [
{
text: "GR NUMBER", align: "center", sortable: false, value: "grnumber",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "DATE", align: "center", sortable: false, value: "date",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "DO NUMBER", align: "center", sortable: false, value: "do",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "SUPPLIER", align: "center", sortable: false, value: "supplier",
width: "20%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "WAREHOUSE", align: "center", sortable: false, value: "wh",
width: "15%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "CATATAN", align: "center", sortable: false, value: "note",
width: "15%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "STATUS", align: "center", sortable: false, value: "status",
width: "10%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "AKSI", align: "center", sortable: false, value: "act",
width: "10%", class: "pa-2 text-center blue lighten-3 white--text",
},
]
}
},
computed: {
filter: {
get() {
return this.$store.state.ro.filter;
},
set(val) {
this.$store.commit("ro/update_filter", val);
}
},
snackbar: {
get() {
return this.$store.state.ro.snackbar;
},
set(val) {
this.$store.commit("ro/update_snackbar", val);
}
},
startDateFilter() {
return this.formatDate(this.filter.startdate);
},
endDateFilter() {
return this.formatDate(this.filter.enddate);
},
curr_page: {
get() {
return this.$store.state.ro.curr_page;
},
set(val) {
this.$store.commit("ro/update_curr_page", val);
this.$store.dispatch("ro/search");
}
},
list_data_ro() {
return this.$store.state.ro.list_data_ro;
},
dialog_form_receive_item: {
get() {
return this.$store.state.form.dialog_form_receive_item;
},
set(val) {
this.$store.commit("form/update_dialog_form_receive_item", val);
}
}
},
methods: {
formatDate(date) {
if (!date) return null;
const [year, month, day] = date.split("-");
return `${day}-${month}-${year}`;
},
openDialogReceiveItem() {
this.$store.dispatch("ro/getSupplier");
this.$store.dispatch("ro/getWarehouse");
this.$store.dispatch("ro/getRuangan");
this.dialog_form_receive_item = true;
},
konfirmRO(data) {
if (data.hasDocuments) {
this.$store.commit("ro/update_selected_ro", data);
this.$store.commit("ro/update_dialog_confirmation", true);
return;
}
const message = "Belum upload bukti penerimaan";
this.snackbar = { color: 'warning', msg: message, isOpen: true }
},
deleteRO(data) {
this.$store.commit("ro/update_selected_ro", data);
this.$store.commit("ro/update_dialog_delete", true);
},
detailView(data) {
this.$store.commit("ro/update_selected_ro", data);
this.$store.dispatch("ro/getSupplier");
this.$store.dispatch("ro/getWarehouse");
this.$store.dispatch("ro/getItemUpdate");
this.$store.dispatch("ro/getRuangan");
this.$store.commit("ro/update_dialog_detail_view", true);
},
editRO(data) {
this.$store.commit("ro/update_selected_ro", data);
this.$store.dispatch("ro/getSupplier");
this.$store.dispatch("ro/getWarehouse");
this.$store.dispatch("ro/getItemUpdate");
this.$store.dispatch("ro/getRuangan");
this.$store.commit("form/update_dialog_form_receive_item_edit", true);
},
handOverRO(data) {
this.$store.commit("ro/update_selected_ro", data);
this.$store.commit("ro/update_dialog_handover", true);
this.$store.dispatch("ro/getListStaff", 'Y');
},
uploadDoct(data) {
this.$store.commit("ro/update_selected_ro", data);
this.$store.commit("ro/update_dialog_document", true);
this.$store.commit("ro/update_imageFiles", []);
this.$store.commit("ro/update_imagePreviews", []);
this.$store.commit("ro/update_cekFile", false);
this.$store.commit("ro/update_act_dialog_doc", 'upload');
},
openViewDoc(data) {
let curryear = data.documents[0].ReceiveOrderPoDocumentDate
let year = new Date(curryear).getFullYear();
let fileBaseUrl = BASE_URL + `/one-media/order-inventaris/${year}/`;
let allImgUrls = [];
for (let i = 0; i < data.documents.length; i++) {
allImgUrls.push(fileBaseUrl + data.documents[i].ReceiveOrderPoDocumentFile);
}
this.$store.commit("ro/update_selected_ro", data);
this.$store.commit("ro/update_imagePreviews", allImgUrls);
this.$store.commit("ro/update_dialog_document", true);
this.$store.commit("ro/update_cekFile", false);
this.$store.commit("ro/update_act_dialog_doc", 'preview');
},
openBarcode(data) {
this.$store.commit("ro/update_selected_ro", data);
this.$store.commit("ro/update_dialog_barcode", true);
this.$store.commit("ro/update_bar_chx_all", false);
this.$store.commit("ro/update_indeterminatex", false);
this.$store.commit("ro/update_selected_barcode", []);
this.$store.dispatch("ro/getBarcodes");
}
},
watch: {
filter: {
handler(newVal, oldVal) {
this.$store.dispatch("ro/search")
},
deep: true
}
},
}
</script>