settlementManage.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="settlement-pages">
  3. <!-- 授信结算 -->
  4. <view class="sxjs-box" v-if="settlementType == 'CREDIT'">
  5. <view class="sxjs-head flex flex_column align-center justify_center">
  6. <view>已用额度</view>
  7. <view class="edu">
  8. ¥<text>{{info.usedAmount}}</text>
  9. </view>
  10. <view>
  11. <u-button :throttle-time="100" size="mini" @click="viewDetail" :custom-style="{background:'#066cff',color:'#fff'}" shape="circle" type="success">查看详情</u-button>
  12. </view>
  13. </view>
  14. <view class="sxjs-head-grid flex align-center justify_between">
  15. <view>
  16. <view>授信额度</view>
  17. <view class="edu">¥<text>{{info.creditLimit}}</text></view>
  18. </view>
  19. <view>
  20. <view>可用额度</view>
  21. <view class="edu">¥<text>{{info.usableAmount}}</text></view>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- 按月结算 -->
  26. <view class="ayjs-box" v-if="settlementType == 'MONTH'">
  27. <view class="ayjs-head flex flex_column align-center justify_center">
  28. <view>累计待结算</view>
  29. <view class="edu">
  30. ¥<text>{{info.waitSettleAmount}}</text>
  31. </view>
  32. <view v-if="info.waitSettleAmount">
  33. <u-button :throttle-time="100" size="mini" @click="viewDetail('-1')" :custom-style="{background:'#066cff',color:'#fff'}" shape="circle" type="success">查看详情</u-button>
  34. </view>
  35. </view>
  36. <view class="jsList">
  37. <view v-for="item in ayJsList" :key="item.month" class="flex align-center justify_between" @click="viewDetail(item.month)">
  38. <view>{{item.month}}月</view>
  39. <view>
  40. <text>¥{{item.settleAmount}}</text>
  41. <u-icon color="#999" size="20" name="arrow-right"></u-icon>
  42. </view>
  43. </view>
  44. <view style="padding-top: 10%;border:0" v-if="ayJsList.length==0 && status!='loading'">
  45. <u-empty :src="`/static/nodata.png`" icon-size="120" text="暂无数据" img-width="120" mode="list"></u-empty>
  46. </view>
  47. <view style="padding: 20upx;border:0" v-if="(total>=ayJsList.length&&ayJsList.length)||status=='loading'">
  48. <u-loadmore :status="status" />
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import {findStoreShelfSettleRule,waitSettleForMonth} from '@/api/shelf'
  56. export default {
  57. components: {
  58. },
  59. data() {
  60. return {
  61. settlementType: '',
  62. info: null,
  63. ayJsList: [],
  64. status: '',
  65. total: 0
  66. }
  67. },
  68. onReady() {
  69. },
  70. onNavigationBarButtonTap(btns){
  71. // 结算记录
  72. if(btns.index == 0){
  73. uni.navigateTo({
  74. url: "/pagesA/digitalShelf/settlementRecord/settlementRecord"
  75. })
  76. }
  77. },
  78. onShow() {
  79. this.getDetail()
  80. },
  81. methods: {
  82. // 查询详情
  83. getDetail(){
  84. findStoreShelfSettleRule().then(res => {
  85. console.log(res)
  86. if(res.status == 200){
  87. this.info = res.data
  88. this.settlementType = res.data.settleType
  89. if(this.settlementType == "MONTH"){
  90. // 获取待结算列表
  91. this.getAyDjsList()
  92. }
  93. }
  94. })
  95. },
  96. // 获取待结算列表
  97. getAyDjsList(){
  98. this.status = 'loading'
  99. waitSettleForMonth().then(res => {
  100. console.log(res)
  101. this.ayJsList = res.data || []
  102. this.total = this.ayJsList.length
  103. this.status = ''
  104. })
  105. },
  106. // 已用额度详情
  107. viewDetail(month){
  108. if(this.settlementType == 'CREDIT'){
  109. uni.navigateTo({
  110. url: "/pagesA/digitalShelf/settlementManage/settlementSxDetail?data="+encodeURIComponent(JSON.stringify(this.info))
  111. })
  112. }else{
  113. uni.navigateTo({
  114. url: "/pagesA/digitalShelf/settlementManage/settlementAyDetail?month="+month+"&data="+encodeURIComponent(JSON.stringify(this.info))
  115. })
  116. }
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="less">
  122. .settlement-pages{
  123. min-height: 100vh;
  124. > view{
  125. padding: 30rpx 50rpx;
  126. }
  127. .sxjs-box{
  128. > view{
  129. background-color: #fff;
  130. border-radius: 25rpx;
  131. margin-bottom: 20rpx;
  132. min-height: 100rpx;
  133. padding: 30rpx;
  134. color: #666;
  135. }
  136. .sxjs-head{
  137. width: 100%;
  138. text-align: center;
  139. font-size: 30rpx;
  140. .edu{
  141. color: #FA3534;
  142. padding: 10rpx 0;
  143. font-size: 36rpx;
  144. text{
  145. font-size: 46rpx;
  146. font-style: italic;
  147. font-weight: 900;
  148. }
  149. }
  150. }
  151. .sxjs-head-grid{
  152. > view{
  153. width: 50%;
  154. border-right: 2rpx solid #eee;
  155. text-align: center;
  156. .edu{
  157. text{
  158. font-size: 40rpx;
  159. color: #222;
  160. }
  161. }
  162. &:last-child{
  163. border: 0;
  164. }
  165. }
  166. }
  167. }
  168. .ayjs-box{
  169. > view{
  170. background-color: #fff;
  171. border-radius: 25rpx;
  172. margin-bottom: 20rpx;
  173. min-height: 100rpx;
  174. padding: 30rpx;
  175. color: #666;
  176. }
  177. .ayjs-head{
  178. width: 100%;
  179. text-align: center;
  180. font-size: 30rpx;
  181. .edu{
  182. color: #FA3534;
  183. padding: 10rpx 0;
  184. font-size: 36rpx;
  185. text{
  186. font-size: 46rpx;
  187. font-style: italic;
  188. font-weight: 900;
  189. }
  190. }
  191. }
  192. .jsList{
  193. > view{
  194. border-bottom: 2rpx solid #eee;
  195. padding: 20rpx 10rpx;
  196. text{
  197. margin-left: 10rpx;
  198. }
  199. &:last-child{
  200. border: 0;
  201. }
  202. }
  203. }
  204. }
  205. }
  206. </style>