<template>
  <div class="midPopUp" v-if="modelValue" @click.stop="handleClose">
    <div class="container" @click.stop>
      <div class="headerTittle">物料详情</div>
      <div class="infoBox">
        <div class="leftInfo">
          <div class="titleText">{{ showInfo.itemName }}</div>
          <div class="describeText">{{ showInfo.itemCode }}</div>
          <div class="describeText">{{ showInfo.itemModel }}</div>
          <!-- <div class="describeText">计划编号：{{ showInfo.batchNo }}</div>
          <div class="describeText">订单编号：{{ showInfo.itemName }}</div>
          <div class="describeText">入库单号：{{ showInfo.itemName }}</div> -->
        </div>
        <div class="rightBox">
          <div></div>
          <div class="sumBox">
            <div class="describeText">录入数量</div>
            <div class="sum">
              {{ showInfo.realNum ? showInfo.realNum : 0 }}
            </div>
          </div>
        </div>
      </div>
      <el-divider />
      <el-scrollbar>
        <div class="body">
          <div
            class="info titleText"
            v-for="(item, index) in showInfoData"
            :key="index"
          >
            {{ item.batchNo }} &nbsp;&nbsp;&nbsp;&nbsp;* {{ item.num }}
            <span style="margin-right: 10px"></span>
          </div>
          <Empty v-if="showInfoData.length == 0" />
        </div>
      </el-scrollbar>
    </div>
  </div>
</template>

<script lang="ts" setup>
const emits = defineEmits(["update:modelValue"]);
const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false,
  },
  showInfoData: {
    type: Object,
  },
  showInfo: {
    type: Object,
  },
});
const scanCode = ref("");
const handleClose = () => {
  emits("update:modelValue", false);
};
</script>

<style lang="scss" scoped>
.el-divider {
  margin-top: 0;
}

.header {
  @include flex;
  width: 100%;
  margin: $p10 0;

  .inputBox {
    width: 75%;
  }
}

.describeText {
  line-height: 25px !important;
}

.infoBox {
  width: 100%;
  height: 200px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  padding: $p20;
  border-radius: 16px;

  .leftInfo {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    div {
      text-align: left !important;
    }
  }

  .rightBox {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    .sumBox {
      width: 180px;
      height: 80px;
      padding-bottom: 40px;
      text-align: left;

      .describeText {
        text-align: left;
        line-height: 30px;
      }

      .sum {
        font-size: $f38;
        font-weight: bold;
        line-height: 20px;
      }
    }
  }
}

.body {
  padding: 0 $p20;

  .info {
    width: 100%;
    height: 70px;
    padding: 0 $p20;
    background-color: white;
    border-radius: 16px;
    line-height: 70px;
  }
}
</style>
