<template>
    <v-layout row wrap mb-1>
        <v-flex xs12>
            <v-card>
                <v-card-text class="pa-1">
                    <v-layout row wrap>
                        <v-flex xs4>
                            <one-date-picker
                                label="Tanggal"
                                :date="sdate"
                                data="0"
                                @change="changeDate"
                            ></one-date-picker>
                        </v-flex>
                        <v-flex xs8 class="text-xs-right">
                            <one-process-ref-internal-new-dialog></one-process-ref-internal-new-dialog>
                        </v-flex>
                    </v-layout>
                </v-card-text>
            </v-card>
        </v-flex>
    </v-layout>
</template>

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

.one-btn-icon {
    font-size: 1.5em
}
</style>

<script>
module.exports = {
    components : {
        'one-process-ref-internal-new-dialog': httpVueLoader('./oneProcessRefInternalNewDialog.vue'),
        'one-date-picker': httpVueLoader('./oneDatePicker.vue')
    },

    computed : {
        sdate () {
            return this.$store.state.header.sdate
        }
    },

    methods : {
        changeDate(x) {
            this.$store.commit('header/update_sdate', x.new_date)
            this.$store.dispatch('header/search')
        }
    }
}
</script>