<template>
  <!-- 列表 -->
  <div>

    <el-table v-loading="loading" :data="list" border>
      <el-table-column
        label="生产领料单"
        align="center"
        prop="workOrderBomNo"
        width="160"
        fixed="left"
      />
      <el-table-column
        label="生产订单"
        align="center"
        prop="workOrderNo"
        width="160"
      />
      <el-table-column
        label="发料单号"
        align="center"
        prop="outStockNo"
        width="160"
      />
      <el-table-column
        label="物料批次"
        align="center"
        prop="wmsLabelMasterId"
        width="170"
      />
      <el-table-column
        label="物料编码"
        align="center"
        prop="erpMaterialId"
        width="160"
      />
      <el-table-column
        label="物料名称"
        align="center"
        prop="materialName"
        width="150"
        show-overflow-tooltip
      />
      <el-table-column label="单位" align="center" prop="unitCode" />
      <el-table-column
        label="供应商"
        align="center"
        prop="supplierCode"
        width="160"
        show-overflow-tooltip
      />
      <el-table-column
        label="仓库"
        align="center"
        prop="wmsStockId"
        width="120"
        show-overflow-tooltip
      />
      <el-table-column
        label="区域"
        align="center"
        prop="wmsStockAreaId"
        width="120"
        show-overflow-tooltip
      />
      <el-table-column
        label="货位"
        align="center"
        prop="wmsStockLocationId"
        width="120"
        show-overflow-tooltip
      />
      <el-table-column label="批次数量" align="center" prop="batchQty" />
      <el-table-column label="发料人" align="center" prop="creator" />
      <el-table-column
        label="创建时间"
        align="center"
        prop="createTime"
        width="160"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNo"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- 物料需求清单查看 -->
    <PickingDetail ref="pickingDetail" />
  </div>
</template>

<script>
import { getOutStockMainDetailPage } from '@/api/wms/inquirePurchase/complexDocuments'
import PickingDetail from '../../components/PickingDetail.vue'

export default {
  name: 'ToClaimed',
  components: { PickingDetail },
  props: {
    queryParamspro: {
      type: Object,
      default: () => {}
    }
  },
  inject: ['paramsQuery'],
  data() {
    return {
      // 遮罩层
      loading: false,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 领料单列表
      list: [],
      // 弹出层标题
      title: '',
      // 是否显示弹出层
      open: false,
      //   提交申请的ids
      ids: '',
      // 查询参数
      queryParams: {
        pageNo: 1,
        pageSize: 10,
        status: 0
      }
    }
  },
  created() {
    this.getList()
    // console.log(this.paramsQuery)
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true
      const params = {
        ...this.paramsQuery,
        ...this.queryParams
      }
      // 执行查询
      getOutStockMainDetailPage(params).then((response) => {
        this.list = response.data.list
        this.total = response.data.total
      }).finally(() => {
        this.loading = false
      })
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNo = 1
      this.getList()
    },
    // 物料需求清单查看
    handleView(row) {
      const { id } = row
      this.$refs.pickingDetail.queryParams.workId = id
      this.$refs.pickingDetail.open = true
    }
  }
}
</script>

  <style>

  </style>

