editBtn.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div>
  3. <el-button :disabled="data.status != '新建'" type="primary" size="mini" @click="editBtn">编 辑</el-button>
  4. <el-drawer
  5. title="我是标题"
  6. :visible.sync="drawer"
  7. :with-header="false"
  8. direction="rtl"
  9. size="80%"
  10. append-to-body
  11. @close="closeDrawer">
  12. <div>
  13. <router-view/>
  14. </div>
  15. </el-drawer>
  16. </div>
  17. </template>
  18. <script>
  19. import {mapGetters} from 'vuex'
  20. export default {
  21. props:['data'],
  22. data () {
  23. return {
  24. drawer:false
  25. }
  26. },
  27. computed: {
  28. ...mapGetters({
  29. DrawerShow:'DrawerShow'
  30. })
  31. },
  32. watch: {
  33. $route (val) {
  34. // if (val.path == '/submit_mag') {
  35. // this.$refs.list.listData()
  36. // }
  37. },
  38. DrawerShow (val) {
  39. val ? this.drawer = true : this.drawer = false
  40. }
  41. },
  42. methods:{
  43. closeDrawer () {
  44. this.$store.dispatch('DrawerShowChange',false)
  45. this.$router.back()
  46. },
  47. editBtn () {
  48. this.$store.dispatch('DrawerShowChange',true)
  49. this.$router.push({path:'/editContract',query:{type:this.data.type == '项目' ? this.data.typemx == '直销' ? '直销项目' : '经销项目' : this.data.type ,id:this.data.sa_contractid}})
  50. }
  51. },
  52. created() {
  53. },
  54. mounted () {
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. /deep/.el-drawer {
  60. background: #F1F2F3 !important;
  61. }
  62. </style>