text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d20881e"],{a4a6:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("v-data-table",{staticClass:"ma-5",attrs:{headers:t.headers,items:t.dataO,"items-per-page":5},scopedSlots:t._u([{key:"item.status",fn:function(e){var r=e.item;return[a("v-chip",{attrs:{label:"",color:t.getColor(r.status),dark:""}},[t._v(" "+t._s(r.status)+" ")])]}},{key:"item.more",fn:function(e){var r=e.item;return[a("v-btn",{attrs:{icon:""},on:{click:function(e){return t.more(r)}}},[a("v-icon",[t._v(" mdi-dots-vertical")])],1)]}},{key:"item.paid",fn:function(e){var r=e.item;return[a("v-chip",{attrs:{label:"",color:t.getColor(r.paid),dark:""}},[t._v(" "+t._s(r.paid?"Paid":"Unpaid")+" ")])]}}],null,!0)}),a("v-dialog",{attrs:{"max-width":"700px"},model:{value:t.vis,callback:function(e){t.vis=e},expression:"vis"}},[a("v-card",[a("v-card-title",[a("span",{staticClass:"headline"},[t._v("Order Details")])]),a("p",{staticClass:"ml-5"},[t._v("Order ID: "+t._s(t.id))]),a("v-card-text",[a("v-container",{attrs:{"grid-list-md":""}},[a("v-layout",{attrs:{row:"",wrap:""}},[a("v-flex",{attrs:{xs12:""}},[a("v-data-table",{attrs:{headers:t.headerD,items:t.dataD,"items-per-page":3},scopedSlots:t._u([{key:"item.image",fn:function(e){var r=e.item;return[a("v-img",{attrs:{height:"100",width:"100","lazy-src":"h"==r.image[0]?r.image:"http://api.ashewa.com/media/"+r.image,src:"h"==r.image[0]?r.image:"http://api.ashewa.com/media/"+r.image},scopedSlots:t._u([{key:"placeholder",fn:function(){return[a("v-row",{staticClass:"fill-height ma-0",attrs:{align:"center",justify:"center"}},[a("v-progress-circular",{attrs:{indeterminate:"",color:"grey lighten-5"}})],1)]},proxy:!0}],null,!0)})]}},{key:"item.quantity",fn:function(e){var r=e.item;return[a("v-chip",{attrs:{label:"",color:"green",dark:""}},[t._v(t._s(r.quantity))])]}}],null,!0)})],1)],1)],1)],1),a("v-card-actions",[a("v-spacer"),a("v-btn",{attrs:{color:"blue darken-1",text:""},on:{click:function(e){t.vis=!1}}},[t._v(" Close ")])],1)],1)],1)],1)},i=[],s=a("5530"),n=(a("d81d"),a("b0c0"),a("2f62")),o={created:function(){this.isTokenSet?this.$store.dispatch("getOrderHistory"):this.$router.push("/login")},data:function(){return{dataD:[],id:"",headerD:[{text:"Image",value:"image"},{text:"Name",value:"name"},{text:"Quantity",value:"quantity"},{text:"Price",value:"price"}],headers:[{text:"Reference",value:"reference"},{text:"Total Price (in Birr)",value:"totalPrice"},{text:"Delivery Status",value:"status"},{text:"Payment Status",value:"paid"},{text:"More",value:"more"},{text:"Payment Method",value:"paymentMethod"}],vis:!1}},computed:Object(s["a"])(Object(s["a"])({},Object(n["c"])(["isTokenSet","user"])),{},{sampleData:function(){return"completed"==this.value?this.d:"delayed"==this.value?this.de:"canceled"==this.value?this.f:this.p},dataO:function(){console.log(this.$store.state.cart.orderHistory);var t=this.$store.state.cart.orderHistory.map((function(t){return{id:t.id,productId:t.orders,reference:t.reference,totalPrice:t.price,status:t.status,paid:t.paid,paymentMethod:t.paymentMethod}}));return t}}),methods:{getColor:function(t){return"COMPLETED"==t?"green":"PENDING"==t?"orange":"ACCEPTED"==t||1==t?"green":"red"},more:function(t){console.log(t),this.dataD=t.productId.map((function(t){return{image:t.product.image,name:t.product.name,quantity:t.quantity,price:t.product.sellingPrice}})),console.log(this.dataD),this.id=t.id,this.vis=!0}}},c=o,d=a("2877"),l=a("6544"),u=a.n(l),m=a("8336"),v=a("b0af"),p=a("99d9"),h=a("cc20"),f=a("a523"),g=a("8fea"),y=a("169a"),x=a("0e8f"),b=a("132d"),k=a("adda"),C=a("a722"),V=a("490a"),_=a("0fd9"),D=a("2fa4"),w=Object(d["a"])(c,r,i,!1,null,null,null);e["default"]=w.exports;u()(w,{VBtn:m["a"],VCard:v["a"],VCardActions:p["b"],VCardText:p["d"],VCardTitle:p["e"],VChip:h["a"],VContainer:f["a"],VDataTable:g["a"],VDialog:y["a"],VFlex:x["a"],VIcon:b["a"],VImg:k["a"],VLayout:C["a"],VProgressCircular:V["a"],VRow:_["a"],VSpacer:D["a"]})}}]);
  //# sourceMappingURL=chunk-2d20881e.ee1c3d1b.js.map