|
@@ -4,19 +4,24 @@
|
|
|
<!--Contenido del formulario-->
|
|
|
<ion-content class="has-header">
|
|
|
|
|
|
- <ion-slides #saleSlides [options]="{onlyExternal: !customer.id}" (ionWillChange)="onSlideChanged($event)">
|
|
|
+ <ion-slides #saleSlides (ionSlideWillChange)="onSlideChanged($event)">
|
|
|
<!--Cliente-->
|
|
|
<ion-slide>
|
|
|
<h1>Seleccione un cliente:</h1>
|
|
|
<ion-searchbar #customerSearchInput placeholder="Buscar cliente" (ionInput)="searchCustomer($event)"></ion-searchbar>
|
|
|
|
|
|
- <ion-list inset *ngIf="search" [virtualScroll]="customers" approxItemHeight="30px">
|
|
|
- <ion-item *virtualItem="let item" (doubleTap)="selectCustomer(item)">
|
|
|
- {{ item.name }}
|
|
|
- </ion-item>
|
|
|
- </ion-list>
|
|
|
+ <div *ngIf="isSearch()">
|
|
|
+ <!--<ion-list inset [virtualScroll]="customers" approxItemHeight="30px">-->
|
|
|
+ <ion-list inset *ngFor="let c of customers">
|
|
|
+ <!--<ion-item *virtualItem="let item" (doubleTap)="selectCustomer(item)">-->
|
|
|
+ <ion-item (doubleTap)="selectCustomer(c)">
|
|
|
+ {{ c.name }}
|
|
|
+ <ion-icon name="checkmark" item-right></ion-icon>
|
|
|
+ </ion-item>
|
|
|
+ </ion-list>
|
|
|
+ </div>
|
|
|
|
|
|
- <div *ngIf="!search">
|
|
|
+ <div *ngIf="!isSearch()">
|
|
|
<h1>Datos del cliente:</h1>
|
|
|
|
|
|
<ion-list inset>
|
|
@@ -49,22 +54,20 @@
|
|
|
</ion-slide>
|
|
|
|
|
|
<!--Líneas de presupuesto-->
|
|
|
- <ion-slide>
|
|
|
+ -<ion-slide>
|
|
|
<h1>Líneas del presupuesto</h1>
|
|
|
<ion-searchbar #productSearchInput placeholder="Buscar producto" (ionInput)="searchProduct($event)" (doubleTap)="readBarcode()"></ion-searchbar>
|
|
|
|
|
|
- <!--<div class="no-element" *ngIf="lines.length == 0 && !search">
|
|
|
- <p>Sin elementos</p>
|
|
|
- </div>-->
|
|
|
-
|
|
|
- <div class="sale-content-wrapper" *ngIf="search">
|
|
|
+ <div class="sale-content-wrapper" *ngIf="isSearch()">
|
|
|
|
|
|
- <ion-scroll scrollY="true" inset [virtualScroll]="products" approxItemHeight="30px">
|
|
|
- <ion-item *virtualItem="let p" (doubleTap)="selectProduct(p)">
|
|
|
- <ion-thumbnail item-left>
|
|
|
+ <!--<ion-scroll inset scrollY="true" [virtualScroll]="products" approxItemHeight="30px">-->
|
|
|
+ <ion-scroll inset scrollY="true" *ngFor="let p of products">
|
|
|
+ <!--<ion-item *virtualItem="let p" (doubleTap)="selectProduct(p)">-->
|
|
|
+ <ion-item (doubleTap)="selectProduct(p)">
|
|
|
+ <!--<ion-thumbnail item-left>
|
|
|
<ion-img [src]="p.image_medium" *ngIf="!p.image_medium"></ion-img>
|
|
|
<img src="./assets/images/product.png" *ngIf="!p.image_medium"/>
|
|
|
- </ion-thumbnail>
|
|
|
+ </ion-thumbnail>-->
|
|
|
|
|
|
<h2>{{ p.name }}</h2>
|
|
|
|
|
@@ -77,10 +80,12 @@
|
|
|
|
|
|
</div>
|
|
|
|
|
|
- <div class="sale-content-wrapper" *ngIf="!search">
|
|
|
+ <div class="sale-content-wrapper" *ngIf="!isSearch()">
|
|
|
|
|
|
- <ion-scroll scrollY="true" [virtualScroll]="lines" approxItemHeight="30px">
|
|
|
- <ion-item *virtualItem="let l">
|
|
|
+ <!--<ion-scroll scrollY="true" [virtualScroll]="lines" approxItemHeight="30px">-->
|
|
|
+ <ion-scroll scrollY="true" *ngFor="let l of lines">
|
|
|
+ <!--<ion-item *virtualItem="let l">-->
|
|
|
+ <ion-item>
|
|
|
<ion-thumbnail item-left>
|
|
|
<ion-img src="l.image_medium" *ngIf="l.image_medium"></ion-img>
|
|
|
<img src="./assets/images/product.png" *ngIf="!l.image_medium"/>
|
|
@@ -108,7 +113,7 @@
|
|
|
</button>
|
|
|
|
|
|
<ion-row>
|
|
|
- <ion-col width-33>
|
|
|
+ <ion-col width-33>
|
|
|
<button ion-button primary clear small icon-only (click)="removeQuantity(l)">
|
|
|
<ion-icon name="remove-circle"></ion-icon>
|
|
|
</button>
|
|
@@ -142,8 +147,28 @@
|
|
|
|
|
|
<!--Finalizar presupuesto-->
|
|
|
<ion-slide>
|
|
|
- <h1>Finalizar</h1>
|
|
|
+ <div class="finish-sale">
|
|
|
+ <h1>Finalizar presupuesto</h1>
|
|
|
|
|
|
+ <ion-list inset>
|
|
|
+ <ion-item>
|
|
|
+ <ion-label>SubTotal:</ion-label>
|
|
|
+ <ion-input text-right readonly [ngModel]="total"></ion-input>
|
|
|
+ </ion-item>
|
|
|
+
|
|
|
+ <ion-item>
|
|
|
+ <ion-label>Descuento:</ion-label>
|
|
|
+ <ion-input text-right readonly value="0"></ion-input>
|
|
|
+ </ion-item>
|
|
|
+
|
|
|
+ <ion-item>
|
|
|
+ <ion-label>Total:</ion-label>
|
|
|
+ <ion-input text-right readonly [ngModel]="total"></ion-input>
|
|
|
+ </ion-item>
|
|
|
+ </ion-list>
|
|
|
+
|
|
|
+ <button ion-button color="primary" (click)="saveSale()">Guardar presupuesto</button>
|
|
|
+ </div>
|
|
|
</ion-slide>
|
|
|
</ion-slides>
|
|
|
</ion-content>
|