WarningPileList.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view>
  3. <image src="/static/icon/background-from.png" mode="" class="background"></image>
  4. <view>
  5. <view class="sousuo">
  6. <u-input disabled placeholder="请选择巡检人员" @click="showName=true" v-model="userName"></u-input>
  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" :action-style="{'font-size':'40rpx'}"
  9. @custom="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. },
  70. cancelWorker()
  71. {
  72. this.userName=''
  73. this.userId=''
  74. },
  75. time(e)
  76. {
  77. this.form.time=e
  78. },
  79. gotoindex(item) {
  80. console.log(item)
  81. uni.navigateTo({
  82. url:`/pages/noLogin/WarningPileForm/WarningPileForm?value=${item.id}`
  83. })
  84. },
  85. topage(url) {
  86. uni.navigateTo({
  87. url
  88. })
  89. },
  90. getProjectList() {
  91. service.getwarningPileList({name:this.name,userId:this.userId}).then(res => {
  92. console.log('getwarningPileList', res)
  93. if (res.length == 0) {
  94. this.$UTILS.showPrompt('暂无项目!')
  95. }
  96. this.list = res;
  97. })
  98. },
  99. getUserName() {
  100. service.getUserName().then(res => {
  101. this.civilPower = res.civilPower;
  102. })
  103. },
  104. },
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .background {
  109. z-index: -1;
  110. position: fixed;
  111. width: 100%;
  112. height: 100%;
  113. background-size: 100% 100%;
  114. }
  115. .project {
  116. border-radius: 72rpx;
  117. padding: 25rpx 0;
  118. text-align: center;
  119. margin: 170rpx 55rpx 0;
  120. }
  121. .project-content {
  122. width: 90%;
  123. margin: 40rpx auto;
  124. padding: 30rpx 20rpx;
  125. border-radius: 20rpx;
  126. background: #edf5ff;
  127. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  128. }
  129. .houseList_in{
  130. display: flex;
  131. justify-content:space-between;
  132. align-items:center;
  133. color: #cbcbcb;
  134. font-size: 38rpx;
  135. }
  136. .houseList_in span{
  137. font-size: 36rpx;
  138. color: #333;
  139. }
  140. .sousuo{
  141. display: flex;
  142. justify-content:space-between;
  143. align-items:center;
  144. }
  145. .position {
  146. position: absolute;
  147. bottom: 100rpx;
  148. right: 50rpx;
  149. .arrow {
  150. width: 152rpx;
  151. height: 152rpx;
  152. border-radius: 50%;
  153. padding: 25rpx;
  154. margin-left: 20rpx;
  155. }
  156. }
  157. </style>