info-card.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view class="pd-24 pb-10 select-item" @click="$emit('click')">
  3. <view class="b-radius bg-#fff pd-20 p-rtv noactive" :class="{ active: selected }">
  4. <view class="d-flex j-sb a-c li-item-head mb-16">
  5. <view class="li-left-tag" :class="{ [`bg-instore-${item?.instoreType}`]: true }">{{
  6. selectDictLabel(pt_fresh_instore_type, item?.instoreType) }}</view>
  7. <view class="f-s-22 c-#666 pt-10">{{ item?.updateTime || item?.createTime }}</view>
  8. </view>
  9. <view class="d-flex flex1 mb-10">
  10. <view class="flex1">
  11. <span class="f-s-34 c-#333 f-w-500 mr-10">{{ item?.variety }}</span>
  12. <span class="f-s-24 c-#666">{{ item?.partName }}</span>
  13. </view>
  14. <view>
  15. <view v-if="item?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检验</view>
  16. <view v-else class="tag-span c-danger bg-#F9ECEA">未检验</view>
  17. </view>
  18. </view>
  19. <view class="pd2-4-0 f-s-28">
  20. <span class="c-#666 w-s-no">入库批号:</span>
  21. <span class="c-#333 f-w-500">{{ item?.batchCode }}</span>
  22. </view>
  23. <!-- <view class="pd2-4-0 f-s-28">
  24. <span class="c-#666">溯源批号:</span>
  25. <span class="c-#333 f-w-500">暂无</span>
  26. </view> -->
  27. <view v-if="['A3', 'A4'].includes(item?.seedType)" class="pd2-4-0 f-s-28">
  28. <span class="c-#666 w-s-no">菌种/菌株编号:</span>
  29. <span class="c-#333 f-w-500">{{ selectDictLabel(pt_fungus_code_type, item?.fungusCodeType) }}/{{
  30. item?.fungusCode }}</span>
  31. </view>
  32. <view class="pd2-4-0 f-s-28">
  33. <span class="c-#666 w-s-no">供应商:</span>
  34. <span class="c-#333 f-w-500">{{ item?.supplierInfo?.cusName || '-' }}</span>
  35. </view>
  36. <view class="pd2-4-0 f-s-28">
  37. <span class="c-#666 w-s-no">存放库房:</span>
  38. <span class="c-#333 f-w-500">{{ getStorageRoomNames(item?.warehouses) || '-' }}</span>
  39. </view>
  40. <view class="pd2-4-0 f-s-28">
  41. <span class="c-#666 w-s-no">入库量:</span>
  42. <span class="c-#333 f-w-500">{{ item?.capacity }}{{ item?.unit }}</span>
  43. </view>
  44. <view class="d-flex">
  45. <view v-if="item?.inputAmount" class="pd2-4-0 f-s-28 flex1">
  46. <span class="c-#666">出库量:</span>
  47. <span class="c-#333 f-w-500">{{ item?.inputAmount || '0' }}{{ item?.unit }}</span>
  48. </view>
  49. <view v-if="item?.restAmount" class="pd2-4-0 f-s-28 flex1">
  50. <span class="c-primary">剩余量:</span>
  51. <span class="c-primary f-w-500">{{ item?.restAmount || '0' }}{{ item?.unit }}</span>
  52. </view>
  53. </view>
  54. <!-- 选中图标 -->
  55. <image v-if="selected" class="w-40 h-40 checked-icon"
  56. src="https://yujin-szyy.oss-cn-chengdu.aliyuncs.com/szyy/images-plt/common/btn_checked_icon.png"
  57. mode="widthFix" />
  58. </view>
  59. </view>
  60. </template>
  61. <script setup lang="ts">
  62. import { selectDictListClass } from '@/utils/ruoyi';
  63. import { getStorageRoomNames } from '@/utils/common';
  64. const props = defineProps<{
  65. item: any;
  66. selected?: boolean;
  67. }>();
  68. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  69. const { pt_fresh_instore_type, pt_seed_type, pt_fungus_code_type } = toRefs<any>(proxy?.useDict('pt_fresh_instore_type', 'pt_seed_type', 'pt_fungus_code_type'));
  70. </script>
  71. <style lang="scss">
  72. .search-select-item {
  73. height: 86rpx;
  74. background-color: #fff;
  75. border-radius: 10rpx;
  76. box-sizing: border-box;
  77. padding: 12rpx;
  78. }
  79. .tag-span {
  80. padding: 4rpx 12rpx;
  81. font-size: 20rpx;
  82. border-radius: 18rpx;
  83. }
  84. .li-item-head {
  85. margin-left: -24rpx;
  86. margin-top: -24rpx;
  87. }
  88. .li-left-tag {
  89. padding: 6rpx 16rpx;
  90. color: #fff;
  91. border-radius: 16rpx 0 16rpx 0;
  92. font-size: 20rpx;
  93. font-weight: 500;
  94. }
  95. .select-item {
  96. .noactive {
  97. border: 1rpx solid transparent;
  98. }
  99. .active {
  100. background-color: #ebf6ee;
  101. position: relative;
  102. border: 1rpx solid #37a954;
  103. }
  104. .checked-icon {
  105. position: absolute;
  106. right: 0rpx;
  107. bottom: 0rpx;
  108. }
  109. }
  110. </style>