Tweak default product view
This commit is contained in:
		
							parent
							
								
									85c43e95e5
								
							
						
					
					
						commit
						29220093dd
					
				
					 1 changed files with 21 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -1,19 +1,26 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <byjove-model-crud model-name="Product"
 | 
			
		||||
                     :label-renderer="renderLabel"
 | 
			
		||||
                     :allow-edit="allowEdit"
 | 
			
		||||
                     :mode="mode"
 | 
			
		||||
                     @refresh="record => { product = record }">
 | 
			
		||||
 | 
			
		||||
    <div style="display: flex; justify-content: space-between; margin-bottom: 0.5rem;">
 | 
			
		||||
 | 
			
		||||
      <b-field label="Item ID">
 | 
			
		||||
        <b-input v-if="mode == 'creating' || mode == 'editing'"
 | 
			
		||||
                 v-model="product.item_id">
 | 
			
		||||
        </b-input>
 | 
			
		||||
        <span v-if="mode == 'viewing' || mode == 'deleting'">
 | 
			
		||||
          {{ product.item_id }}
 | 
			
		||||
        </span>
 | 
			
		||||
      </b-field>
 | 
			
		||||
      <div style="display: flex; flex-direction: column;">
 | 
			
		||||
 | 
			
		||||
        <b-field label="Brand">
 | 
			
		||||
          {{ product.brand_name }}
 | 
			
		||||
        </b-field>
 | 
			
		||||
 | 
			
		||||
        <b-field label="Description">
 | 
			
		||||
          {{ product.description }}
 | 
			
		||||
        </b-field>
 | 
			
		||||
 | 
			
		||||
        <b-field label="Size">
 | 
			
		||||
          {{ product.size }}
 | 
			
		||||
        </b-field>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <img :src="product.image_url" />
 | 
			
		||||
    </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +49,7 @@
 | 
			
		|||
      <div class="card-content">
 | 
			
		||||
        <div class="content">
 | 
			
		||||
 | 
			
		||||
          <b-field label="Preferred Vendor">
 | 
			
		||||
          <b-field label="Preferred">
 | 
			
		||||
            {{ product.vendor_name }} @ {{ product.default_unit_cost_display }}
 | 
			
		||||
          </b-field>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -86,5 +93,10 @@ export default {
 | 
			
		|||
            product: {},
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        renderLabel(product) {
 | 
			
		||||
            return product.product_key
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue