码迷,mamicode.com
首页 > 其他好文 > 详细

element 弹框关闭报错

时间:2019-11-08 20:43:59      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:def   dia   err   对话   sync   方法   methods   ESS   ack   

<template>
  <el-container style="padding: 00px 20px 0px 20px">
    <el-dialog
      title="售电公司注册审批记录"
      :visible.sync="innerVisible"
      width="60%"
      @close="closeDialog"
      :close-on-click-modal="true"
      :modal="false"
    >
    </el-dialog>
  </el-container>
</template>

<script>
import FlowNodeInsInfoRegApi from @/api/pxf-service-imarketservice/imarketMemberManage/registerCheck/FlowNodeInsInfoRegApi
import moment from moment
export default {
  props: {
    accessVisible: Boolean,
    membersRegInfo: {
      type: Object,
      default: function() {
        return {}
      }
    },
    states: {
      type: Object,
      default: function() {
        return {}
      }
    },
    processNum: {
      type: String,
      default: ‘‘
    }
  },
  data() {
    return {
      innerVisible: false,
      mmFlowNodeInsInfoRegList: [],
      scopeFlowNodeInsInfoRegList: [],
      scopeInfos: [],
      scopeProcessNum: ‘‘,
      scopeAll: ‘‘,
    }
  },
  watch: {

    accessVisible(newValue) {
      this.innerVisible = newValue
    }
  },
  mounted() {
    if (this.accessVisible) {
      this.init()
      this.queryByProcessNum(this.processNum, 1)
      this.queryByProcessNum(this.scopeProcessNum, 0)
    }
  },
  methods: {
    closeDialog() {
      this.$emit(close-dialog)
    },
    close() {
      this.$emit(update:visible) // 传递关闭事件
      this.$emit(close-dialog)
    },
    closeModal(e) {
      if (this.visible) {
        document.querySelector(.dialog).contains(e.target) ? ‘‘ : this.close() // 判断点击的落点在不在dialog对话框内,如果在对话框外就调用this.close()方法关闭对话框
      }
    },
    init() {
      this.scopeInfos = this.membersRegInfo.scopeInfos.filter(item => item.isRegAdd !== 1 && item.state !== 01)
      // 默认第一业务范围
      this.scopeProcessNum = ‘‘
      if (this.scopeInfos.length > 0) {
        if (this.scopeProcessNum === ‘‘) {
          this.scopeProcessNum = this.scopeInfos[0].processNum
        }
      }
      // 拼接所有业务范围
      this.scopeAll = ‘‘
      this.membersRegInfo.scopeInfos.forEach((item) => {
        this.scopeAll += item.name + 
      })
      if (this.scopeAll.indexOf() > -1) {
        this.scopeAll = this.scopeAll.substr(0, this.scopeAll.length - 1)
      }
    },
    queryByProcessNum(processNum, isRegAdd) {
      if (!processNum) {
        return
      }
      FlowNodeInsInfoRegApi.queryByProcessNum(processNum).then(result => {
        if (isRegAdd === 1) {
          this.mmFlowNodeInsInfoRegList = result.data
        } else {
          this.scopeFlowNodeInsInfoRegList = result.data
        }
      }).catch(err => {
        console.log(err)
      })
    },
    applicationDateFormat(row) {
      var date = row.applicationDate
      if (!date) {
        return ‘‘
      }
      return moment(date).format(YYYY-MM-DD)
    },
    dateFormat(row, column) {
      var date = row[column.property]
      if (!date) {
        return ‘‘
      }
      return moment(date).format(YYYY-MM-DD HH:mm:ss)
    },
    close() {
      this.$emit(close-dialog)
    },
    formatterState(row, column) {
      var state = row[column.property]
      return this.states[state]
    }
  }
}
</script>

<style scoped>

</style>

 

 

 

element 弹框关闭报错

标签:def   dia   err   对话   sync   方法   methods   ESS   ack   

原文地址:https://www.cnblogs.com/javascript9527/p/11823047.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!