EquipmentArchives.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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.maintenanceSecond?item.maintenanceSecond: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.listData = []
  71. this.corpequipmentarchivesListfun()
  72. },
  73. onReachBottom() {
  74. this.status = 'loading'
  75. if (this.page.current * this.page.size < this.total) {
  76. this.page.current++
  77. this.corpequipmentarchivesListfun()
  78. } else {
  79. this.status = 'nomore'
  80. }
  81. },
  82. methods: {
  83. // 跳转详情页面
  84. Jumpfun(id){
  85. if (id) {
  86. uni.$u.route('/pages/device/FileDetails/FileDetails?id=' + id);
  87. }else {
  88. uni.$u.route('/pages/device/FileDetails/FileDetails');
  89. }
  90. },
  91. // 搜索
  92. searchfun(value) {
  93. this.listData = []
  94. this.page.current = 1
  95. this.page.size = 10
  96. this.page.retrieval = value
  97. this.corpequipmentarchivesListfun()
  98. },
  99. // 搜索清空
  100. clearfun(){
  101. this.listData = []
  102. this.page.current = 1
  103. this.page.size = 10
  104. this.page.retrieval = ''
  105. this.corpequipmentarchivesListfun()
  106. },
  107. // 获取设备档案列表
  108. corpequipmentarchivesListfun(){
  109. this.loading = true
  110. corpequipmentarchivesList(this.page).then(res=>{
  111. let list = res.data.records
  112. this.listData = [...this.listData,...list]
  113. this.total = res.data.total
  114. this.loading = false
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .searchforBox {
  122. width: 100%;
  123. background: #fff;
  124. padding: 20rpx 30rpx;
  125. box-sizing: border-box;
  126. .addbox {
  127. margin-left: 20rpx;
  128. border: 2rpx solid #dd451b;
  129. border-radius: 12rpx;
  130. color: #fff;
  131. padding: 5rpx 10rpx;
  132. font-size: 28rpx;
  133. background: #dd451b;
  134. }
  135. }
  136. .screenflex {
  137. display: flex;
  138. align-items: center;
  139. justify-content: space-between;
  140. margin-top: 20rpx;
  141. font-size: 30rpx;
  142. }
  143. .listbox {
  144. padding: 20rpx 16rpx;
  145. box-sizing: border-box;
  146. .cardBox {
  147. background: #fff;
  148. border-radius: 12rpx;
  149. width: 100%;
  150. padding: 30rpx;
  151. padding-bottom: 0;
  152. box-sizing: border-box;
  153. margin-bottom: 30rpx;
  154. .listbox_title {
  155. display: flex;
  156. align-items: center;
  157. justify-content: space-between;
  158. margin-bottom: 20rpx;
  159. .listbox_titleLeft {
  160. display: flex;
  161. align-content: center;
  162. font-size: 30rpx;
  163. // color: #215476;
  164. font-weight: 500;
  165. }
  166. .listbox_titleRight {
  167. font-size: 30rpx;
  168. // color: #215476;
  169. }
  170. }
  171. .countBox {
  172. margin-top: 20rpx;
  173. border-top: 2rpx solid #F6F6F6;
  174. padding: 20rpx 0;
  175. display: flex;
  176. align-items: center;
  177. text-align: center;
  178. font-size: 30rpx;
  179. .countBox_Left {
  180. flex: 1;
  181. border-right: 2rpx solid #F6F6F6;
  182. }
  183. .countBox_Right {
  184. flex: 1;
  185. }
  186. }
  187. }
  188. }
  189. .title {
  190. // font-size: 34rpx;
  191. font-size: 32rpx;
  192. // color: #215476;
  193. // font-weight: bold;
  194. }
  195. </style>