index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <!-- 进出记录详情 -->
  2. <template>
  3. <view class="record-info-page">
  4. <view class="top-button-box">
  5. <view class="sub-box">
  6. <picker class="sub-box-min-box" @change="bindPickerChange" :value="subIndex" :range="subNameList">
  7. <view class="uni-input sub-box-name">{{subNameList[subIndex]}}</view>
  8. <view class="sub-box-button">v</view>
  9. </picker>
  10. </view>
  11. <view class="right-time-box">
  12. <uni-section class="section-time-box" :title="'日期范围用法:' + '[' + range + ']'" type="line"></uni-section>
  13. <uni-datetime-picker v-model="range" type="daterange" @change="changeLog($event)" />
  14. </view>
  15. </view>
  16. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  17. <view class="for-box" v-for="(item,index) in dataList" :key="index" @click="tableButton(item)">
  18. <view class="time-p">{{item.showInTime}}</view>
  19. <view class="for-min-box" v-for="(minItem,minIndex) in item.list" :key="minIndex">
  20. <view class="top-name-box">
  21. <view class="position-left"></view>
  22. <img v-if="minItem.avatar" :src="baseUrl+minItem.avatar">
  23. <img v-else src="@/pages_basics/images/icon_01.png">
  24. <view class="top-name-p">{{minItem.userName}}</view>
  25. <view class="top-type-p"
  26. :class="minItem.accessStatus==1?'colorA':(minItem.accessStatus==2?'colorB':(minItem.accessStatus==3?'colorC':''))">
  27. {{minItem.accessStatusStr}}
  28. </view>
  29. <view class="position-right"></view>
  30. </view>
  31. <view class="titme-bottom-p">签到时间:{{minItem.inTime}}</view>
  32. <view class="titme-bottom-p">离开时间:{{minItem.outTime}}</view>
  33. <view class="titme-bottom-p">停留时间:{{minItem.hoursMinutes}}</view>
  34. </view>
  35. </view>
  36. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  37. </scroll-view>
  38. </view>
  39. </template>
  40. <script>
  41. import {
  42. config
  43. } from '@/api/request/config.js'
  44. import {
  45. systemSubjectGetListByPower
  46. } from '@/api/commonality/permission.js'
  47. import {
  48. laboratoryAppletPassOutList
  49. } from '@/pages_basics/api/index.js'
  50. export default {
  51. data() {
  52. return {
  53. baseUrl: config.base_url,
  54. range: [],
  55. subNameList: [],
  56. subList: [],
  57. subIndex: 0,
  58. // 查询参数
  59. queryParams: {
  60. page: 1,
  61. pageSize: 10,
  62. },
  63. //数据列表
  64. dataList: [],
  65. total: 0,
  66. getDataType: false,
  67. }
  68. },
  69. onLoad(option) {
  70. },
  71. onShow() {
  72. this.systemSubjectGetListByPower();
  73. this.getList();
  74. },
  75. methods: {
  76. //选中数据
  77. tableButton(item) {
  78. },
  79. changeLog(e) {
  80. this.$set(this.queryParams,'page',1);
  81. this.getList();
  82. },
  83. bindPickerChange(e) {
  84. this.$set(this, 'subIndex', e.detail.value);
  85. this.$set(this.queryParams,'page',1);
  86. this.getList();
  87. },
  88. //滚动加载事件
  89. scrollGet() {
  90. if (this.total / this.queryParams.pageSize <= this.queryParams.page) {
  91. this.$set(this, 'getDataType', true);
  92. } else {
  93. this.queryParams.page += 1;
  94. this.$nextTick(() => {
  95. this.getList();
  96. })
  97. }
  98. },
  99. //获取数据列表
  100. async getList() {
  101. let self = this;
  102. let obj = JSON.parse(JSON.stringify(this.queryParams));
  103. obj.subId = this.subIndex == 0 ? '' : this.subList[this.subIndex].subId;
  104. if (this.range[0]) {
  105. obj.startTime = this.range[0] + 'T00:00:00'
  106. obj.endTime = this.range[1] + 'T23:59:59'
  107. } else {
  108. obj.startTime = '';
  109. obj.endTime = '';
  110. }
  111. const {
  112. data
  113. } = await laboratoryAppletPassOutList(obj);
  114. if (data.code == 200) {
  115. let list = [];
  116. if(this.queryParams.page != 1){
  117. list = JSON.parse(JSON.stringify(this.dataList));
  118. }
  119. data.data.records.forEach((item) => {
  120. let num = 0;
  121. list.forEach((minItem) => {
  122. if (item.showInTime == minItem.showInTime) {
  123. num++
  124. minItem.list.push(item)
  125. }
  126. })
  127. if (num == 0) {
  128. list.push({
  129. showInTime: item.showInTime,
  130. list: [item]
  131. })
  132. }
  133. })
  134. this.$set(this, 'dataList', list);
  135. this.$set(this, 'total', data.data.total);
  136. if (data.data.total / this.queryParams.pageSize <= this.queryParams.page) {
  137. this.$set(this, 'getDataType', true);
  138. }
  139. }
  140. },
  141. //查询实验室
  142. async systemSubjectGetListByPower() {
  143. let self = this;
  144. const {
  145. data
  146. } = await systemSubjectGetListByPower();
  147. if (data.code == 200) {
  148. let nameList = ['全部'];
  149. let list = [{
  150. subName: '全部',
  151. subId: ''
  152. }];
  153. data.data.forEach((item) => {
  154. nameList.push(item.subName)
  155. list.push({
  156. subName: item.subName,
  157. subId: item.subId,
  158. })
  159. })
  160. this.$set(this, 'subNameList', nameList);
  161. this.$set(this, 'subList', list);
  162. this.$set(this, 'subIndex', 0);
  163. }
  164. },
  165. }
  166. }
  167. </script>
  168. <style lang="stylus" scoped>
  169. .record-info-page {
  170. height: 100%;
  171. display: flex;
  172. flex-direction: column;
  173. overflow: hidden;
  174. .top-button-box {
  175. padding: 20rpx;
  176. display: flex;
  177. .sub-box {
  178. width: 250rpx;
  179. height: 70rpx;
  180. border-radius: 10rpx;
  181. margin-right: 10rpx;
  182. border: 1px solid #dedede;
  183. background-color: #fff;
  184. overflow: hidden;
  185. .sub-box-min-box {
  186. .sub-box-name {
  187. padding-left: 10rpx;
  188. line-height: 70rpx;
  189. display: inline-block;
  190. width: 200rpx;
  191. overflow: hidden
  192. }
  193. .sub-box-button {
  194. display: inline-block;
  195. line-height: 70rpx;
  196. width: 40rpx;
  197. text-align: center;
  198. color: #dedede;
  199. overflow: hidden
  200. }
  201. }
  202. }
  203. .right-time-box {
  204. flex: 1;
  205. height: 80rpx;
  206. }
  207. }
  208. .info-max-box {
  209. flex: 1;
  210. overflow-y scroll;
  211. .for-box {
  212. .time-p {
  213. margin: 0 32rpx;
  214. font-size: 30rpx;
  215. }
  216. .for-min-box {
  217. background: #fff;
  218. margin: 32rpx;
  219. padding-bottom: 30rpx;
  220. .top-name-box {
  221. position: relative;
  222. display: flex;
  223. border-bottom: 1rpx dashed #dedede;
  224. margin-bottom: 30rpx;
  225. img {
  226. width: 70rpx;
  227. height: 70rpx;
  228. border-radius: 50%;
  229. margin: 27rpx 31rpx 33rpx 31rpx;
  230. }
  231. .top-name-p {
  232. line-height: 130rpx;
  233. font-size: 28rpx;
  234. flex: 1;
  235. display: block;
  236. overflow: hidden;
  237. text-overflow: ellipsis;
  238. white-space: nowrap;
  239. }
  240. .top-type-p {
  241. line-height: 130rpx;
  242. margin-right: 40rpx;
  243. font-size: 28rpx;
  244. display: block;
  245. overflow: hidden;
  246. text-overflow: ellipsis;
  247. white-space: nowrap;
  248. }
  249. .colorA {
  250. color: #0183FA;
  251. }
  252. .colorB {
  253. color: #999999;
  254. }
  255. .colorC {
  256. color: #FA5801;
  257. }
  258. .position-left {
  259. position: absolute;
  260. left: -15rpx;
  261. top: 114rpx;
  262. width: 30rpx;
  263. height: 30rpx;
  264. background: #f5f5f5;
  265. border-radius: 15rpx;
  266. }
  267. .position-right {
  268. position: absolute;
  269. right: -15rpx;
  270. top: 114rpx;
  271. width: 30rpx;
  272. height: 30rpx;
  273. background: #f5f5f5;
  274. border-radius: 15rpx;
  275. }
  276. }
  277. .titme-bottom-p {
  278. line-height: 50rpx;
  279. font-size: 28rpx;
  280. margin: 0 32rpx;
  281. }
  282. }
  283. }
  284. .get-data-null-p {
  285. text-align: center;
  286. line-height: 40rpx;
  287. padding-bottom: 40px;
  288. color: #999;
  289. }
  290. }
  291. }
  292. </style>