<template>
    <v-dialog
        v-model="dialog"
        max-width="500px"
        persistent
    >
        <v-card>
            <v-card-text>
                <v-layout row wrap>
                    <v-flex xs12>
                        <v-textarea
                            rows="5"
                            outline
                            label="Catatan Validasi External"
                            style="background-color:rgb(255, 204, 242) "
                            hide-details
                            v-model="validation_note"
                        ></v-textarea>
                    </v-flex>
                </v-layout>
                <v-layout row wrap style="margin-top:10px;">
                    <v-flex xs12>
                        <v-textarea
                            rows="5"
                            style="background-color:rgb(204, 255, 221) "
                            outline
                            label="Catatan Validasi Internal"
                            hide-details
                            v-model="validation_note_internal"
                        ></v-textarea>
                    </v-flex>
                </v-layout>
            </v-card-text>

            <v-card-actions>
                <v-btn color="primary" flat @click="dialog=!dialog">Tutup</v-btn>
                <v-spacer></v-spacer>
                <v-btn color="primary" @click="save">Simpan</v-btn>
            </v-card-actions>
        </v-card>
    </v-dialog>
</template>

<style>
/* .v-overlay--active {
    z-index: 1005 !important;
}

.v-dialog__content--active {
    z-index: 1006 !important;
} */
</style>

<script>
module.exports = {
    data () {
        return {}
    },

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

        validation_note : {
            get () { return this.$store.state.re_patient.validation_note},
            set (v) { this.$store.commit('re_patient/update_validation_note', v) }
        },
        validation_note_internal : {
            get () { return this.$store.state.re_patient.validation_note_internal},
            set (v) { this.$store.commit('re_patient/update_validation_note_internal', v) }
        }
    },

    methods : {
        async save () {
            await this.$store.dispatch('re_patient/save_note')
            this.$store.commit("re_patient/update_dialog_note",false)
            this.$store.dispatch("re_patient/info_req")
        }
    }
}
</script>
