vinPartItem.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <block>
  3. <view class="nav-right-item flex" v-for="(item, index) in list" :key="item.productSn">
  4. <view class="uni-col-2">
  5. <u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_120,w_120,color_ffffff'" @click="viewImg(item)" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  6. </view>
  7. <view class="item-info uni-col-10">
  8. <view class="item-name">
  9. <text>{{item.name}}</text>
  10. </view>
  11. <view class="item-detail">
  12. <view class="item-detail-info">
  13. <view class="flex justify_between">
  14. <view>
  15. <text class="item-detail-text flex_1">{{item.code}}</text>
  16. <u-tag v-if="commonPartCode.includes(item.code)" size="mini" style="margin-left: 5px;" text="通用" mode="light" shape="circle" type="success"></u-tag>
  17. </view>
  18. <text class="item-detail-text" v-if="item.affiliation=='SHELF'">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
  19. </view>
  20. <view class="flex" v-if="item.productTypeSn=='543766811373752320'">
  21. <u-tag :text="item.origCode" mode="light" borderColor="#ffffff" shape="circle" type="success"></u-tag>
  22. </view>
  23. <view class="flex justify_between">
  24. <view class="item-detail-text flex_1">
  25. <!-- 货架产品 -->
  26. <view @click="openPriceModal(item,1,showShelfDetial)" v-if="item.affiliation=='SHELF'">
  27. <text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</text>
  28. <text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
  29. <u-icon name="arrow-right" v-if="priceShowVal&&showShelfDetial"></u-icon>
  30. </view>
  31. <!-- 非货架 -->
  32. <view @click="openPriceModal(item,1,showNonShelfDetial)" v-else>
  33. <text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.non_shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</text>
  34. <text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.non_shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
  35. <u-icon name="arrow-right" v-if="priceShowVal&&showNonShelfDetial"></u-icon>
  36. </view>
  37. </view>
  38. <view class="item-detail-text" v-if="item.currentInven">
  39. <u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx'}" type="primary" size="mini">
  40. <u-icon name="plus" color="#fff" size="28"></u-icon>
  41. </u-button>
  42. <u-number-box v-else @change="updateVinNums" @blur="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
  43. </view>
  44. <view class="item-detail-text" v-if="item.affiliation=='NON_SHELF'||!item.currentInven">
  45. <text v-if="!item.checked" @click="addPart(item)" class="phtxt">我要急送</text>
  46. <u-number-box v-else @change="updateVinNums" @blur="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </block>
  54. </template>
  55. <script>
  56. export default {
  57. props: {
  58. list: {
  59. type: Array,
  60. default: () => {
  61. return []
  62. }
  63. },
  64. commonPartCode: {
  65. type: Array,
  66. default: () => {
  67. return []
  68. }
  69. },
  70. configPrice: {
  71. type: Object,
  72. default: () => {
  73. return {}
  74. }
  75. },
  76. showCarPrice: {
  77. type: Boolean,
  78. default: false
  79. },
  80. showCostPrice: {
  81. type: Boolean,
  82. default: false
  83. },
  84. showShelfDetial: {
  85. type: Boolean,
  86. default: false
  87. },
  88. showNonShelfDetial: {
  89. type: Boolean,
  90. default: false
  91. },
  92. priceShowVal: {
  93. type: Boolean,
  94. default: false
  95. },
  96. },
  97. data() {
  98. return {
  99. }
  100. },
  101. methods: {
  102. openPriceModal(item, type, show) {
  103. this.$emit('openPrice', item, type, show)
  104. },
  105. addPart(item) {
  106. this.$emit('addPart', item, 'vin')
  107. },
  108. updateVinNums(e) {
  109. this.$emit('updateVinNums', e)
  110. },
  111. viewImg(item){
  112. this.$emit('viewImg',item)
  113. }
  114. }
  115. }
  116. </script>
  117. <style>
  118. </style>