good-item.vue 2.7 KB

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