Bläddra i källkod

lead form added

robert2206 8 år sedan
förälder
incheckning
5dcccad43f

+ 34 - 0
src/pages/lead/lead.html

@@ -9,4 +9,38 @@
     </ion-navbar>
 </ion-header>
 <ion-content>
+    <form id="details-form">
+        <ion-item>
+            <ion-label stacked>Asunto</ion-label>
+            <ion-input type="text"></ion-input>
+        </ion-item>
+        <ion-item (tap)="selectCustomer()">
+            <ion-label stacked>Cliente</ion-label>
+            <ion-input type="text" value="{{ lead.customer.name }}"></ion-input>
+        </ion-item>
+        <ion-item>
+            <ion-label stacked>Dirección</ion-label>
+            <ion-input type="text"></ion-input>
+        </ion-item>
+        <ion-item>
+            <ion-label stacked>Ciudad</ion-label>
+            <ion-input type="text"></ion-input>
+        </ion-item>
+        <ion-item>
+            <ion-label stacked>Nombre de Contacto</ion-label>
+            <ion-input type="text"></ion-input>
+        </ion-item>
+        <ion-item>
+            <ion-label stacked>Correo Electrónico</ion-label>
+            <ion-input type="text"></ion-input>
+        </ion-item>
+        <ion-item>
+            <ion-label stacked>Teléfono</ion-label>
+            <ion-input type="text"></ion-input>
+        </ion-item>
+        <ion-item>
+            <ion-label stacked>Celular</ion-label>
+            <ion-input type="text"></ion-input>
+        </ion-item>
+    </form>
 </ion-content>

+ 20 - 1
src/pages/lead/lead.ts

@@ -4,12 +4,18 @@ import { NavController, NavParams } from 'ionic-angular';
 import { Lead } from "../../odoo/models/crm.lead";
 import { BaseDetailsView } from "../../base/base-details-view";
 
+import { CustomersPage } from "../customers/customers";
+
+import { EventsManager } from "../../base/events/event-manager";
+
 @Component({
     selector: 'page-lead',
     templateUrl: 'lead.html'
 })
 export class LeadPage extends BaseDetailsView<Lead> {
 
+    lead: any = {};
+
     constructor(
         public navCtrl: NavController,
         public navParams: NavParams
@@ -24,7 +30,20 @@ export class LeadPage extends BaseDetailsView<Lead> {
      * 
      */
     ionViewDidLoad() {
-        console.log('ionViewDidLoad LeadPage');
+        EventsManager.subscribe("app:select", data => { 
+            this.lead.customer = data;
+        });
+    }
+
+    /**
+     * 
+     */
+    selectCustomer(): void {
+        this.navCtrl.push(CustomersPage, { 
+            params: {
+                mode: "selection"
+            }
+        });
     }
 
 }

+ 16 - 0
src/pages/leads/leads.html

@@ -10,6 +10,22 @@
 			</button>
 		</ion-buttons>
     </ion-navbar>
+    <ion-toolbar>
+        <ion-segment [(ngModel)]="stage">
+            <ion-segment-button value="nueva">
+                Nueva
+            </ion-segment-button>
+            <ion-segment-button value="negociacion">
+                Negociación
+            </ion-segment-button>
+            <ion-segment-button value="fidelizacion">
+                Fidelización
+            </ion-segment-button>
+            <ion-segment-button value="perdido">
+                Perdido
+            </ion-segment-button>
+        </ion-segment>
+    </ion-toolbar>
 </ion-header>
 <ion-toolbar *ngIf="isSearch()">
     <ion-searchbar placeholder="Buscar" debounce="1000" (ionInput)="performSearch($event)"></ion-searchbar>

+ 10 - 0
src/pages/leads/leads.scss

@@ -1,3 +1,13 @@
 page-leads {
+    ion-segment {
+        background: $eiru-color;
+    }
 
+    ion-segment-button {
+        color: #fff !important;
+    }
+
+    .segment-activated {
+        border-color: #f7f7f7 !important;
+    }
 }

+ 10 - 4
src/pages/leads/leads.ts

@@ -5,12 +5,17 @@ import { BaseListView } from "../../base/base-list-view";
 import { Lead } from "../../odoo/models/crm.lead";
 import { LeadPage } from "../lead/lead";
 
+import { PouchService } from "../../services/pouch-service"
+import { CaseStage } from "../../odoo/models/crm.case.stage";
+
 @Component({
     selector: 'page-leads',
     templateUrl: 'leads.html'
 })
 export class LeadsPage extends BaseListView<Lead>  {
 
+    stage: string;
+
     constructor(
         public navCtrl: NavController,
         public navParams: NavParams,
@@ -18,9 +23,9 @@ export class LeadsPage extends BaseListView<Lead>  {
         public alertCtrl: AlertController
     ) { 
         super(Lead);
-
-        this.setTitle(navParams.data.title);
-        this.setFilters(navParams.data.params.filters);
+        
+        super.setTitle(navParams.data.title);
+        super.setFilters(navParams.data.params.filters);
     }
 
     /**
@@ -37,7 +42,8 @@ export class LeadsPage extends BaseListView<Lead>  {
         super.unselectItem();
     }
 
-      /**
+
+    /**
      * 
      * @param item
      */

+ 1 - 1
src/pages/order/order.html

@@ -10,7 +10,7 @@
 </ion-header>
 <ion-content>
     <form>
-         <ion-item-divider>
+        <ion-item-divider>
             Cliente
         </ion-item-divider>
         <ion-item (tap)="selectCustomer()">

+ 0 - 2
src/pages/order/order.ts

@@ -14,8 +14,6 @@ import { CartItem } from "./models/cart-item"
 
 import { EventsManager } from "../../base/events/event-manager";
 
-import * as Moment from "moment";
-
 @Component({
     selector: 'page-order',
     templateUrl: 'order.html'