regulatorBoxList.vue 4.6 KB

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