<template>
  <view class="" style="width: 100%; background-color: #fff; border-radius: 10rpx">
    <view class="uni-flex uni-row" style="align-items: center">
      <text style="font-size: 35rpx; padding-left: 10rpx">物料代码</text>
      <item :dataContent="dataContent" style="padding-top: 10rpx; margin-left: 10rpx"></item>
    </view>

    <view class="uni-flex uni-row space-between" style="align-items: center">
      <view>
        <pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
        <pack v-if="dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
        <batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
        <view class="" v-if="dataContent.jobNumber" style="font-size: 30rpx; padding-left: 10rpx; padding-bottom: 10rpx">
          <text style="color: coral">任务号</text>
          {{ dataContent.jobNumber }}
        </view>
        <view class="" v-if="dataContent.businessType" style="font-size: 30rpx; padding-left: 10rpx; padding-bottom: 10rpx">
          <text style="color: green">业务类型</text>
          {{ businessTypeDesc(dataContent.businessType) }}
        </view>
      </view>
      <view class="uni-flex" style="flex-direction: column">
        <view class="uni-flex uni-row center">
          <qty :dataContent="dataContent" :isShowStdPack="isShowStdPack" :isShowStatus="true"></qty>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import itemQty from '@/mycomponents/item/itemQty.vue'
import item from '@/mycomponents/item/item.vue'
import pack from '@/mycomponents/balance/pack.vue'
import batch from '@/mycomponents/balance/batch.vue'
import qty from '@/mycomponents/qty/qty.vue'
import status from '@/mycomponents/status/status.vue'
import { getBusinessTypeName } from '@/common/directory.js'

const props = defineProps({
  dataContent: {
    type: Object,
    default: null
  },
  isShowPack: {
    type: Boolean,
    default: true
  },
  isShowBatch: {
    type: Boolean,
    default: true
  },
  isShowLocation: {
    type: Boolean,
    default: true
  },
  isShowStdPack: {
    type: Boolean,
    default: true
  }
})
const businessTypeDesc = (type) => {
  return getBusinessTypeName(type)
}
</script>

<style></style>
