settlementDetail.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <view class="settlement-pages">
  3. <!-- 授信结算 -->
  4. <view class="sxjs-box" v-if="info">
  5. <view class="sxjs-head flex justify_between">
  6. <view class="flex flex_column align_start justify_center">
  7. <view>已结算</view>
  8. <view class="edu">
  9. ¥<text>{{info.settleAmount}}</text>
  10. </view>
  11. </view>
  12. <view class="flex flex_column align_end justify_center">
  13. <view>支付方式</view>
  14. <view class="pay">
  15. {{info.payTypeVal}}
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="ds-box" v-if="info">
  21. <view>
  22. <view class="titls">使用记录</view>
  23. <scroll-view style="height: calc(100vh - 370upx);position: relative;" scroll-y @scrolltolower="onreachBottom">
  24. <!-- 列表 -->
  25. <view class="ds-list" v-for="item in list" :key="item.id" @click="viewDetail(item)">
  26. <view class="flex align-center">
  27. <view class="orderNo">{{item.shelfOrderNo}}</view>
  28. <view class="time">{{item.createDate}}</view>
  29. </view>
  30. <view class="flex align_center">
  31. <view class="carImage flex flex_column">
  32. <u-image v-if="!item.billSource" :src="item.vehicleLogo" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  33. <u-image v-if="item.billSource=='qr_code'" src="/static/qrcode.png" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  34. <u-image v-if="item.billSource=='bar_code'" src="/static/barcode.png" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  35. <u-image v-if="item.billSource=='product_code'" src="/static/tag.png" border-radius="30" width="100" height="100" bg-color="#333" ></u-image>
  36. </view>
  37. <view style="flex-grow: 1;" v-if="!item.billSource">
  38. <view class="carModel flex align_center">
  39. {{item.vehicleModel}}
  40. <view class="price">
  41. ¥{{item.settleAmount}}
  42. </view>
  43. </view>
  44. <view class="carVin flex">
  45. <view>VIN码:{{item.vin||'暂无'}}</view>
  46. <text v-if="item.vin" @click.stop="copyVin(item.vin)">复制</text>
  47. </view>
  48. </view>
  49. <view v-else>
  50. <view class="pcode flex">
  51. <text>{{item.shelfOrderDetailList[0].productCode}}</text>
  52. </view>
  53. <view class="carModel flex">
  54. <text>{{item.shelfOrderDetailList[0].productName}}</text>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view style="padding: 20upx;">
  60. <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  61. <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
  62. </view>
  63. </scroll-view>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import carNo from '@/components/carNo.vue'
  70. import { getShelfOrderList } from "@/api/shelf.js"
  71. export default {
  72. components: {
  73. carNo
  74. },
  75. data() {
  76. return {
  77. info: null,
  78. allData: [],
  79. list: [],
  80. pageSize: 20,
  81. pageNo: 1,
  82. status: 'loading',
  83. total: 0,
  84. }
  85. },
  86. onReady() {
  87. },
  88. onLoad() {
  89. this.info = this.$store.state.vuex_settleRecordDetail
  90. // 获取使用记录
  91. this.getUseRecord()
  92. },
  93. methods: {
  94. // 复制
  95. copyVin(vin){
  96. uni.setClipboardData({
  97. data: vin||'',
  98. })
  99. },
  100. getUseRecord(pageNo){
  101. let _this = this
  102. if (pageNo) {
  103. this.pageNo = pageNo
  104. }
  105. let params = {
  106. pageNo: this.pageNo,
  107. pageSize: this.pageSize,
  108. settleBillSn: this.info.settleBillSn
  109. }
  110. console.log(params)
  111. this.status = "loading"
  112. getShelfOrderList(params).then(res => {
  113. console.log(res)
  114. if (res.code == 200 || res.status == 204 || res.status == 200) {
  115. if(_this.pageNo>1){
  116. _this.list = _this.list.concat(res.data.list || [])
  117. }else{
  118. _this.list = res.data.list || []
  119. }
  120. _this.total = res.data.count || 0
  121. } else {
  122. _this.list = []
  123. _this.total = 0
  124. _this.noDataText = res.message
  125. }
  126. if(this.swiperCurrent == 0){
  127. this.tabList[0].count = _this.total<=99?_this.total:'99+'
  128. }
  129. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  130. })
  131. },
  132. // scroll-view到底部加载更多
  133. onreachBottom() {
  134. console.log(this.list.length, this.total)
  135. if(this.list.length < this.total){
  136. this.pageNo += 1
  137. this.getUseRecord()
  138. }else{
  139. this.status = "nomore"
  140. }
  141. },
  142. viewDetail(item){
  143. item.payDate = this.info.payDate
  144. this.$u.vuex('vuex_settleOrderDetail', item)
  145. uni.navigateTo({
  146. url: "/pagesA/digitalShelf/settlementRecord/orderPartDetail"
  147. })
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="less">
  153. .settlement-pages{
  154. height: 100vh;
  155. display: flex;
  156. flex-direction: column;
  157. > view{
  158. padding: 30rpx 50rpx;
  159. }
  160. .sxjs-box{
  161. > view{
  162. background-color: #fff;
  163. border-radius: 25rpx;
  164. min-height: 100rpx;
  165. padding: 30rpx;
  166. color: #666;
  167. }
  168. .sxjs-head{
  169. width: 100%;
  170. text-align: center;
  171. font-size: 30rpx;
  172. margin-bottom: 0;
  173. > view{
  174. width: 50%;
  175. > .edu{
  176. color: #29AD46;
  177. padding: 10rpx 0;
  178. font-size: 36rpx;
  179. text{
  180. font-size: 46rpx;
  181. font-style: italic;
  182. font-weight: 900;
  183. }
  184. }
  185. .pay{
  186. padding: 10rpx 0;
  187. font-size: 36rpx;
  188. color: #222222;
  189. }
  190. }
  191. }
  192. }
  193. .ds-box{
  194. flex-grow: 1;
  195. padding: 0 50rpx;
  196. overflow: auto;
  197. > view{
  198. background-color: #fff;
  199. border-radius: 25rpx;
  200. padding: 30rpx;
  201. .titls{
  202. font-weight: bold;
  203. }
  204. }
  205. .ds-list{
  206. background-color: #fff;
  207. min-height: 100rpx;
  208. padding: 20rpx 0;
  209. color: #666;
  210. border-bottom: 2rpx solid #f5f5f5;
  211. > view{
  212. padding: 10rpx;
  213. font-size: 28rpx;
  214. &:first-child{
  215. justify-content: space-between;
  216. }
  217. .time{
  218. color: #666E75;
  219. font-size: 24rpx;
  220. }
  221. .price{
  222. color: #FB1E1E;
  223. font-size: 32rpx;
  224. padding-left: 20rpx;
  225. }
  226. .carImage{
  227. padding-right: 20rpx;
  228. }
  229. .carModel{
  230. color: #222;
  231. font-size: 28rpx;
  232. margin-bottom: 10rpx;
  233. }
  234. .orderNo{
  235. color: #666E75;
  236. font-size: 28rpx;
  237. }
  238. .carVin{
  239. color: #666E75;
  240. font-size: 24upx;
  241. > view{
  242. word-break:break-all;
  243. }
  244. text{
  245. background-color: #EBEBEB;
  246. border-radius: 100rpx;
  247. padding: 0 20rpx;
  248. color: #033692;
  249. font-size: 20rpx;
  250. display: flex;
  251. align-items: center;
  252. justify-content: center;
  253. margin-left: 10rpx;
  254. height: 40rpx;
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. </style>