regulatorBoxList.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view>
  3. <image src="/static/icon/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>调压箱编号:{{item.code}}</span>
  19. <span>管理所:{{item.administrativeOffice}}</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. }
  55. },
  56. onLoad() {
  57. this.getProjectList();
  58. this.getUserName();
  59. this.getWorker();
  60. uni.setNavigationBarColor({
  61. frontColor: '#ffffff',
  62. backgroundColor: '#2d95f4',
  63. })
  64. },
  65. methods: {
  66. getWorker()
  67. {
  68. service.getWorker().then(res => {
  69. this.workList=res
  70. })
  71. },
  72. worker(e)
  73. {
  74. this.userName=e[0].label
  75. this.userId=e[0].value
  76. this.getProjectList()
  77. },
  78. cancelWorker()
  79. {
  80. this.userName=''
  81. this.userId=''
  82. },
  83. time(e)
  84. {
  85. this.form.time=e
  86. },
  87. gotoindex(item) {
  88. console.log(item)
  89. uni.navigateTo({
  90. url:`/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?code=${item.code}&name=${item.name}&administrativeOffice=${item.administrativeOffice}`
  91. })
  92. },
  93. topage(url) {
  94. uni.navigateTo({
  95. url
  96. })
  97. },
  98. getProjectList() {
  99. this.list=[]
  100. service.getregulatorBoxList({name:this.name,code:this.code,administrativeOffice:this.administrativeOffice}).then(res => {
  101. console.log('getregulatorBoxList', res)
  102. if (res.length == 0) {
  103. this.$UTILS.showPrompt('暂无项目!')
  104. }
  105. this.list = res
  106. })
  107. },
  108. getUserName() {
  109. service.getUserName().then(res => {
  110. this.civilPower = res.civilPower;
  111. })
  112. },
  113. },
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .background {
  118. z-index: -1;
  119. position: fixed;
  120. width: 100%;
  121. height: 100%;
  122. background-size: 100% 100%;
  123. }
  124. .project {
  125. border-radius: 72rpx;
  126. padding: 25rpx 0;
  127. text-align: center;
  128. margin: 170rpx 55rpx 0;
  129. }
  130. .project-content {
  131. width: 90%;
  132. margin: 40rpx auto;
  133. padding: 30rpx 20rpx;
  134. border-radius: 20rpx;
  135. background: #edf5ff;
  136. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  137. }
  138. .houseList_in{
  139. display: flex;
  140. justify-content:space-between;
  141. align-items:center;
  142. color: #cbcbcb;
  143. font-size: 38rpx;
  144. }
  145. .houseList_in span{
  146. font-size: 36rpx;
  147. color: #333;
  148. }
  149. .sousuo{
  150. display: flex;
  151. justify-content:space-between;
  152. align-items:center;
  153. }
  154. .position {
  155. position: absolute;
  156. bottom: 100rpx;
  157. right: 50rpx;
  158. .arrow {
  159. width: 152rpx;
  160. height: 152rpx;
  161. border-radius: 50%;
  162. padding: 25rpx;
  163. margin-left: 20rpx;
  164. }
  165. }
  166. </style>