<!-- 检定记录 -->
<script lang="ts" setup name="MeasureRecords">
import type { TableColumn } from '@/components/NormalTable/table_interface'

const props = defineProps({
  // 样品id
  sampleId: {
    type: String,
    required: true,
  },
})

// 检定记录
interface SimpleMeasureRecord {
  orderCode: string // 委托单编号
  orderTime: string // 委托单日期
  customerCode: string // 委托人代码
  customerName: string // 委托人名称
  deliverer: string // 送检人
  deliverTime: string // 送检日期
}

// 查询条件
const searchQuery = ref({
  sampleId: '',
  orderId: '',
})

// 表格表头
const columns = ref<TableColumn[]>([
  { text: '委托单编号', value: 'orderCode' },
  { text: '委托单日期', value: 'orderTime' },
  { text: '委托方代码', value: 'customerCode' },
  { text: '委托方名称', value: 'customerName' },
  { text: '送检人', value: 'deliverer' },
  { text: '送检日期', value: 'deliverTime' },
])

// 证书列表
const list = ref<SimpleMeasureRecord[]>([])
const total = ref(0)
// 加载状态
const loading = ref(false)
// 查找证书状态及列表
function fetchData() {
  loading.value = true
  list.value = [
    { orderCode: '1231231212', orderTime: '2022-01-02', customerCode: '20301224', customerName: '203所', deliverer: '张三', deliverTime: '2022-01-02' },
  ]
  loading.value = false
}
fetchData()
</script>

<template>
  <div>
    <normal-table
      :data="list" :total="total" :columns="columns"
      :list-loading="loading"
      :pagination="false"
    />
  </div>
</template>
