Merge branch 'main' into BarraDeNavegacion
This commit is contained in:
		@@ -5,7 +5,7 @@
 | 
				
			|||||||
  <meta charset="UTF-8" />
 | 
					  <meta charset="UTF-8" />
 | 
				
			||||||
  <link rel="icon" href="/favicon.ico" />
 | 
					  <link rel="icon" href="/favicon.ico" />
 | 
				
			||||||
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 | 
					  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 | 
				
			||||||
  <title>Welcome to Vuetify 3</title>
 | 
					  <title>Don Confiao</title>
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								tienda_ilusion/don_confiao/frontend/don-confiao/public/1.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								tienda_ilusion/don_confiao/frontend/don-confiao/public/1.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 15 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 55 KiB  | 
@@ -1,7 +1,9 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <v-app>
 | 
					  <v-app>
 | 
				
			||||||
      <NavBar />
 | 
					      <NavBar />
 | 
				
			||||||
      <router-view />
 | 
					      <v-main>
 | 
				
			||||||
 | 
					          <router-view />
 | 
				
			||||||
 | 
					      </v-main>
 | 
				
			||||||
  </v-app>
 | 
					  </v-app>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 46 KiB  | 
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <v-app-bar color="primary" prominent>
 | 
					    <v-app-bar color="primary" prominent>
 | 
				
			||||||
    <v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
 | 
					    <v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
 | 
				
			||||||
    <v-toolbar-title>Menu</v-toolbar-title>
 | 
					    <v-toolbar-title>Menu</v-toolbar-title>
 | 
				
			||||||
    <v-spacer></v-spacer>
 | 
					    <v-spacer></v-spacer>
 | 
				
			||||||
@@ -22,6 +22,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
 export default {
 | 
					 export default {
 | 
				
			||||||
 | 
					     name: 'NavBar',
 | 
				
			||||||
     data: () => ({
 | 
					     data: () => ({
 | 
				
			||||||
         drawer: false,
 | 
					         drawer: false,
 | 
				
			||||||
         group: null,
 | 
					         group: null,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,101 +1,94 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <v-app-bar color="primary" prominent>
 | 
					  <v-container>
 | 
				
			||||||
    <v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
 | 
					 | 
				
			||||||
    <v-toolbar-title>My files</v-toolbar-title>
 | 
					 | 
				
			||||||
    <v-spacer></v-spacer>
 | 
					 | 
				
			||||||
    <template v-if="$vuetify.display.mdAndUp">
 | 
					 | 
				
			||||||
      <v-btn icon="mdi-magnify" variant="text"></v-btn>
 | 
					 | 
				
			||||||
      <v-btn icon="mdi-filter" variant="text"></v-btn>
 | 
					 | 
				
			||||||
    </template>
 | 
					 | 
				
			||||||
    <v-btn icon="mdi-dots-vertical" variant="text"></v-btn>
 | 
					 | 
				
			||||||
  </v-app-bar>
 | 
					 | 
				
			||||||
  <v-navigation-drawer v-model="drawer"
 | 
					 | 
				
			||||||
                       :location="$vuetify.display.mobile ? 'bottom' : undefined"
 | 
					 | 
				
			||||||
                       temporary>
 | 
					 | 
				
			||||||
    <v-list :items="items"></v-list>
 | 
					 | 
				
			||||||
  </v-navigation-drawer>
 | 
					 | 
				
			||||||
  <v-container app>
 | 
					 | 
				
			||||||
      <v-form ref="form" v-model="valid">
 | 
					      <v-form ref="form" v-model="valid">
 | 
				
			||||||
        <v-text-field
 | 
					        <v-row>
 | 
				
			||||||
          v-model="purchase.date"
 | 
					          <v-col>
 | 
				
			||||||
          label="Fecha"
 | 
					          <v-select
 | 
				
			||||||
          type="date"
 | 
					            v-model="purchase.customer"
 | 
				
			||||||
          :rules="[rules.required]"
 | 
					            :items="clients"
 | 
				
			||||||
          required
 | 
					            item-title="name"
 | 
				
			||||||
        ></v-text-field>
 | 
					            item-value="id"
 | 
				
			||||||
        <v-select
 | 
					            label="Cliente"
 | 
				
			||||||
          v-model="purchase.customer"
 | 
					            :rules="[rules.required]"
 | 
				
			||||||
          :items="clients"
 | 
					            required
 | 
				
			||||||
          item-title="name"
 | 
					            class="mr-4"
 | 
				
			||||||
          item-value="id"
 | 
					            ></v-select>
 | 
				
			||||||
          label="Cliente"
 | 
					          </v-col>
 | 
				
			||||||
          :rules="[rules.required]"
 | 
					          <v-col
 | 
				
			||||||
          required
 | 
					            lg="2"
 | 
				
			||||||
        ></v-select>
 | 
					            >
 | 
				
			||||||
 | 
					          <v-text-field
 | 
				
			||||||
 | 
					            v-model="purchase.date"
 | 
				
			||||||
 | 
					            label="Fecha"
 | 
				
			||||||
 | 
					            type="date"
 | 
				
			||||||
 | 
					            :rules="[rules.required]"
 | 
				
			||||||
 | 
					            required
 | 
				
			||||||
 | 
					            ></v-text-field>
 | 
				
			||||||
 | 
					          </v-col>
 | 
				
			||||||
 | 
					          </v-row>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <v-textarea
 | 
					        <v-textarea
 | 
				
			||||||
          v-model="purchase.notes"
 | 
					          v-model="purchase.notes"
 | 
				
			||||||
          label="Notas"
 | 
					          label="Notas"
 | 
				
			||||||
 | 
					          rows="2"
 | 
				
			||||||
        ></v-textarea>
 | 
					        ></v-textarea>
 | 
				
			||||||
        <v-divider></v-divider>
 | 
					        <v-divider></v-divider>
 | 
				
			||||||
        <v-container>
 | 
					        <v-container>
 | 
				
			||||||
          <v-toolbar>
 | 
					          <v-toolbar>
 | 
				
			||||||
            <v-toolbar-title secondary>Productos</v-toolbar-title>
 | 
					            <v-toolbar-title secondary>Productos</v-toolbar-title>
 | 
				
			||||||
          </v-toolbar>
 | 
					          </v-toolbar>
 | 
				
			||||||
          <div v-for="(line, index) in purchase.saleline_set" :key="line.id">
 | 
					        <v-container v-for="(line, index) in purchase.saleline_set" :key="line.id">
 | 
				
			||||||
            <v-row>
 | 
					          <v-row>
 | 
				
			||||||
              <v-col>
 | 
					            <v-col>
 | 
				
			||||||
                <v-select
 | 
					              <v-select
 | 
				
			||||||
                  v-model="line.product"
 | 
					                v-model="line.product"
 | 
				
			||||||
                  :items="products"
 | 
					                :items="products"
 | 
				
			||||||
                  @update:modelValue="onProductChange(index)"
 | 
					                @update:modelValue="onProductChange(index)"
 | 
				
			||||||
                  item-title="name"
 | 
					                item-title="name"
 | 
				
			||||||
                  item-value="id"
 | 
					                item-value="id"
 | 
				
			||||||
                  label="Producto"
 | 
					                label="Producto"
 | 
				
			||||||
                  :rules="[rules.required]"
 | 
					                :rules="[rules.required]"
 | 
				
			||||||
                  required
 | 
					                required
 | 
				
			||||||
                ></v-select>
 | 
					              ></v-select>
 | 
				
			||||||
              </v-col>
 | 
					            </v-col>
 | 
				
			||||||
              <v-col>
 | 
					            <v-col>
 | 
				
			||||||
                <v-text-field
 | 
					              <v-text-field
 | 
				
			||||||
                  v-model.number="line.unit_price"
 | 
					                v-model.number="line.unit_price"
 | 
				
			||||||
                  label="Precio"
 | 
					                label="Precio"
 | 
				
			||||||
                  type="number"
 | 
					                type="number"
 | 
				
			||||||
                  :rules="[rules.required]"
 | 
					                :rules="[rules.required]"
 | 
				
			||||||
                  prefix="$"
 | 
					                prefix="$"
 | 
				
			||||||
                  required
 | 
					                required
 | 
				
			||||||
                  readonly
 | 
					                readonly
 | 
				
			||||||
                ></v-text-field>
 | 
					              ></v-text-field>
 | 
				
			||||||
              </v-col>
 | 
					            </v-col>
 | 
				
			||||||
              <v-col>
 | 
					            <v-col>
 | 
				
			||||||
                <v-text-field
 | 
					              <v-text-field
 | 
				
			||||||
                  v-model.number="line.quantity"
 | 
					                v-model.number="line.quantity"
 | 
				
			||||||
                  label="Cantidad"
 | 
					                label="Cantidad"
 | 
				
			||||||
                  type="number"
 | 
					                type="number"
 | 
				
			||||||
                  :rules="[rules.required]"
 | 
					                :rules="[rules.required]"
 | 
				
			||||||
                  required
 | 
					                required
 | 
				
			||||||
                ></v-text-field>
 | 
					              ></v-text-field>
 | 
				
			||||||
              </v-col>
 | 
					            </v-col>
 | 
				
			||||||
              <v-col>
 | 
					            <v-col>
 | 
				
			||||||
                <v-text-field
 | 
					              <v-text-field
 | 
				
			||||||
                  type="number"
 | 
					                type="number"
 | 
				
			||||||
                  :value="calculateSubtotal(line)"
 | 
					                :value="calculateSubtotal(line)"
 | 
				
			||||||
                  label="Subtotal"
 | 
					                label="Subtotal"
 | 
				
			||||||
                  prefix="$"
 | 
					                prefix="$"
 | 
				
			||||||
                  readonly
 | 
					                readonly
 | 
				
			||||||
                  disable
 | 
					                disable
 | 
				
			||||||
                ></v-text-field>
 | 
					              ></v-text-field>
 | 
				
			||||||
              </v-col>
 | 
					            </v-col>
 | 
				
			||||||
              <v-col>
 | 
					            <v-col>
 | 
				
			||||||
                <v-btn @click="removeLine(index)" color="red">Eliminar</v-btn>
 | 
					              <v-btn @click="removeLine(index)" color="red">Eliminar</v-btn>
 | 
				
			||||||
              </v-col>
 | 
					            </v-col>
 | 
				
			||||||
            </v-row>
 | 
					          </v-row>
 | 
				
			||||||
          </div>
 | 
					        </v-container>
 | 
				
			||||||
          <v-btn @click="addLine" color="blue">Agregar</v-btn>
 | 
					        <v-btn @click="addLine" color="blue">Agregar</v-btn>
 | 
				
			||||||
 | 
					 | 
				
			||||||
        </v-container>
 | 
					        </v-container>
 | 
				
			||||||
 | 
					 | 
				
			||||||
        <v-divider></v-divider>
 | 
					        <v-divider></v-divider>
 | 
				
			||||||
 | 
					 | 
				
			||||||
        <v-text-field
 | 
					        <v-text-field
 | 
				
			||||||
          :value="calculateTotal"
 | 
					          :value="calculateTotal"
 | 
				
			||||||
          label="Total"
 | 
					          label="Total"
 | 
				
			||||||
@@ -137,7 +130,7 @@
 | 
				
			|||||||
          },
 | 
					          },
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        purchase: {
 | 
					        purchase: {
 | 
				
			||||||
          date: '',
 | 
					          date: this.getCurrentDate(),
 | 
				
			||||||
          client: null,
 | 
					          client: null,
 | 
				
			||||||
          notes: '',
 | 
					          notes: '',
 | 
				
			||||||
          saleline_set: [{product:'', unit_price: 0, quantity: 0}],
 | 
					          saleline_set: [{product:'', unit_price: 0, quantity: 0}],
 | 
				
			||||||
@@ -170,6 +163,14 @@
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
 | 
					      getCurrentDate() {
 | 
				
			||||||
 | 
					        const today = new Date();
 | 
				
			||||||
 | 
					        const yyyy = today.getFullYear();
 | 
				
			||||||
 | 
					        const mm = String(today.getMonth() + 1).padStart(2, '0');
 | 
				
			||||||
 | 
					        const dd = String(today.getDate()).padStart(2, '0');
 | 
				
			||||||
 | 
					        return `${yyyy}-${mm}-${dd}`;
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      onProductChange(index) {
 | 
					      onProductChange(index) {
 | 
				
			||||||
        const selectedProductId = this.purchase.saleline_set[index].product;
 | 
					        const selectedProductId = this.purchase.saleline_set[index].product;
 | 
				
			||||||
        const selectedProduct = this.products.find(p => p.id == selectedProductId);
 | 
					        const selectedProduct = this.products.find(p => p.id == selectedProductId);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user