productPricing.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view class="productPricing-content">
  3. <u-navbar title="产品报价" :safeAreaInsetTop="false" :border-bottom="false" @leftClick="toPage('/pages/sales/index')">
  4. <view class="u-nav-slot" slot="right" style="padding-right: 40rpx;" @click="showModal=true">
  5. <u-icon name="search" color="#999" size="28"></u-icon>查询
  6. </view>
  7. </u-navbar>
  8. <view class="checkbox-price">
  9. <u-checkbox-group placement="row">
  10. <u-checkbox v-model="item.checked" activeColor="rgb(4, 133, 246)" v-for="(item,index) in priceList" :key="index" :name="item.val">{{item.name}}</u-checkbox>
  11. </u-checkbox-group>
  12. </view>
  13. <scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
  14. <view class="st-detailList-main">
  15. <view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
  16. <view class="st-detailList-tit">
  17. <view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{item.name}}
  18. </view>
  19. <view class="st-detailList-item-con flex align_center">
  20. <view class="pimgs">
  21. <u-image :src="item.productMainPic&&item.productMainPic.imageUrl?item.productMainPic.imageUrl:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
  22. </view>
  23. <view class="flex_1">
  24. <view>产品编码:{{item.code}}</view>
  25. <view class="padding_3">原厂编码:{{item.origCode}}</view>
  26. <view class="flex align_center justify_between">
  27. <view class="font_13">
  28. 总款数:<text>{{toThousands(item.stockQty|| 0)}} 个</text>
  29. </view>
  30. <view class="font_13">
  31. 车主价:¥<text>{{toThousands(item.carOwnersPrice|| 0,2)}} </text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="price-all flex">
  37. <view class="price-item" v-if="priceList[0].checked">
  38. <text>{{toThousands(item.offerCost|| 0,2)}} </text>
  39. <view>成本价</view>
  40. </view>
  41. <view class="price-item" v-if="priceList[1].checked">
  42. <text>{{toThousands(item.cityPrice|| 0,2)}} </text>
  43. <view>市级价</view>
  44. </view>
  45. <view class="price-item" v-if="priceList[2].checked">
  46. <text>{{toThousands(item.specialPrice|| 0,2)}} </text>
  47. <view>特约价</view>
  48. </view>
  49. <view class="price-item" v-if="priceList[3].checked">
  50. <text>{{toThousands(item.terminalPrice|| 0,2)}} </text>
  51. <view>终端会员价</view>
  52. </view>
  53. </view>
  54. </view>
  55. <u-empty v-if="listData.length == 0 &&status!='loading'" :text="noDataText" mode="list" ></u-empty>
  56. <view style="padding-bottom: 20upx;">
  57. <u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
  58. </view>
  59. </view>
  60. </scroll-view>
  61. <!-- 搜索弹窗 -->
  62. <search :showModal="showModal" @refresh="refreshList" @close="showModal=false"/>
  63. </view>
  64. </template>
  65. <script>
  66. import { toThousands } from '@/libs/tools'
  67. import { dealerProductList } from '@/api/sales'
  68. import search from './search.vue'
  69. export default{
  70. components:{search},
  71. data(){
  72. return{
  73. toThousands,
  74. listData:[],
  75. totalNum:0,
  76. priceList:[
  77. { name: '成本价', checked: false, val: 'offerCost' },
  78. { name: '市级价', checked: false, val: 'cityPrice' },
  79. { name: '特约价', checked: false, val: 'specialPrice' },
  80. { name: '终端会员价', checked: false, val: 'terminalPrice' },
  81. ],
  82. pageNo:1,
  83. pageSize:6,
  84. noDataText: '暂无数据',
  85. theme: '',
  86. status: 'loadmore',
  87. showModal:false,
  88. params:{}
  89. }
  90. },
  91. onLoad(option) {
  92. this.theme = getApp().globalData.theme
  93. this.getList()
  94. },
  95. methods:{
  96. toPage(url){
  97. uni.switchTab({
  98. url:url
  99. })
  100. },
  101. // 刷新列表
  102. refreshList(val){
  103. this.params =val ? val : {},
  104. this.$nextTick(function(){
  105. this.getList(1)
  106. })
  107. },
  108. // 列表
  109. getList(pageNo){
  110. const _this = this
  111. if (pageNo) {
  112. this.pageNo = pageNo
  113. }
  114. let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize })
  115. this.status = "loading"
  116. dealerProductList(params).then(res => {
  117. if (res.status == 200) {
  118. if(this.pageNo>1){
  119. this.listData = this.listData.concat(res.data.list || [])
  120. }else{
  121. this.listData = res.data.list || []
  122. }
  123. this.totalNum = res.data.count || 0
  124. } else {
  125. this.listData = []
  126. this.totalNum = 0
  127. this.noDataText = res.message
  128. }
  129. this.status = "loadmore"
  130. })
  131. },
  132. // scroll-view到底部加载更多
  133. onreachBottom() {
  134. if(this.listData.length < this.totalNum){
  135. this.pageNo += 1
  136. this.getList()
  137. }
  138. },
  139. }
  140. }
  141. </script>
  142. <style lang="scss">
  143. .productPricing-content{
  144. width:100%;
  145. height: 100vh;
  146. .checkbox-price{
  147. background-color: #fff;
  148. display: flex;
  149. justify-content: space-around;
  150. padding: 20rpx 0;
  151. margin-bottom: 15rpx;
  152. color: #191919;
  153. }
  154. .product-list{
  155. height: calc(100vh - 94upx);
  156. .st-detailList-main{
  157. .st-detailList-main-item{
  158. background: #ffffff;
  159. padding: 20upx;
  160. margin-bottom: 25upx;
  161. border-radius: 25upx;
  162. box-shadow: 1px 1px 3px #EEEEEE;
  163. .st-detailList-tit{
  164. padding-bottom: 20upx;
  165. border-bottom: 1px solid #e4e7ed;
  166. white-space: nowrap;
  167. overflow: hidden;
  168. text-overflow: ellipsis;
  169. .u-line{
  170. display: inline-block;
  171. width: 6upx;
  172. height: 40upx;
  173. background-color: red;
  174. vertical-align: bottom;
  175. margin: 0 20upx 0 10upx;
  176. }
  177. }
  178. .st-detailList-item-con{
  179. padding: 20upx;
  180. font-size: 26upx;
  181. .pimgs{
  182. margin-right: 16upx;
  183. }
  184. .font_13{
  185. font-size: 26upx;
  186. }
  187. .padding_3{
  188. padding: 6upx 0;
  189. }
  190. }
  191. .price-all{
  192. border-top: 1px solid #e4e7ed;
  193. padding: 20upx 20upx 0;
  194. .price-item{
  195. width: 25%;
  196. border-right: 1px solid #e4e7ed;
  197. text-align: center;
  198. >view{
  199. color:#999;
  200. }
  201. }
  202. .price-item:last-child{
  203. border-right: none;
  204. }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. </style>