<!--
  @description:不合格供应商详情组件
  @Modifier: haofengxian/肖文龙
  @routerPath:
  @date: 2020-7-9-11:10
-->
<template>
  <div class="main mb10">
    <table class="tableData">
      <tr class="singleRow">
        <td>
          供应商名称
        </td>
        <td>{{ formData.supplierName }}</td>
      </tr>
      <tr class="singleRow">
        <td>
          处罚意见
        </td>
        <td>
          {{ filterDictText(supplierPunishIdeaGroup,formData.punishIdea) }}
        </td>
      </tr>
      <tr class="singleRow">
        <td>
          淘汰原因
        </td>
        <!-- 不合格供应商淘汰原因-->
        <td v-if="formData.punishIdea === '01'">
          {{ filterDictText(supplierBelowGradeWeedOutReasonGroup,formData.freezingReasons) }}
        </td>
        <!--纳入黑名单淘汰原因-->
        <td v-if="formData.punishIdea === '02'">
          {{ filterDictText(supplierBlackWeedOutReasonGroup,formData.freezingReason) }}
        </td>
      </tr>
      <!--纳入黑名单 显示处罚时间期限(月)-->
      <tr v-if="formData.punishIdea === '02'" class="singleRow">
        <td>
          处罚时间期限（月）
        </td>
        <td>
          {{ filterDictText(supplierPunishTimeTermGroup,formData.punishTime) }}
        </td>
      </tr>
      <tr class="singleRow">
        <td>
          事件说明
        </td>
        <td>{{ formData.remarks }}</td>
      </tr>
      <tr class="singleRow">
        <td>
          附件
        </td>
        <td>
          <downloadFile :data="{}" />
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
/* 接口*/
import { queryBlacklistInfo } from '@/api/supplier/supplierUnqualified'
import { filterDictText } from '@/assets/js/utils'// 常用方法
/* 组件*/
import downloadFile from '@comp/common/updownload/downloadFile' // 获取附件信息 下载组件
import { supplierGroupMixin } from '@/views/supplier/mixins/supplierGroupMixin'
export default {
  name: 'BlacklistInfoCompDetail',
  components: {
    downloadFile// 文件下载
  },
  mixins: [supplierGroupMixin],
  data() {
    return {
      formData: {
        freezingReason: '', // 淘汰原因
        id: '', // 主键
        punishIdea: '01', // 处罚意见 01:暂停合格供应商资格 02:取消合格供应商资格
        punishTime: '', // 处罚时间期限 1-11:1-11月 12:一年 24:两年 36:三年
        remarks: '', // 事件说明
        status: '01', // 状态 00保存 01提交
        supplierId: '', // 供应商id
        supplierName: '' // 供应商名称
      }
    }
  },
  created() {
    this.initGetBlacklistDictionaries() // 字典
  },
  methods: {
    filterDictText,
    // 查询黑名单详情
    getBlacklistInfo(id) {
      this.dialog = true
      // this.businessLicenseData.bizId = id // 获取附件
      queryBlacklistInfo(id).then(res => {
        this.formData = res.data
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
