<template>

    <v-dialog
      v-model="dialog"
      width="500"
    >


      <v-card>
        <v-card-title
          class="headline grey lighten-2 pt-2 pb-2"
          primary-title
        >
          Pembayaran Berhasil
        </v-card-title>
        <v-card-text class="pt-2 pb-2">
          <h6 class="display-1 text-center">No Pembayaran <span class="blue--text">{{ text_payno }}</span></h6>
        </v-card-text>
        <v-divider></v-divider>

        <v-card-actions>
          <v-btn
            color="warning"
            @click="print_nota"
            class="ml-2"
          >
            NOTA
          </v-btn>
          <v-btn
            color="warning"
            @click="print_nota_kop"
            class="ml-2"
          >
            NOTA KOP
          </v-btn>

         

          <v-spacer></v-spacer>
          <v-btn
            color="primary"
            flat
            @click="finish"
          >
            Tutup
          </v-btn>
        </v-card-actions>
      </v-card>
    </v-dialog>

</template>

<style scoped>
</style>

<script>
module.exports = {
    components : {

    },
    methods : {
       tuing: function() {
          alert('x')
       },

       finish: function() {
         this.dialog = false
        //  location.reload()
       },

       print_nota () {
         this.$store.dispatch('payment/print_nota', this.$store.state.payment.payment_id)
         return
       },
       print_nota_kop () {
         this.$store.dispatch('payment/print_nota_kop', this.$store.state.payment.payment_id)
         return
       },

       print_notain () {
         this.$store.dispatch('payment/print_notain', this.$store.state.payment.payment_id)
         return
       }
    },
    computed : {
       dialog: {
          get() {
             return this.$store.state.payment.finish_dialog_is_active;
          },
          set(val) {
             this.$store.commit('payment/update_finish_dialog_is_active', val);
          }
       },

       text_payno () {
         return this.$store.state.payment.payment_number
       }
    }
}
</script>
