<!-- 应急物资分类表 -->
<template>
  <basic-container>
    <el-form class="whole_form">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="物资大类">
            <el-input />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="物资类别">
            <el-input />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="物资名称">
            <el-input />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-button type="primary">搜索</el-button>
          <el-button>清空</el-button>
        </el-col>
      </el-row>
    </el-form>
    <el-table :data="tableData" style="width: 100%" stripe border>
      <el-table-column prop="dmUpname0" label="物资大类" header-align="center" align="center" />
      <el-table-column prop="dmUpname1" label="物资类别" header-align="center" align="center" />
      <el-table-column prop="dmUpname2" label="物资名称" header-align="center" align="center" />
      <el-table-column prop="moduleNum" label="规格型号" header-align="center" align="center" />
      <el-table-column prop="dmUpname3" label="单位" header-align="center" align="center" />
    </el-table>
    <pagination
      v-show="page.total > 0"
      v-model:page="page.currentPage"
      v-model:limit="page.pageSize"
      :total="page.total"
      @pagination="getList"
    />
  </basic-container>
</template>

<script setup lang="ts">
import { ref, reactive } from "vue";
import { getSuppliesType } from "@/api/dataStatistics/index";

const tableData: any = ref([]);
const page = reactive({
  currentPage: 1,
  pageSize: 10,
  total: 0
});
const getList = () => {
  const data = reactive({
    size: page.pageSize,
    current: page.currentPage,
    params: {}
  });
  getSuppliesType(data).then((res: any) => {
    console.log(res);
    if (res.code === 0) {
      tableData.value = res.data.records;
      page.total = res.data.total;
    }
  });
};

getList();
</script>

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