EquipmentArchives.vue 4.8 KB

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