index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <!-- 历史记录 -->
  2. <template>
  3. <view class="historicalRecords">
  4. <view class="picker-box">
  5. <picker @change="subChange" :value="subIndex" :range="subList" :range-key="'subName'">
  6. <view class="picker-p" :class="queryParams.subId?'check-picker-p':''">{{queryParams.subId?queryParams.subName:'全部实验室'}}</view>
  7. </picker>
  8. </view>
  9. <view class="check-button-max-box">
  10. <view @click="checkButton(1)" :class="typeIndex == 1?'check-p':''">已报备待回收</view>
  11. <view @click="checkButton(2)" :class="typeIndex == 2?'check-p':''">已回收</view>
  12. <view @click="checkButton(3)" :class="typeIndex == 3?'check-p':''">超期未回收</view>
  13. </view>
  14. <scroll-view scroll-y @scrolltolower="scrollGet" class="for-max-box">
  15. <view class="for-max-big-box" @click="goPage(item)"
  16. v-for="(item,index) in dataList" :key="index">
  17. <view class="for-title-p">报备单编号:{{item.listNewData1}}</view>
  18. <view class="for-text-p">报备实验室:{{item.listNewData2}}</view>
  19. <view class="for-text-p">上门回收日期:{{item.listNewData3}}</view>
  20. <view class="for-text-p">废物种类:{{item.listNewData4}}</view>
  21. <view class="for-text-p">报备人:{{item.listNewData5}}</view>
  22. <view class="for-text-p">报备时间:{{item.listNewData6}}</view>
  23. <view class="for-type-p" :class="item.listNewData0==1?'colorA':(item.listNewData0==2?'colorB':(item.listNewData0==3?'colorC':''))">{{item.listNewData0==1?'已报备待回收':(item.listNewData0==2?'已回收':(item.listNewData0==3?'超期未回收':''))}}</view>
  24. <view class="for-icon-p">》</view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. demo1,
  32. demo2
  33. } from '@/pages_hazardousWasteRecycling/api/index.js'
  34. export default {
  35. data() {
  36. return {
  37. subIndex:'',
  38. subList:[],
  39. subIndex:'',
  40. // 查询参数
  41. getDataType: false,
  42. queryParams: {
  43. page: 1,
  44. pageSize: 10,
  45. subId:"",
  46. },
  47. total: 0,
  48. dataList: [],
  49. typeIndex:1,
  50. }
  51. },
  52. onLoad(option) {
  53. },
  54. onShow() {
  55. },
  56. mounted() {
  57. this.$set(this,'dataList',[
  58. {
  59. listNewData0:'1',
  60. listNewData1:'HW202510400001',
  61. listNewData2:'植物营养实验室(A201)',
  62. listNewData3:'2025-11-05(星期四)',
  63. listNewData4:'4',
  64. listNewData5:'王二小(2020110010)',
  65. listNewData6:'2025-11-04 10:10:09',
  66. },
  67. {
  68. listNewData0:'1',
  69. listNewData1:'HW202510400001',
  70. listNewData2:'植物营养实验室(A201)',
  71. listNewData3:'2025-11-05(星期四)',
  72. listNewData4:'4',
  73. listNewData5:'王二小(2020110010)',
  74. listNewData6:'2025-11-04 10:10:09',
  75. },
  76. {
  77. listNewData0:'2',
  78. listNewData1:'HW202510400001',
  79. listNewData2:'植物营养实验室(A201)',
  80. listNewData3:'2025-11-05(星期四)',
  81. listNewData4:'4',
  82. listNewData5:'王二小(2020110010)',
  83. listNewData6:'2025-11-04 10:10:09',
  84. },
  85. {
  86. listNewData0:'2',
  87. listNewData1:'HW202510400001',
  88. listNewData2:'植物营养实验室(A201)',
  89. listNewData3:'2025-11-05(星期四)',
  90. listNewData4:'4',
  91. listNewData5:'王二小(2020110010)',
  92. listNewData6:'2025-11-04 10:10:09',
  93. },
  94. {
  95. listNewData0:'3',
  96. listNewData1:'HW202510400001',
  97. listNewData2:'植物营养实验室(A201)',
  98. listNewData3:'2025-11-05(星期四)',
  99. listNewData4:'4',
  100. listNewData5:'王二小(2020110010)',
  101. listNewData6:'2025-11-04 10:10:09',
  102. },
  103. {
  104. listNewData0:'3',
  105. listNewData1:'HW202510400001',
  106. listNewData2:'植物营养实验室(A201)',
  107. listNewData3:'2025-11-05(星期四)',
  108. listNewData4:'4',
  109. listNewData5:'王二小(2020110010)',
  110. listNewData6:'2025-11-04 10:10:09',
  111. },
  112. {
  113. listNewData0:'1',
  114. listNewData1:'HW202510400001',
  115. listNewData2:'植物营养实验室(A201)',
  116. listNewData3:'2025-11-05(星期四)',
  117. listNewData4:'4',
  118. listNewData5:'王二小(2020110010)',
  119. listNewData6:'2025-11-04 10:10:09',
  120. },
  121. {
  122. listNewData0:'2',
  123. listNewData1:'HW202510400001',
  124. listNewData2:'植物营养实验室(A201)',
  125. listNewData3:'2025-11-05(星期四)',
  126. listNewData4:'4',
  127. listNewData5:'王二小(2020110010)',
  128. listNewData6:'2025-11-04 10:10:09',
  129. },
  130. ]);
  131. },
  132. methods: {
  133. //详情跳转
  134. goPage(item){
  135. uni.navigateTo({
  136. url: "/pages_hazardousWasteRecycling/views/historicalRecords/infoPage",
  137. });
  138. },
  139. //选项切换
  140. checkButton(type){
  141. if(this.typeIndex != type){
  142. this.$set(this,'typeIndex',type);
  143. }
  144. },
  145. //滚动加载事件
  146. scrollGet() {
  147. let self = this;
  148. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  149. this.$set(this, 'getDataType', true);
  150. } else {
  151. this.queryParams.page += 1;
  152. this.$nextTick(() => {
  153. this.getList();
  154. })
  155. }
  156. },
  157. //获取实验室列表
  158. async getList() {
  159. let self = this;
  160. let obj = JSON.parse(JSON.stringify(this.queryParams));
  161. const {
  162. data
  163. } = await laboratoryAppletSubList(obj);
  164. if (data.code == 200) {
  165. if(self.queryParams.page == 1){
  166. this.$set(this, 'dataList', data.data.records);
  167. this.$set(this, 'total', data.data.total);
  168. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  169. this.$set(this, 'getDataType', true);
  170. }
  171. }else{
  172. this.$set(this, 'dataList', [...this.dataList, ...data.data.records]);
  173. this.$set(this, 'total', data.data.total);
  174. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  175. this.$set(this, 'getDataType', true);
  176. }
  177. }
  178. }
  179. },
  180. },
  181. }
  182. </script>
  183. <style lang="stylus" scoped>
  184. .historicalRecords{
  185. height: 100%;
  186. display flex;
  187. flex-direction column;
  188. .picker-box{
  189. height:60rpx;
  190. width:700rpx;
  191. margin:20rpx 25rpx;
  192. background-color: #fff
  193. border:1rpx solid #dedede;
  194. border-radius:10rpx;
  195. .picker-p{
  196. padding:0 20rpx;
  197. color:#666;
  198. line-height:60rpx;
  199. }
  200. .check-picker-p{
  201. }
  202. }
  203. .check-button-max-box{
  204. display: flex;
  205. border-radius:10rpx;
  206. border:1rpx solid #fff;
  207. line-height:58rpx;
  208. height:60rpx;
  209. width:700rpx;
  210. margin:0 25rpx 20rpx;
  211. overflow: hidden;
  212. view{
  213. flex:1;
  214. text-align: center;
  215. background-color: #fff;
  216. color:#0183FA;
  217. }
  218. .check-p{
  219. background-color: #0183FA;
  220. color:#fff;
  221. }
  222. }
  223. .for-max-box{
  224. flex: 1;
  225. overflow-y scroll;
  226. padding-bottom:60rpx;
  227. .for-max-big-box{
  228. margin:0 25rpx 25rpx;
  229. background-color: #fff;
  230. border-radius:10rpx;
  231. border:1rpx solid #dedede;
  232. padding:20rpx;
  233. position: relative;
  234. .for-title-p{
  235. font-size:30rpx;
  236. font-weight:700;
  237. line-height:50rpx;
  238. }
  239. .for-text-p{
  240. font-size:30rpx;
  241. line-height:50rpx;
  242. }
  243. .for-type-p{
  244. position: absolute;
  245. top:24rpx;
  246. right:20rpx;
  247. }
  248. .for-icon-p{
  249. position: absolute;
  250. top:155rpx;
  251. right:20rpx;
  252. font-size:32rpx;
  253. color:#999;
  254. }
  255. .colorA{
  256. color:#0183FA;
  257. }
  258. .colorB{
  259. color:#00CD66;
  260. }
  261. .colorC{
  262. color:#FF6A6A;
  263. }
  264. }
  265. }
  266. }
  267. </style>