good-item.vue 2.6 KB

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