WarningPileList.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view>
  3. <image src="/static/icon/background.png" mode="" class="background"></image>
  4. <view class="" style="padding-top: 90rpx;">
  5. <back></back>
  6. </view>
  7. <view style="padding-top: 60rpx;">
  8. <view style="margin: 20rpx;">
  9. <u-input disabled placeholder="请选择巡检人员" @click="showName=true" v-model="userName"></u-input>
  10. <u-select v-model="showName" :list="workList" label-name="name" value-name="id" @confirm="worker()" @cancel="cancelWorker()"></u-select>
  11. <u-search placeholder="请输入巡检柱名称" v-model="name" :action-style="{'font-size':'40rpx'}"
  12. @custom="getProjectList()"></u-search>
  13. </view>
  14. <view v-for="(item,index) in list" :key="index">
  15. <view class="project-content" @click="gotoindex(item)">
  16. <view>
  17. <view class="font-forty-eight blue">
  18. {{item.name}}<u-icon name="arrow-right"></u-icon>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import service from '@/api/index.js'
  29. export default {
  30. data() {
  31. return {
  32. params: {
  33. year: true,
  34. month: true,
  35. day: true,
  36. hour: true,
  37. minute: false,
  38. second: false
  39. },
  40. showName:false,
  41. showTime: false,
  42. list: [],
  43. workList: [],
  44. value: '',
  45. nameValue: '',
  46. name:'',
  47. userName:'',
  48. civilPower: '',
  49. form:{},
  50. userId:''
  51. }
  52. },
  53. onLoad() {
  54. this.getProjectList();
  55. this.getUserName();
  56. this.getWorker()
  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. border: 4rpx solid #3857F3;
  123. margin: 40rpx 55rpx 0;
  124. padding: 30rpx 20rpx;
  125. border-radius: 48rpx;
  126. }
  127. .position {
  128. position: absolute;
  129. bottom: 100rpx;
  130. right: 50rpx;
  131. .arrow {
  132. width: 152rpx;
  133. height: 152rpx;
  134. border-radius: 50%;
  135. padding: 25rpx;
  136. margin-left: 20rpx;
  137. }
  138. }
  139. </style>