pendingOrder.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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.clientManager }}</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. };
  110. this.$router.push({
  111. path: `/index/personal/detail`,
  112. query: {
  113. item: JSON.stringify(detailInfo),
  114. },
  115. });
  116. },
  117. },
  118. };
  119. </script>
  120. <style scoped>
  121. .card {
  122. background-color: white;
  123. border-radius: 5px;
  124. padding: 10px;
  125. margin: 10px;
  126. }
  127. .projectName {
  128. width: 100%;
  129. margin-bottom: 5px;
  130. display: flex;
  131. }
  132. .van-tag {
  133. margin: 2px;
  134. }
  135. .businessTitle {
  136. font-weight: bold;
  137. margin-bottom: 5px;
  138. }
  139. /deep/ .van-tabs__wrap {
  140. width: 100%;
  141. }
  142. .clientInfo {
  143. margin-bottom: 5px;
  144. }
  145. </style>