<!--
  @description:查看财务审计报告
  @Modifier:qk
  @routerPath:supplierDeclaration/supplier/financialSituation
  @date:2020/2/17-17:27
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="declareDetailData.dialog"
    title="查看申报材料"
    width="700px"
    custom-class="el-dialog__body-p0"
    top="calc((100vh - 611px) / 2)"
  >
    <section class="main mb10">
      <table class="tableData">
        <tr>
          <td>审核单位</td>
          <td>{{ formData.departName }}</td>
        </tr>
        <tr>
          <td>供应商名称</td>
          <td>{{ formData.supplierName }}</td>
        </tr>
        <tr>
          <td>申报时间</td>
          <td>{{ formData.createTime }}</td>
        </tr>
        <tr>
          <td>申报状态</td>
          <td>
            <span
              v-for="(item,index) in auditStatusList"
              v-if="formData.auditStatus===item.typecode"
              :key="index"
            >
              {{ item.typename }}
            </span>
          </td>
        </tr>
      </table>
      <template v-if="auditList.length>0">
        <div class="page-title">
          审核信息
        </div>
        <el-scrollbar style="max-height:350px">
          <div>
            <el-table
              ref="smallTable"
              :data="auditList"
            >
              <el-table-column
                prop="auditTime"
                align="center"
                label="审核时间"
                min-width="160"
              />
              <el-table-column
                header-align="center"
                label="审核人"
                prop="auditUserName"
                min-width="140"
              />
              <el-table-column
                align="center"
                prop="qualificationsType"
                label="审核状态"
                width="110"
              >
                <template slot-scope="scope">
                  <span>
                    {{ filterDictText(auditStatusList, scope.row.auditStatus) }}
                  </span>
                </template>
              </el-table-column>
              <el-table-column
                header-align="center"
                prop="auditOpinion"
                label="审核意见"
                min-width="200"
              />
            </el-table>
          </div>
        </el-scrollbar>
      </template>
    </section>
  </el-dialog>
</template>

<script>
/* 接口*/
import { queryDeclarationInfo } from '@/api/supplier/declaraTionrecord'
/* 混合开发方法-参数字段*//* 混合开发*/
import { declareHegSupperGroupMixin } from '@/views/supplier/editorDeclaration/mixins/declareHegSupperGroupMixin'// 供应商-字典
import { supplierGroupMixin } from '@/views/supplier/mixins/supplierGroupMixin'
/* 公用方法*/
import { filterDictText } from '@/assets/js/utils'// 常用方法
export default {
  name: 'EnterpriseQualificationDialog',
  mixins: [declareHegSupperGroupMixin, supplierGroupMixin],
  props: {
    // 弹框展示状态
    declareDetailData: {
      type: Object,
      default: function() {
        return {
          dialog: false, //
          id: ''// 申报id
        }
      }
    }
  },
  data() {
    return {
      formData: {
        departName: '', // 审核单位名称
        createTime: '', // 申报时间
        supplierName: '', // 供应商名称
        auditStatus: '' // 申报状态
      },
      auditList: []// 审核信息
    }
  },
  created() {
    this.initData()
  },
  methods: {
    filterDictText,
    // 查询数据
    initData() {
      queryDeclarationInfo(this.declareDetailData.id).then(res => {
        const { data, auditList } = res.data
        this.formData = data
        this.formData.createTime = this.$Moment(this.formData.createTime).format(this.momentDateTime)// 申报时间
        this.auditList = auditList// 审核列表
      })
    }
  }
}
</script>

<style scoped lang="less">
</style>
