<!--
  @description: 申报材料变更-企业资质
  @Modifier: 肖文龙
  @routerPath:
  @date: 2020-6-1 16:32:31
-->
<template>
  <div class="p0-16">
    <enterpriseQualificationAdd v-if="isView" @showStatuschage="showStatuschage" />
    <template v-else>
      <div v-if="changeView" class="mb10">
        <el-button type="primary" @click="isView=true">
          修改
        </el-button>
      </div>
      <enterpriseQualificationDetail />
      <!-- 审核信息 -->
      <inforaMtionAuditDetail v-if="!judgePageData.detailType" />
    </template>
  </div>
</template>

<script>
/* 组件 */
import enterpriseQualificationAdd from './enterpriseQualification-add'// 编辑
import enterpriseQualificationDetail from './enterpriseQualification-detail'// 查看
import inforaMtionAuditDetail from '@/views/supplier/editorDeclaration/inforaMtionAudit/inforaMtionAudit-detail'// 审报材料-审核信息
export default {
  name: 'EssentialInformationChangeEditView',
  components: {
    enterpriseQualificationAdd, // 编辑
    enterpriseQualificationDetail, // 查看
    inforaMtionAuditDetail // 审核信息
  },
  props: {
    showStatus: {
      type: String,
      default: function() {
        return
      }
    },
    judgePageData: {
      type: Object,
      default: function() {
        return {
          departId: '', // 供应商id
          declarationId: '', // 申报审核携带参数
          isViewPage: '', // 判斷是否是供应商本人登录 空代表是
          departInfoId: '' // 变更提交携带参数
        }
      }
    }
  },
  data() {
    return {
      isView: false, // 展示状态  true 编辑
      changeView: true, // 是否展示修改按钮
      type: this.$route.meta.type // 类型 变更、审核、入库
    }
  },
  created() {
    if (this.type === 'declarationChange' && this.showStatus === '00') { // 只有变更展示修改按钮
      this.changeView = false
    }
  },
  methods: {
    // 接收基本信息传的参数-审核状态-审核图片展示
    showStatuschage() {
      this.$emit('showStatuschage')// 传给父集组件参数-审核状态-审核图片展示
      if (this.type === 'declarationChange') { // 只有变更展示修改按钮
        this.isView = false
        this.changeView = false
      }
    }
  }
}
</script>

<style lang="less" scoped>

</style>
