<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 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 label="任务类型" v-if="info.BAO_BAO_TYPE === '1'">
        {{ 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
        label="排查日期"
        v-if="info.TYPE === 'listType0005'"
      >
        {{ 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="RISKUNITNAME" label="风险点（单元）" width="180" />
      <el-table-column prop="PARTSNAME" label="辨识部位" width="180" />
      <el-table-column prop="RISK_DESCR" label="存在风险" width="300" />
      <el-table-column prop="DNAME5" label="风险分级" width="180" />
      <el-table-column prop="USERNAME" label="管控负责人" width="180" />
      <el-table-column prop="CHECK_CONTENT" label="检查内容" />
    </layout-table>
  </layout-card>
</template>

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

const route = useRoute();
const { LISTMANAGER_ID } = route.query;
const info = ref({});
const { list } = useListData(getInventoryManagementView, {
  otherParams: { LISTMANAGER_ID },
  usePagination: false,
  callbackFn: (list, responseData) => {
    info.value = responseData.pd;
  },
});
console.log(list);
console.log(info);
</script>

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