good-item.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 class="action-btn-box" v-if="showPrint">
  45. <view class="print-btn" @click="clickPrint">
  46. 打印条码
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default{
  54. props:{
  55. item:{
  56. type:Object,
  57. default:()=>{}
  58. },
  59. showPrint:{
  60. type:Boolean,
  61. default: false
  62. }
  63. },
  64. data() {
  65. return {
  66. calendarShow:false,
  67. value1: Number(new Date()),
  68. maxDate:Number(new Date()),
  69. }
  70. },
  71. methods:{
  72. toDetail() {
  73. this.$emit('toDetail',this.item)
  74. },
  75. calendarClick() {
  76. this.$emit('calendarClick',this.item)
  77. },
  78. clickPrint(){
  79. this.$emit('print',this.item)
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .good-item {
  86. padding: 24rpx 0;
  87. border-bottom: 4rpx solid #F0F6FB;
  88. .good-msg {
  89. display: flex;
  90. align-items: center;
  91. padding: 0 24rpx;
  92. &-name {
  93. color: #333;
  94. font-family: "PingFang SC";
  95. font-size: 28rpx;
  96. font-weight: 500;
  97. margin-bottom: 16rpx;
  98. }
  99. &-txm {
  100. color: #999;
  101. font-family: "PingFang SC";
  102. font-size: 28rpx;
  103. font-weight: 400;
  104. }
  105. }
  106. .good-cont {
  107. display: grid;
  108. grid-template-columns: 25% 45% 30%;
  109. margin-top: 16rpx;
  110. padding: 0 24rpx;
  111. &-item {
  112. font-family: "PingFang SC";
  113. font-weight: 400;
  114. margin-bottom: 24rpx;
  115. .item-label {
  116. color: #999;
  117. font-size: 24rpx;
  118. margin-bottom: 16rpx;
  119. }
  120. .item-value {
  121. color: #000;
  122. font-size: 28rpx;
  123. }
  124. }
  125. }
  126. }
  127. .action-btn-box{
  128. text-align: right;
  129. padding: 30rpx 48rpx 0 26rpx;
  130. .print-btn{
  131. font-family: PingFang SC;
  132. font-weight: 500;
  133. font-size: 28rpx;
  134. color: #0256FF;
  135. }
  136. }
  137. </style>