<!-- 整件拣货 -->
<template>
  <div class="wholePicking">
    <getInfo/>
    <p-tabs v-model="key">
      <p-tab-pane key="1" tab="回盘任务查询">
        <!-- tab0  -->
        <tab0 ref="tab0"/>
      </p-tab-pane>
    </p-tabs>
  </div>
</template>

<script>
// 头部信息
import getInfo from './components/getInfo'

import tab0 from './components/tab0'

export default {
  components: {tab0, getInfo},
  data() {
    return {
      key: '1',
      selectedRows1: [],
      selectedRows2: [],
      selectedRows3: [],
      bldgInfo: {},
      // 弹窗-扫描监管码
      scanVisible: false,
      isScan: true, //扫描监管码是否禁用。
      scanTableList: [], // 扫描监管码数据
      // 弹窗-绑定容器
      bindContainerVisible: false,


      warehouseId: '',
      stage: 1, //扫码阶段：0=入库质检 1=PC拣货 2=PC内复核 3=PC外复核 4=补录 5=PDA拣货 6=PDA内复核 7=PDA外复核
    }
  },
  created() {
    this.warehouseId = this.warehouse.warehouseId
  },
  computed: {
    warehouse() {
      return this.$store.getters.warehouse
    }
  },
  methods: {
    // 接收数据 过滤isSupervise==1
    emitData(selectedRows, db, ok) {
      // 判断是否双击
      if ((selectedRows.length == 1 && selectedRows[0].isSupervise && db) || ok) {
        this.scanVisible = true
      } else {
        this.scanVisible = false
      }
      let temp = selectedRows.filter((item) => item.isSupervise == 1)
      this.scanTableList = temp.map((item) => {
        return {
          refBillId: item.pickTaskId, //拣选任务主表id
          refBillLineId: item.pickTaskDId, //拣选任务明细id

          packSize: item.maxSu, // 混入默认大包装参数
          itemId: item.itemId, //商品id
          containerCode: item.containerCode, //容器编号
          batchNum: item.batchNum, //批次号
          itemName: item.itemName, //商品名称
          itemNum: item.itemCode, //商品编码
          specification: item.itemSpecs, //商品规格
          pieceQty: item.qty, //数量
          uom: item.uom, //包装单位
          caseQty: item.uomQty, //件数
          oddPieceQty: item.oddPieceQty, //零散数
          minSu: item.minSu, //小包装
          middleSu: item.middleSu, //中包装
          maxSu: item.maxSu, // 大包装
          manufacturerName: item.manufacturer, // 生产厂家
          manufacturerLotNum: item.manufacturerLotNum, //批号2021.7.7
          srcCode: item.srcCode, // 源单编号
        }
      })
      console.log('转换字段后数据：', this.scanTableList)
    },
  },
}
</script>

<style scoped lang="less">
.wholePicking {
  background: white;

  ::v-deep {
    .ant-tabs {
      padding-bottom: 30px;
      // tab 导航部分
      .ant-tabs-bar {
        padding-left: 20px;
      }

      // tab标题文字
      .ant-tabs-tab {
        font-size: 16px;
        font-weight: bold;
        padding-top: 20px;
        letter-spacing: 1px;
      }
    }
  }
}
</style>
