Hello good morning, I am having this problem, I have 2 tables, a main table that has a button that opens a popup with the second table. What is the idea? That if I click on the button of the first table and first option it would have to show me only the information of that element, in the popup I make a console.log(item.id) and it shows me the data of that element well , but when I open the popup it shows me all the data.. it must be something that I am overlooking, thank you very much
<template>
<v-card>
<v-card-title>
Control Modificaciones
</v-card-title>
<v-card-text>
<v-row>
<v-col cols="12" md="3" class="ml-3">
<v-text-field
v-model="fechaDesde"
type="date"
label="Fecha Desde"
:rules="[(v) => !!v || 'Este campo es requiredo']"
required
></v-text-field>
</v-col>
<v-col cols="12" md="3" class="ml-3">
<v-text-field
v-model="fechaHasta"
type="date"
label="Fecha Hasta"
:rules="[(v) => !!v || 'Este campo es requiredo']"
required
></v-text-field>
</v-col>
<v-btn color="info" title="Crear" class="mt-6 ml-8" @click="buscar()">
Buscar
</v-btn>
</v-row>
</v-card-text>
<v-row>
<v-col cols="8" md="8" class="ml-3">
<v-card-text>
<v-simple-table>
<template>
<thead>
<tr>
<th class="text-left">Nro Orden</th>
<th class="text-left">Cliente</th>
<th class="text-left">Tipo</th>
<th class="text-left">Fecha Creacion</th>
<th class="text-left">Fecha Ult Modificacion</th>
<th class="text-left">Cant Modificada</th>
<th class="text-left">Acciones</th>
</tr>
</thead>
<tbody>
<tr v-for="item in list" :key="item.id">
<td>{{ item.numero }}</td>
<td>{{ item.cliente.nombre }}</td>
<td>{{ item.tipoPresupuestoString }}</td>
<td>{{ formatDate(item.fechaAlta) }}</td>
<td>{{ formatDate(item.fechaModificacion) }}</td>
<td>{{ item.numero }}</td>
<td>
<v-icon
title="Historial del presupuesto"
@click="abrirPopupListadoPresupuestoHistorial(item)"
>mdi-clipboard-text-clock-outline</v-icon
>
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-card-text>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="12" class="ml-3">
<v-dialog
v-model="popupPresupuestoHistorial"
class="ml-10"
max-width="800px"
max-height="700px"
>
<v-card>
<v-card-title class="text-h3 dark lighten-2">
Listado de Presupuesto Historial.
</v-card-title>
<v-card-text>
<v-simple-table>
<template>
<thead>
<tr>
<th class="text-left">Fecha</th>
<th class="text-left">Comentario</th>
<th class="text-left">Usuario</th>
<th class="text-left">Datos Generales</th>
<th class="text-left">Articulos Nuevos</th>
<th class="text-left">Articulos Modifados</th>
<th class="text-left">Articulos Eliminados</th>
<th class="text-left">Acciones</th>
</tr>
</thead>
<tbody>
<tr v-for="item in list" :key="item.id">
<td>{{ formatDate(item.fecha) }}</td>
<td>{{ item.observacion }}</td>
<td>{{ item.usuario.name }}</td>
<td>{{ item.datosCabecera }}</td>
<td>{{ item.articulosNuevos }}</td>
<td>
{{ item.articulosModificados }}
</td>
<td>
{{ item.articulosEliminados }}
</td>
<td></td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
text
color="primary"
@click="popupPresupuestoHistorial = false"
>
Cancelar
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-col>
</v-row>
</v-card>
</template>
<script>
import moment from "moment";
import PresupuestoServices from "../../services/PresupuestoServices";
import Swal from "sweetalert2";
export default {
name: "ControlModificaciones",
data() {
return {
fechaHasta: null,
fechaDesde: null,
list: [],
popupPresupuestoHistorial: false,
};
},
created() {
this.presupuestoServices = new PresupuestoServices();
},
mounted() {},
methods: {
showSuccess(message) {
this.$toastr.Add({
name: "UniqueToastName",
title: "Success Message",
msg: message,
type: "success",
});
},
showError(message) {
this.$toastr.Add({
name: "UniqueToastName",
title: "Error Message",
msg: message,
type: "error",
});
},
formatDate(value) {
return value ? moment(value).format("DD/MM/YYYY") : "";
},
buscar() {
if (this.fechaDesde == null && this.fechaHasta == null) {
Swal.fire("Primero debes seleccionar las fechas.");
return;
}
const fechaDesde = this.fechaDesde != null ? this.fechaDesde : null;
const fechaHasta = this.fechaHasta != null ? this.fechaHasta : null;
Swal.fire({
title: "Espere unos momentos ...",
showConfirmButton: false,
});
this.presupuestoServices
.controlModificaciones(fechaDesde, fechaHasta)
.then((data) => {
Swal.close();
this.list = data;
})
.catch((error) => {
Swal.close();
this.showError(error.response.data);
});
},
abrirPopupListadoPresupuestoHistorial(item) {
this.popupPresupuestoHistorial = true;
console.log(item.id);
// this.list[0].presupuestoHistorial = item.id;
},
},
};
</script>