gradingControl.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="gradingControl">
  3. <scroll-view scroll-y @scrolltolower="scrollGet" class="for-max-box">
  4. <img class="null-img" v-if="!dataList[0]" src="@/pages_manage/images/null-data-1.png">
  5. <view class="for-box" v-for="(item,index) in dataList" :key="index" @click="tableButton(item)">
  6. <view class="for-box-left">
  7. <view class="for-name-box">
  8. <view>{{item.name}}</view>
  9. <view :class="item.status == 1?'colorA':'colorB'">{{item.status == 1?'已执行':'未执行'}}</view>
  10. </view>
  11. <view class="for-dept-box">{{item.deptName}}</view>
  12. <view class="for-type-box">
  13. <view>{{item.typeName}}</view>
  14. <view>{{item.levelName}}</view>
  15. </view>
  16. </view>
  17. <view class="for-box-right">
  18. <img src="@/pages_manage/images/icon_04.png">
  19. </view>
  20. </view>
  21. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  22. </scroll-view>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. laboratoryGradeManageList,
  28. } from '@/pages_manage/api/index.js'
  29. export default {
  30. name: "gradingControl",
  31. data() {
  32. return {
  33. // 查询参数
  34. queryParams: {
  35. page: 1,
  36. pageSize: 10,
  37. name: "",
  38. deptId: null,
  39. typeId: null,
  40. levelId: null,
  41. },
  42. getDataType: false,
  43. //列表数据
  44. dataList: [],
  45. }
  46. },
  47. onLoad(option) {
  48. },
  49. onShow() {
  50. this.getList();
  51. },
  52. methods: {
  53. //滚动加载事件
  54. scrollGet() {
  55. let self = this;
  56. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  57. this.$set(this, 'getDataType', true);
  58. } else {
  59. this.queryParams.page += 1;
  60. this.$nextTick(() => {
  61. this.getList();
  62. })
  63. }
  64. },
  65. //获取分级管控列表
  66. async getList() {
  67. let self = this;
  68. let obj = JSON.parse(JSON.stringify(this.queryParams));
  69. obj.executionUserId = uni.getStorageSync('userId')
  70. const {
  71. data
  72. } = await laboratoryGradeManageList(obj);
  73. if (data.code == 200) {
  74. if (self.queryParams.page == 1) {
  75. this.dataList = data.data.records;
  76. this.total = data.data.total;
  77. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  78. this.$set(this, 'getDataType', true);
  79. }
  80. } else {
  81. this.dataList = [...this.dataList, ...data.data.records]
  82. this.total = data.data.total;
  83. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  84. this.$set(this, 'getDataType', true);
  85. }
  86. }
  87. }
  88. },
  89. tableButton(item) {
  90. uni.navigateTo({
  91. url: '/pages_manage/views/gradingControl/infoPage?infoData=' + encodeURIComponent(JSON.stringify(item))
  92. });
  93. },
  94. }
  95. }
  96. </script>
  97. <style lang="stylus" scoped>
  98. .gradingControl {
  99. height: 100%;
  100. display: flex;
  101. flex-direction: column;
  102. .for-max-box {
  103. flex: 1;
  104. overflow-y scroll;
  105. .null-img {
  106. display block;
  107. width: 276rpx;
  108. height: 321rpx;
  109. position absolute;
  110. top: 200rpx;
  111. left: 274rpx;
  112. }
  113. .for-box:nth-child(1) {
  114. border-top: none;
  115. }
  116. .for-box {
  117. display: flex;
  118. padding: 10px;
  119. border-top: 4rpx solid #dedede;
  120. overflow hidden;
  121. background #ffffff;
  122. view {
  123. overflow: hidden;
  124. text-overflow: ellipsis;
  125. white-space: nowrap;
  126. font-size: 32rpx;
  127. color: #333;
  128. line-height: 60rpx;
  129. }
  130. .for-box-left {
  131. flex: 1;
  132. .for-name-box {
  133. display: flex;
  134. view:nth-child(1) {
  135. flex: 1;
  136. font-size: 36rpx;
  137. }
  138. view:nth-child(2) {
  139. width: 100rpx;
  140. margin-left: 20rpx;
  141. }
  142. .colorA {
  143. color: #0183FA;
  144. }
  145. .colorB {
  146. color: #999;
  147. }
  148. }
  149. .for-dept-box {}
  150. .for-type-box {
  151. display: flex;
  152. view {
  153. flex: 1;
  154. }
  155. }
  156. }
  157. .for-box-right {
  158. img {
  159. margin-top: 80rpx;
  160. width: 12rpx;
  161. height: 24rpx;
  162. }
  163. }
  164. }
  165. .get-data-null-p {
  166. text-align: center;
  167. line-height: 80rpx;
  168. padding-bottom: 40px;
  169. color: #999;
  170. }
  171. }
  172. }
  173. </style>