notes.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <div class="app-container">
  3. <tinymce v-model="shoppingNotes" :height="300" />
  4. <div slot="footer" class="dialog-footer" style="float: right;padding:80px 0 80px 0;">
  5. <el-button type="primary" style="width:100px;" :loading="loadingbut" @click="onSubmite()">{{ loadingbuttext }}</el-button>
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import Tinymce from '@/components/Tinymce'
  11. import { getOrganizeInfo, updateOrganizeInfo } from '@/api/other'
  12. export default {
  13. components: {
  14. Tinymce
  15. },
  16. data() {
  17. return {
  18. isContent: false,
  19. shoppingNotes: '',
  20. loadingbut: false,
  21. loadingbuttext: '提交'
  22. }
  23. },
  24. computed: {
  25. organizeID() {
  26. return this.$store.getters.organizeID
  27. }
  28. },
  29. created() {
  30. this.initData()
  31. },
  32. methods: {
  33. initData() {
  34. getOrganizeInfo({ id: this.organizeID }).then(response => {
  35. console.log(response)
  36. this.shoppingNotes = response.data.shoppingNotes
  37. })
  38. },
  39. onSubmite() {
  40. this.loadingbut = true
  41. this.loadingbuttext = '提交中'
  42. updateOrganizeInfo({ id: this.organizeID, afterSale: this.shoppingNotes }).then(response => {
  43. this.$message({ message: response.msg, type: 'success', center: true })
  44. this.loadingbut = false
  45. this.loadingbuttext = '提交'
  46. setTimeout(() => {
  47. this.initData()
  48. }, 1000)
  49. }).catch(() => {
  50. this.loadingbut = false
  51. this.loadingbuttext = '提交'
  52. })
  53. }
  54. }
  55. }
  56. </script>
  57. <style scoped>
  58. </style>