myOrder.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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="getMyOrder()">
  7. <div class="card" v-for="item in listData" :key="item.id" @click="toDetail(item)">
  8. <h3>
  9. <van-icon name="link-o" />
  10. &nbsp;{{ item.orderId }}
  11. </h3>
  12. <p class="productionNo" v-if="item.productionNo">
  13. <van-icon name="coupon-o" />
  14. &nbsp;
  15. {{ item.productionNo }}
  16. </p>
  17. <p class="projectName">
  18. <van-icon name="location-o" />
  19. &nbsp;{{ item.orderName }}
  20. </p>
  21. <p>
  22. <van-tag type="primary" size="medium" class="van-tag">
  23. {{ item.production ? (item.production === 'REPORT' ? '报告' : (item.production === 'STATEMENT' ? '意见书' :
  24. '复评函'
  25. )) : '订单' }}
  26. </van-tag>
  27. <van-tag type="primary" size="medium" class="van-tag" v-if="item.currentNodeName">{{ item.currentNodeName }}</van-tag>
  28. <van-tag type="success" size="medium" class="van-tag">{{ item.clienteleName }}</van-tag>
  29. <van-tag type="success" :color="item.repertoryState === '未入库' ? '#969799' : ''" size="medium" class="van-tag">{{ item.repertoryState }}</van-tag>
  30. <van-tag type="success" :color="!item.delivery ? '#969799' : ''" size="medium" class="van-tag">{{ item.delivery ? '已送达' : '未送达' }}</van-tag>
  31. <van-tag type="success" :color="item.edeclareResult === null ? '#969799' : ''" size="medium" class="van-tag">{{ item.edeclareResult==null ? '未申报' : item.edeclareResult }}</van-tag>
  32. </p>
  33. </div>
  34. </van-list>
  35. </van-pull-refresh>
  36. <van-back-top right="10vw" bottom="10vh" />
  37. </div>
  38. </template>
  39. <script>
  40. import { myOrder } from '@/api/major';
  41. export default {
  42. data() {
  43. return {
  44. loading: false,
  45. listData: [],
  46. finished: false,
  47. listQuery: {
  48. // 当前页数
  49. current: 1,
  50. // 查询关键字
  51. keyword: null,
  52. },
  53. };
  54. },
  55. created() {
  56. this.getMyOrder();
  57. },
  58. methods: {
  59. onClickLeft() {
  60. history.back();
  61. },
  62. // 大中型待办列表刷新
  63. onRefresh() {
  64. this.listQuery.current = 1;
  65. this.finished = false;
  66. this.listData = [];
  67. this.getMyOrder();
  68. },
  69. // 大中型待办列表关键字搜索
  70. onSearch() {
  71. this.listQuery.current = 1;
  72. this.finished = false;
  73. this.listData = [];
  74. this.getMyOrder();
  75. },
  76. // 获取我的大中型订单
  77. getMyOrder() {
  78. this.loading = true;
  79. myOrder(this.listQuery).then((res) => {
  80. if (res.code == 200) {
  81. if (res.data.records) {
  82. this.listData = this.listData.concat(res.data.records);
  83. }
  84. // 判断是否还有下一页
  85. if (res.data.pages > this.listQuery.current) {
  86. // 服务端返回的总页数大于当前页数, 将当前页数+1
  87. this.listQuery.current++;
  88. } else {
  89. // 反之停止加载
  90. this.finished = true;
  91. }
  92. }
  93. this.loading = false;
  94. });
  95. },
  96. toDetail(item) {
  97. const detailInfo = {
  98. orderId: item.orderId,
  99. name: item.orderName,
  100. productionType: item.production ? (item.production === 'REPORT' ? '报告' : (item.production === 'STATEMENT' ? '意见书' : '复评函' )) : '订单',
  101. productionNo: item.productionNo,
  102. nodeName: item.currentNodeName,
  103. clientManager: item.clientManager,
  104. principal: item.principal,
  105. realAmount: item.realAmount,
  106. invoiceAmount: item.invoiceAmount,
  107. clienteleName: item.clienteleName,
  108. clienteleSubName: item.clienteleSubName,
  109. clienteleContactName: item.clienteleContactName,
  110. bailor: item.bailor,
  111. owner: item.owner,
  112. repertoryState: item.repertoryState,
  113. delivery: item.delivery ? '已送达' : '未送达',
  114. deliveryDate: item.deliveryDate,
  115. mdeclareResult: item.mdeclareResult==null ? '未申报' : item.mdeclareResult,
  116. edeclareResult: item.edeclareResult==null ? '未申报' : item.edeclareResult,
  117. }
  118. this.$router.push({
  119. path: `/index/major/detail`,
  120. query: {
  121. item: JSON.stringify(detailInfo),
  122. },
  123. });
  124. },
  125. },
  126. };
  127. </script>
  128. <style scoped>
  129. .card {
  130. background-color: white;
  131. border-radius: 12px;
  132. box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.1);
  133. padding: 16px;
  134. margin: 10px;
  135. }
  136. .productionNo {
  137. width: 100%;
  138. font-size: 14px;
  139. }
  140. .projectName {
  141. width: 100%;
  142. /* overflow: hidden;
  143. white-space: nowrap;
  144. text-overflow: ellipsis; */
  145. }
  146. .van-tag {
  147. margin: 2px;
  148. }
  149. </style>