<!-- 库存明细 -->
<template>
  <div class="box">
    <a-table :dataSource="dataSource" :row-key="(record) => record.key" :pagination="informationData"
      @change="onChangePage" :columns="columns">
      <template #bodyCell="{ column, record }">
      </template>
    </a-table>
  </div>
</template>
<script setup>

import reserveDataApi from '@/api/reserveData.info/reserveDataApi'
import { useRouter } from 'vue-router'

const informationData = ref({
  total: 0,
  current: 1,
  size: 10
})
const columns = [
  {
    title: '序号',
    dataIndex: 'Index',
    align: 'center',
    customRender: ({ text, record, index }) => {
      return `${index + 1}`
    }
  },
  {
    title: '库区名称',
    dataIndex: 'orgName',
    align: 'center',
    key: 'orgName'
  },
  {
    title: '仓房名称',
    dataIndex: 'storehouseName',
    align: 'center',
    key: 'storehouseName'
  },
  {
    title: '货位',
    dataIndex: 'warehouseName',
    align: 'center',
    key: 'warehouseName'
  },
  {
    title: '品种',
    dataIndex: 'pzName',
    align: 'center',
    key: 'pzName'
  },
  {
    title: '性质',
    dataIndex: 'hwxzName',
    align: 'center',
    key: 'hwxzName',
  },
  {
    title: '等级',
    dataIndex: 'djName',
    align: 'center',
    key: 'djName'
  },
  {
    title: '数量',
    dataIndex: 'kcsl',
    align: 'center',
    key: 'kcsl'
  }
]
const dataSource = ref([])
// 表格分页
const onChangePage = (ev) => {
  informationData.value = { ...ev }
  onSearch()
}
// 列表数据
const getDataList = () => {
  const fd = {
    // 
    orgId: useRouter().currentRoute.value.query.orgId,
    current: informationData.value.current,
    size: informationData.value.size,
  }
  reserveDataApi.businessCountPage(fd).then((res) => {
    dataSource.value = []
    dataSource.value = res.records
    informationData.value.total = res.total
  })
}
onMounted(() => {
  getDataList()
});
</script>
<style lang="less" scoped>
.box {
  margin-top: 32px;
}
</style>