stationMy.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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"
  8. :show-action="false" :animation="true"></u-search>
  9. <u-button type="primary" size="mini" @click="testBtn">搜素</u-button>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="list">
  14. <view class="item" v-for="(item,index) in list" :key="index">
  15. <view class="v1">
  16. {{item.stationNo}}<span class="y">|</span>{{item.name}}
  17. </view>
  18. <view class="v2">
  19. <view class="v21" :class="{
  20. v3:item.inspectionCycle
  21. }">
  22. 巡检周期:{{item.inspectionCycle?''+item.inspectionCycle+'天':'未设置'}}
  23. </view>
  24. <view class="v22" :class="{
  25. v3:item.inspectionExamine
  26. }">
  27. 异常解决时限:{{item.inspectionExamine?''+item.inspectionErrorLimitDuration+'小时':'未设置'}}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  33. <view class="floating-button">
  34. <view class="button " @click="gotoTask">
  35. 关联场站
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import * as API from '@/apis/pagejs/pagesTeam.js'
  42. export default {
  43. data() {
  44. return {
  45. list: [],
  46. listForm: {
  47. pageIndex: 1,
  48. pageSize: 20,
  49. recordsTotal: 1,
  50. status: 0,
  51. roleName: "XJ,XJADMIN",
  52. roleName: "XJ",
  53. },
  54. id: "",
  55. testName: "",
  56. queryName: "",
  57. };
  58. },
  59. onLoad(op) {
  60. this.id = op.id
  61. this.getList()
  62. },
  63. onShow() {
  64. },
  65. onReachBottom() {
  66. if (this.list.length < this.listForm.recordsTotal) {
  67. this.myLoadmore();
  68. }
  69. },
  70. methods: {
  71. gotoTask() {
  72. uni.navigateTo({
  73. url: '/pages/team/stationAdd?id=' + this.id,
  74. events: {
  75. // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
  76. acceptDataFromOpenerPage: (data) => {
  77. console.log(data)
  78. this.getList(1)
  79. },
  80. }
  81. })
  82. },
  83. myLoadmore() {
  84. this.listForm.pageIndex += 1;
  85. this.getList()
  86. },
  87. showqueryName(item) {
  88. if (this.queryName) {
  89. var name = item.name
  90. return name.indexOf(this.queryName) != -1
  91. } else {
  92. return true
  93. }
  94. },
  95. testBtn() {
  96. this.queryName = this.testName
  97. this.getList(1)
  98. },
  99. getList(bl) {
  100. if (bl) {
  101. this.listForm.pageIndex = 1
  102. }
  103. uni.showLoading({
  104. title: "加载中",
  105. mask: true,
  106. })
  107. this.listForm.id = this.id
  108. this.listForm.queryContent = this.queryName
  109. API.teamUserStation(this.listForm).then((res) => {
  110. var list = this.list
  111. if (this.listForm.pageIndex == 1) {
  112. list = res.data.data;
  113. } else {
  114. list = [
  115. ...list,
  116. ...res.data.data
  117. ];
  118. }
  119. this.list = list
  120. this.listForm.recordsTotal = res.data.recordsTotal
  121. uni.hideLoading();
  122. }).catch(error => {
  123. uni.hideLoading();
  124. uni.showToast({
  125. title: error,
  126. icon: "none"
  127. })
  128. })
  129. },
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .list {
  135. padding-top: 20rpx;
  136. padding-bottom: 120rpx;
  137. .item:not(:last-child) {
  138. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  139. }
  140. .item {
  141. padding: 24rpx 32rpx;
  142. background: #fff;
  143. .vquery {
  144. display: flex;
  145. align-items: center;
  146. }
  147. .buildMode {
  148. font-size: 24rpx;
  149. border: 2rpx solid #bbbbbb;
  150. border-radius: 8rpx;
  151. color: #1677ff;
  152. padding: 2rpx 8rpx;
  153. margin: 0 8rpx;
  154. }
  155. .buildMode1 {
  156. color: #1677ff;
  157. border: 2rpx solid #1677ff;
  158. }
  159. .buildMode2 {
  160. color: #4CAF50;
  161. border: 2rpx solid #4CAF50;
  162. }
  163. .qName {
  164. color: #FF5100
  165. }
  166. .v1 {
  167. color: rgba(16, 16, 16, 1);
  168. font-size: 32rpx;
  169. }
  170. .y {
  171. margin: 0 8rpx;
  172. color: rgba(119, 119, 119, 1);
  173. }
  174. .v2 {
  175. color: red;
  176. font-size: 24rpx;
  177. white-space: pre;
  178. display: flex;
  179. flex-direction: row;
  180. justify-content: space-between;
  181. align-items: center;
  182. }
  183. .v3 {
  184. color: rgba(119, 119, 119, 1);
  185. font-size: 24rpx;
  186. }
  187. }
  188. }
  189. .top {
  190. border-bottom: 2rpx solid #e8e8e8;
  191. }
  192. .search {
  193. padding: 16rpx 32rpx;
  194. background: #fff;
  195. .searchBox {
  196. display: flex;
  197. align-items: center;
  198. background: #F2F2F2;
  199. padding: 2rpx 16rpx;
  200. border-radius: 16rpx;
  201. justify-content: space-between;
  202. }
  203. }
  204. .floating-button {
  205. z-index: 999;
  206. position: fixed;
  207. bottom: 0;
  208. width: 100%;
  209. display: flex;
  210. height: 120rpx;
  211. justify-content: space-around;
  212. background-color: rgba(255, 255, 255, 1);
  213. .button {
  214. margin-top: 24rpx;
  215. border-radius: 50px;
  216. height: 80rpx;
  217. width: 80%;
  218. display: flex;
  219. align-items: center;
  220. justify-content: center;
  221. padding: 12rpx;
  222. background-color: rgba(22, 119, 255, 1);
  223. color: rgba(255, 255, 255, 1);
  224. font-size: 32rpx;
  225. }
  226. }
  227. </style>