vinPartItem.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. <image
  6. :src="item.images ? item.images+'?x-oss-process=image/resize,m_fixed,h_60,w_60,color_ffffff' : '/static/def_imgs.png'"
  7. @click="viewImg(item)"
  8. style="width:100rpx;height:100rpx;border-radius: 30rpx;background-color: #EBEBEB;"
  9. >
  10. </image>
  11. </view>
  12. <view class="item-info uni-col-10">
  13. <view class="item-name">
  14. <text>{{item.name}}</text>
  15. </view>
  16. <view class="item-detail">
  17. <view class="item-detail-info">
  18. <view class="flex justify_between">
  19. <view class="flex align_center">
  20. <text class="item-detail-text flex_1">{{item.code}}</text>
  21. <uni-tag v-if="commonPartCode.includes(item.code)" size="small" style="margin-left: 5px;" text="通用" :circle="true" type="success"></uni-tag>
  22. </view>
  23. <text class="item-detail-text" style="width: 50%;text-align: right;" v-if="item.affiliation=='SHELF'">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
  24. </view>
  25. <view class="flex" v-if="item.productTypeSn=='543766811373752320'">
  26. <uni-tag :text="item.origCode" inverted :circle="true" type="success"></uni-tag>
  27. </view>
  28. <view class="flex justify_between">
  29. <view class="item-detail-text">
  30. <!-- 货架产品 -->
  31. <view class="flex align_center" @click="openPriceModal(item,1,showShelfDetial)" v-if="item.affiliation=='SHELF'">
  32. <view class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</view>
  33. <view class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</view>
  34. <uni-icons type="arrowright" color="#00aaff" size="12" v-if="priceShowVal&&showShelfDetial"></uni-icons>
  35. </view>
  36. <!-- 非货架 -->
  37. <view class="flex align_center" @click="openPriceModal(item,1,showNonShelfDetial)" v-else>
  38. <view class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.non_shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</view>
  39. <view class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.non_shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</view>
  40. <uni-icons type="arrowright" color="#00aaff" size="12" v-if="priceShowVal&&showNonShelfDetial"></uni-icons>
  41. </view>
  42. </view>
  43. <view class="item-detail-text" v-if="item.currentInven">
  44. <view
  45. class="addbtn flex align_center justify_center"
  46. @click="addPart(item)"
  47. v-if="!item.checked"
  48. >
  49. <uni-icons type="plusempty" color="#fff" size="18"></uni-icons>
  50. </view>
  51. <uni-number-box v-else :hideInput="true" @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0" :max="item.currentInven"></uni-number-box>
  52. </view>
  53. <view class="item-detail-text" v-if="item.affiliation=='NON_SHELF'||!item.currentInven">
  54. <text v-if="!item.checked" @click="addPart(item)" class="phtxt">我要急送</text>
  55. <uni-number-box v-else :hideInput="true" @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0"></uni-number-box>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </block>
  63. </template>
  64. <script>
  65. export default {
  66. props: {
  67. list: {
  68. type: Array,
  69. default: () => {
  70. return []
  71. }
  72. },
  73. commonPartCode: {
  74. type: Array,
  75. default: () => {
  76. return []
  77. }
  78. },
  79. configPrice: {
  80. type: Object,
  81. default: () => {
  82. return {}
  83. }
  84. },
  85. showCarPrice: {
  86. type: Boolean,
  87. default: false
  88. },
  89. showCostPrice: {
  90. type: Boolean,
  91. default: false
  92. },
  93. showShelfDetial: {
  94. type: Boolean,
  95. default: false
  96. },
  97. showNonShelfDetial: {
  98. type: Boolean,
  99. default: false
  100. },
  101. priceShowVal: {
  102. type: Boolean,
  103. default: false
  104. },
  105. },
  106. data() {
  107. return {
  108. }
  109. },
  110. methods: {
  111. openPriceModal(item, type, show) {
  112. this.$emit('openPrice', item, type, show)
  113. },
  114. addPart(item) {
  115. this.$emit('addPart', item, 'vin')
  116. },
  117. updateVinNums(value,id) {
  118. this.$emit('updateVinNums', {value:value,index:id})
  119. },
  120. viewImg(item){
  121. this.$emit('viewImg',item)
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="less">
  127. @import '/flex.css';
  128. .nav-right-item{
  129. padding: 15upx 25upx;
  130. border-bottom: 2rpx solid #f5f5f5;
  131. .uni-col-2{
  132. width: 50px;
  133. }
  134. .item-info{
  135. padding-left: 10upx;
  136. width: 80%;
  137. flex-grow: 1;
  138. .item-name{
  139. font-size: 30upx;
  140. color: #191919;
  141. display: flex;
  142. align-items: center;
  143. >image{
  144. width: 38rpx;
  145. height: 38rpx;
  146. margin-right: 10rpx;
  147. }
  148. >text{
  149. flex: 1;
  150. word-break: break-all;
  151. }
  152. }
  153. .item-detail{
  154. .item-detail-info{
  155. padding: 10upx 0 4upx;
  156. /deep/ .uni-tag{
  157. word-break: break-all;
  158. font-size: 28rpx;
  159. color: #0fab04eee;
  160. border: 0;
  161. padding: 0.2rem 0.3rem;
  162. }
  163. > view{
  164. padding-bottom: 10rpx;
  165. align-items: center;
  166. .item-detail-text{
  167. color: #999;
  168. .addbtn{
  169. width:44rpx;
  170. height:44rpx;
  171. background:#066cff;
  172. border-radius:50px;
  173. }
  174. .phtxt{
  175. color: #0485F6;
  176. font-size: 28upx;
  177. }
  178. .item-price{
  179. color: #FB1E1E;
  180. font-size: 28upx;
  181. }
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. </style>