selectStation.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view>
  3. <u-navbar title="选择站点" title-color="#101010"></u-navbar>
  4. <view class="top">
  5. <view class="search">
  6. <view class="searchBox">
  7. <u-search shape="square" placeholder="搜索站点" maxlength="12" v-model="testName" :show-action="false"
  8. :animation="true"></u-search>
  9. <u-button type="primary" size="mini" @click="testBtn">搜素</u-button>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="body2">
  14. <view class="item" v-if="isAll" @click="returnName( {id:''})">
  15. <view class="v">
  16. <view class="v1" style="font-weight: bold;" >
  17. 查询全部
  18. </view>
  19. </view>
  20. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  21. </view>
  22. <view class="item" v-for="(item,i) in list" :key="i"
  23. @click="returnName( item)">
  24. <view class="v">
  25. <view class="v1" >
  26. {{item.stationNo}}<span class="y">|</span>{{item.name}}
  27. </view>
  28. <view class="v2" v-if="item.stationAddress" >
  29. {{item.stationAddress}}
  30. </view>
  31. </view>
  32. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  33. </view>
  34. </view>
  35. <u-divider color="#B6BDC3" :isnone="list.length==0">已经到底了</u-divider>
  36. </view>
  37. </template>
  38. <script>
  39. import * as API from '@/apis/pagejs/pagesTask.js'
  40. export default {
  41. data() {
  42. return {
  43. list: [],
  44. testName: "",
  45. listForm: {
  46. pageIndex: 1,
  47. pageSize: 15,
  48. recordsTotal: 1,
  49. },
  50. queryName: "",
  51. type: 1,
  52. isAll: 0,
  53. };
  54. },
  55. onLoad(op) {
  56. if (op.isAll) {
  57. this.isAll = op.isAll
  58. }
  59. if (op.type) {
  60. this.type = op.type
  61. }
  62. this.getList()
  63. },
  64. onReachBottom() {
  65. if (this.list.length < this.listForm.recordsTotal) {
  66. this.myLoadmore();
  67. }
  68. },
  69. methods: {
  70. myLoadmore() {
  71. this.listForm.pageIndex += 1;
  72. this.getList()
  73. },
  74. getList(bl) {
  75. if (bl) {
  76. this.listForm.pageIndex = 1
  77. }
  78. uni.showLoading({
  79. title: "加载中",
  80. mask: true,
  81. })
  82. this.listForm.id = this.jphelp.getPersonInfo().id
  83. this.listForm.queryContent=this.queryName
  84. API.teamUserStationUpdateList(this.listForm).then((res) => {
  85. var list = this.list
  86. if (this.listForm.pageIndex == 1) {
  87. list = res.data.data;
  88. } else {
  89. list = [
  90. ...list,
  91. ...res.data.data
  92. ];
  93. }
  94. this.list =list
  95. this.listForm.recordsTotal=res.data.recordsTotal
  96. uni.hideLoading();
  97. }).catch(error => {
  98. uni.hideLoading();
  99. uni.showToast({
  100. title: error,
  101. icon: "none"
  102. })
  103. })
  104. },
  105. returnName( obj) {
  106. const eventChannel = this.getOpenerEventChannel();
  107. eventChannel.emit('acceptDataFromOpenerPage', {
  108. item: obj
  109. })
  110. uni.navigateBack()
  111. },
  112. testBtn() {
  113. this.queryName=this.testName
  114. this.listForm.queryContent=this.queryName
  115. this.getList(1)
  116. },
  117. getInfo() {
  118. }
  119. }
  120. }
  121. </script>
  122. <style>
  123. page {
  124. background-color: rgba(242, 244, 246, 1);
  125. }
  126. </style>
  127. <style lang="scss" scoped>
  128. ::v-deep .u-content {
  129. width: 380% !important;
  130. }
  131. .search {
  132. padding: 16rpx 32rpx;
  133. background: #fff;
  134. .searchBox {
  135. display: flex;
  136. align-items: center;
  137. background: #F2F2F2;
  138. padding: 2rpx 16rpx;
  139. border-radius: 16rpx;
  140. justify-content: space-between;
  141. }
  142. }
  143. .body2 {
  144. padding-top: 20rpx;
  145. .item:not(:last-child) {
  146. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  147. }
  148. .item {
  149. padding: 24rpx 32rpx;
  150. background: #fff;
  151. display: flex;
  152. justify-content: space-between;
  153. .vquery {
  154. display: flex;
  155. align-items: center;
  156. }
  157. .buildMode {
  158. font-size: 24rpx;
  159. border: 2rpx solid #bbbbbb;
  160. border-radius: 8rpx;
  161. color: #1677ff;
  162. padding: 2rpx 8rpx;
  163. margin: 0 8rpx;
  164. }
  165. .buildMode1 {
  166. color: #1677ff;
  167. border: 2rpx solid #1677ff;
  168. }
  169. .buildMode2 {
  170. color: #4CAF50;
  171. border: 2rpx solid #4CAF50;
  172. }
  173. .qName {
  174. color: #FF5100
  175. }
  176. .v1 {
  177. color: rgba(16, 16, 16, 1);
  178. font-size: 32rpx;
  179. }
  180. .y{
  181. margin: 0 8rpx;
  182. color:rgba(119, 119, 119, 1);
  183. }
  184. .v2 {
  185. color: rgba(119, 119, 119, 1);
  186. font-size: 24rpx;
  187. }
  188. }
  189. }
  190. </style>