add progress
This commit is contained in:
@@ -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) {
|
||||
try {
|
||||
var resp = await axios.post(URL + '/', params);
|
||||
|
||||
@@ -8,18 +8,32 @@
|
||||
<v-card-text>
|
||||
<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-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-flex xs6 pr-1>
|
||||
<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 xs6 pl-1>
|
||||
<v-autocomplete label="Staff Penerima*" outline :rules="rules_staff" return-object
|
||||
@@ -48,22 +62,26 @@ module.exports = {
|
||||
{ M_RuanganID: 1, M_RuanganName: "bonde" }
|
||||
],
|
||||
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'],
|
||||
headers: [
|
||||
{
|
||||
text: "ITEM", align: "center", sortable: false, value: "itemname",
|
||||
width: "60%", class: "pa-2 blue lighten-3 white--text",
|
||||
text: "", align: "center", sortable: false, value: "checked",
|
||||
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",
|
||||
},
|
||||
{
|
||||
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",
|
||||
},
|
||||
],
|
||||
items: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -99,6 +117,14 @@ module.exports = {
|
||||
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() {
|
||||
return this.$store.state.ro.list_staff
|
||||
},
|
||||
@@ -107,6 +133,19 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
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() {
|
||||
this.$store.commit("ro/update_selected_staff", {});
|
||||
this.dialog_handover = false
|
||||
@@ -114,11 +153,20 @@ module.exports = {
|
||||
},
|
||||
async simpanHandOver() {
|
||||
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 = {
|
||||
staffID: this.selected_staff.M_UserID,
|
||||
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);
|
||||
this.$refs.formhandover.resetValidation();
|
||||
}
|
||||
|
||||
@@ -1,45 +1,41 @@
|
||||
<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 v-model="dialog_barcode" persistent max-width="50vw">
|
||||
<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 xs3> ITEM </v-flex>
|
||||
<v-flex xs3> RUANGAN </v-flex>
|
||||
<v-flex xs4> NOMOR 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 xs3>{{ vs.M_ItemDesc }}</v-flex>
|
||||
<v-flex xs3>{{ vs.M_RuanganName }}</v-flex>
|
||||
<v-flex xs4>{{ 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-1" @click="printMultipleBarcode">Cetak terpilih
|
||||
[ {{ selected_barcode.length }} ]
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -33,30 +33,30 @@
|
||||
</v-layout>
|
||||
|
||||
<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-model="form_receive.referensi" outline required
|
||||
placeholder="salah satu nomor pengiriman / supplier"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 pl-1>
|
||||
<v-flex xs4 px-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-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 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-flex xs12>
|
||||
<v-textarea v-model="form_receive.note" hide-details auto-grow rows="1" label="Catatan"
|
||||
|
||||
@@ -23,36 +23,30 @@
|
||||
<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-flex xs4 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-flex xs4 px-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-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 row mt-2>
|
||||
<!-- <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> -->
|
||||
|
||||
<v-layout row mt-2 wrap>
|
||||
<v-flex xs12>
|
||||
|
||||
@@ -377,6 +377,7 @@ module.exports = {
|
||||
this.$store.commit("ro/update_selected_ro", data);
|
||||
this.$store.dispatch("ro/getRuangan");
|
||||
this.$store.dispatch("ro/getListStaff", 'Y');
|
||||
this.$store.dispatch("ro/getItemSerahTerima");
|
||||
this.$store.commit("ro/update_dialog_handover", true);
|
||||
},
|
||||
uploadDoct(data) {
|
||||
|
||||
@@ -40,6 +40,7 @@ export default {
|
||||
indeterminatex: false,
|
||||
bar_chx_all: false,
|
||||
selected_barcode: [],
|
||||
list_itembelumserah: []
|
||||
},
|
||||
mutations: {
|
||||
update_dialog_confirmation(state, data) {
|
||||
@@ -119,6 +120,9 @@ export default {
|
||||
},
|
||||
update_selected_barcode(state, val) {
|
||||
state.selected_barcode = val
|
||||
},
|
||||
update_list_itembelumserah(state, val) {
|
||||
state.list_itembelumserah = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@@ -243,7 +247,7 @@ export default {
|
||||
isUpfront: element.PurchaseOrderShippingCostStatus
|
||||
}
|
||||
|
||||
const isExist = context.rootState.form.shipping_info.some(
|
||||
const isExist = temp_ship.some(
|
||||
item => item.num_po == element.PurchaseOrderNumber
|
||||
);
|
||||
if (!isExist) {
|
||||
@@ -273,9 +277,9 @@ export default {
|
||||
note: context.state.selected_ro.ReceiveOrderPoNote
|
||||
}
|
||||
|
||||
context.commit("form/update_form_receive", form, {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", form, { root: true });
|
||||
context.commit("form/update_shipping_info", temp_ship, { root: true });
|
||||
context.commit("form/update_form_receive_item", resp.data, { root: true });
|
||||
}
|
||||
} catch (error) {
|
||||
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) {
|
||||
try {
|
||||
param.token = one_token()
|
||||
|
||||
Reference in New Issue
Block a user