Last active
March 24, 2017 17:04
-
-
Save alexmoreno/1468cba53a22b1df80f6b10db9acf53f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mounted() { | |
let startingPromises = [ | |
this.$store.dispatch('produtos/load_marcas_data'), | |
this.$store.dispatch('produtos/load_categorias_data'), | |
this.$store.dispatch('produtos/load_produtos_tipo_data'), | |
this.$store.dispatch('produtos/load_tags_data'), | |
] | |
Promise.all(startingPromises).then((resolve) => { | |
this.$nextTick(function () { | |
var vm = this | |
jQuery('textarea.editor').summernote({ | |
height: 200, | |
callbacks: { | |
onChange: function(contents, $editable) { | |
vm.model.descricao = contents; | |
} | |
} | |
}); | |
}); | |
if(this.$route.params.id > 0) { | |
this.produtoAccess = true; | |
this.disabled_items = [] | |
this.titulo = "Editar "+this.titulo; | |
this.$store.dispatch('produtos/load', this.$route.params.id).then((response) => { | |
this.prepareLoadedProduto(response) | |
}) | |
} else { | |
this.produtoAccess = false; | |
this.$store.dispatch('produtos/reset'); | |
this.titulo = "Adicionar "+this.titulo; | |
} | |
}, (reject) => { | |
dialog.alertFlutuante('erro', "O sistema está com problemas, contate o administrador do sistema.") | |
}) | |
//this.$store.dispatch('produtos/load_atributos_data') | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment