good-item.vue 2.9 KB

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