<template>
    <v-dialog v-model="dialog_edit_request" persistent width="40vw">
        <v-card>
            <v-card-title class="headline grey lighten-2" primary-title>
                APPROVE / REJECT REQUEST EDIT JURNAL {{ selected_jurnal.jurnalNo }}
            </v-card-title>
            <v-card-text>
                <p>
                    Request edit jurnal oleh: {{ selected_jurnal.JurnalRequestEditStaffName }}
                </p>
                <p>
                    Apakah anda yakin menyetujui request perubahan jurnal berikut: <br>
                    Nomor: <strong>{{ selected_jurnal.jurnalNo }}</strong> <br>
                    Judul: <strong>{{ selected_jurnal.jurnalTitle }}</strong> <br>
                    Deskripsi: {{ selected_jurnal.jurnalDescription }} <br>
                </p>
            </v-card-text>
            <v-card-actions>
                <v-btn color="warning" dark @click="updateStatus('rejected')">Reject</v-btn>
                <v-spacer></v-spacer>
                <v-btn color="error" outline @click="dialog_edit_request = false">Batal</v-btn>
                <v-btn color="primary" dark @click="updateStatus('approved')">Approve</v-btn>
            </v-card-actions>
        </v-card>
    </v-dialog>
</template>

<script>
module.exports = {
    data() {
        return {
            
        }
    },
    computed: {
        dialog_edit_request: {
            get() {
                return this.$store.state.journal.dialog_edit_request
            },
            set(val) {
                this.$store.commit("journal/update_dialog_edit_request", val)
            }
        },
        selected_jurnal: {
            get() {
                return this.$store.state.journal.selected_jurnal
            },
            set(val) {
                this.$store.commit("journal/update_selected_jurnal", val)
            }
        },
    },
    methods: {
        updateStatus(status) {
            this.$store.dispatch("journal/updateRequestEditStatus", {status: status})
        }
    },
}
</script>