WarningPileList.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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 disabled placeholder="请选择巡检人员" @click="showName=true" v-model="userName" :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="name" :show-action="false" :action-style="{'font-size':'40rpx'}"
  9. @search="getProjectList()"></u-search>
  10. </view>
  11. <view v-for="(item,index) in list" :key="index">
  12. <view class="project-content houseList" @click="gotoindex(item)">
  13. <view class="font-forty-eight houseList_in">
  14. <span>{{item.name}}</span>
  15. <u-icon name="arrow-right"></u-icon>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import service from '@/api/index.js'
  25. export default {
  26. data() {
  27. return {
  28. params: {
  29. year: true,
  30. month: true,
  31. day: true,
  32. hour: true,
  33. minute: false,
  34. second: false
  35. },
  36. showName:false,
  37. showTime: false,
  38. list: [],
  39. workList: [],
  40. value: '',
  41. nameValue: '',
  42. name:'',
  43. userName:'',
  44. civilPower: '',
  45. form:{},
  46. userId:''
  47. }
  48. },
  49. onLoad() {
  50. this.getProjectList();
  51. this.getUserName();
  52. this.getWorker();
  53. uni.setNavigationBarColor({
  54. frontColor: '#ffffff',
  55. backgroundColor: '#2d95f4',
  56. })
  57. },
  58. methods: {
  59. getWorker()
  60. {
  61. service.getWorker().then(res => {
  62. this.workList=res
  63. })
  64. },
  65. worker(e)
  66. {
  67. this.userName=e[0].label
  68. this.userId=e[0].value
  69. this.getProjectList()
  70. },
  71. cancelWorker()
  72. {
  73. this.userName=''
  74. this.userId=''
  75. },
  76. time(e)
  77. {
  78. this.form.time=e
  79. },
  80. gotoindex(item) {
  81. console.log(item)
  82. uni.navigateTo({
  83. url:`/pages/noLogin/WarningPileForm/WarningPileForm?id=${item.id}`
  84. })
  85. },
  86. topage(url) {
  87. uni.navigateTo({
  88. url
  89. })
  90. },
  91. getProjectList() {
  92. this.list=[]
  93. service.getwarningPileList({name:this.name,userId:this.userId}).then(res => {
  94. console.log('getwarningPileList', res)
  95. if (res.length == 0) {
  96. this.$UTILS.showPrompt('暂无项目!')
  97. }
  98. this.list = res;
  99. })
  100. },
  101. getUserName() {
  102. service.getUserName().then(res => {
  103. this.civilPower = res.civilPower;
  104. })
  105. },
  106. },
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .background {
  111. z-index: -1;
  112. position: fixed;
  113. width: 100%;
  114. height: 100%;
  115. background-size: 100% 100%;
  116. }
  117. .project {
  118. border-radius: 72rpx;
  119. padding: 25rpx 0;
  120. text-align: center;
  121. margin: 170rpx 55rpx 0;
  122. }
  123. .project-content {
  124. width: 90%;
  125. margin: 40rpx auto;
  126. padding: 30rpx 20rpx;
  127. border-radius: 20rpx;
  128. background: #edf5ff;
  129. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  130. }
  131. .houseList_in{
  132. display: flex;
  133. justify-content:space-between;
  134. align-items:center;
  135. color: #cbcbcb;
  136. font-size: 38rpx;
  137. }
  138. .houseList_in span{
  139. font-size: 36rpx;
  140. color: #333;
  141. }
  142. .sousuo{
  143. display: flex;
  144. justify-content:space-between;
  145. align-items:center;
  146. }
  147. .position {
  148. position: absolute;
  149. bottom: 100rpx;
  150. right: 50rpx;
  151. .arrow {
  152. width: 152rpx;
  153. height: 152rpx;
  154. border-radius: 50%;
  155. padding: 25rpx;
  156. margin-left: 20rpx;
  157. }
  158. }
  159. </style>