vinPartItem.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <block>
  3. <view class="nav-right-item flex" v-for="item 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_60,w_60,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 class="flex align_center">
  15. <text class="item-detail-text flex_1">{{item.code}}</text>
  16. <uni-tag v-if="commonPartCode.includes(item.code)" size="small" style="margin-left: 5px;" text="通用" :circle="true" type="success"></uni-tag>
  17. </view>
  18. <text class="item-detail-text" style="width: 50%;text-align: right;" 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. <uni-tag :text="item.origCode" inverted :circle="true" type="success"></uni-tag>
  22. </view>
  23. <view class="flex justify_between">
  24. <view class="item-detail-text">
  25. <!-- 货架产品 -->
  26. <view class="flex align_center" @click="openPriceModal(item,1,showShelfDetial)" v-if="item.affiliation=='SHELF'">
  27. <view class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</view>
  28. <view class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</view>
  29. <uni-icons type="arrowright" color="#00aaff" size="12" v-if="priceShowVal&&showShelfDetial"></uni-icons>
  30. </view>
  31. <!-- 非货架 -->
  32. <view class="flex align_center" @click="openPriceModal(item,1,showNonShelfDetial)" v-else>
  33. <view class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.non_shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</view>
  34. <view class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.non_shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</view>
  35. <uni-icons type="arrowright" color="#00aaff" size="12" v-if="priceShowVal&&showNonShelfDetial"></uni-icons>
  36. </view>
  37. </view>
  38. <view class="item-detail-text" v-if="item.currentInven">
  39. <button @click="addPart(item)" v-if="!item.checked" :style="{width:'48rpx',height:'48rpx',background:'#066cff',borderRadius:'50px',padding:0,border:'none'}" type="primary" size="mini">
  40. <uni-icons type="plusempty" color="#fff" size="20"></uni-icons>
  41. </button>
  42. <uni-number-box v-else @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0" :max="item.currentInven"></uni-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. <uni-number-box v-else @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0"></uni-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(value,id) {
  109. this.$emit('updateVinNums', {value:value,index:id})
  110. },
  111. viewImg(item){
  112. this.$emit('viewImg',item)
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="less">
  118. @import '/flex.css';
  119. .nav-right-item{
  120. padding: 15upx 25upx;
  121. border-bottom: 2rpx solid #f5f5f5;
  122. .uni-col-2{
  123. width: 50px;
  124. }
  125. .item-info{
  126. padding-left: 10upx;
  127. width: 80%;
  128. flex-grow: 1;
  129. .item-name{
  130. font-size: 30upx;
  131. color: #191919;
  132. display: flex;
  133. align-items: center;
  134. >image{
  135. width: 38rpx;
  136. height: 38rpx;
  137. margin-right: 10rpx;
  138. }
  139. >text{
  140. flex: 1;
  141. word-break: break-all;
  142. }
  143. }
  144. .item-detail{
  145. .item-detail-info{
  146. padding: 10upx 0 4upx;
  147. /deep/ .uni-tag{
  148. word-break: break-all;
  149. font-size: 28rpx;
  150. color: #0fab04eee;
  151. border: 0;
  152. padding: 0.2rem 0.3rem;
  153. }
  154. > view{
  155. padding-bottom: 10rpx;
  156. align-items: center;
  157. .item-detail-text{
  158. color: #999;
  159. .phtxt{
  160. color: #0485F6;
  161. font-size: 28upx;
  162. }
  163. .item-price{
  164. color: #FB1E1E;
  165. font-size: 28upx;
  166. }
  167. }
  168. }
  169. }
  170. }
  171. }
  172. }
  173. </style>