pendingOrder.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div>
  3. <BackBar title="正在进行-个贷" lefttext="返回" />
  4. <van-search v-model="listQuery.keyword" placeholder="请输入搜索关键词" @search="onSearch()" />
  5. <van-pull-refresh v-model="loading" @refresh="onRefresh()">
  6. <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="getPendingOrder()">
  7. <div class="card" v-for="item in listData" :key="item.id" @click="toDetail(item)">
  8. <div class="businessTitle">
  9. <van-icon name="link-o" />
  10. {{ item.orderId }}
  11. </div>
  12. <div class="projectName">
  13. <div>
  14. <van-icon name="location-o" />
  15. {{ item.location }}
  16. </div>
  17. </div>
  18. <div class="clientInfo">
  19. <div>
  20. <van-icon name="contact-o" />
  21. {{ item.clientName }}-{{ item.clientSubName}}
  22. </div>
  23. </div>
  24. <div>
  25. <van-tag type="primary" size="medium" class="van-tag">{{ item.currentNodeName }}</van-tag>
  26. <van-tag type="success" size="medium" class="van-tag">{{ item.handlerName }}</van-tag>
  27. <van-tag color="#969799" size="medium" class="van-tag">{{ item.created }}</van-tag>
  28. </div>
  29. </div>
  30. </van-list>
  31. </van-pull-refresh>
  32. <van-back-top right="10vw" bottom="10vh" />
  33. </div>
  34. </template>
  35. <script>
  36. import { pendingOrder } from '@/api/personal';
  37. export default {
  38. data() {
  39. return {
  40. loading: false,
  41. listData: [],
  42. finished: false,
  43. listQuery: {
  44. // 当前页数
  45. current: 1,
  46. // 查询关键字
  47. keyword: null,
  48. },
  49. };
  50. },
  51. created() {
  52. this.getPendingOrder();
  53. },
  54. methods: {
  55. // 列表刷新
  56. onRefresh() {
  57. this.listQuery.current = 1;
  58. this.finished = false;
  59. this.listData = [];
  60. this.getPendingOrder();
  61. },
  62. // 列表关键字搜索
  63. onSearch() {
  64. this.listQuery.current = 1;
  65. this.finished = false;
  66. this.listData = [];
  67. this.getPendingOrder();
  68. },
  69. // 获取我的订单
  70. getPendingOrder() {
  71. this.loading = true;
  72. pendingOrder(this.listQuery).then((res) => {
  73. if (res.code == 200) {
  74. if (res.data.records) {
  75. this.listData = this.listData.concat(res.data.records);
  76. }
  77. // 判断是否还有下一页
  78. if (res.data.pages > this.listQuery.current) {
  79. // 服务端返回的总页数大于当前页数, 将当前页数+1
  80. this.listQuery.current++;
  81. } else {
  82. // 反之停止加载
  83. this.finished = true;
  84. }
  85. }
  86. this.loading = false;
  87. });
  88. },
  89. toDetail(item) {
  90. const detailInfo = {
  91. orderId: item.orderId,
  92. location: item.location,
  93. acreage: item.acreage,
  94. price: item.price,
  95. amount: item.amount / 10000,
  96. clientName: item.clientName,
  97. clientSubName: item.clientSubName,
  98. agent: item.agent,
  99. contactName: item.contactName,
  100. contactTel: item.contactTel,
  101. bailorA: item.bailorA,
  102. bailoraTel: item.bailoraTel,
  103. bailorbTel: item.bailorbTel,
  104. bailorB: item.bailorB,
  105. realAmount: item.realAmount,
  106. shouldAmount: item.shouldAmount,
  107. invoiceAmount: item.invoiceAmount,
  108. created: item.created,
  109. clientManager: item.clientManager
  110. };
  111. this.$router.push({
  112. path: `/index/personal/detail`,
  113. query: {
  114. item: JSON.stringify(detailInfo),
  115. },
  116. });
  117. },
  118. },
  119. };
  120. </script>
  121. <style scoped>
  122. .card {
  123. background-color: white;
  124. border-radius: 5px;
  125. padding: 10px;
  126. margin: 10px;
  127. }
  128. .projectName {
  129. width: 100%;
  130. margin-bottom: 5px;
  131. display: flex;
  132. }
  133. .van-tag {
  134. margin: 2px;
  135. }
  136. .businessTitle {
  137. font-weight: bold;
  138. margin-bottom: 5px;
  139. }
  140. /deep/ .van-tabs__wrap {
  141. width: 100%;
  142. }
  143. .clientInfo {
  144. margin-bottom: 5px;
  145. }
  146. </style>