<template>
  <el-dialog
    v-dialogDrag
    title="查看出库明细"
    :visible.sync="open"
    width="900px"
    append-to-body
    :before-close="beforeClose"
    @open="dialogOpen"
  >

    <el-table :data="list" border size="mini">
      <el-table-column
        label="仓库"
        align="center"
        prop="stockCode"
        width="150"
        show-overflow-tooltip
      />
      <el-table-column label="区域" align="center" prop="areaCode" />
      <el-table-column label="货位" align="center" prop="locationCode" />
      <el-table-column label="箱号" align="center" prop="boxNo" />
      <el-table-column label="数量" align="center" prop="boxQty" />
      <el-table-column label="单位" align="center" prop="unitCode" />
      <el-table-column label="产品编码" align="center" prop="productCode" />
      <el-table-column
        label="产品名称"
        align="center"
        prop="productName"
        width="160"
      />

    </el-table>

  </el-dialog>
</template>

<script>
import { getDetailPage } from '@/api/wms/output/salesIssue'

export default {
  data() {
    return {
      // 遮罩层
      loading: false,
      buttonLoading: false,
      // 总条数
      total: 0,
      // WMS 生产发料 主列表
      list: [],
      // 弹出层标题
      title: '',
      // 是否显示弹出层
      open: false,
      // 显示搜索条件
      showSearch: true,
      searching: false,
      currentData: {},
      // 查询参数
      queryParams: {
        pageNo: 1,
        pageSize: 10,
        id: ''
      }
    }
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true
      // 执行查询
      getDetailPage(this.queryParams).then(response => {
        this.list = response.data.list
        this.total = response.data.total
      }).finally(() => {
        this.loading = false
      })
    },
    dialogOpen() {
      this.getList()
    },
    beforeClose(done) {
      this.list = []
      this.total = 0
      done && done()
    }
  }
}
</script>

<style>
</style>

