<script lang="ts" setup>
import { $t } from "@/common/languages";
import TreeSidePageableTable from "@/components/base/treeside-pageable-table/TreeSidePageableTable.vue";

/**
 * 必须要的变量
 */
const getPageUrl = "/warehouse/stock/getStockPage";
const treeSideUrl = "/warehouse/warehouse/getWarehouseSelectList";
const searchers = [
  {
    name: "searchCode",
    type: "text" as const,
    placeholder:
      $t("_prop.warehouse.warehouse_item.partNumber") + "/" + $t("_prop.warehouse.warehouse_item.productSpecs"),
  },
];
</script>
<template>
  <TreeSidePageableTable
    :url="getPageUrl"
    :searchers="searchers"
    ref="tableRef"
    :tree-side-url="treeSideUrl"
    tree-side-node-name="value"
    tree-side-param-name="storeId"
    tree-side-title="所有仓库"
  >
    <template #columns>
      <el-table-column :label="$t('_prop.warehouse.warehouse_item.productType')" prop="productType" />
      <el-table-column :label="$t('_prop.warehouse.warehouse_item.partNumber')" prop="partNumber" />
      <el-table-column :label="$t('_prop.warehouse.warehouse_item.productSpecs')" prop="productSpecs" />
      <el-table-column :label="$t('_prop.warehouse.warehouse_item.productPacking')" prop="productPacking" />
      <el-table-column :label="$t('_prop.warehouse.warehouse_item.productBrand')" prop="productBrand" />
      <el-table-column :label="$t('_prop.warehouse.warehouse_item.productPackSize')" prop="productPackSize" />
      <el-table-column :label="$t('_prop.warehouse.warehouse.storeName')" prop="storeName" />
      <el-table-column :label="$t('_prop.warehouse.stock.productCount')" prop="productCount" />
    </template>
  </TreeSidePageableTable>
</template>
