productPricing.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="productPricing-content">
  3. <view class="top"></view>
  4. <view class="status_bar flex justify_between align_center">
  5. <u-icon name="arrow-left" color="#191919" size="32" @click="toPage('/pages/sales/index')"></u-icon>
  6. <view class="title">产品报价</view>
  7. <view><u-icon name="search" color="#999" size="28" @click="search"></u-icon>查询</view>
  8. </view>
  9. <view class="checkbox-price">
  10. <u-checkbox-group placement="row" @change="checkboxChange">
  11. <u-checkbox v-model="item.checked" activeColor="rgb(4, 133, 246)" v-for="(item,index) in priceList" :key="index" :name="item.name" :label="item.name">{{item.name}}</u-checkbox>
  12. </u-checkbox-group>
  13. </view>
  14. <scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
  15. <view class="st-detailList-main">
  16. <view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
  17. <view class="st-detailList-tit">
  18. <view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{item.name}}
  19. </view>
  20. <view class="st-detailList-item-con flex align_center">
  21. <view class="pimgs">
  22. <u-image :src="item.product&&item.product.productMsg?item.product.productMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
  23. </view>
  24. <view class="flex_1">
  25. <view>产品编码:{{item.code}}</view>
  26. <view class="padding_3">原厂编码:{{item.origCode}}</view>
  27. <view class="flex align_center justify_between">
  28. <view class="font_13">
  29. 库存数量:
  30. <u-count-to :end-val="item.stockQty ? item.stockQty : 0" separator="," font-size="26"></u-count-to>个
  31. </view>
  32. <view class="font_13">
  33. 车主价:
  34. ¥<u-count-to :end-val="item.carOwnersPrice ? item.carOwnersPrice : 0" separator="," font-size="26" :decimals="2"></u-count-to>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="price-all flex">
  40. <view class="price-item" v-if="isCostPrice">
  41. <u-count-to :end-val="item.offerCost ? item.offerCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
  42. <view>成本价</view>
  43. </view>
  44. <view class="price-item" v-if="isCityPrice">
  45. <u-count-to :end-val="item.cityPrice ? item.cityPrice : 0" separator="," font-size="26" :decimals="2"></u-count-to>
  46. <view>市级价</view>
  47. </view>
  48. <view class="price-item" v-if="isSpecialPrice">
  49. <u-count-to :end-val="item.specialPrice ? item.specialPrice : 0" separator="," font-size="26" :decimals="2"></u-count-to>
  50. <view>特约价</view>
  51. </view>
  52. <view class="price-item" v-if="isTerminalPrice">
  53. <u-count-to :end-val="item.terminalPrice ? item.terminalPrice : 0" separator="," font-size="26" :decimals="2"></u-count-to>
  54. <view>终端会员价</view>
  55. </view>
  56. </view>
  57. </view>
  58. <view v-if="listData && listData.length == 0">
  59. <u-empty :text="noDataText" mode="list" :img-width="200" :margin-top="30"></u-empty>
  60. </view>
  61. </view>
  62. </scroll-view>
  63. <!-- 搜索弹窗 -->
  64. <search :showModal="showModal"/>
  65. </view>
  66. </template>
  67. <script>
  68. import { dealerProductList } from '@/api/sales'
  69. import search from './search.vue'
  70. export default{
  71. components:{search},
  72. data(){
  73. return{
  74. listData:[],
  75. totalNum:0,
  76. priceList:[{name:'成本价',checked:false},{name:'市级价',checked:false},{name:'特约价',checked:false},{name:'终端会员价',checked:false}],
  77. pageNo:1,
  78. pageSize:10,
  79. noDataText: '暂无数据',
  80. theme: '',
  81. isCostPrice: false,
  82. isCityPrice: false,
  83. isSpecialPrice: false,
  84. isTerminalPrice: false,
  85. showModal:false,
  86. params:{}
  87. }
  88. },
  89. onLoad(option) {
  90. this.theme = getApp().globalData.theme
  91. this.params = option.data ? JSON.parse(option.data) : {}
  92. this.getList()
  93. },
  94. methods:{
  95. toPage(url){
  96. uni.switchTab({
  97. url:url
  98. })
  99. },
  100. // 搜索
  101. search(){
  102. this.showModal=true
  103. console.log('点击的时间里看电视剧')
  104. },
  105. // 价格显示
  106. checkboxChange(val){
  107. if(val&&val.length>0){
  108. const a= val.filter(item=>{return item=='成本价'})
  109. const b= val.filter(item=>{return item=='市级价'})
  110. const c= val.filter(item=>{return item=='特约价'})
  111. const d= val.filter(item=>{return item=='终端会员价'})
  112. if(a&&a.length>0){
  113. this.isCostPrice=true
  114. }else{
  115. this.isCostPrice=false
  116. }
  117. if(b&&b.length>0){
  118. this.isCityPrice=true
  119. }else{
  120. this.isCityPrice=false
  121. }
  122. if(c&&c.length>0){
  123. this.isSpecialPrice=true
  124. }else{
  125. this.isSpecialPrice=false
  126. }
  127. if(d&&d.length>0){
  128. this.isTerminalPrice=true
  129. }else{
  130. this.isTerminalPrice=false
  131. }
  132. }else{
  133. this.isCostPrice=false
  134. this.isCityPrice=false
  135. this.isSpecialPrice=false
  136. this.isTerminalPrice=false
  137. }
  138. },
  139. // 列表
  140. getList(pageNo){
  141. const _this = this
  142. if (pageNo) {
  143. this.pageNo = pageNo
  144. }
  145. let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize })
  146. dealerProductList(params).then(res => {
  147. if (res.status == 200) {
  148. if(this.pageNo>1){
  149. this.listData = this.listData.concat(res.data.list || [])
  150. }else{
  151. this.listData = res.data.list || []
  152. }
  153. this.totalNum = res.data.count || 0
  154. } else {
  155. this.listData = []
  156. this.totalNum = 0
  157. this.noDataText = res.message
  158. }
  159. })
  160. },
  161. // scroll-view到底部加载更多
  162. onreachBottom() {
  163. if(this.listData.length < this.totalNum){
  164. this.pageNo += 1
  165. this.getList()
  166. }
  167. },
  168. }
  169. }
  170. </script>
  171. <style lang="scss">
  172. .productPricing-content{
  173. width:100%;
  174. height: 100vh;
  175. .top {
  176. top: var(--status-bar-height);
  177. }
  178. .status_bar {
  179. height: 44px;
  180. padding: 7px 3px;
  181. width: 100%;
  182. background-color: #fff;
  183. text-align: center;
  184. .title{
  185. font-weight: 700;
  186. font-size: 16px;
  187. }
  188. // position: fixed;
  189. // top: 0px;
  190. // z-index: 999;
  191. }
  192. .checkbox-price{
  193. background-color: #fff;
  194. display: flex;
  195. justify-content: space-around;
  196. padding: 20rpx 0;
  197. margin-bottom: 15rpx;
  198. color: #191919;
  199. }
  200. .product-list{
  201. height: calc(100vh - 94upx);
  202. .st-detailList-main{
  203. .st-detailList-main-item{
  204. background: #ffffff;
  205. padding: 20upx;
  206. margin-bottom: 25upx;
  207. border-radius: 25upx;
  208. box-shadow: 1px 1px 3px #EEEEEE;
  209. .st-detailList-tit{
  210. padding-bottom: 20upx;
  211. border-bottom: 1px solid #e4e7ed;
  212. white-space: nowrap;
  213. overflow: hidden;
  214. text-overflow: ellipsis;
  215. .u-line{
  216. display: inline-block;
  217. width: 6upx;
  218. height: 40upx;
  219. background-color: red;
  220. vertical-align: bottom;
  221. margin: 0 20upx 0 10upx;
  222. }
  223. }
  224. .st-detailList-item-con{
  225. padding: 20upx;
  226. font-size: 26upx;
  227. .pimgs{
  228. margin-right: 16upx;
  229. }
  230. .font_13{
  231. font-size: 26upx;
  232. }
  233. .padding_3{
  234. padding: 6upx 0;
  235. }
  236. }
  237. .price-all{
  238. border-top: 1px solid #e4e7ed;
  239. padding: 20upx 20upx 0;
  240. .price-item{
  241. width: 25%;
  242. border-right: 1px solid #e4e7ed;
  243. text-align: center;
  244. >view{
  245. color:#999;
  246. }
  247. }
  248. .price-item:last-child{
  249. border-right: none;
  250. }
  251. }
  252. }
  253. }
  254. }
  255. }
  256. </style>