index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div class="sj_history">
  3. <van-tabs :active="active" color="rgba(138, 5, 84, 1)" @change="onChange">
  4. <van-tab title="待签到"></van-tab>
  5. <van-tab title="待入场"></van-tab>
  6. <van-tab title="装卸中"></van-tab>
  7. <van-tab title="已完成"></van-tab>
  8. <van-tab title="已过期"></van-tab>
  9. <van-tab title="已取消"></van-tab>
  10. <van-tab title="全部"></van-tab>
  11. </van-tabs>
  12. <div class="list">
  13. <div class="list-item" v-for="item in list" :key="item.id">
  14. <div class="status qd" v-if="item.status == 0">待签到</div>
  15. <div class="status rz" v-if="item.status == 1">待入厂</div>
  16. <div class="status zx" v-if="item.status == 2">装卸中</div>
  17. <div class="status wc" v-if="item.status == 3">已完成</div>
  18. <div class="status gq" v-if="item.status == 4">已过期</div>
  19. <div class="status qx" v-if="item.status == 5">已取消</div>
  20. <div
  21. class="time"
  22. @click="jumpPage('/pages/subPackages/sj_history/edit?id=' + item.id)"
  23. >
  24. {{ item.reservationDate }}
  25. {{ item.timeStart + "~" + item.timeEnd }} 装货
  26. </div>
  27. <div class="info">{{ item.loadNum }}个托盘</div>
  28. <div class="info1">车辆:{{ item.carNo }}/{{ item.carType }}</div>
  29. <div class="info1">司机:{{ item.driverName }}</div>
  30. <div v-if="item.status == 5" class="info1 qxrq">
  31. 取消日期:2024-07-31 15:00
  32. </div>
  33. <div class="bottborder"></div>
  34. <div class="foot-btn">
  35. <van-button
  36. color="rgba(138, 5, 84, 1)"
  37. plain
  38. type="default"
  39. size="small"
  40. @click="cancelRow(item)"
  41. >取消</van-button
  42. >
  43. <van-button
  44. style="margin-left: 24rpx"
  45. color="rgba(138, 5, 84, 1)"
  46. type="default"
  47. size="small"
  48. @click="
  49. jumpPage('/pages/subPackages/sj_history/edit?id=' + item.id)
  50. "
  51. >修改</van-button
  52. >
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import { reservationListPage } from "@/js_sdk/sjTools.js";
  60. import { getUserLocalStorageInfo } from "@/js_sdk/localUserInfo.js";
  61. export default {
  62. data() {
  63. return {
  64. searchData: {
  65. pageNum: 1,
  66. pageSize: 10,
  67. status: 0,
  68. },
  69. total: 0,
  70. list: [],
  71. };
  72. },
  73. onLoad() {
  74. console.log(getUserLocalStorageInfo().user.id);
  75. this.searchData.userId = getUserLocalStorageInfo().user.id;
  76. this.reservationListPage();
  77. },
  78. onReachBottom() {
  79. // 触底加载更多
  80. this.searchData.pageNum += 1;
  81. this.reservationListPage();
  82. },
  83. methods: {
  84. cancelRow(e) {
  85. console.log(e);
  86. },
  87. onChange(e) {
  88. console.log(e);
  89. this.list = [];
  90. let statusList = {
  91. 0: 0,
  92. 1: 1,
  93. 2: 2,
  94. 3: 3,
  95. 4: 4,
  96. 5: 5,
  97. 6: null,
  98. };
  99. this.searchData.status = statusList[e.detail.index];
  100. this.reservationListPage();
  101. },
  102. async reservationListPage() {
  103. let { data } = await reservationListPage(this.searchData);
  104. console.log(data);
  105. if (this.list.length != data.total) {
  106. this.list.push(...data.list);
  107. }
  108. },
  109. jumpPage(path) {
  110. console.log(path);
  111. uni.navigateTo({
  112. url: path,
  113. fail: (fail) => {},
  114. });
  115. },
  116. },
  117. };
  118. </script>
  119. <style lang="scss">
  120. .sj_history {
  121. .list {
  122. .list-item {
  123. padding: 24rpx 32rpx;
  124. background: #ffffff;
  125. position: relative;
  126. margin-top: 24rpx;
  127. .foot-btn {
  128. display: flex;
  129. justify-content: flex-end;
  130. padding-top: 16rpx;
  131. .van-button {
  132. border-radius: 30rpx 30rpx 30rpx 30rpx;
  133. }
  134. }
  135. .bottborder {
  136. padding-bottom: 24rpx;
  137. border-bottom: 2rpx solid #e8edf5;
  138. }
  139. .info {
  140. font-weight: 400;
  141. font-size: 28rpx;
  142. color: #333333;
  143. }
  144. .info1 {
  145. margin-top: 8rpx;
  146. font-weight: 400;
  147. font-size: 28rpx;
  148. color: #666666;
  149. }
  150. .qxrq {
  151. color: rgba(142, 139, 228, 1);
  152. }
  153. .time {
  154. font-weight: 400;
  155. font-size: 32rpx;
  156. color: #333333;
  157. margin-bottom: 8rpx;
  158. }
  159. .status {
  160. width: 144rpx;
  161. height: 56rpx;
  162. text-align: center;
  163. line-height: 56rpx;
  164. border-top-right-radius: 5%;
  165. border-bottom-left-radius: 50%;
  166. position: absolute;
  167. top: -1rpx;
  168. right: 0;
  169. font-weight: 400;
  170. font-size: 28rpx;
  171. }
  172. .qd {
  173. background: rgba(3, 101, 249, 0.2);
  174. color: #0365f9;
  175. }
  176. .rc {
  177. background: rgba(255, 184, 0, 0.3);
  178. color: #d99f00;
  179. }
  180. .zx {
  181. background: rgba(138, 5, 84, 0.2);
  182. color: #8a0554;
  183. }
  184. .wc {
  185. background: rgba(34, 181, 101, 0.2);
  186. color: #22b565;
  187. }
  188. .gq {
  189. color: #c7191f;
  190. background: rgba(199, 25, 31, 0.2);
  191. }
  192. .qx {
  193. color: #888888;
  194. background: rgba(136, 136, 136, 0.3);
  195. }
  196. }
  197. }
  198. }
  199. </style>