otherPartItem.vue 4.6 KB

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