<template>
  <div class="midPopUp" v-if="modelValue" @click.stop="handleClose">
    <div class="container" @click.stop>
      <div class="headerTittle">物料详情</div>
      <div class="info tmInfo">
        <div class="titleText">123123213</div>
        <div class="describeText">scsadsada</div>
      </div>
      <el-scrollbar>
        <div class="body" v-for="item in 7">
          <div class="info titleText" @click="clickInfo">adadwad</div>
        </div>
      </el-scrollbar>
    </div>
  </div>
  <ConfirmMessage ref="confirmMessageRef" />
</template>

<script lang="ts" setup>
import { ref } from "vue";
const emits = defineEmits(["update:modelValue"]);
const props = defineProps<{
  modelValue: {
    type: Boolean;
    default: false;
  };
}>();
const scanCode = ref("");
const handleClose = () => {
  emits("update:modelValue", false);
};
const confirmMessageRef = ref(null);
const clickInfo = () => {
  confirmMessageRef.value?.showDialog(
    "替换确认",
    "是否替换：ASD1241234234为新的物料？",
    "确定",
    () => {
      console.log("替换");
    }
  );
};
</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;
  margin-bottom: $p10;
}

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

.tmInfo {
  background-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 $p20;

  .titleText {
    line-height: 30px;
  }

  .describeText {
    text-align: left;
  }
}
</style>
