gradingControl.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. },
  51. mounted() {
  52. this.getList();
  53. },
  54. methods: {
  55. //滚动加载事件
  56. scrollGet() {
  57. let self = this;
  58. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  59. this.$set(this, 'getDataType', true);
  60. } else {
  61. this.queryParams.page += 1;
  62. this.$nextTick(() => {
  63. this.getList();
  64. })
  65. }
  66. },
  67. //获取分级管控列表
  68. async getList() {
  69. let self = this;
  70. let obj = JSON.parse(JSON.stringify(this.queryParams));
  71. obj.executionUserId = uni.getStorageSync('userId')
  72. const {
  73. data
  74. } = await laboratoryGradeManageList(obj);
  75. if (data.code == 200) {
  76. if (self.queryParams.page == 1) {
  77. this.dataList = data.data.records;
  78. this.total = data.data.total;
  79. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  80. this.$set(this, 'getDataType', true);
  81. }
  82. } else {
  83. this.dataList = [...this.dataList, ...data.data.records]
  84. this.total = data.data.total;
  85. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  86. this.$set(this, 'getDataType', true);
  87. }
  88. }
  89. }
  90. },
  91. tableButton(item) {
  92. uni.navigateTo({
  93. url: '/pages_manage/views/gradingControl/infoPage?infoData=' + encodeURIComponent(JSON.stringify(item))
  94. });
  95. },
  96. }
  97. }
  98. </script>
  99. <style lang="stylus" scoped>
  100. .gradingControl {
  101. height: 100%;
  102. display: flex;
  103. flex-direction: column;
  104. .for-max-box {
  105. flex: 1;
  106. overflow-y scroll;
  107. .null-img {
  108. display block;
  109. width: 276rpx;
  110. height: 321rpx;
  111. position absolute;
  112. top: 200rpx;
  113. left: 274rpx;
  114. }
  115. .for-box:nth-child(1) {
  116. border-top: none;
  117. }
  118. .for-box {
  119. display: flex;
  120. padding: 10px;
  121. border-top: 4rpx solid #dedede;
  122. overflow hidden;
  123. background #ffffff;
  124. view {
  125. overflow: hidden;
  126. text-overflow: ellipsis;
  127. white-space: nowrap;
  128. font-size: 32rpx;
  129. color: #333;
  130. line-height: 60rpx;
  131. }
  132. .for-box-left {
  133. flex: 1;
  134. .for-name-box {
  135. display: flex;
  136. view:nth-child(1) {
  137. flex: 1;
  138. font-size: 36rpx;
  139. }
  140. view:nth-child(2) {
  141. width: 100rpx;
  142. margin-left: 20rpx;
  143. }
  144. .colorA {
  145. color: #0183FA;
  146. }
  147. .colorB {
  148. color: #999;
  149. }
  150. }
  151. .for-dept-box {}
  152. .for-type-box {
  153. display: flex;
  154. view {
  155. flex: 1;
  156. }
  157. }
  158. }
  159. .for-box-right {
  160. img {
  161. margin-top: 80rpx;
  162. width: 12rpx;
  163. height: 24rpx;
  164. }
  165. }
  166. }
  167. .get-data-null-p {
  168. text-align: center;
  169. line-height: 80rpx;
  170. padding-bottom: 40px;
  171. color: #999;
  172. }
  173. }
  174. }
  175. </style>