<template>
    <v-layout column fill-height>
        <v-flex v-if="preid == 0 || preid == null || preid == -1" xs12>
          <v-card class="pa-1 mb-2">
                <v-card-text class="pa-0">
                    <v-layout row wrap>
                        <v-flex xs12>
                            <patient-search-box></patient-search-box>
                        </v-flex>
                    </v-layout>
                </v-card-text>
                
            </v-card>
      </v-flex> 
    

        <!-- <v-flex xs12 grow> -->
            <v-card class="pa-1 p-left-side grow" grow>
                <v-card-text class="pa-0">
                    <v-layout row wrap>

                        <v-flex xs12>
                           <patient-detail></patient-detail>
                        </v-flex>
                        <v-divider></v-divider>
                        <v-flex xs12>
                           <patient-notes></patient-notes> 
                        </v-flex>
                    </v-layout>
                </v-card-text>

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

<style scoped>
/* .p-left-side {
    min-height: 500px;
} */
</style>

<script>
module.exports = {
	components : {
        'patient-search-box' : httpVueLoader('./patientSearchBox.vue'),
        'patient-detail': httpVueLoader('./patientDetail.vue'),
        'patient-notes' : httpVueLoader('./patientNotes.vue'),
        
    },
    data() {
        return {

        };
    },
    computed : {
        preid: {
            get() {
                return this.$store.state.order.preid
            },
            set(val) {
                this.$store.commit('order/update_preid',val)
            }
        },
        dialog_start: {
            get() {
                return this.$store.state.order.dialog_start
            },
            set(val) {
                this.$store.commit('order/update_dialog_start',val)
            }
        },
        status_start: {
            get() {
                return this.$store.state.order.status_start
            },
            set(val) {
                this.$store.commit('order/update_status_start',val)
            }
        },
        time_start: {
            get() {
                return this.$store.state.order.time_start
            },
            set(val) {
                this.$store.commit('order/update_time_start',val)
            }
        },
        elapsedTime: {
            get() {
                return this.$store.state.order.elapsedTime
            },
            set(val) {
                this.$store.commit('order/update_elapsedTime',val)
            }
        }
    },
    methods: {
        start() {
            this.time_start = setInterval(() => {
                this.elapsedTime += 1000;
            }, 1000);
            this.status_start = 'Y'
           // this.show_time = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
            //this.dialog_start = false
            this.$store.dispatch('order/get_time_start',{'id':0})
        },
        stop() {
            clearInterval(this.time_start);
        },
        reset() {
            this.elapsedTime = 0;
        }
    }
}
</script>
