<template>
  <el-dialog :visible.sync="visible" :title="title" width="95%">
    <table class="table-ui">
      <tr>
        <td class="tbg">行业类型</td>
        <td colspan="3">{{ form.INDUSTRY_TYPE_NAMES.replaceAll(',', ' / ') }}</td>
      </tr>
      <tr>
        <td class="tbg">标准名称</td>
        <td colspan="3">{{ form.CHECK_STANDARD_NAME }}</td>
      </tr>
      <tr>
        <td class="tbg">状态</td>
        <td colspan="3">{{ form.COMMON_STATUS ? (form.COMMON_STATUS === 1 ? '有效' : '停用') : '' }}</td>
      </tr>
      <tr>
        <td class="tbg">标准明细</td>
        <td colspan="3" style="padding:0;">
          <table style="padding:0;width:100%" class="table-vi">
            <tr>
              <th class="title">检查类别</th>
              <th class="title">检查类别</th>
              <th class="title">检查项目</th>
              <th class="title">检查内容</th>
              <th class="title">检查标准</th>
              <th class="title">参考依据</th>
              <th class="title">检查合格项</th>
              <th class="title">检查不合格项</th>
              <th class="title">操作类型</th>
            </tr>
            <tbody v-if="form.itemList.length > 0">
              <tr v-for="(item,index) in form.itemList" :key="index">
                <td class="title">{{ index + 1 }}</td>
                <td class="title">{{ item.CHECK_CATEGORY_NAME }}</td>
                <td class="title">{{ item.CHECK_ITEM_NAME }}</td>
                <td class="title">{{ item.CHECK_CONTENT }}</td>
                <td class="title">{{ item.CHECK_STANDARD }}</td>
                <td class="title">{{ item.REFERENCE_BASIS }}</td>
                <td class="title">{{ item.CHECK_QUALIFIED }}</td>
                <td class="title">{{ item.CHECK_UNQUALIFIED }}</td>
                <td class="title">{{ item.OPERATION_TYPE ? (item.OPERATION_TYPE === 1 ? '选择' : '填写') : '' }}</td>
              </tr>
            </tbody>
            <tbody v-else>
              <tr>
                <td colspan="9" style="text-align: center">暂无数据</td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
    </table>
    <div slot="footer" class="dialog-footer">
      <el-button @click="close">取 消</el-button>
    </div>
  </el-dialog>
</template>
<script>
import waves from '@/directive/waves'
import { requestFN } from '@/utils/request'
export default {
  directives: { waves },
  props: {
    title: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      loading: true,
      visible: false,
      form: {
        COMMON_ID: '',
        INDUSTRY_TYPE_NAMES: '',
        CHECK_STANDARD_NAME: '',
        COMMON_STATUS: '',
        itemList: []
      }
    }
  },
  created() {
  },
  methods: {
    init(e) {
      this.visible = true
      if (e) {
        this.getData(e)
      }
    },
    getData(COMMON_ID) {
      this.listLoading = true
      requestFN(
        '/hiddenDangerCheckStandardCommon/getInfo',
        { COMMON_ID: COMMON_ID }
      ).then((data) => {
        this.listLoading = false
        this.form = data.pd
      }).catch((e) => {
        this.listLoading = false
      })
    },
    close() {
      this.visible = false
    }
  }
}

</script>

<style scoped>
.tbg{
  width: 110px !important;
}
</style>
