otherPartItem.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. <text class="item-detail-text flex_1">{{item.code}}</text>
  15. <text class="item-detail-text">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
  16. </view>
  17. <view class="flex" v-if="item.productTypeSn=='543766811373752320'">
  18. <u-tag :text="item.origCode" mode="light" borderColor="#ffffff" shape="circle" type="success"></u-tag>
  19. </view>
  20. <view class="flex justify_between">
  21. <view class="item-detail-text flex_1" @click="openPriceModal(item,0,showShelfDetial)">
  22. <text class="item-price" :style="{color:!item.price?'#666':''}" v-if="showCarPrice&&configPrice&&configPrice.shelf_price_show == '1'">{{item.price?'¥'+item.price:'暂无价格'}}</text>
  23. <text class="item-price" :style="{color:!item.cost?'#666':''}" v-if="showCostPrice&&configPrice&&configPrice.shelf_cost_show == '1'">{{item.cost?'¥'+item.cost:'暂无价格'}}</text>
  24. <u-icon name="arrow-right" v-if="priceShowVal&&showShelfDetial"></u-icon>
  25. </view>
  26. <view class="item-detail-text" v-if="item.currentInven">
  27. <u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx',background:'#066cff'}" type="primary" size="mini">
  28. <u-icon name="plus" color="#fff" size="28"></u-icon>
  29. </u-button>
  30. <u-number-box v-else @change="updateNums" @blur="updateNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
  31. </view>
  32. <view class="item-detail-text" v-else>
  33. <text @click="addPart(item)" v-if="!item.checked" class="phtxt">我要急送</text>
  34. <u-number-box v-else @change="updateNums" @blur="updateNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </block>
  42. </template>
  43. <script>
  44. export default {
  45. props: {
  46. list: {
  47. type: Array,
  48. default: () => {
  49. return []
  50. }
  51. },
  52. configPrice: {
  53. type: Object,
  54. default: () => {
  55. return {}
  56. }
  57. },
  58. showCarPrice: {
  59. type: Boolean,
  60. default: false
  61. },
  62. showCostPrice: {
  63. type: Boolean,
  64. default: false
  65. },
  66. showShelfDetial: {
  67. type: Boolean,
  68. default: false
  69. },
  70. showNonShelfDetial: {
  71. type: Boolean,
  72. default: false
  73. },
  74. priceShowVal: {
  75. type: Boolean,
  76. default: false
  77. },
  78. },
  79. data() {
  80. return {
  81. }
  82. },
  83. methods: {
  84. openPriceModal(item, type, show) {
  85. this.$emit('openPrice', item, type, show)
  86. },
  87. addPart(item) {
  88. this.$emit('addPart', item, 'other')
  89. },
  90. updateNums(e) {
  91. this.$emit('updateNums', e)
  92. },
  93. viewImg(item){
  94. this.$emit('viewImg',item)
  95. }
  96. }
  97. }
  98. </script>
  99. <style>
  100. </style>