regulatorBoxList.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view>
  3. <image src="https://cczdsz.cn/app/images//background-from.png" mode="" class="background"></image>
  4. <view>
  5. <view class="sousuo">
  6. <u-search placeholder="调压箱名称" @search="getProjectList(true)" v-model="name" :show-action="false"></u-search>
  7. <!-- <u-select v-model="showName" :list="workList" label-name="name" value-name="id" @confirm="worker()" @cancel="cancelWorker()"></u-select> -->
  8. <u-search placeholder="调压箱编号" v-model="code" :show-action="false" :action-style="{'font-size':'40rpx'}"
  9. @search="getProjectList(true)"></u-search>
  10. <u-search placeholder="管理所编号" v-model="administrativeOffice" :show-action="false" :action-style="{'font-size':'40rpx'}"
  11. @search="getProjectList(true)"></u-search>
  12. </view>
  13. <view v-for="(item,index) in list" :key="index">
  14. <view class="project-content houseList" @click="gotoindex(item)">
  15. <view class="font-forty-eight houseList_in">
  16. <view style="display: flex;flex-direction: column;">
  17. <span>调压箱名称:{{item.name}}</span>
  18. <span style="font-size: 15px;">调压箱编号:{{item.number}}</span>
  19. <!-- <span style="font-size: 15px;">管理所:{{item.managementOffice}}</span> -->
  20. </view>
  21. <u-icon name="arrow-right"></u-icon>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import service from '@/api/index.js'
  31. export default {
  32. data() {
  33. return {
  34. params: {
  35. year: true,
  36. month: true,
  37. day: true,
  38. hour: true,
  39. minute: false,
  40. second: false
  41. },
  42. showName:false,
  43. showTime: false,
  44. list: [],
  45. workList: [],
  46. value: '',
  47. nameValue: '',
  48. name:'',
  49. userName:'',
  50. civilPower: '',
  51. form:{},
  52. userId:'',
  53. code:'',administrativeOffice:'',
  54. ReachBottom:false,
  55. page:1,
  56. total:0,
  57. pagetype:null
  58. }
  59. },
  60. onLoad(e) {
  61. this.getUserName();
  62. this.pagetype=e.value
  63. this.getWorker();
  64. uni.setNavigationBarColor({
  65. frontColor: '#ffffff',
  66. backgroundColor: '#2d95f4',
  67. })
  68. },
  69. onTabItemTap(e)
  70. {
  71. console.log(e)
  72. uni.removeStorageSync('type')
  73. },
  74. onReachBottom(){
  75. console.log('触底')
  76. this.getReachBottom()
  77. },
  78. onPullDownRefresh()
  79. {
  80. console.log('下拉刷新')
  81. this.getReachBottom()
  82. },
  83. methods: {
  84. getReachBottom()
  85. {
  86. if (this.ReachBottom) {
  87. this.page+=1
  88. this.getProjectList()
  89. }else
  90. {
  91. this.page=1
  92. this.ReachBottom=false
  93. }
  94. },
  95. getWorker()
  96. {
  97. service.getWorker().then(res => {
  98. this.workList=res
  99. })
  100. },
  101. worker(e)
  102. {
  103. this.userName=e[0].label
  104. this.userId=e[0].value
  105. this.getProjectList()
  106. },
  107. cancelWorker()
  108. {
  109. this.userName=''
  110. this.userId=''
  111. },
  112. time(e)
  113. {
  114. this.form.time=e
  115. },
  116. gotoindex(item) {
  117. console.log(item)
  118. if(this.pagetype=='10')
  119. {
  120. uni.navigateTo({
  121. url:`/pages/noLogin/GRegulatingBoxMaintenance/GRegulatingBoxMaintenance?number=${item.number}&name=${item.name}&managementOffice=${item.managementOffice}&id=${item.id}&managementOfficeId=${item.id}&type=2`
  122. })
  123. }
  124. uni.navigateTo({
  125. url:`/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?number=${item.number}&name=${item.name}&managementOffice=${item.managementOffice}&id=${item.id}&managementOfficeId=${item.id}&type=2`
  126. })
  127. },
  128. topage(url) {
  129. uni.navigateTo({
  130. url
  131. })
  132. },
  133. getProjectList(flag) {
  134. if(flag){
  135. this.list=[];
  136. }
  137. service.getregulatorBoxList({inspector:this.userId,name:this.name,number:this.code,managementOffice:this.administrativeOffice,pageSize:10,pageNum:this.page}).then(res => {
  138. console.log('getregulatorBoxList', res)
  139. if (res.rows.length == 0) {
  140. this.$UTILS.showPrompt('暂无项目!')
  141. }
  142. this.total=res.total
  143. if(res.total>this.page*10)
  144. {
  145. this.ReachBottom=true
  146. }else
  147. {
  148. this.ReachBottom=false
  149. }
  150. this.list.push(...res.rows)
  151. })
  152. },
  153. getUserName() {
  154. service.getUserName().then(res => {
  155. this.userId=res.id
  156. this.civilPower = res.civilPower;
  157. this.getProjectList();
  158. })
  159. },
  160. },
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. .background {
  165. z-index: -1;
  166. position: fixed;
  167. width: 100%;
  168. height: 100%;
  169. background-size: 100% 100%;
  170. }
  171. .project {
  172. border-radius: 72rpx;
  173. padding: 25rpx 0;
  174. text-align: center;
  175. margin: 170rpx 55rpx 0;
  176. }
  177. .project-content {
  178. width: 90%;
  179. margin: 40rpx auto;
  180. padding: 30rpx 20rpx;
  181. border-radius: 20rpx;
  182. background: #edf5ff;
  183. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  184. }
  185. .houseList_in{
  186. display: flex;
  187. justify-content:space-between;
  188. align-items:center;
  189. color: #cbcbcb;
  190. font-size: 38rpx;
  191. }
  192. .houseList_in span{
  193. font-size: 36rpx;
  194. color: #333;
  195. }
  196. .sousuo{
  197. display: flex;
  198. justify-content:space-between;
  199. align-items:center;
  200. }
  201. .position {
  202. position: absolute;
  203. bottom: 100rpx;
  204. right: 50rpx;
  205. .arrow {
  206. width: 152rpx;
  207. height: 152rpx;
  208. border-radius: 50%;
  209. padding: 25rpx;
  210. margin-left: 20rpx;
  211. }
  212. }
  213. </style>