-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#324 Temporarily solution for new product modal
- Loading branch information
Jorr.it
committed
Jan 5, 2023
1 parent
c74bc33
commit a13919c
Showing
11 changed files
with
234 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
<div id="product-new" | ||
data-purchaseorderid="{{ purchaseOrderId }}" | ||
data-salesorderid="{{ salesOrderId }}" | ||
data-producttypeid="{{ productTypeId }}" | ||
></div> | ||
|
||
{{ encore_entry_script_tags('product-new') }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<template> | ||
<div> | ||
|
||
<ModalEdit urlPrefix="../../" | ||
:purchaseOrderId="purchaseOrderId" :salesOrderId="salesOrderId" :productTypeId="productTypeId" | ||
:productStatuses="productStatuses" :locations="locations" :productTypes="productTypes" | ||
/> | ||
|
||
</div> | ||
</template> | ||
|
||
<script> | ||
import ModalEdit from '../ProductStock/components/modals/ModalEdit.vue' | ||
export default { | ||
name: 'App', | ||
components: { ModalEdit }, | ||
data() { | ||
var dataElement = document.querySelector('div#product-new'); | ||
var purchaseOrderId = parseInt(dataElement.dataset.purchaseorderid); | ||
var salesOrderId = parseInt(dataElement.dataset.salesorderid); | ||
var productTypeId = parseInt(dataElement.dataset.producttypeid); | ||
return { | ||
purchaseOrderId, | ||
salesOrderId, | ||
productTypeId, | ||
productId: null, | ||
productStatuses: [], | ||
productTypes: [], | ||
locations: [], | ||
} | ||
}, | ||
computed: { | ||
offset() { | ||
return (this.page-1) * this.pageLength | ||
}, | ||
pageCount() { | ||
return Math.ceil(parseFloat(this.productCount) / this.pageLength) | ||
}, | ||
}, | ||
mounted() { | ||
this.loadMeta() | ||
$('#modalEdit').modal('show') | ||
}, | ||
methods: { | ||
loadMeta() { | ||
this.axios.get("../../vue/product/meta") | ||
.then(response => { | ||
this.productStatuses = response.data.productStatuses | ||
this.productTypes = response.data.productTypes | ||
this.locations = response.data.locations | ||
}) | ||
}, | ||
closeModal() { | ||
this.product=null | ||
this.modal=null | ||
$('.modal').modal('hide') | ||
}, | ||
formattedPrice(product, withEuroSign) { | ||
if (!product || !product.price) return '' | ||
var price = parseFloat(product.price) / 100 | ||
price = price.toLocaleString('nl', {minimumFractionDigits: 2, maximumFractionDigits: 2}) | ||
return withEuroSign ? '€ '+price : price | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Vue from 'vue' | ||
import axios from 'axios' | ||
import VueAxios from 'vue-axios' | ||
import App from './App.vue' | ||
|
||
Vue.use(VueAxios, axios) | ||
|
||
new Vue({ render: h => h(App) }).$mount('#product-new') |
File renamed without changes.
Oops, something went wrong.