good-item.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view>
  3. <view class="good-item">
  4. <view class="" @click="toDetail">
  5. <view class="good-msg">
  6. <u-image
  7. :src="item.imgNameArr[0] || ''"
  8. width="128rpx"
  9. height="128rpx"
  10. ></u-image>
  11. <view class="ss-m-l-16">
  12. <view class="good-msg-name">{{item.materialName}}</view>
  13. <view class="good-msg-txm">条形码:{{item.barCode}}</view>
  14. </view>
  15. </view>
  16. <view class="good-cont">
  17. <view class="good-cont-item">
  18. <view class="item-label">规格</view>
  19. <view class="item-value">{{item.materialStandard || '-'}}</view>
  20. </view>
  21. <view class="good-cont-item">
  22. <view class="item-label">批次号</view>
  23. <view class="item-value">{{item.batchNumber || '-'}}</view>
  24. </view>
  25. <view class="good-cont-item" @click.stop="calendarClick">
  26. <view class="item-label">生产日期</view>
  27. <view class="item-value">{{item.productionDate ? $u.timeFormat(item.productionDate, 'yyyy-mm-dd') : '-'}}</view>
  28. </view>
  29. <view class="good-cont-item">
  30. <view class="item-label">库存</view>
  31. <view class="item-value">{{item.inventory ? (item.inventory * 1).toFixed(0) : '0'}}{{item.commodityUnit || ''}}</view>
  32. </view>
  33. <view class="good-cont-item">
  34. <view class="item-label">库位</view>
  35. <view class="item-value">{{item.position || '-'}}</view>
  36. </view>
  37. <view class="good-cont-item">
  38. <view class="item-label">订单数量</view>
  39. <view class="item-value">{{item.operNumber || '0'}}{{item.materialUnit || ''}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <slot></slot>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default{
  49. props:{
  50. item:{
  51. type:Object,
  52. default:()=>{}
  53. }
  54. },
  55. data() {
  56. return {
  57. calendarShow:false,
  58. value1: Number(new Date()),
  59. maxDate:Number(new Date()),
  60. }
  61. },
  62. methods:{
  63. toDetail() {
  64. this.$emit('toDetail',this.item)
  65. },
  66. calendarClick() {
  67. this.$emit('calendarClick',this.item)
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .good-item {
  74. padding: 24rpx 0;
  75. border-bottom: 4rpx solid #F0F6FB;
  76. .good-msg {
  77. display: flex;
  78. align-items: center;
  79. padding: 0 24rpx;
  80. &-name {
  81. color: #333;
  82. font-family: "PingFang SC";
  83. font-size: 28rpx;
  84. font-weight: 500;
  85. margin-bottom: 16rpx;
  86. }
  87. &-txm {
  88. color: #999;
  89. font-family: "PingFang SC";
  90. font-size: 28rpx;
  91. font-weight: 400;
  92. }
  93. }
  94. .good-cont {
  95. display: grid;
  96. grid-template-columns: 25% 45% 30%;
  97. margin-top: 16rpx;
  98. padding: 0 24rpx;
  99. &-item {
  100. font-family: "PingFang SC";
  101. font-weight: 400;
  102. margin-bottom: 24rpx;
  103. .item-label {
  104. color: #999;
  105. font-size: 24rpx;
  106. margin-bottom: 16rpx;
  107. }
  108. .item-value {
  109. color: #000;
  110. font-size: 28rpx;
  111. }
  112. }
  113. }
  114. }
  115. </style>