<template>
  <div class="mobile">
    <van-search
      v-model="searchForm.KEYWORDS"
      show-action
      :clearable="false"
      placeholder="请输入搜索关键词"
      @search="fnGetData"
    >
      <template #action>
        <div @click="fnGetData">搜索</div>
      </template>
    </van-search>
    <van-cell-group
      v-for="(item, index) in list"
      :key="index"
      class="mt-10"
      @click="
        $router.push({
          path: '/mobile/risk_point/inspection_record',
          query: {
            CHECKRECORD_ID: item.CHECKRECORD_ID,
            IDENTIFICATIONPARTS_ID,
          },
        })
      "
    >
      <van-cell title="检查清单" :value="item.LISTMANAGERNAME" />
      <van-cell title="检查时间" :value="item.CHECK_TIME" />
      <van-cell title="检查人" :value="item.USERNAME" />
    </van-cell-group>
  </div>
</template>

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

const route = useRoute();
const { IDENTIFICATIONPARTS_ID } = route.query;
const { list, searchForm, fnGetData } = useListData(getRiskPointCheckList, {
  otherParams: { IDENTIFICATIONPARTS_ID },
});
</script>

<style scoped lang="scss">
.mt-10 {
  &:first-child {
    margin-top: 0;
  }
}
</style>
