settlementSxDetail.vue 7.1 KB

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