regulatorBoxList.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view>
  3. <image src="https://121.37.40.217/app/images//background-from.png" mode="" class="background"></image>
  4. <view>
  5. <view class="sousuo">
  6. <u-search placeholder="调压箱名称" @search="getProjectList()" 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()"></u-search>
  10. <u-search placeholder="管理所编号" v-model="administrativeOffice" :show-action="false" :action-style="{'font-size':'40rpx'}"
  11. @search="getProjectList()"></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. }
  58. },
  59. onLoad() {
  60. this.getUserName();
  61. this.getWorker();
  62. uni.setNavigationBarColor({
  63. frontColor: '#ffffff',
  64. backgroundColor: '#2d95f4',
  65. })
  66. },
  67. onTabItemTap(e)
  68. {
  69. console.log(e)
  70. uni.removeStorageSync('type')
  71. },
  72. onReachBottom(){
  73. console.log('触底')
  74. this.getReachBottom()
  75. },
  76. onPullDownRefresh()
  77. {
  78. console.log('下拉刷新')
  79. this.getReachBottom()
  80. },
  81. methods: {
  82. getReachBottom()
  83. {
  84. if (this.ReachBottom) {
  85. this.page+=1
  86. this.getProjectList()
  87. }else
  88. {
  89. this.page=1
  90. this.ReachBottom=false
  91. }
  92. },
  93. getWorker()
  94. {
  95. service.getWorker().then(res => {
  96. this.workList=res
  97. })
  98. },
  99. worker(e)
  100. {
  101. this.userName=e[0].label
  102. this.userId=e[0].value
  103. this.getProjectList()
  104. },
  105. cancelWorker()
  106. {
  107. this.userName=''
  108. this.userId=''
  109. },
  110. time(e)
  111. {
  112. this.form.time=e
  113. },
  114. gotoindex(item) {
  115. console.log(item)
  116. uni.navigateTo({
  117. url:`/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?number=${item.number}&name=${item.name}&managementOffice=${item.managementOffice}&id=${item.id}&type=2`
  118. })
  119. },
  120. topage(url) {
  121. uni.navigateTo({
  122. url
  123. })
  124. },
  125. getProjectList() {
  126. //this.list=[]
  127. service.getregulatorBoxList({inspector:this.userId,name:this.name,code:this.code,managementOffice:this.administrativeOffice,pageSize:10,pageNum:this.page}).then(res => {
  128. console.log('getregulatorBoxList', res)
  129. if (res.rows.length == 0) {
  130. this.$UTILS.showPrompt('暂无项目!')
  131. }
  132. this.total=res.total
  133. if(res.total>this.page*10)
  134. {
  135. this.ReachBottom=true
  136. }else
  137. {
  138. this.ReachBottom=false
  139. }
  140. this.list.push(...res.rows)
  141. })
  142. },
  143. getUserName() {
  144. service.getUserName().then(res => {
  145. this.userId=res.id
  146. this.civilPower = res.civilPower;
  147. this.getProjectList();
  148. })
  149. },
  150. },
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .background {
  155. z-index: -1;
  156. position: fixed;
  157. width: 100%;
  158. height: 100%;
  159. background-size: 100% 100%;
  160. }
  161. .project {
  162. border-radius: 72rpx;
  163. padding: 25rpx 0;
  164. text-align: center;
  165. margin: 170rpx 55rpx 0;
  166. }
  167. .project-content {
  168. width: 90%;
  169. margin: 40rpx auto;
  170. padding: 30rpx 20rpx;
  171. border-radius: 20rpx;
  172. background: #edf5ff;
  173. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  174. }
  175. .houseList_in{
  176. display: flex;
  177. justify-content:space-between;
  178. align-items:center;
  179. color: #cbcbcb;
  180. font-size: 38rpx;
  181. }
  182. .houseList_in span{
  183. font-size: 36rpx;
  184. color: #333;
  185. }
  186. .sousuo{
  187. display: flex;
  188. justify-content:space-between;
  189. align-items:center;
  190. }
  191. .position {
  192. position: absolute;
  193. bottom: 100rpx;
  194. right: 50rpx;
  195. .arrow {
  196. width: 152rpx;
  197. height: 152rpx;
  198. border-radius: 50%;
  199. padding: 25rpx;
  200. margin-left: 20rpx;
  201. }
  202. }
  203. </style>