<!--
 * @Author: zwq
 * @Date: 2023-08-24 14:47:58
 * @LastEditors: zwq
 * @LastEditTime: 2023-11-04 10:31:56
 * @Description:
-->
<template>
	<div>
		<base-table
			v-loading="dataListLoading"
			:table-props="tableProps"
      max-height="200"
			:table-data="tableData" />
      </div>
</template>

<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';

const tableProps = [
	{
		prop: 'goodsBatch',
		label: '产品批次',
	},
	{
		prop: 'numDet',
		label: '批次数量',
	},
	{
		prop: 'createTime',
		label: '入库时间',
		filter: parseTime,
	},
];
export default {
	props: {
    warehouseId: {
			type: String,
			default: '',
		},
	},
	data() {
		return {
			urlOptions: {
				getDataListURL: getWarehouseRealtimeDet
			},
			tableProps,
			tableData: [],
      dataListLoading: false,
		};
	},
	components: {
	},
	created() {},
  mounted() {
    this.getDataList()
  },
	methods: {
    // 获取数据列表
    getDataList() {
      this.dataListLoading = true;
      this.urlOptions.getDataListURL(this.warehouseId).then(response => {
        this.tableData = response.data;
        this.dataListLoading = false;
      });
    },
	},
};
</script>
