index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view class="container">
  3. <uni-navbar title="运输查看"></uni-navbar>
  4. <view class="box " style="overflow: hidden;">
  5. <!-- 按钮区域 -->
  6. <view class="button-box commonMt">
  7. <view :class="'car-box ' + (queryParams.auditState==='1'?'active':'')" @click="carbButtonClick">
  8. <image style="width: 28rpx;height: 28rpx;" src="../../static/images/record/state1.png"
  9. mode="widthFix"></image>
  10. <text>合规记录</text>
  11. </view>
  12. <view :class="'car-box ' + (queryParams.auditState==='-1'?'active':'')" @click="personbButtonClick">
  13. <image style="width: 28rpx;height: 28rpx;" src="../../static/images/record/state2.png"
  14. mode="widthFix"></image>
  15. <text>不合规记录</text>
  16. </view>
  17. </view>
  18. <view class="box2">
  19. <!-- 通过记录 -->
  20. <view class="commonMb">
  21. <view @click="goTo(item.id,item.auditState)" class="small-box commonBj " v-for="item in tongguoList"
  22. :key="item.id">
  23. <view class="small-box-top">
  24. <view class="small-box-top-left">
  25. <image style="width: 35rpx;height: 35rpx;margin-left: 11rpx;"
  26. src="../../static/images/record/right.png" mode="widthFix">
  27. </image>
  28. <text>{{ item.transportName }}</text>
  29. </view>
  30. <view v-if="item.auditState === 1" class="small-box-right">
  31. <text>合&nbsp;规</text>
  32. </view>
  33. <view v-else class="small-box-right box-linear">
  34. <text>不合规</text>
  35. </view>
  36. </view>
  37. <view class="small-box-middle mt20">
  38. <view class="middle-left">
  39. <view class="circle-green circle-style">
  40. </view>
  41. <view class="small-box-middle-line-left">
  42. </view>
  43. <view class="circle-red circle-style">
  44. </view>
  45. </view>
  46. <view class="middle-middle">
  47. <view class="position-start">
  48. <view class="green bold size24 textStyle">{{item.startName}}</view>
  49. </view>
  50. <view class="position-end">
  51. <text class="red bold size24 textStyle ">{{item.endName}}</text>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="small-box-date">
  56. <image style="width: 24rpx;height: 24rpx;margin-left: 10rpx;"
  57. src="../../static/images/transport/rili.png" mode="widthFix">
  58. </image>
  59. <text class="ml19 font-size-style">
  60. 时间: {{item.startTime+' — '+item.endTime}}
  61. </text>
  62. </view>
  63. <view class="small-box-bottom mt23">
  64. <view class="small-box-bottom-left">
  65. <image style="width: 25rpx;height: 25rpx;margin-left: 10rpx;"
  66. src="../../static/images/transport/time.png" mode="widthFix"></image>
  67. <text class="ml19 font-size-style">车牌号:{{item.carNumber}} </text>
  68. </view>
  69. <view class="small-box-bottom-left">
  70. <image style="width: 25rpx;height: 25rpx;" src="../../static/images/record/duoren.png"
  71. mode="widthFix">
  72. </image>
  73. <text class="mr15 ml19 font-size-style">车辆司机:{{item.driverName}}</text>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. selectHistoryData
  85. } from "@/api/company/record.js"
  86. export default {
  87. data() {
  88. return {
  89. queryParams: {
  90. userId: this.$store.state.user.userId,
  91. auditState: '1'
  92. },
  93. // 通过记录或者驳回记录0是通过,1是驳回
  94. isCarInfo: '-1',
  95. tongguoList: [],
  96. }
  97. },
  98. methods: {
  99. goTo(id, state) {
  100. this.$tab.navigateTo(`/pages/recordDetail/index?id=${id}&state=${state}`)
  101. },
  102. // 运输记录和驳回就的点击事件
  103. carbButtonClick() {
  104. this.queryParams.auditState = '1';
  105. this.getRecordList();
  106. },
  107. personbButtonClick() {
  108. this.queryParams.auditState = '-1';
  109. this.getRecordList();
  110. },
  111. // 获得记录列表
  112. async getRecordList() {
  113. const res = await selectHistoryData(this.queryParams)
  114. console.log('记录列表', res);
  115. this.tongguoList = res.rows
  116. this.tongguoList.forEach(item => {
  117. item.startTime = item.startTime.replace(/-/g, '/').slice(0, -3)
  118. item.endTime = item.endTime.replace(/-/g, '/').slice(0, -3)
  119. })
  120. }
  121. },
  122. onShow() {
  123. // this.queryParams.auditState= '1';
  124. this.getRecordList()
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .active {
  130. background: linear-gradient(0deg, #F59A02 0%, #FFD334 100%) !important;
  131. box-shadow: 0px 2rpx 13rpx 0px rgba(27, 43, 95, 0.25) !important;
  132. }
  133. .button-box {
  134. display: flex;
  135. justify-content: space-between;
  136. align-items: center;
  137. margin-bottom: 24rpx;
  138. .car-box {
  139. display: flex;
  140. align-items: center;
  141. justify-content: center;
  142. width: 330rpx;
  143. height: 66rpx;
  144. background: rgba(255, 255, 255, 0.6);
  145. border: 0;
  146. // box-shadow: 0px 0px 24rpx 6rpx rgba(109, 160, 251, 0.6);
  147. border-radius: 33rpx;
  148. uni-text {
  149. margin-left: 18rpx;
  150. font-size: 28rpx;
  151. font-weight: bold;
  152. color: #FFFFFF;
  153. }
  154. }
  155. }
  156. .small-box {
  157. padding: 22rpx;
  158. box-sizing: border-box;
  159. margin-bottom: 31rpx;
  160. .small-box-top {
  161. display: flex;
  162. justify-content: space-between;
  163. align-items: center;
  164. .small-box-top-left {
  165. display: flex;
  166. align-items: center;
  167. uni-text {
  168. font-size: 28rpx;
  169. font-weight: bold;
  170. color: #333333;
  171. margin-left: 18rpx;
  172. }
  173. }
  174. .small-box-right {
  175. text-align: center;
  176. width: 103rpx;
  177. height: 45rpx;
  178. border-radius: 15rpx;
  179. font-size: 26rpx;
  180. font-weight: bold;
  181. color: #FFFFFF;
  182. line-height: 45rpx;
  183. background: linear-gradient(90deg, #3FC377 0%, #83D992 100%);
  184. }
  185. }
  186. .mt20 {
  187. margin-top: 20rpx;
  188. }
  189. .small-box-date {
  190. display: flex;
  191. align-items: center;
  192. margin-top: 24rpx;
  193. }
  194. .small-box-bottom {
  195. display: flex;
  196. justify-content: space-between;
  197. align-items: center;
  198. .small-box-bottom-left {
  199. display: flex;
  200. align-items: center;
  201. }
  202. }
  203. }
  204. .font-size-style {
  205. font-size: 24rpx;
  206. font-weight: 400;
  207. color: #485B93;
  208. }
  209. .ml19 {
  210. margin-left: 10rpx;
  211. }
  212. .mt23 {
  213. margin-top: 23rpx;
  214. }
  215. .mr15 {
  216. margin-right: 15rpx;
  217. }
  218. .box-linear {
  219. background: linear-gradient(90deg, #FF2D04 0%, #FFA53E 100%) !important;
  220. }
  221. </style>