<template>
   <v-layout class="fill-height" column>
      <v-card   class="mb-2 pa-2 searchbox">
         <v-layout row>
            <v-flex xs8>
               <v-layout>
                  <v-text-field class="flex xs4 ma-1"
                                placeholder="No Lab"
                                single-line
                                outline
                                hide-details
                                ></v-text-field>
                     <v-text-field class="flex xs8 ma-1"
                                   label=""
                                   placeholder="Nama"
                                   single-line
                                   outline
                                   hide-details
                                   ></v-text-field>
               </v-layout>
            </v-flex>
            <v-flex xs4>
               <v-layout>
                  <v-btn class="flex xs6 ma-1" color="success"  >
                     Search
                  </v-btn>
                     <v-btn class="flex xs6 ma-1" color="info"  >
                        Kirim 
                     </v-btn>
               </v-layout>
            </v-flex>
         </v-layout>
      </v-card>


      <v-card class="grow">
         <v-subheader>
            Sample Siap Kirim
         </v-subheader>
         <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)">
                  <v-checkbox v-model="props.item.selected"></v-checkbox>
               </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,xtable.v-table tbody th {
   height: 40px;
}

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

</style>

<script>
module.exports = {
   data() {
      return {
         query: "",
         items: [],
         headers: [
            {
               text: "VERIFIKASI",
               align: "left",
               sortable: false,
               value: "mr",
               width: "15%",
               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: "Pilih",
               align: "left",
               sortable: false,
               value: "status",
               width: "5%",
               class: "pa-2 blue lighten-3 white--text"
            }
         ],
         isLoading: false,
         patients: [
            {"status":"","date":"2019-02-21 10:00:00",
               "lab":"08000198909", "sid": "08000198909-S", 
               "name": "Pasien Umum", "selected":false},
            {"status":"","date":"2019-02-22 06:30:00",
               "lab":"08000198111", "sid": "08000198111-2", 
               "name": "Heri Suryawan", "selected":false},
            {"status":"","date":"2019-02-22 06:45:00",
               "lab":"08000198222", "sid": "08000198222-U", 
               "name": "LUKA MODRIC","selected":true},
         ]
      };
   },
   methods : {
      oneMoment : function(d) {
         return window.oneMoment(d)
      }
   }
}
</script>
