File

src/app/components/layout/modales/modal-historial-ventas/modal-historial-ventas.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods

Constructor

constructor(_venta: Venta)
Parameters :
Name Type Optional
_venta Venta No

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

Public _venta
Type : Venta
Decorators :
@Inject(MAT_DIALOG_DATA)
columnasTabla
Type : string[]
Default value : ['producto', 'cantidad', 'precio', 'total']
detalleVenta
Type : DetalleVenta[]
Default value : []
fechaRegistro
Type : string
Default value : ''
numeroDocumento
Type : string
Default value : ''
tipoPago
Type : string
Default value : ''
total
Type : string
Default value : ''
import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { DetalleVenta } from 'src/app/interfaces/detalle-venta';
import { Venta } from '../../../../interfaces/venta';


@Component({
  selector: 'app-modal-historial-ventas',
  templateUrl: './modal-historial-ventas.component.html',
  styleUrls: ['./modal-historial-ventas.component.css']
})
export class ModalHistorialVentasComponent implements OnInit{

  fechaRegistro: string = '';
  numeroDocumento: string = '';
  tipoPago: string = '';
  total: string = '';
  detalleVenta: DetalleVenta[] = [];
  columnasTabla: string[] = ['producto', 'cantidad', 'precio', 'total'];

  constructor(@Inject(MAT_DIALOG_DATA) public _venta: Venta) {

      this.fechaRegistro = _venta.fechaRegistro!;
      this.numeroDocumento = _venta.numeroDocumento!;
      this.tipoPago = _venta.tipoPago;
      this.total = _venta.totalTexto;
      this.detalleVenta = _venta.detalleVenta;
  
  }

  ngOnInit(): void {
    throw new Error('Method not implemented.');
  }



}
<h2 mat-dialog-title>Detalle de la Venta</h2>
<mat-dialog-content>
        <mat-grid-list cols="4" rowHeight="70px">
            <mat-grid-tile>
                <mat-form-field appearance="fill" style="width: 95%;">
                    <mat-label>Fecha Registro</mat-label>
                    <input matInput [(ngModel)]="fechaRegistro">
                    <mat-icon matSuffix>account-box</mat-icon>
                </mat-form-field>
            </mat-grid-tile>
            <mat-grid-tile>
                <mat-form-field appearance="fill" style="width: 95%;">
                    <mat-label>NĂºmero de Venta</mat-label>
                    <input matInput [(ngModel)]="numeroDocumento">
                    <mat-icon matSuffix>account-box</mat-icon>
                </mat-form-field>
            </mat-grid-tile>
            <mat-grid-tile>
                <mat-form-field appearance="fill" style="width: 95%;">
                    <mat-label>Tipo de Pago</mat-label>
                    <input matInput [(ngModel)]="tipoPago">
                    <mat-icon matSuffix>account-box</mat-icon>
                </mat-form-field>
            </mat-grid-tile>
            <mat-grid-tile>
                <mat-form-field appearance="fill" style="width: 95%;">
                    <mat-label>Total</mat-label>
                    <input matInput [(ngModel)]="total">
                    <mat-icon matSuffix>account-box</mat-icon>
                </mat-form-field>
            </mat-grid-tile>
        </mat-grid-list>
        <h4>Lista de productos</h4>
            <table mat-table [dataSource]="detalleVenta" class="mat-elevation-z2">
                <ng-container matColumnDef="producto">
                    <th mat-header-cell *matHeaderCellDef>Producto</th>
                    <td mat-cell *matCellDef="let element">{{element.descripcionProducto}}</td>
                </ng-container>
                <ng-container matColumnDef="cantidad">
                    <th mat-header-cell *matHeaderCellDef>Cantidad</th>
                    <td mat-cell *matCellDef="let element">{{element.cantidad}}</td>
                </ng-container>
                <ng-container matColumnDef="precio">
                    <th mat-header-cell *matHeaderCellDef>Precio</th>
                    <td mat-cell *matCellDef="let element">$ {{element.precioTexto}}</td>
                </ng-container>
                <ng-container matColumnDef="total">
                    <th mat-header-cell *matHeaderCellDef>Total</th>
                    <td mat-cell *matCellDef="let element">$ {{element.totalTexto}}</td>
                </ng-container>
                <tr mat-header-row *matHeaderRowDef="columnasTabla"></tr>
                <tr mat-row *matRowDef="let row; columns: columnasTabla;"></tr>
            </table>
</mat-dialog-content>
<mat-dialog-actions align="end">
    <button mat-raised-button mat-dialog-close cdkFocusInitial color="warn">Volver</button>
</mat-dialog-actions>

./modal-historial-ventas.component.css

table{
    width: 100%;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""