<template>
  <layout-card>
    <el-divider content-position="left">隐患排查清单信息</el-divider>
    <el-descriptions :column="2" border>
      <el-descriptions-item label="清单名称">
        {{ info.NAME }}
      </el-descriptions-item>
      <el-descriptions-item
        v-if="WHETHER_HAZARDS === '1'"
        label="是否包保责任人任务"
      >
        <span v-if="info.BAO_BAO_TYPE === '0'">否</span>
        <span v-if="info.BAO_BAO_TYPE === '1'">是</span>
      </el-descriptions-item>
      <el-descriptions-item v-if="info.BAO_BAO_TYPE === '1'" label="任务类型">
        {{ info.TASK_TYPE_NAME }}
      </el-descriptions-item>
      <el-descriptions-item label="部门">
        {{ info.DEPARTMENT_NAME }}
      </el-descriptions-item>
      <el-descriptions-item label="岗位">
        {{ info.POST_NAME }}
      </el-descriptions-item>
      <el-descriptions-item label="负责人">
        {{ info.USER_NAME }}
      </el-descriptions-item>
      <el-descriptions-item label="排查类型">
        {{ info.SCREENTYPENAME }}
      </el-descriptions-item>
      <el-descriptions-item label="排查周期">
        {{ info.PERIODNAME }}
      </el-descriptions-item>
      <el-descriptions-item label="清单类型">
        {{ info.TYPENAME }}
      </el-descriptions-item>
      <el-descriptions-item
        v-if="info.TYPE === 'listType0005'"
        label="排查日期"
      >
        {{ info.START_DATE }} - {{ info.END_DATE }}
      </el-descriptions-item>
    </el-descriptions>
    <el-divider content-position="left">检查内容</el-divider>
    <layout-table :data="list" :show-pagination="false">
      <el-table-column type="index" label="序号" width="55" />
      <el-table-column
        prop="CHECK_CATEGORY_NAME"
        label="检查类别"
        width="180"
      />
      <el-table-column prop="CHECK_ITEM_NAME" label="检查项目" width="180" />
      <el-table-column prop="CHECK_CONTENT" label="检查内容" width="200" />
      <el-table-column prop="CHECK_STANDARD" label="检查标准" width="200" />
      <el-table-column prop="REFERENCE_BASIS" label="参考依据" width="200" />
      <el-table-column prop="CHECK_QUALIFIED" label="检查合格项" width="200" />
      <el-table-column
        prop="CHECK_UNQUALIFIED"
        label="检查不合格项"
        width="200"
      />
      <el-table-column label="操作类型">
        <template #default="{ row }">
          <span v-if="row.OPERATION_TYPE === 1">选择</span>
          <span v-if="row.OPERATION_TYPE === 2">填写</span>
        </template>
      </el-table-column>
    </layout-table>
  </layout-card>
</template>

<script setup>
import { useRoute } from "vue-router";
import useListData from "@/assets/js/useListData.js";
import { getCustomStopView } from "@/request/hazard_investigation.js";
import { ref } from "vue";

const route = useRoute();
const { CUSTOM_ID, WHETHER_HAZARDS } = route.query;
const info = ref({});
const { list } = useListData(getCustomStopView, {
  otherParams: { CUSTOM_ID },
  usePagination: false,
  callbackFn: (list, resData) => {
    info.value = resData.pd;
  },
});
</script>

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