[pricelist][prettier] some style up
This commit is contained in:
		
							parent
							
								
									86bb722623
								
							
						
					
					
						commit
						dc948e6f11
					
				| 
						 | 
				
			
			@ -84,9 +84,12 @@
 | 
			
		|||
          </div>
 | 
			
		||||
          <q-separator v-if="index < volume.prices.length - 1" />
 | 
			
		||||
        </div>
 | 
			
		||||
          <div v-if='!public && !nodetails && isUnderMinPrice' class='fit warning bg-red text-center text-white text-body1'>
 | 
			
		||||
            Einer der Preise ist unterhalb des niedrigsten minimal Preises.
 | 
			
		||||
          </div>
 | 
			
		||||
        <div
 | 
			
		||||
          v-if="!public && !nodetails && isUnderMinPrice"
 | 
			
		||||
          class="fit warning bg-red text-center text-white text-body1"
 | 
			
		||||
        >
 | 
			
		||||
          Einer der Preise ist unterhalb des niedrigsten minimal Preises.
 | 
			
		||||
        </div>
 | 
			
		||||
        <div v-if="editable" class="full-width row justify-end text-right">
 | 
			
		||||
          <q-btn round icon="mdi-plus" size="sm" color="primary">
 | 
			
		||||
            <q-tooltip> Preis hinzufügen </q-tooltip>
 | 
			
		||||
| 
						 | 
				
			
			@ -134,7 +137,7 @@ export default defineComponent({
 | 
			
		|||
      required: true,
 | 
			
		||||
    },
 | 
			
		||||
    cost_per_volume: {
 | 
			
		||||
      type: undefined
 | 
			
		||||
      type: undefined,
 | 
			
		||||
    },
 | 
			
		||||
    editable: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
| 
						 | 
				
			
			@ -274,21 +277,21 @@ export default defineComponent({
 | 
			
		|||
 | 
			
		||||
    const isUnderMinPrice = computed(() => {
 | 
			
		||||
      if (volumes.value) {
 | 
			
		||||
        const this_volume = volumes.value.find(a => a.id === volume.value)
 | 
			
		||||
        const this_volume = volumes.value.find((a) => a.id === volume.value);
 | 
			
		||||
        if (this_volume) {
 | 
			
		||||
          if (this_volume.min_prices.length > 0) {
 | 
			
		||||
            const min_price = this_volume.min_prices.sort((a, b) => {
 | 
			
		||||
              if (a.price > b.price) return 1
 | 
			
		||||
              if (a.price < b.price) return -1
 | 
			
		||||
              return 0
 | 
			
		||||
            })[0]
 | 
			
		||||
            console.log('min_price', min_price)
 | 
			
		||||
            return this_volume.prices.some(a => a.price < min_price.price)
 | 
			
		||||
              if (a.price > b.price) return 1;
 | 
			
		||||
              if (a.price < b.price) return -1;
 | 
			
		||||
              return 0;
 | 
			
		||||
            })[0];
 | 
			
		||||
            console.log('min_price', min_price);
 | 
			
		||||
            return this_volume.prices.some((a) => a.price < min_price.price);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
        return false
 | 
			
		||||
    })
 | 
			
		||||
      return false;
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      volumes,
 | 
			
		||||
| 
						 | 
				
			
			@ -303,7 +306,7 @@ export default defineComponent({
 | 
			
		|||
      deleteVolume,
 | 
			
		||||
      deleteIngredient,
 | 
			
		||||
      change,
 | 
			
		||||
      isUnderMinPrice
 | 
			
		||||
      isUnderMinPrice,
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -125,7 +125,7 @@
 | 
			
		|||
    <q-card-section :key="key">
 | 
			
		||||
      <drink-price-volumes
 | 
			
		||||
        v-model="edit_volumes"
 | 
			
		||||
        :cost_per_volume='cost_per_volume'
 | 
			
		||||
        :cost_per_volume="cost_per_volume"
 | 
			
		||||
        editable
 | 
			
		||||
        @update="updateVolume"
 | 
			
		||||
        @delete-volume="deleteVolume"
 | 
			
		||||
| 
						 | 
				
			
			@ -315,7 +315,9 @@ export default defineComponent({
 | 
			
		|||
      set: (val: number) => ((<Drink>edit_drink.value).cost_per_volume = val),
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const hasIngredients = computed(() => edit_volumes.value?.some(a => a.ingredients.length > 0))
 | 
			
		||||
    const hasIngredients = computed(() =>
 | 
			
		||||
      edit_volumes.value?.some((a) => a.ingredients.length > 0)
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      edit_drink,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue