settlementSxDetail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <view class="settlement-pages">
  3. <!-- 授信结算 -->
  4. <view class="sxjs-box" v-if="info">
  5. <view class="sxjs-head flex flex_column align-center justify_center">
  6. <view>已用额度</view>
  7. <view class="edu">
  8. <text>¥{{info?info.usedAmount.toFixed(2):0.00}}</text>
  9. </view>
  10. </view>
  11. <view class="sxjs-head-grid flex align-center justify_between">
  12. <view :class="tabIndex==0?'active':''" @click="tabChange(0)">
  13. <view>待结算</view>
  14. <view class="edu"><text>¥{{info?info.waitSettleAmount:0.00}}</text></view>
  15. <view class="line"></view>
  16. </view>
  17. <view :class="tabIndex==1?'active':''" @click="tabChange(1)">
  18. <view>已冻结</view>
  19. <view class="edu"><text>¥{{info?info.freezeAmount.toFixed(2):0.00}}</text></view>
  20. <view class="line"></view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="ds-box">
  25. <scroll-view style="height: calc(100vh - 370upx);position: relative;" scroll-y @scrolltolower="loadMore">
  26. <view class="notes-msg" v-if="tabIndex==1">
  27. 已冻结金额是指状态为“待取货”的订单结算金额合计,暂时无需支付,但是会占用授信额度,请尽快处理
  28. </view>
  29. <!-- 列表 -->
  30. <view class="ds-list" v-for="item in list" :key="item.id">
  31. <view class="flex align_center">
  32. <view class="orderNo">{{item.shelfOrderNo}}</view>
  33. <view class="time">{{item.createDate}}</view>
  34. </view>
  35. <view class="flex align_center">
  36. <view class="carImage flex flex_column justify_center">
  37. <u-image :src="item.vehicleLogo" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  38. </view>
  39. <view class="carModel">
  40. {{item.vehicleModel}}
  41. </view>
  42. <view class="price">¥{{item.settleAmount}}</view>
  43. </view>
  44. </view>
  45. <view style="padding-top: 10%;border:0" v-if="list.length==0 && status!='loading'">
  46. <u-empty :src="`/static/nodata.png`" icon-size="180" text="暂无记录" img-width="180" mode="list"></u-empty>
  47. </view>
  48. <view style="padding: 20upx;">
  49. <u-loadmore v-if="(allData.length>=list.length&&list.length)||status=='loading'" :status="status" />
  50. </view>
  51. </scroll-view>
  52. </view>
  53. <!-- <view class="footer" v-if="tabIndex==0&&info&&info.waitSettleAmount>0">
  54. <u-button @click="toPay" :throttle-time="100" :custom-style="{background:'#1283d4',color:'#fff'}" shape="circle" type="success">
  55. 立即支付(¥{{info.waitSettleAmount}})
  56. </u-button>
  57. </view> -->
  58. </view>
  59. </template>
  60. <script>
  61. import uniIcons from '@/components/uni-icons/uni-icons.vue';
  62. import { waitSettleForSx,shelfSettleBillToPay,findStoreShelfSettleRule } from '@/api/shelf.js'
  63. export default {
  64. components: {
  65. uniIcons
  66. },
  67. data() {
  68. return {
  69. tabIndex: 0,
  70. pageNo: 1,
  71. pageSize:10,
  72. list: [],
  73. allData: [],
  74. info:null,
  75. status: 'loading',
  76. shelfOrderSnList:[]
  77. }
  78. },
  79. onReady() {
  80. },
  81. onLoad(option) {
  82. this.getDetail()
  83. },
  84. methods: {
  85. // 查询详情
  86. getDetail(){
  87. findStoreShelfSettleRule().then(res => {
  88. console.log(res)
  89. if(res.status == 200){
  90. this.info = res.data
  91. this.getwaitSettleForSx()
  92. }
  93. })
  94. },
  95. // 去支付
  96. toPay(){
  97. this.info.shelfOrderSnList = this.shelfOrderSnList
  98. },
  99. waitSettleAmount() {
  100. let ret = 0
  101. this.allData.map(item => {
  102. ret = ret + item.settleAmount
  103. })
  104. this.info.waitSettleAmount = ret.toFixed(2)
  105. },
  106. // 获取详细列表
  107. getwaitSettleForSx(){
  108. const state = ["WAIT","FREEZE","FINISH"]
  109. waitSettleForSx({shelfOrderState: state[this.tabIndex]}).then(res => {
  110. this.allData = res.data || []
  111. console.log(this.allData)
  112. // 默认显示第一页
  113. const allTotal = this.allData.length
  114. this.list = this.allData.slice(0,allTotal<=this.pageSize?allTotal:this.pageSize)
  115. this.status = allTotal>=this.list.length ? "nomore" : 'loadmore'
  116. if(this.tabIndex==0){
  117. // 获取所有sn
  118. this.allData.map(item => {
  119. this.shelfOrderSnList.push(item.shelfOrderSn)
  120. })
  121. this.waitSettleAmount()
  122. }
  123. })
  124. },
  125. tabChange(i){
  126. this.tabIndex = i
  127. this.pageNo = 1
  128. this.status = "loading"
  129. this.allData = []
  130. this.list = []
  131. this.shelfOrderSnList = []
  132. this.getwaitSettleForSx()
  133. },
  134. loadMore(event){
  135. console.log(event,'滚动到底部')
  136. const curCount = this.list.length
  137. const total = this.allData.length
  138. if(curCount<total){
  139. // 下页
  140. this.pageNo = this.pageNo + 1
  141. this.status = "loading"
  142. setTimeout(()=>{
  143. const end = this.pageNo * this.pageSize
  144. this.list = this.allData.slice(0,end)
  145. this.status = total>=this.list.length ? "nomore" : 'loadmore'
  146. },500)
  147. }else{
  148. this.status = "nomore"
  149. }
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="less">
  155. .settlement-pages{
  156. width: 100%;
  157. height: 100vh;
  158. display: flex;
  159. flex-direction: column;
  160. > view{
  161. padding: 30rpx 50rpx;
  162. }
  163. .sxjs-box{
  164. > view{
  165. background-color: #fff;
  166. border-radius: 25rpx;
  167. min-height: 100rpx;
  168. padding: 30rpx;
  169. color: #666;
  170. }
  171. .sxjs-head{
  172. width: 100%;
  173. text-align: center;
  174. font-size: 30rpx;
  175. margin-bottom: 0;
  176. > .edu{
  177. color: #FA3534;
  178. padding: 10rpx 0;
  179. font-size: 36rpx;
  180. text{
  181. font-size: 46rpx;
  182. font-style: italic;
  183. font-weight: 900;
  184. }
  185. }
  186. }
  187. .sxjs-head-grid{
  188. margin-top: -40rpx;
  189. padding-bottom: 20rpx;
  190. > view{
  191. width: 50%;
  192. border-right: 2rpx solid #eee;
  193. text-align: center;
  194. color: #999;
  195. position: relative;
  196. .edu{
  197. text{
  198. font-size: 40rpx;
  199. }
  200. }
  201. &:last-child{
  202. border: 0;
  203. }
  204. .line{
  205. width: 60%;
  206. position: absolute;
  207. left: 20%;
  208. bottom: -20rpx;
  209. }
  210. }
  211. .active{
  212. color: #666;
  213. .edu{
  214. text{
  215. color: #222;
  216. }
  217. }
  218. .line{
  219. border-bottom: 6rpx solid #0485F6;
  220. }
  221. }
  222. }
  223. }
  224. .ds-box{
  225. flex-grow: 1;
  226. padding: 0 50rpx;
  227. overflow: auto;
  228. .notes-msg{
  229. background-color: #F8ECD9;
  230. border-radius: 25rpx;
  231. margin-bottom: 20rpx;
  232. min-height: 100rpx;
  233. padding: 30rpx;
  234. color: #666E75;
  235. font-size: 28rpx;
  236. }
  237. .ds-list{
  238. background-color: #fff;
  239. border-radius: 25rpx;
  240. margin-bottom: 20rpx;
  241. min-height: 100rpx;
  242. padding: 10rpx;
  243. color: #666;
  244. > view{
  245. padding: 10rpx;
  246. font-size: 28rpx;
  247. &:first-child{
  248. justify-content: space-between;
  249. }
  250. .time{
  251. color: #666E75;
  252. font-size: 24rpx;
  253. }
  254. .price{
  255. color: #FA3534;
  256. font-size: 32rpx;
  257. padding-left: 20rpx;
  258. }
  259. .carImage{
  260. padding-right: 20rpx;
  261. }
  262. .carModel{
  263. color: #222;
  264. font-size: 28rpx;
  265. flex-grow: 1;
  266. }
  267. .orderNo{
  268. font-size: 28rpx;
  269. }
  270. }
  271. }
  272. }
  273. }
  274. </style>