-
+
@@ -165,16 +142,16 @@
import formHandler from '../../../general/mixins/formHandler';
export default {
data(){
- return {
- submitted: false,
- product: {
- stockCode: '',
- description: '',
- quantity: 1,
- unit_price: 0,
- },
- products: []
- }
+ return {
+ submitted: false,
+ product: {
+ stockCode: '',
+ description: '',
+ quantity: 1,
+ unit_price: 0,
+ },
+ products: [],
+ }
},
created() {
this.products = this.data.purchase_order ? this.data.purchase_order.details : [];
@@ -231,7 +208,16 @@
quantity: 1,
unit_price: 0,
};
-
+ },
+ updateProduct(product, index){
+ console.log(product);
+ this.products[index] = {
+ stockCode: product.stockCode,
+ description: product.description,
+ quantity: product.quantity,
+ unit_price: product.unit_price,
+ total: product.quantity * parseFloat((product.unit_price).toString().replace(',', ''))
+ };
},
removeProduct(index){
this.products.splice(index, 1);
diff --git a/resources/assets/vue/components/bookings/forms/PurchaseOrderItemFormComponent.vue b/resources/assets/vue/components/bookings/forms/PurchaseOrderItemFormComponent.vue
new file mode 100644
index 00000000..c25ad961
--- /dev/null
+++ b/resources/assets/vue/components/bookings/forms/PurchaseOrderItemFormComponent.vue
@@ -0,0 +1,92 @@
+
+
+
+
+
{{product.stockCode}}
+
+
+
+
{{product.description}}
+
+
+
+
{{product.quantity}}
+
+
+
+
{{product.unit_price}}
+
+
+
+
+
{{(Math.round((productTotal + Number.EPSILON) * 100) / 100).toFixed(2) }}
+
+
+
+
+
+
+
+
+
\ No newline at end of file