feature: po pay downpayment
This commit is contained in:
@@ -6,12 +6,6 @@
|
||||
<v-btn icon @click="createNewOrder()">
|
||||
<v-icon large>add_box</v-icon>
|
||||
</v-btn>
|
||||
<!-- <v-btn icon @click="createNewContract()">
|
||||
<v-icon large>add_box</v-icon>
|
||||
</v-btn>
|
||||
<v-btn icon @click="createNewOrder()">
|
||||
<v-icon large>add_box</v-icon>
|
||||
</v-btn> -->
|
||||
</v-toolbar>
|
||||
|
||||
<v-card class="pa-2">
|
||||
@@ -66,8 +60,17 @@
|
||||
<div v-show="props.item.PurchaseOrderStatus == 'Draft'">
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="warning" dark v-on="on" @click="" small
|
||||
style="min-width: 40px; margin: 0;">
|
||||
<v-btn color="green" dark v-on="on" @click="openDialogAttachment(props.item)"
|
||||
small style="min-width: 40px; margin: 0;">
|
||||
<v-icon small>attachment</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Upload Attachment</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="warning" dark v-on="on" @click="sendRequestPO(props.item)"
|
||||
small style="min-width: 40px; margin: 0;">
|
||||
<v-icon small>send</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
@@ -75,8 +78,8 @@
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="info" dark v-on="on" @click="" small
|
||||
style="min-width: 40px; margin: 0;">
|
||||
<v-btn color="info" dark v-on="on" @click="openEditFormOrder(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small>
|
||||
<v-icon small>edit</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
@@ -84,8 +87,8 @@
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="error" dark v-on="on" @click="" small
|
||||
style="min-width: 40px; margin: 0;">
|
||||
<v-btn color="error" dark v-on="on" @click="openDialogDeleteOrder(props.item)"
|
||||
small style="min-width: 40px; margin: 0;">
|
||||
<v-icon small>delete</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
@@ -95,12 +98,21 @@
|
||||
<div v-show="props.item.PurchaseOrderStatus != 'Draft'">
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="warning" dark v-on="on" @click="viewPO(props.item)" small
|
||||
style="min-width: 40px; margin: 0;">
|
||||
<v-btn color="green" dark v-on="on" @click="openDialogAttachment(props.item)"
|
||||
small style="min-width: 40px; margin: 0;">
|
||||
<v-icon small>attachment</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Upload Attachment</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="warning" dark v-on="on" @click="viewDetailPO(props.item)"
|
||||
small style="min-width: 40px; margin: 0;">
|
||||
<v-icon small>visibility</v-icon>
|
||||
</v-btn>
|
||||
<span>Detail PO</span>
|
||||
</template>
|
||||
<span>Detail PO</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
</td>
|
||||
@@ -119,11 +131,7 @@
|
||||
</v-snackbar>
|
||||
|
||||
<dialog-add-attchment></dialog-add-attchment>
|
||||
<dialog-add-item-aset></dialog-add-item-aset>
|
||||
<dialog-delete-order></dialog-delete-order>
|
||||
|
||||
<!-- <dialog-form-order-aset></dialog-form-order-aset> -->
|
||||
<!-- <dialog-create-kontrak></dialog-create-kontrak> -->
|
||||
<dialog-create-order></dialog-create-order>
|
||||
</div>
|
||||
</template>
|
||||
@@ -131,8 +139,9 @@
|
||||
<script>
|
||||
module.exports = {
|
||||
mounted() {
|
||||
this.$store.dispatch('poasset/lookupVendor')
|
||||
this.$store.dispatch('poasset/lookupCabang')
|
||||
this.$store.dispatch('orderAsset/listingCabang');
|
||||
this.$store.dispatch('orderAsset/listingSupplier');
|
||||
this.$store.dispatch('common/getListingPOAsset');
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -176,36 +185,33 @@ module.exports = {
|
||||
},
|
||||
components: {
|
||||
'dialog-add-attchment': httpVueLoader('./dialog-add-attachment.vue'),
|
||||
'dialog-form-order-aset': httpVueLoader('./dialog-form-order-aset.vue'),
|
||||
'dialog-add-item-aset': httpVueLoader('./dialog-add-item-aset.vue'),
|
||||
'dialog-delete-order': httpVueLoader('./dialog-delete-order.vue'),
|
||||
|
||||
'dialog-create-kontrak': httpVueLoader('./dialog-create-contract.vue'),
|
||||
'dialog-create-order': httpVueLoader('./dialog-create-order.vue'),
|
||||
},
|
||||
computed: {
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.poasset.snackbar;
|
||||
return this.$store.state.common.snackbar;
|
||||
},
|
||||
set(val) {
|
||||
return this.$store.commit("poasset/update_snackbar", val);
|
||||
return this.$store.commit("common/update_snackbar", val);
|
||||
}
|
||||
},
|
||||
filterpo: {
|
||||
get() {
|
||||
return this.$store.state.poasset.filterpo;
|
||||
return this.$store.state.common.filterpo;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("poasset/update_filterpo", val);
|
||||
this.$store.commit("common/update_filterpo", val);
|
||||
this.$store.dispatch('common/getListingPOAsset');
|
||||
}
|
||||
},
|
||||
currpage: {
|
||||
get() {
|
||||
return this.$store.state.poasset.currpage;
|
||||
return this.$store.state.common.currpage;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("poasset/update_currpage", val);
|
||||
this.$store.commit("common/update_currpage", val);
|
||||
}
|
||||
},
|
||||
formattedStartdate() {
|
||||
@@ -215,15 +221,18 @@ module.exports = {
|
||||
return this.formatDate(this.filterpo.enddate);
|
||||
},
|
||||
list_status() {
|
||||
return this.$store.state.poasset.list_status;
|
||||
return this.$store.state.common.list_status;
|
||||
},
|
||||
list_asetpo() {
|
||||
return this.$store.state.poasset.list_asetpo;
|
||||
return this.$store.state.common.list_asetpo;
|
||||
},
|
||||
pagelength() {
|
||||
const total = this.list_asetpo.total;
|
||||
if (total === undefined || total < 1) return 1;
|
||||
return Math.ceil(total / 10);
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.common.loading_process;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -237,21 +246,58 @@ module.exports = {
|
||||
if (isNaN(num)) return 0;
|
||||
return num.toFixed(2).replace('.', ',').replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
||||
},
|
||||
createNewOrder() {
|
||||
this.$store.commit('poasset/update_dialog_form_orderaset', true);
|
||||
},
|
||||
createNewContract() {
|
||||
this.$store.commit("kontrakAsset/update_dialog_create_contract", true);
|
||||
},
|
||||
createNewOrder() {
|
||||
this.$store.commit("orderAsset/update_dialog_create_order", true);
|
||||
},
|
||||
viewPO(item) {
|
||||
openDialogAttachment(item) {
|
||||
let param = {
|
||||
contractID: item.contractID,
|
||||
poID: item.PurchaseOrderID
|
||||
};
|
||||
|
||||
if (item.PurchaseOrderStatus != 'Draft') {
|
||||
this.$store.commit("common/update_viewonlymode", true);
|
||||
}
|
||||
|
||||
this.$store.dispatch('common/getAssetAttachment', param);
|
||||
this.$store.commit("common/update_selected_orderaset", item);
|
||||
this.$store.commit("common/update_dialog_attachment", true);
|
||||
},
|
||||
openDialogDeleteOrder(item) {
|
||||
if (!this.loading_process) {
|
||||
this.$store.commit("common/update_selected_orderaset", item)
|
||||
this.$store.commit("common/update_dialog_deleteorder", true);
|
||||
} else {
|
||||
const snac = { color: 'warning', msg: 'terdapat proses lain yang masih berjalan', state: true };
|
||||
this.snackbar = snac;
|
||||
}
|
||||
},
|
||||
sendRequestPO(item) {
|
||||
if (item.AttachmentCount < 1) {
|
||||
const snac = { color: 'warning', msg: 'belum upload attachment', state: true };
|
||||
this.snackbar = snac;
|
||||
} else if (!this.loading_process) {
|
||||
this.$store.dispatch('kontrakAsset/sendRequestPO', item.PurchaseOrderID);
|
||||
} else {
|
||||
const snac = { color: 'warning', msg: 'terdapat proses lain yang masih berjalan', state: true };
|
||||
this.snackbar = snac;
|
||||
}
|
||||
},
|
||||
openEditFormOrder(item) {
|
||||
this.$store.dispatch("kontrakAsset/getDetailDataPO", item.PurchaseOrderID);
|
||||
},
|
||||
viewDetailPO(item) {
|
||||
this.$store.commit("common/update_viewonlymode", true);
|
||||
this.$store.dispatch("kontrakAsset/getDetailDataPO", item.PurchaseOrderID);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
filterpo: {
|
||||
handler(val) {
|
||||
this.$store.dispatch('common/getListingPOAsset');
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user