<template>
  <view class="uni-flex u-col-center" style="padding-top: 15rpx; padding-bottom: 15rpx; padding-left: 10rpx; padding-right: 10rpx; font-size: 32rpx; background-color: #fff">
    <text style="font-size: 30rpx">{{ title }} </text>
    <view class="uni-flex u-col-center" @click="showPack">
      <text style="color: #3fbaff; font-size: 25rpx" v-if="packingNumber == '' && isShowEdit == true">&nbsp 请扫描</text>
      <text style="color: #3fbaff; font-size: 25rpx">&nbsp {{ packingNumber }}</text>
      <image v-if="isShowEdit" style="width: 45rpx; height: 45rpx" src="/static/icons/icons_edit.svg"></image>
    </view>
    <win-scan-pack ref="scanPopup" @getResult="getScanResult" headerType="HPQ"></win-scan-pack>
  </view>
</template>

<script setup lang="ts">
import winScanPack from '@/mycomponents/scan/winScanPack.vue'

const props = defineProps({
  title: {
    type: String,
    default: '需求库位'
  },
  packingNumber: {
    type: String,
    default: ''
  },
  isShowEdit: {
    type: Boolean,
    default: true
  }
})
const showPack = () => {
  scanPopup.value.openScanPopup()
}
const getScanResult = (result) => {
  emit('getScanResult', result)
}

// 传递给父类
const emit = defineEmits(['result'])
</script>

<style></style>
