equipmentControlOverdue.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <!-- 数据看板-设备管控-超期服役排行 -->
  2. <template>
  3. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  4. <view class="equipmentControl">
  5. <!-- 超期服役排行 -->
  6. <view class="table" v-if="pageType==1">
  7. <view class="table-border">
  8. <view class="table-th">
  9. <view class="table-th-li">
  10. <view>排行</view>
  11. <view>学院单位</view>
  12. <view>设备总数(台)</view>
  13. <view>超期服役数(台)</view>
  14. </view>
  15. </view>
  16. <view class="table-tb">
  17. <view class="table-tb-li" v-for="(item,index) in dataList" :key="index">
  18. <view>
  19. <text
  20. :class="index==0?'sortOne':(index==1?'sortTow':(index==2?'sortThree':'sortFive'))">{{index+1}}</text>
  21. </view>
  22. <view>{{item.deptName}}</view>
  23. <view>{{item.deviceNum}}</view>
  24. <view>{{item.extendedService}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 设备使用寿命 -->
  30. <view class="table-tow" v-if="pageType==2">
  31. <view class="table-border">
  32. <view class="table-th">
  33. <view class="table-th-li">
  34. <view>学院单位</view>
  35. <view>5年内(台)</view>
  36. <view>10年内(台)</view>
  37. <view>12年内(台)</view>
  38. <view>20年内(台)</view>
  39. </view>
  40. </view>
  41. <view class="table-tb">
  42. <view class="table-tb-li" v-for="(item,index) in dataList" :key="index">
  43. <view>{{item.deptName}}</view>
  44. <view>{{item.fiveYears}}</view>
  45. <view>{{item.tenYears}}</view>
  46. <view>{{item.twelveYears}}</view>
  47. <view>{{item.twentyYears}}</view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  53. </view>
  54. </scroll-view>
  55. </template>
  56. <script>
  57. import {
  58. config
  59. } from '@/api/request/config.js'
  60. import {
  61. reportAppletReportApiEquipOverdueGetLifePageList,
  62. reportAppletReportApiEquipLifeGetReportBsEquipLifeList
  63. } from '@/pages/api/index.js'
  64. export default {
  65. name: "equipmentControl",
  66. components: {
  67. },
  68. data() {
  69. return {
  70. pageType: 1,
  71. // 查询参数
  72. queryParams: {
  73. page: 1,
  74. pageSize: 10,
  75. },
  76. dataList: [],
  77. total: 0,
  78. getDataType:false,
  79. }
  80. },
  81. onLoad(option) {
  82. if (option.pageType) {
  83. this.pageType = option.pageType;
  84. if (this.pageType == 1) {
  85. uni.setNavigationBarTitle({
  86. title: '超期服役排行'
  87. })
  88. } else if (this.pageType == 2) {
  89. uni.setNavigationBarTitle({
  90. title: '设备使用寿命统计'
  91. })
  92. }
  93. }
  94. },
  95. created() {
  96. },
  97. beforeMount() {
  98. },
  99. mounted() {
  100. if (this.pageType == 1) {
  101. this.getList();
  102. } else if (this.pageType == 2) {
  103. this.getListTow();
  104. }
  105. },
  106. methods: {
  107. //滚动事件
  108. scrollGet() {
  109. let self = this;
  110. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  111. this.$set(this, 'getDataType', true);
  112. } else {
  113. this.queryParams.page += 1;
  114. this.$nextTick(() => {
  115. if (this.pageType == 1) {
  116. this.getList();
  117. } else if (this.pageType == 2) {
  118. this.getListTow();
  119. }
  120. })
  121. }
  122. },
  123. async getList() {
  124. let self = this;
  125. const {
  126. data
  127. } = await reportAppletReportApiEquipOverdueGetLifePageList(this.queryParams);
  128. if (data.code == 200) {
  129. if (self.queryParams.page == 1) {
  130. this.dataList = data.data.records;
  131. this.total = data.data.total;
  132. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  133. this.$set(this, 'getDataType', true);
  134. }
  135. } else {
  136. this.dataList = [...this.dataList, ...data.data.records]
  137. this.total = data.data.total;
  138. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  139. this.$set(this, 'getDataType', true);
  140. }
  141. }
  142. }
  143. },
  144. async getListTow() {
  145. let self = this;
  146. const {
  147. data
  148. } = await reportAppletReportApiEquipLifeGetReportBsEquipLifeList(this.queryParams);
  149. if (data.code == 200) {
  150. if (self.queryParams.page == 1) {
  151. this.dataList = data.data.records;
  152. this.total = data.data.total;
  153. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  154. this.$set(this, 'getDataType', true);
  155. }
  156. } else {
  157. this.dataList = [...this.dataList, ...data.data.records]
  158. this.total = data.data.total;
  159. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  160. this.$set(this, 'getDataType', true);
  161. }
  162. }
  163. }
  164. },
  165. dateClick(index) {
  166. this.dateIndex = index;
  167. },
  168. },
  169. }
  170. </script>
  171. <style lang="stylus" scoped>
  172. .info-max-box{
  173. height: 100%;
  174. width: 100%;
  175. }
  176. .equipmentControl {
  177. height: 100%;
  178. width: 100%;
  179. background: #363744;
  180. box-sizing: border-box;
  181. .table {
  182. width: 750rpx;
  183. .table-border {
  184. overflow: auto;
  185. .table-th {
  186. width: 750rpx;
  187. height: 80rpx;
  188. background: rgba(162, 162, 162, 0.2);
  189. padding: 0 30rpx;
  190. box-sizing: border-box;
  191. .table-th-li {
  192. height: 80rpx;
  193. display: flex;
  194. justify-content: flex-start;
  195. >view {
  196. font-weight: 400;
  197. font-size: 30rpx;
  198. color: #FFFFFF;
  199. line-height: 80rpx;
  200. text-align: center;
  201. margin-right: 18rpx;
  202. width: 120rpx;
  203. overflow: hidden;
  204. text-overflow: ellipsis;
  205. white-space: nowrap;
  206. }
  207. >view:nth-of-type(1) {
  208. width: 90rpx;
  209. text-align: left;
  210. }
  211. >view:nth-of-type(2) {
  212. width: 168rpx;
  213. }
  214. >view:nth-of-type(3) {
  215. width: 190rpx;
  216. }
  217. >view:nth-of-type(4) {
  218. width: 300rpx;
  219. }
  220. }
  221. }
  222. .table-tb {
  223. width: 750rpx;
  224. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  225. background: #3E414F;
  226. padding: 0 30rpx;
  227. box-sizing: border-box;
  228. .table-tb-li {
  229. height: 80rpx;
  230. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  231. display: flex;
  232. justify-content: flex-start;
  233. >view {
  234. font-weight: 400;
  235. font-size: 28rpx;
  236. color: #FFFFFF;
  237. line-height: 80rpx;
  238. text-align: center;
  239. margin-right: 38rpx;
  240. width: 120rpx;
  241. overflow: hidden;
  242. text-overflow: ellipsis;
  243. white-space: nowrap;
  244. }
  245. >view:nth-of-type(1) {
  246. width: 90rpx;
  247. text-align: left;
  248. }
  249. >view:nth-of-type(2) {
  250. width: 168rpx;
  251. }
  252. >view:nth-of-type(3) {
  253. width: 190rpx;
  254. }
  255. >view:nth-of-type(4) {
  256. width: 300rpx;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. .sortOne {
  263. display: inline-block;
  264. width: 40rpx;
  265. height: 40rpx;
  266. padding: 4rpx;
  267. box-sizing: border-box;
  268. background: rgba(255, 0, 0, 0.2);
  269. font-weight: 400;
  270. font-size: 28rpx;
  271. color: #FF0000;
  272. line-height: 40rpx;
  273. text-align: center;
  274. border-radius: 20rpx;
  275. }
  276. .sortTow {
  277. display: inline-block;
  278. width: 40rpx;
  279. height: 40rpx;
  280. padding: 4rpx;
  281. box-sizing: border-box;
  282. background: rgba(255, 153, 0, 0.2);
  283. font-weight: 400;
  284. font-size: 28rpx;
  285. color: #FF9900;
  286. line-height: 40rpx;
  287. text-align: center;
  288. border-radius: 20rpx;
  289. }
  290. .sortThree {
  291. display: inline-block;
  292. width: 40rpx;
  293. height: 40rpx;
  294. padding: 4rpx;
  295. box-sizing: border-box;
  296. background: rgba(255, 242, 0, 0.2);
  297. font-weight: 400;
  298. font-size: 28rpx;
  299. color: #FFF200;
  300. line-height: 40rpx;
  301. text-align: center;
  302. border-radius: 20rpx;
  303. }
  304. .sortFive {
  305. display: inline-block;
  306. width: 40rpx;
  307. height: 40rpx;
  308. padding: 4rpx;
  309. box-sizing: border-box;
  310. background: rgba(1, 131, 250, 0.2);
  311. font-weight: 400;
  312. font-size: 28rpx;
  313. color: #0183FA;
  314. line-height: 40rpx;
  315. text-align: center;
  316. border-radius: 20rpx;
  317. }
  318. .table-tow {
  319. width: 750rpx;
  320. .table-border {
  321. overflow: auto;
  322. .table-th {
  323. width: 860rpx;
  324. height: 80rpx;
  325. background: rgba(162, 162, 162, 0.2);
  326. padding: 0 30rpx;
  327. box-sizing: border-box;
  328. .table-th-li {
  329. height: 80rpx;
  330. display: flex;
  331. justify-content: flex-start;
  332. >view {
  333. font-weight: 400;
  334. font-size: 30rpx;
  335. color: #FFFFFF;
  336. line-height: 80rpx;
  337. text-align: center;
  338. margin-right: 18rpx;
  339. width: 140rpx;
  340. overflow: hidden;
  341. text-overflow: ellipsis;
  342. white-space: nowrap;
  343. }
  344. >view:nth-of-type(1) {
  345. width: 168rpx;
  346. text-align: left;
  347. }
  348. }
  349. }
  350. .table-tb {
  351. width: 860rpx;
  352. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  353. background: #3E414F;
  354. padding: 0 30rpx;
  355. box-sizing: border-box;
  356. .table-tb-li {
  357. height: 80rpx;
  358. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  359. display: flex;
  360. justify-content: flex-start;
  361. >view {
  362. font-weight: 400;
  363. font-size: 28rpx;
  364. color: #FFFFFF;
  365. line-height: 80rpx;
  366. text-align: center;
  367. margin-right: 38rpx;
  368. width: 140rpx;
  369. overflow: hidden;
  370. text-overflow: ellipsis;
  371. white-space: nowrap;
  372. }
  373. >view:nth-of-type(1) {
  374. width: 168rpx;
  375. text-align: left;
  376. }
  377. }
  378. }
  379. }
  380. }
  381. }
  382. .get-data-null-p {
  383. text-align: center;
  384. height: 100rpx;
  385. line-height: 100rpx;
  386. color: #999;
  387. padding-bottom:200rpx;
  388. }
  389. </style>