regulatorBoxList.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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()" 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. 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() {
  134. //this.list=[]
  135. service.getregulatorBoxList({inspector:this.userId,name:this.name,code:this.code,managementOffice:this.administrativeOffice,pageSize:10,pageNum:this.page}).then(res => {
  136. console.log('getregulatorBoxList', res)
  137. if (res.rows.length == 0) {
  138. this.$UTILS.showPrompt('暂无项目!')
  139. }
  140. this.total=res.total
  141. if(res.total>this.page*10)
  142. {
  143. this.ReachBottom=true
  144. }else
  145. {
  146. this.ReachBottom=false
  147. }
  148. this.list.push(...res.rows)
  149. })
  150. },
  151. getUserName() {
  152. service.getUserName().then(res => {
  153. this.userId=res.id
  154. this.civilPower = res.civilPower;
  155. this.getProjectList();
  156. })
  157. },
  158. },
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. .background {
  163. z-index: -1;
  164. position: fixed;
  165. width: 100%;
  166. height: 100%;
  167. background-size: 100% 100%;
  168. }
  169. .project {
  170. border-radius: 72rpx;
  171. padding: 25rpx 0;
  172. text-align: center;
  173. margin: 170rpx 55rpx 0;
  174. }
  175. .project-content {
  176. width: 90%;
  177. margin: 40rpx auto;
  178. padding: 30rpx 20rpx;
  179. border-radius: 20rpx;
  180. background: #edf5ff;
  181. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  182. }
  183. .houseList_in{
  184. display: flex;
  185. justify-content:space-between;
  186. align-items:center;
  187. color: #cbcbcb;
  188. font-size: 38rpx;
  189. }
  190. .houseList_in span{
  191. font-size: 36rpx;
  192. color: #333;
  193. }
  194. .sousuo{
  195. display: flex;
  196. justify-content:space-between;
  197. align-items:center;
  198. }
  199. .position {
  200. position: absolute;
  201. bottom: 100rpx;
  202. right: 50rpx;
  203. .arrow {
  204. width: 152rpx;
  205. height: 152rpx;
  206. border-radius: 50%;
  207. padding: 25rpx;
  208. margin-left: 20rpx;
  209. }
  210. }
  211. </style>