index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='巡检记录'></cus-header>
  4. <div class="top" @tap="placeShow = true;">
  5. <div class="left">
  6. <image :src="imgBase+'inspection/record_location.png'"></image>
  7. <text>{{'电商园四期B座'}}</text>
  8. </div>
  9. <div class="right">
  10. <u-icon name="arrow-right" color="#FFFFFF" size="32"></u-icon>
  11. </div>
  12. </div>
  13. <div class="filtrate">
  14. <div class="pre" @tap="timeShow = true;">
  15. <text>巡检时间</text>
  16. <div style="transform: rotate(30deg);"><u-icon name="play-left-fill" color="#999999" size="24"></u-icon></div>
  17. </div>
  18. <div class="pre" @tap="typeShow = true">
  19. <text>巡检类型</text>
  20. <div style="transform: rotate(30deg);"><u-icon name="play-left-fill" color="#999999" size="24"></u-icon></div>
  21. </div>
  22. <div class="pre" @tap="userShow = true">
  23. <text>巡检人员</text>
  24. <div style="transform: rotate(30deg);"><u-icon name="play-left-fill" color="#999999" size="24"></u-icon></div>
  25. </div>
  26. </div>
  27. <div class="title">共有<span>{{list.length}}</span>条记录</div>
  28. <div class="boxs" v-if="list.length">
  29. <div class="box" v-for="(item,index) in list" :key="index">
  30. <div class="place">{{item.place}}</div>
  31. <div class="pre">巡检类型<span>{{item.type}}</span></div>
  32. <div class="pre">巡检人员<span>{{item.person}}</span></div>
  33. <div class="pre">联系电话<span>{{item.phone}}</span></div>
  34. <div class="pre">巡检时间<span>{{item.time}}</span></div>
  35. </div>
  36. </div>
  37. <template v-else>
  38. <page-empty :height="'calc(100vh - '+(mt+150)+'px)'" marginTop="150px"></page-empty>
  39. </template>
  40. <u-picker :show="placeShow" :columns="placeColumns" @cancel="placeShow=false" @change="changeHandler" @confirm="e=>paramsConfirm(e,'')" ref="uPicker"></u-picker>
  41. <u-picker :show="timeShow" :columns="timeColumns" title="巡检时间" @cancel="timeShow=false" @confirm="e=>paramsConfirm(e,'')"></u-picker>
  42. <u-picker :show="typeShow" :columns="typeColumns" title="巡检类型" @cancel="typeShow=false" @confirm="e=>paramsConfirm(e,'')"></u-picker>
  43. <u-picker :show="userShow" :columns="userColumns" title="巡检人员" @cancel="userShow=false" @confirm="e=>paramsConfirm(e,'')"></u-picker>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data(){
  49. return {
  50. timeShow:false,
  51. timeColumns:[
  52. ['不限','2025-01-09','2025-01-08']
  53. ],
  54. placeShow:false,
  55. placeColumns:[
  56. ['A栋','B栋'],
  57. ['A101', 'A102', 'A103', 'A201']
  58. ],
  59. placeColumnData: [
  60. ['A101', 'A102', 'A103', 'A201'],
  61. ['B201', 'B203', 'B303', 'B404']
  62. ],
  63. typeShow:false,
  64. typeColumns:[
  65. ['全部','类型1','类型2']
  66. ],
  67. userShow:false,
  68. userColumns:[
  69. ['全部','人员A','人员B']
  70. ],
  71. list:[
  72. {
  73. place:'B座13楼1301',
  74. type:'安保',
  75. person:'张浩',
  76. phone:'18799980997',
  77. time:'2024-12-28 10:34:22'
  78. },
  79. {
  80. place:'B座13楼1302',
  81. type:'安保',
  82. person:'张浩',
  83. phone:'18799980997',
  84. time:'2024-12-28 10:34:22'
  85. },
  86. {
  87. place:'B座13楼1303',
  88. type:'安保',
  89. person:'张浩',
  90. phone:'18799980997',
  91. time:'2024-12-28 10:34:22'
  92. }
  93. ]
  94. }
  95. },
  96. methods:{
  97. changeHandler(e) {
  98. const {
  99. columnIndex,
  100. value,
  101. values, // values为当前变化列的数组内容
  102. index,
  103. // 微信小程序无法将picker实例传出来,只能通过ref操作
  104. picker = this.$refs.uPicker
  105. } = e
  106. // 当第一列值发生变化时,变化第二列(后一列)对应的选项
  107. if (columnIndex === 0) {
  108. // picker为选择器this实例,变化第二列对应的选项
  109. picker.setColumnValues(1, this.placeColumnData[index])
  110. }
  111. },
  112. paramsConfirm(e,type){
  113. this.placeShow = this.timeShow= this.typeShow = this.userShow = false;
  114. }
  115. }
  116. }
  117. </script>
  118. <style scoped lang="less">
  119. .page{
  120. padding-bottom: 20rpx;
  121. background: #F4F8FB;
  122. box-sizing: border-box;
  123. .top{
  124. width: 100%;
  125. height: 102rpx;
  126. background: #198CFF;
  127. padding: 0 30rpx;
  128. box-sizing: border-box;
  129. display: flex;
  130. align-items: center;
  131. justify-content: space-between;
  132. .left{
  133. display: flex;
  134. align-items: center;
  135. image{
  136. width: 36rpx;
  137. height: 36rpx;
  138. }
  139. text{
  140. font-family: PingFangSC, PingFang SC;
  141. font-weight: 400;
  142. font-size: 30rpx;
  143. color: #FFFFFF;
  144. line-height: 42rpx;
  145. margin-left: 10rpx;
  146. }
  147. }
  148. }
  149. .filtrate{
  150. width: 100%;
  151. height: 90rpx;
  152. background: #FFFFFF;
  153. display: flex;
  154. .pre{
  155. width: calc(100% / 3);
  156. height: 100%;
  157. display: flex;
  158. align-items: center;
  159. justify-content: center;
  160. text{
  161. font-family: PingFangSC, PingFang SC;
  162. font-weight: 400;
  163. font-size: 28rpx;
  164. color: #4E5969;
  165. line-height: 40rpx;
  166. margin-right: 12rpx;
  167. }
  168. }
  169. }
  170. .title{
  171. font-family: PingFang-SC, PingFang-SC;
  172. font-weight: bold;
  173. font-size: 32rpx;
  174. color: #1D2129;
  175. line-height: 32rpx;
  176. margin-top: 36rpx;
  177. padding-left: 24rpx;
  178. span{
  179. color: #198CFF;
  180. margin: 0 10rpx;
  181. }
  182. }
  183. .boxs{
  184. width: 100%;
  185. padding: 0 24rpx;
  186. box-sizing: border-box;
  187. margin-top: 16rpx;
  188. overflow: hidden;
  189. .box{
  190. margin-top: 20rpx;
  191. background: #FFFFFF;
  192. border-radius: 16rpx;
  193. padding: 36rpx 24rpx;
  194. .place{
  195. font-family: PingFang-SC, PingFang-SC;
  196. font-weight: bold;
  197. font-size: 32rpx;
  198. color: #1D2129;
  199. line-height: 36rpx;
  200. white-space: nowrap;
  201. overflow: hidden;
  202. text-overflow: ellipsis;
  203. }
  204. .pre{
  205. font-family: PingFangSC, PingFang SC;
  206. font-weight: 400;
  207. font-size: 24rpx;
  208. color: #86909C;
  209. line-height: 24rpx;
  210. margin-top: 26rpx;
  211. span{
  212. font-family: PingFangSC, PingFang SC;
  213. font-weight: 400;
  214. font-size: 26rpx;
  215. color: #1D2129;
  216. line-height: 26rpx;
  217. margin-left: 20rpx;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. </style>