<template>
  <view class="">
    <u-popup v-model="show" mode="bottom">
      <request-common-info :dataContent="dataContent" @onClose="closePopup">
        <view class="">
          <comListItem :dataList="dataList"></comListItem>
        </view>
        <view class="split_line"></view>
      </request-common-info>
    </u-popup>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import requestCommonInfo from '@/mycomponents/request/requestCommonInfo.vue'
import comListItem from '@/mycomponents/common/comListItem.vue'

const dataContent = ref({})
const dataList = ref([])
const show = ref(false)
const openPopup = (val) => {
  dataContent.value = val
  dataList.value = [
    {
      title: '从仓库代码',
      content: dataContent.value.fromWarehouseCode
    },
    {
      title: '到仓库代码',
      content: dataContent.value.toWarehouseCode
    },
    {
      title: '车间代码',
      content: dataContent.value.workshopCode
    },
    {
      title: '使用在途库',
      content: dataContent.value.useOnTheWayLocation,
      type: 'boolean'
    },
    {
      title: '从库位类型范围',
      content: dataContent.value.fromLocationTypes,
      type: 'locationType'
    },
    {
      title: '到库位类型范围',
      content: dataContent.value.toLocationTypes,
      type: 'locationType'
    },
    {
      title: '从库区代码范围',
      content: dataContent.value.fromAreaCodes
    },
    {
      title: '到库区代码范围',
      content: dataContent.value.toAreaCodes
    }
  ]
  setTimeout((res) => {
    show.value = true
  }, 500)
}
const closePopup = () => {
  show.value = false
}
defineExpose({
  openPopup,
  closePopup
})
</script>

<style></style>
