settlementSxDetail.vue 7.2 KB

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