add progress

This commit is contained in:
2026-06-03 17:11:38 +07:00
parent d018e85927
commit 315b657ee3
7 changed files with 172 additions and 86 deletions

View File

@@ -323,6 +323,25 @@ export async function getBarcodes(params) {
} }
} }
export async function getInventarisBelumSerah(params) {
try {
var resp = await axios.post(URL + '/getInventarisBelumSerah', params);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (error) {
return {
status: "ERR",
message: error.message
};
}
}
export async function template(params) { export async function template(params) {
try { try {
var resp = await axios.post(URL + '/', params); var resp = await axios.post(URL + '/', params);
@@ -340,4 +359,4 @@ export async function template(params) {
message: error.message message: error.message
}; };
} }
} }

View File

@@ -8,18 +8,32 @@
<v-card-text> <v-card-text>
<p>Apakah Anda yakin ingin melakukan serah terima barang inventaris kepada user pemohon</p> <p>Apakah Anda yakin ingin melakukan serah terima barang inventaris kepada user pemohon</p>
<v-data-table :headers="headers" :items="items" hide-actions class="elevation-1">
<template v-slot:items="props">
<tr>
</tr>
</template>
</v-data-table>
<v-form ref="formhandover" lazy-validation v-model="valid_formhandover"> <v-form ref="formhandover" lazy-validation v-model="valid_formhandover">
<v-data-table :headers="headers" :items="list_itembelumserah" hide-actions class="elevation-1">
<template v-slot:items="props">
<tr>
<td class="text-xs-center">
<v-checkbox v-if="props.item.isHandoverDone == 'N'" v-model="props.item.checked"
hide-details @change="onChangeCheckbox(props.item)">
</v-checkbox>
</td>
<td class="text-xs-center">{{ props.item.M_ItemDesc }}</td>
<td class="text-xs-center">{{ props.item.originalQty }}</td>
<td class="text-xs-center">
<v-text-field v-if="props.item.checked" v-model="props.item.serahQty" type="number"
solo :rules="qtyRules(props.item.sisaQty)"></v-text-field>
<div v-else>
{{ props.item.serahQty }}
</div>
</td>
</tr>
</template>
</v-data-table>
<v-layout row mt-2> <v-layout row mt-2>
<v-flex xs6 pr-1> <v-flex xs6 pr-1>
<v-autocomplete v-model="selected_ruangan" :items="list_lokasi" label="Lokasi Penerima*" <v-autocomplete v-model="selected_ruangan" :items="list_lokasi" label="Lokasi Penerima*"
outline item-value="M_RuanganID" item-text="M_RuanganName"></v-autocomplete> :rules="ruang_rules" outline item-value="M_RuanganID"
item-text="M_RuanganName"></v-autocomplete>
</v-flex> </v-flex>
<v-flex xs6 pl-1> <v-flex xs6 pl-1>
<v-autocomplete label="Staff Penerima*" outline :rules="rules_staff" return-object <v-autocomplete label="Staff Penerima*" outline :rules="rules_staff" return-object
@@ -48,22 +62,26 @@ module.exports = {
{ M_RuanganID: 1, M_RuanganName: "bonde" } { M_RuanganID: 1, M_RuanganName: "bonde" }
], ],
valid_formhandover: true, valid_formhandover: true,
ruang_rules: [v => (v && Object.keys(v).length > 0) || 'Lokasi ruangan harus diisi'],
rules_staff: [v => (v && Object.keys(v).length > 0) || 'Staff harus diisi'], rules_staff: [v => (v && Object.keys(v).length > 0) || 'Staff harus diisi'],
headers: [ headers: [
{ {
text: "ITEM", align: "center", sortable: false, value: "itemname", text: "", align: "center", sortable: false, value: "checked",
width: "60%", class: "pa-2 blue lighten-3 white--text", width: "10%", class: "pa-2 blue lighten-3 white--text",
}, },
{ {
text: "QTY", align: "center", sortable: false, value: "qtyitem", text: "ITEM", align: "center", sortable: false, value: "itemname",
width: "50%", class: "pa-2 blue lighten-3 white--text",
},
{
text: "QTY DITERIMA", align: "center", sortable: false, value: "qtyitem",
width: "20%", class: "pa-2 blue lighten-3 white--text", width: "20%", class: "pa-2 blue lighten-3 white--text",
}, },
{ {
text: "HANDOVER", align: "center", sortable: false, value: "qtysend", text: "QTY HANDOVER", align: "center", sortable: false, value: "qtysend",
width: "20%", class: "pa-2 blue lighten-3 white--text", width: "20%", class: "pa-2 blue lighten-3 white--text",
}, },
], ],
items: []
} }
}, },
computed: { computed: {
@@ -99,6 +117,14 @@ module.exports = {
this.$store.commit("ro/update_selected_ro", val); this.$store.commit("ro/update_selected_ro", val);
} }
}, },
list_itembelumserah: {
get() {
return this.$store.state.ro.list_itembelumserah
},
set(val) {
this.$store.commit("ro/update_list_itembelumserah", val)
}
},
list_staff() { list_staff() {
return this.$store.state.ro.list_staff return this.$store.state.ro.list_staff
}, },
@@ -107,6 +133,19 @@ module.exports = {
}, },
}, },
methods: { methods: {
onChangeCheckbox(item) {
if (item.checked) {
item.serahQty = item.sisaQty
} else {
item.serahQty = item.originalQty - item.sisaQty
}
},
qtyRules(originalQty) {
return [
v => Number(v) > 0 || "Jumlah harus diatas 0",
v => Number(v) <= Number(originalQty) || "Jumlah melebihi inventaris yang diterima"
];
},
closeHandOver() { closeHandOver() {
this.$store.commit("ro/update_selected_staff", {}); this.$store.commit("ro/update_selected_staff", {});
this.dialog_handover = false this.dialog_handover = false
@@ -114,11 +153,20 @@ module.exports = {
}, },
async simpanHandOver() { async simpanHandOver() {
if (this.$refs.formhandover.validate()) { if (this.$refs.formhandover.validate()) {
let checked = this.list_itembelumserah.filter((ele) => ele.checked);
if (checked.length < 1) {
console.log("no item selected");
return;
}
let prm = { let prm = {
staffID: this.selected_staff.M_UserID, staffID: this.selected_staff.M_UserID,
receiveOrderPoID: this.selected_ro.ReceiveOrderPoID, receiveOrderPoID: this.selected_ro.ReceiveOrderPoID,
ruanganID: this.selected_ro.M_RuanganID ruanganID: this.selected_ruangan,
item: checked
} }
// console.log("parameter", prm);
await this.$store.dispatch("ro/saveHandover", prm); await this.$store.dispatch("ro/saveHandover", prm);
this.$refs.formhandover.resetValidation(); this.$refs.formhandover.resetValidation();
} }

View File

@@ -1,45 +1,41 @@
<template> <template>
<v-dialog v-model="dialog_barcode" persistent max-width="600"> <v-dialog v-model="dialog_barcode" persistent max-width="50vw">
<v-card> <v-card>
<v-card-title style="color: #fff" class="headline grey darken-1">Cetak Barcode</v-card-title> <v-card-title style="color: #fff" class="headline grey darken-1">Cetak Barcode</v-card-title>
<v-card-text> <v-card-text>
<v-layout pa-2 class="grey lighten-2" row> <v-layout pa-2 class="grey lighten-2" row>
<v-flex xs1> <v-flex xs1>
<v-checkbox style="padding-top: 0; margin-top: 0" hide-details color="grey darken-1" <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"> :indeterminate="indeterminatex" @change="changeCbxAll(bar_chx_all)" v-model="bar_chx_all">
</v-checkbox> </v-checkbox>
</v-flex> </v-flex>
<v-flex xs5> ITEM </v-flex> <v-flex xs3> ITEM </v-flex>
<v-flex xs5> NUMBER BARCODE </v-flex> <v-flex xs3> RUANGAN </v-flex>
<v-flex xs1> CETAK </v-flex> <v-flex xs4> NOMOR BARCODE </v-flex>
</v-layout> <v-flex xs1> CETAK </v-flex>
<v-layout align-center pa-2 v-for="(vs, idx) in barcodes" :key="vs.id" class="grey lighten-4" row> </v-layout>
<v-flex xs1> <v-layout align-center pa-2 v-for="(vs, idx) in barcodes" :key="vs.id" class="grey lighten-4" row>
<v-checkbox style="padding-top: 0; margin-top: 0" color="grey darken-1" hide-details v-model="vs.chex" <v-flex xs1>
@change="checkTop()"></v-checkbox> <v-checkbox style="padding-top: 0; margin-top: 0" color="grey darken-1" hide-details
</v-flex> v-model="vs.chex" @change="checkTop()"></v-checkbox>
<v-flex xs5> </v-flex>
{{ vs.M_ItemDesc }} <v-flex xs3>{{ vs.M_ItemDesc }}</v-flex>
</v-flex> <v-flex xs3>{{ vs.M_RuanganName }}</v-flex>
<v-flex xs5> <v-flex xs4>{{ vs.T_BarcodeBarangNumber }}</v-flex>
{{ vs.T_BarcodeBarangNumber }} <v-flex xs1>
</v-flex> <span @click="printSingleBarcode(vs)"
<v-flex xs1> class="icon-medium-fill-base-small xs1 white--text grey darken-1 ml-1 icon-print"></span>
<span @click="printSingleBarcode(vs)" </v-flex>
class="icon-medium-fill-base-small xs1 white--text grey darken-1 ml-1 icon-print"></span> </v-layout>
</v-flex> </v-card-text>
</v-layout> <v-card-actions>
</v-card-text> <v-spacer></v-spacer>
<v-card-actions> <v-btn color="grey darken-1" flat @click="dialog_barcode = false">Tutup</v-btn>
<v-spacer></v-spacer> <v-btn dark color="grey darken-1" @click="printMultipleBarcode">Cetak terpilih
<v-btn color="grey darken-1" flat @click="dialog_barcode = false">Tutup</v-btn> [ {{ selected_barcode.length }} ]
<!-- <v-btn dark color="grey darken-3" @click="printRobo" </v-btn>
>Cetak Robo </v-card-actions>
</v-btn> --> </v-card>
<v-btn dark color="grey darken-1" @click="printMultipleBarcode">Cetak terpilih [ {{ selected_barcode.length }}
]</v-btn>
</v-card-actions>
</v-card>
</v-dialog> </v-dialog>
</template> </template>
@@ -174,4 +170,4 @@ module.exports = {
}, },
}, },
} }
</script> </script>

View File

@@ -33,30 +33,30 @@
</v-layout> </v-layout>
<v-layout row> <v-layout row>
<v-flex xs6 pr-1> <v-flex xs4 pr-1>
<v-text-field label="Referensi (No Pengiriman/No Supplier)*" :rules="rules_ref" <v-text-field label="Referensi (No Pengiriman/No Supplier)*" :rules="rules_ref"
v-model="form_receive.referensi" outline required v-model="form_receive.referensi" outline required
placeholder="salah satu nomor pengiriman / supplier"></v-text-field> placeholder="salah satu nomor pengiriman / supplier"></v-text-field>
</v-flex> </v-flex>
<v-flex xs6 pl-1> <v-flex xs4 px-1>
<v-autocomplete v-model="form_receive.warehouse" :rules="rules_warehouse" <v-autocomplete v-model="form_receive.warehouse" :rules="rules_warehouse"
:items="list_warehouse" outline required item-text="WarehouseName" label="Gudang*" :items="list_warehouse" outline required item-text="WarehouseName" label="Gudang*"
return-object></v-autocomplete> return-object></v-autocomplete>
</v-flex> </v-flex>
</v-layout> <v-flex xs4 pl-1>
<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-text-field label="Biaya Ekspedisi" outline prefix="Rp. "
v-model="form_receive.shipping_cost" hide-details></v-text-field> v-model="form_receive.shipping_cost" hide-details></v-text-field>
</v-flex> </v-flex>
</v-layout> </v-layout>
<!-- <v-layout row>
<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-layout> -->
<v-layout row wrap> <v-layout row wrap>
<v-flex xs12> <v-flex xs12>
<v-textarea v-model="form_receive.note" hide-details auto-grow rows="1" label="Catatan" <v-textarea v-model="form_receive.note" hide-details auto-grow rows="1" label="Catatan"

View File

@@ -23,36 +23,30 @@
<v-autocomplete v-model="form_receive.supplier" hide-details :items="list_supplier" <v-autocomplete v-model="form_receive.supplier" hide-details :items="list_supplier"
return-object outline item-text="SupplierName" label="Supplier"></v-autocomplete> return-object outline item-text="SupplierName" label="Supplier"></v-autocomplete>
</v-flex> </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>
<v-layout row mt-2> <v-layout row mt-2>
<v-flex xs6 pr-1> <v-flex xs4 pr-1>
<v-text-field label="Referensi (No Pengiriman/No Supplier)*" v-model="form_receive.referensi" <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> outline hide-details placeholder="salah satu nomor pengiriman / supplier"></v-text-field>
</v-flex> </v-flex>
<v-flex xs6 pl-1> <v-flex xs4 px-1>
<v-autocomplete v-model="form_receive.warehouse" hide-details :items="list_warehouse" outline <v-autocomplete v-model="form_receive.warehouse" hide-details :items="list_warehouse" outline
return-object item-text="WarehouseName" label="Gudang"></v-autocomplete> return-object item-text="WarehouseName" label="Gudang"></v-autocomplete>
</v-flex> </v-flex>
<v-flex xs4 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>
<v-layout row mt-2> <!-- <v-layout row mt-2>
<v-flex xs6 pr-1> <v-flex xs6 pr-1>
<v-autocomplete v-model="form_receive.lokasi" :items="list_lokasi" return-object outline <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 item-value="M_RuanganID" item-text="M_RuanganName" label="Lokasi*" hide-details
required></v-autocomplete> required></v-autocomplete>
</v-flex> </v-flex>
<v-flex xs6 pl-1> </v-layout> -->
<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-layout row mt-2 wrap>
<v-flex xs12> <v-flex xs12>

View File

@@ -377,6 +377,7 @@ module.exports = {
this.$store.commit("ro/update_selected_ro", data); this.$store.commit("ro/update_selected_ro", data);
this.$store.dispatch("ro/getRuangan"); this.$store.dispatch("ro/getRuangan");
this.$store.dispatch("ro/getListStaff", 'Y'); this.$store.dispatch("ro/getListStaff", 'Y');
this.$store.dispatch("ro/getItemSerahTerima");
this.$store.commit("ro/update_dialog_handover", true); this.$store.commit("ro/update_dialog_handover", true);
}, },
uploadDoct(data) { uploadDoct(data) {

View File

@@ -40,6 +40,7 @@ export default {
indeterminatex: false, indeterminatex: false,
bar_chx_all: false, bar_chx_all: false,
selected_barcode: [], selected_barcode: [],
list_itembelumserah: []
}, },
mutations: { mutations: {
update_dialog_confirmation(state, data) { update_dialog_confirmation(state, data) {
@@ -119,6 +120,9 @@ export default {
}, },
update_selected_barcode(state, val) { update_selected_barcode(state, val) {
state.selected_barcode = val state.selected_barcode = val
},
update_list_itembelumserah(state, val) {
state.list_itembelumserah = val
} }
}, },
actions: { actions: {
@@ -243,7 +247,7 @@ export default {
isUpfront: element.PurchaseOrderShippingCostStatus isUpfront: element.PurchaseOrderShippingCostStatus
} }
const isExist = context.rootState.form.shipping_info.some( const isExist = temp_ship.some(
item => item.num_po == element.PurchaseOrderNumber item => item.num_po == element.PurchaseOrderNumber
); );
if (!isExist) { if (!isExist) {
@@ -273,9 +277,9 @@ export default {
note: context.state.selected_ro.ReceiveOrderPoNote note: context.state.selected_ro.ReceiveOrderPoNote
} }
context.commit("form/update_form_receive", form, {root: true}); context.commit("form/update_form_receive", form, { root: true });
context.commit("form/update_shipping_info", temp_ship, {root: true}); context.commit("form/update_shipping_info", temp_ship, { root: true });
context.commit("form/update_form_receive_item", resp.data, {root: true}); context.commit("form/update_form_receive_item", resp.data, { root: true });
} }
} catch (error) { } catch (error) {
context.commit("update_snackbar", { context.commit("update_snackbar", {
@@ -342,6 +346,30 @@ export default {
}); });
} }
}, },
async getItemSerahTerima(context) {
try {
let param = {
token: one_token(),
ROID: context.state.selected_ro.ReceiveOrderPoID
}
let resp = await api.getInventarisBelumSerah(param);
if (resp.status != 'OK') {
context.commit("update_snackbar", {
color: 'error',
msg: resp.message,
isOpen: true
});
} else {
context.commit("update_list_itembelumserah", resp.data);
}
} catch(error) {
context.commit("update_snackbar", {
color: 'error',
msg: error.message,
isOpen: true
});
}
},
async saveHandover(context, param) { async saveHandover(context, param) {
try { try {
param.token = one_token() param.token = one_token()