<template>
    <v-card   class="mb-1 pa-1">
        <v-layout row>
            <v-flex xs4>
                <v-layout>
                    <one-date-picker
                        label="Start Date"
                        :date="null"
                        @change="startDateChange"
                        :data="null"
                        :max_date="null"
                        class="mr-4"
                     ></one-date-picker>
                     <v-layout>
                    <one-date-picker
                        label="End Date"
                        :date="null"
                        @change="startDateChange"
                        :data="null"
                        :max_date="null"
                        class="mr-4"
                     ></one-date-picker>
                        <v-text-field class="flex xs8 ma-1"
                                    label=""
                                    placeholder="Nama"
                                    single-line
                                    solo
                                    hide-details
                                    v-model="search"
                                    ></v-text-field>

                        <v-btn class="flex xs6 ma-1" color="success" @click="searchs" >
                        Search
                    </v-btn>
                </v-layout>
            </v-flex>

            
            <v-flex xs2>
                <v-layout>
                    
                </v-layout>
            </v-flex>

            <v-flex xs3 class="text-xs-right">
                <v-btn
                    color="blue-grey"
                    class="white--text ma-1"
                    @click="histories"
                    >
                    Histori
                </v-btn>

                <v-btn
                    color="blue"
                    class="white--text ma-1"
                    @click="save_result"
                    >
                    Simpan
                    <v-icon right dark>save_alt</v-icon>
                </v-btn>
            </v-flex>
        </v-layout>
    </v-card>
</template>

<style scoped>
button {
    
    height: 48px;
}
</style>

<script>
module.exports = {
    components : {
        'one-date-picker' : httpVueLoader('./oneDatePicker2.vue')
    },

    computed : {
        nolab : {
            get () { return this.$store.state.re_patient.nolab },
            set (v) { this.$store.commit('re_patient/update_nolab', v) }
        },

        search : {
            get () { return '' },
            set (v) { this.$store.commit('re_patient/update_search', v) }
        },

        

        selected_group : {
            get () { return this.$store.state.re_px.selected_group },
            set (v) { this.$store.commit('re_px/update_selected_group', v) }
        }
    },

    methods : {
        searchs() {
            this.$store.dispatch('re_patient/search')
        },

        save_result() {
            this.$store.dispatch('re_px/save')
        },

        histories() {
            this.$store.commit('re_history/update_dialog_history', true)
        },

        startDateChange(prm) {
        //  this.$store.commit('worklist_patient/update_sdate', prm.new_date)
        },
    }
}
</script>