patrol.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar title="今日巡更" left-icon="left" @clickLeft="getBackFn" color="#161616" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  5. </uni-nav-bar>
  6. <view class="pfbox" :style="'background-color:'+backgroundColor">
  7. <view class="patop">
  8. <view class="tit" @click="getRecordFn">巡更记录</view>
  9. <view class="txt" @click="getSetFn">巡更点设置</view>
  10. </view>
  11. <view class="patabs flexc">
  12. <view class="patab cof7" @click="tabval=0">
  13. <view class="pattit">25</view>
  14. <view class="pattxt">巡更点</view>
  15. <image :src="linea" class="line" v-if="tabval==0"></image>
  16. </view>
  17. <view class="patab co02" @click="tabval=1">
  18. <view class="pattit">25</view>
  19. <view class="pattxt">已巡更</view>
  20. <image :src="lineb" class="line" v-if="tabval==1"></image>
  21. </view>
  22. <view class="patab cof6" @click="tabval=2">
  23. <view class="pattit">25</view>
  24. <view class="pattxt">未巡更</view>
  25. <image :src="linec" class="line" v-if="tabval==2"></image>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <image :src="pbg" class="navbg"></image>
  31. <view class="wymain">
  32. <view class="pfbox" style="opacity: 0;">
  33. <view class="patop">
  34. <view class="tit">巡更记录</view>
  35. <view class="txt">巡更点设置</view>
  36. </view>
  37. <view class="patabs flexc">
  38. <view class="patab cof7" @click="tabval=0">
  39. <view class="pattit">25</view>
  40. <view class="pattxt">巡更点</view>
  41. <image :src="linea" class="line" v-if="tabval==0"></image>
  42. </view>
  43. <view class="patab co02" @click="tabval=1">
  44. <view class="pattit">25</view>
  45. <view class="pattxt">已巡更</view>
  46. <image :src="lineb" class="line" v-if="tabval==1"></image>
  47. </view>
  48. <view class="patab cof6" @click="tabval=2">
  49. <view class="pattit">25</view>
  50. <view class="pattxt">未巡更</view>
  51. <image :src="linec" class="line" v-if="tabval==2"></image>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 列表 -->
  56. <view class="carlists">
  57. <car-list :datainfo="list" :wtdt="wtdt" type='patrol' @getDetail="getDetail" @getAddFn="getAddFn"></car-list>
  58. </view>
  59. </view>
  60. <loading></loading>
  61. </view>
  62. </template>
  63. <script>
  64. import config from '@/config'
  65. const baseUrl = config.baseUrl
  66. import carList from "@/work/components/car/list.vue"
  67. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  68. export default{
  69. components:{carList},
  70. data(){
  71. return{
  72. backgroundColor: "transparent",
  73. pbg:require("@/work/static/service/pbg.png"),
  74. plbg:require("@/work/static/service/plbg.png"),
  75. linea:require("@/work/static/service/linea.png"),
  76. lineb:require("@/work/static/service/lineb.png"),
  77. linec:require("@/work/static/service/linec.png"),
  78. list:[{tit:'皖A IC520',type:1},{tit:'晋E KD783',type:2},],
  79. pageSize: 10,
  80. pageNum: 1,
  81. reachflag: true,
  82. wtdt:'',
  83. nvaHeight:44,
  84. tabval:0,
  85. }
  86. },
  87. onPageScroll(e) {
  88. var scrollTop = Number(e.scrollTop);
  89. if (scrollTop > 0) {
  90. this.backgroundColor = '#CDDEFF'
  91. } else {
  92. this.backgroundColor = 'transparent'
  93. }
  94. },
  95. // 上拉触底加载更多触发事件
  96. onReachBottom() {
  97. if (this.reachflag) {
  98. this.pageNum++
  99. this.getDataFn()
  100. }
  101. },
  102. onLoad: function() {
  103. uni.getSystemInfo({
  104. success: (e) => {
  105. this.nvaHeight = Number(e.statusBarHeight)+44;
  106. }
  107. })
  108. },
  109. methods:{
  110. checkPermi, checkRole,
  111. getDetail(){
  112. this.$tab.navigateTo("/work/pages/service/patroldetail")
  113. },
  114. getRecordFn(){
  115. this.$tab.navigateTo("/work/pages/service/patrolrecord")
  116. },
  117. getSetFn(){
  118. this.$tab.navigateTo("/work/pages/service/patrolset")
  119. },
  120. getAddFn(){
  121. this.$tab.navigateTo("/work/pages/service/patroladd")
  122. },
  123. getBackFn(){
  124. uni.navigateBack({
  125. delta:1
  126. })
  127. },
  128. getDataFn(){
  129. return
  130. var params={
  131. pageSize:this.pageSize,
  132. pageNum: this.pageNum,
  133. }
  134. params.noticeType=this.tabidx
  135. getNoticeList(params).then(res=>{
  136. if(res.code==200){
  137. if (res.rows.length < this.pageSize) {
  138. this.reachflag = false
  139. this.wtdt = '到底了~';
  140. } else {
  141. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  142. if (num < res.total) {
  143. this.reachflag = true
  144. this.wtdt = ''
  145. } else {
  146. this.reachflag = false
  147. this.wtdt = '到底了~';
  148. }
  149. }
  150. if (this.pageNum == 1) {
  151. this.list = res.rows;
  152. } else {
  153. this.list = this.list.concat(res.rows)
  154. }
  155. }else{
  156. this.$toast(res.msg)
  157. }
  158. })
  159. },
  160. }
  161. }
  162. </script>
  163. <style>
  164. page{background: #F3F3F0;}
  165. </style>
  166. <style lang="scss" scoped>
  167. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  168. .navbg{width: 100%;height: 578rpx;z-index: 0;}
  169. .wymain{z-index: 2;position: relative;}
  170. .carlists{padding: 0 18rpx;}
  171. .patop{display: flex;justify-content: space-between;padding-top: 20rpx;margin-bottom: 28rpx;
  172. .tit{font-weight: 500;font-size: 26rpx;color: #304367;width: 152rpx;height: 58rpx;border-radius: 0 29rpx 29rpx 0;background-color: #AEC3EB;line-height: 58rpx;padding-left: 22rpx;
  173. }
  174. .txt{font-weight: 500;font-size: 26rpx;color: #304367;padding-right: 20rpx;}
  175. }
  176. .patabs{
  177. padding: 0 26rpx;margin-bottom:40rpx;
  178. .patab{margin: 0 16rpx;width: 200rpx;height: 124rpx;background: #FFFFFF;border-radius: 20rpx;padding-top: 16rpx;text-align: center;position: relative;
  179. .pattit{font-size: 40rpx;font-weight: bold;margin-bottom: 6rpx;}
  180. .line{position: absolute;bottom: -12rpx;left: 4rpx;width: 192rpx;height: 20rpx;}
  181. .pattxt{font-weight: 500;font-size: 22rpx;}
  182. }
  183. }
  184. </style>