<template>
   <v-layout class="fill-height" column>
      <v-card class="grow">
         <v-subheader>
            Daftar Pengiriman Sample 
         </v-subheader>
            <hr style="border-top:0px solid #c8c8c8;"></hr>
         <v-data-table
            :headers="headers" :items="patients"
            :loading="isLoading"
            hide-actions class="xelevation-1">
            <template slot="items" slot-scope="props">
               <td class="text-xs-left pa-2" 
                   @click="selectMe(props.item)">
                  {{ oneMoment(props.item.date) }}
               </td>
               <td class="text-xs-left pa-2" 
                   @click="selectMe(props.item)">
                  {{ props.item.lab }}
               </td>
               <td class="pa-2" 
                   @click="selectMe(props.item)">
                  {{ props.item.sid}}
               </td>
               <td class="text-xs-left pa-2" 
                   @click="selectMe(props.item)">
                  {{ props.item.name }}
               </td>
               <td class="text-xs-left pa-2" 
                   @click="selectMe(props.item)">
                  {{ props.item.status}}
               </td>
            </template>

         </v-data-table>

      </v-card>
   </v-layout>
</template>

<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
   min-height:60px;
}
.searchbox .v-btn {
   min-height:60px;
}
table.v-table tbody td,table.v-table tbody th {
   height: 40px;
}

table.v-table thead tr {
   height: 40px;
}

</style>

<script>
module.exports = {
   data() {
      return {
         query: "",
         items: [],
         headers: [
            {
               text: "KIRIM",
               align: "left",
               sortable: false,
               value: "mr",
               width: "20%",
               class: "pa-2 blue lighten-3 white--text"
            },
            {
               text: "NO LAB",
               align: "left",
               sortable: false,
               value: "mr",
               width: "15%",
               class: "pa-2 blue lighten-3 white--text"
            },
            {
               text: "SAMPLE ID",
               align: "left",
               sortable: false,
               value: "lab",
               width: "15%",
               class: "pa-2 blue lighten-3 white--text"
            },
            {
               text: "NAMA",
               align: "left",
               sortable: false,
               value: "name",
               width: "25%",
               class: "pa-2 blue lighten-3 white--text"
            },

            {
               text: "Status",
               align: "left",
               sortable: false,
               value: "status",
               width: "15%",
               class: "pa-2 blue lighten-3 white--text"
            }
         ],


         isLoading: false,
         patients: [
            {"status":"Pending","date": "2019-02-22 07:00:00",
               "lab":"08000198909", "sid": "08000198909-S", 
               "name": "Pasien Umum", "selected":false},
            {"status":"Pending","date": "2019-02-22 06:45:00",
               "lab":"08000198111", "sid": "08000198111-2", 
               "name": "Heri Suryawan", "selected":false},
            {"status":"Pending","date": "2019-02-22 06:30:00",
               "lab":"08000198222", "sid": "08000198222-U", 
               "name": "LUKA MODRIC","selected":true},
         ]
      };
   },
   methods : {
      oneMoment : function(d) {
         return window.oneMoment(d)
      }
   }

}
</script>
