EquipmentArchives.vue 4.3 KB

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