混凝土运输管理微信小程序、替班
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
4.1 KiB

1 week ago
  1. <template>
  2. <view class="b-relative">
  3. <view class="mask" :class="{ 'active':!!show }" @click="close" v-if="!!show"></view>
  4. <view class="iu b-relative" :class="{ 'active':!!show }">
  5. <view class="it">选择设备</view>
  6. <view class="itc" @click="close">关闭</view>
  7. <view>
  8. <view class="re-card-p32" v-for="(ele,idx) in cars">
  9. <view class="re-empty" v-if="cars.length<1">
  10. <view>暂无数据</view>
  11. </view>
  12. <view class="flex-sb">
  13. <view>
  14. <image class="re-from-car" src="/static/icons/icon11.png"></image>
  15. <span>{{ele.carNo}}</span>
  16. </view>
  17. <view class="re-card-show" @click="success(ele)" v-if="ele.status && +ele.status===0">
  18. <span style="color: #F40000;">确认选择</span>
  19. </view>
  20. <view class="re-card-show" @click="success(ele)" v-if="ele.status && +ele.status===1">
  21. <span style="color: #F40000;">确认选择</span>
  22. </view>
  23. <view class="re-card-show" v-if="ele.status && +ele.status===2">
  24. <span style="color: #F40000;">未通过审核</span>
  25. </view>
  26. <view class="re-card-show" v-if="ele.status && +ele.status===3">
  27. <span style="color: #F40000;">设备使用中</span>
  28. </view>
  29. </view>
  30. <view class="flex-sb re-card-select mt20">
  31. <view>轴数</view>
  32. <view class="flex" style="color: #9E9E9E;">
  33. <span v-if="!ele.mi">错误轴数</span>
  34. <view style="color: #0d0d0d;" v-if="ele.mi">{{ ele.mi }}</view>
  35. <uni-icons v-if="!ele.mi" type="down" size="28rpx" color="#9E9E9E"></uni-icons>
  36. </view>
  37. </view>
  38. <view class="flex-sb re-card-select">
  39. <view>上传证件</view>
  40. <view class="flex" style="color: #9E9E9E;" v-if="!ele.syximage" >
  41. <span>未上传证件</span>
  42. <uni-icons type="right" size="28rpx" color="#9E9E9E"></uni-icons>
  43. </view>
  44. <view class="flex" style="color: #0d0d0d;" v-if="ele.syximage" @click="clickCar(ele.id)">
  45. <span>查看证件信息</span>
  46. <uni-icons type="right" size="28rpx" color="#2d2d2d"></uni-icons>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. cars: []
  59. }
  60. },
  61. methods: {
  62. close(){
  63. this.$emit("close")
  64. },
  65. success(car){
  66. console.log(car);
  67. this.$emit("success", car)
  68. this.close()
  69. },
  70. loadCars(){
  71. this.$httpGet("/api/car/select", {}, (res) => {
  72. console.log('[/car/select]', res);
  73. if(res.data){
  74. this.cars = this.$utils.toArray(res.data)
  75. this.$httpGet("/api/car/checkOrder", {}, (res) => {
  76. if(res.data){
  77. let uesd = this.$utils.toArray(res.data)
  78. uesd.forEach(usd => {
  79. this.cars.forEach(car => {
  80. if(car.id === usd.car_id){
  81. car.status = 3
  82. }
  83. })
  84. })
  85. }
  86. })
  87. }
  88. })
  89. },
  90. clickCar(id){
  91. uni.navigateTo({ url: `/pages/base/showcar?id=${id}`})
  92. }
  93. },
  94. props: {
  95. show: {
  96. type: Boolean,
  97. required: false,
  98. default: false
  99. }
  100. },
  101. mounted(){
  102. this.loadCars()
  103. },
  104. onShow(){
  105. this.loadCars()
  106. }
  107. }
  108. </script>
  109. <style>
  110. .re-from-car{
  111. width: 72rpx;
  112. height: 60rpx;
  113. margin: 0 16rpx -20rpx 0;
  114. }
  115. .mask{
  116. content: ' ';
  117. width: 100vw;
  118. height: 100vh;
  119. background-color: rgba(51, 51, 51, 0.8);
  120. position: fixed;
  121. top: 0;
  122. left: 0;
  123. z-index: 999;
  124. opacity: 0;
  125. }
  126. .mask.active{
  127. opacity: 1;
  128. }
  129. .iu{
  130. /* width: calc(100vw - 88rpx); */
  131. min-height: 342rpx;
  132. padding: 0 0;
  133. background-color: #dcdcdc;
  134. position: fixed;
  135. bottom: 0;
  136. left: 0;
  137. z-index: 1000;
  138. transform: translateY(100%);
  139. transition: .2s ease-in;
  140. }
  141. .iu.active{
  142. transform: translateY(0);
  143. }
  144. .it{
  145. font-size: 32rpx;
  146. height: 100rpx;
  147. line-height: 100rpx;
  148. color: #111;
  149. letter-spacing: 0em;
  150. padding-left: 44rpx;
  151. background-color: #fff;
  152. margin-bottom: 32rpx;
  153. }
  154. .itc{
  155. font-size: 28rpx;
  156. line-height: 72rpx;
  157. color: #888;
  158. position: absolute;
  159. right: 44rpx;
  160. top: 12rpx;
  161. }
  162. .ii{
  163. width: 670rpx;
  164. min-height: 342rpx;
  165. border-radius: 16rpx;
  166. }
  167. .ic{
  168. width: 110rpx;
  169. height: 110rpx;
  170. position: absolute;
  171. top: calc(50% - 55rpx);
  172. left: calc(50% - 55rpx);
  173. }
  174. </style>