EquipmentArchives.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view>
  3. <view class="searchforBox">
  4. <view style="display: flex;align-items: center;">
  5. <u-search :showAction="true" actionText="搜索" clearabled :animation="true" @search="searchfun" @clear="clearfun"></u-search>
  6. <view class="addbox" @click="Jumpfun()">添加档案</view>
  7. </view>
  8. <!-- <view class="screenflex">
  9. <view>数量排序</view>
  10. <view>维保次数</view>
  11. <view>客户名称</view>
  12. </view> -->
  13. </view>
  14. <view class="listbox">
  15. <view class="cardBox" v-for="item in listData" :key="item.id" @click="Jumpfun(item.id)">
  16. <view class="listbox_title">
  17. <view class="listbox_titleLeft">
  18. <!-- <u-icon name="bookmark-fill" color="#215476" size="22"></u-icon> -->
  19. <view style="width: 10rpx;height: 35rpx;background-color: #fd4b09; margin-right: 8rpx;"></view>
  20. <text>{{item.sysNo}}</text>
  21. </view>
  22. <!-- <view class="listbox_titleRight" @click="Jumpfun(item.id)">详情</view> -->
  23. </view>
  24. <!-- style="margin-left: 40rpx;" -->
  25. <view class="title">{{item.corpName}}</view>
  26. <view class="countBox">
  27. <view class="countBox_Left">
  28. <text>设备数量:{{item.equipmentNumber}}</text>
  29. </view>
  30. <view class="countBox_Right">
  31. <text>维修次数:{{item.maintenance_second?item.maintenance_second:0}}</text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <u-loadmore v-if="total !== 0" :status="status" />
  37. </view>
  38. </template>
  39. <script>
  40. import { corpequipmentarchivesList } from '@/api/device/index.js'
  41. export default {
  42. data() {
  43. return {
  44. // 页面配置
  45. page:{
  46. current: 1,
  47. size: 10,
  48. },
  49. // 列表数据
  50. listData:[],
  51. status: 'loadmore',
  52. total:0
  53. }
  54. },
  55. onLoad() {
  56. this.corpequipmentarchivesListfun()
  57. },
  58. onShow() {},
  59. onReachBottom() {
  60. this.status = 'loading'
  61. if (this.page.current * this.page.size < this.total) {
  62. this.page.current++
  63. this.corpequipmentarchivesListfun()
  64. } else {
  65. this.status = 'nomore'
  66. }
  67. },
  68. methods: {
  69. // 跳转详情页面
  70. Jumpfun(id){
  71. if (id) {
  72. uni.$u.route('/pages/device/FileDetails/FileDetails?id=' + id);
  73. }else {
  74. uni.$u.route('/pages/device/FileDetails/FileDetails');
  75. }
  76. },
  77. // 搜索
  78. searchfun(value) {
  79. this.page.corpName = value
  80. this.corpequipmentarchivesListfun()
  81. },
  82. // 搜索清空
  83. clearfun(){
  84. this.page.corpName = ''
  85. this.corpequipmentarchivesListfun()
  86. },
  87. // 获取设备档案列表
  88. corpequipmentarchivesListfun(){
  89. corpequipmentarchivesList(this.page).then(res=>{
  90. let list = res.data.records
  91. this.listData = [...this.listData,...list]
  92. this.total = res.data.total
  93. })
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .searchforBox {
  100. width: 100%;
  101. background: #fff;
  102. padding: 20rpx 30rpx;
  103. box-sizing: border-box;
  104. .addbox {
  105. margin-left: 20rpx;
  106. border: 2rpx solid #dd451b;
  107. border-radius: 12rpx;
  108. color: #fff;
  109. padding: 5rpx 10rpx;
  110. font-size: 28rpx;
  111. background: #dd451b;
  112. }
  113. }
  114. .screenflex {
  115. display: flex;
  116. align-items: center;
  117. justify-content: space-between;
  118. margin-top: 20rpx;
  119. font-size: 30rpx;
  120. }
  121. .listbox {
  122. padding: 20rpx 16rpx;
  123. box-sizing: border-box;
  124. .cardBox {
  125. background: #fff;
  126. border-radius: 12rpx;
  127. width: 100%;
  128. padding: 30rpx;
  129. padding-bottom: 0;
  130. box-sizing: border-box;
  131. margin-bottom: 30rpx;
  132. .listbox_title {
  133. display: flex;
  134. align-items: center;
  135. justify-content: space-between;
  136. margin-bottom: 20rpx;
  137. .listbox_titleLeft {
  138. display: flex;
  139. align-content: center;
  140. font-size: 30rpx;
  141. // color: #215476;
  142. font-weight: 500;
  143. }
  144. .listbox_titleRight {
  145. font-size: 30rpx;
  146. // color: #215476;
  147. }
  148. }
  149. .countBox {
  150. margin-top: 20rpx;
  151. border-top: 2rpx solid #F6F6F6;
  152. padding: 20rpx 0;
  153. display: flex;
  154. align-items: center;
  155. text-align: center;
  156. font-size: 30rpx;
  157. .countBox_Left {
  158. flex: 1;
  159. border-right: 2rpx solid #F6F6F6;
  160. }
  161. .countBox_Right {
  162. flex: 1;
  163. }
  164. }
  165. }
  166. }
  167. .title {
  168. // font-size: 34rpx;
  169. font-size: 32rpx;
  170. // color: #215476;
  171. // font-weight: bold;
  172. }
  173. </style>