123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <!-- 进出记录 -->
- <template>
- <view class="accessRecord">
- <view class="title">
- <view v-for="(item,index) in statisticsData" :key="index">
- <view>{{item.num}}</view>
- <view>{{item.name}}</view>
- </view>
- </view>
- <view class="list" v-for="(item,index) in dataList" :key="index">
- <view class="list-t">{{item.showInTime}}</view>
- <view class="list-b" v-for="(item2,index2) in item.list" :key="index2">
- <view class="list-b-t">
- <img v-if="item2.avatar" :src="baseUrl+item2.avatar">
- <img v-else src="@/pages_basics/images/icon_01.png">
- <view>{{item2.userName}}</view>
- <view>{{item2.phone}}</view>
- <view
- :class="item2.accessStatus==1?'color-A':(item2.accessStatus==2?'color-B':(item2.accessStatus==3?'color-C':''))">
- {{item2.accessStatusStr}}
- </view>
- </view>
- <img class="list-b-img" src="@/pages_manage/images/for_min_bg.png">
- <view class="list-b-b">
- <view>签到时间:{{item2.inTime?item2.inTime:'-'}}</view>
- <view>离开时间:{{item2.outTime?item2.outTime:'-'}}</view>
- <view>停留时间:{{item2.hoursMinutes?item2.hoursMinutes:'-'}}</view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- import {
- laboratoryAppletPassOutList,
- laboratoryAppletPassOutCount
- } from '@/pages_basics/api/index.js'
- export default {
- name: "accessRecord",
- props: {
- subjectData: {},
- },
- data() {
- return {
- baseUrl: config.base_url,
- statisticsData: [{
- name: '当前实验人数',
- num: '0'
- },
- {
- name: '今日累计人次',
- num: '0'
- },
- {
- name: '当月累计人次',
- num: '0'
- },
- ],
- newData: {
- },
- dataList: [],
- // 查询参数
- queryParams: {
- page: 1,
- pageSize: 10,
- subId: '',
- },
- total: 0,
- }
- },
- created() {
- },
- beforeMount() {
- uni.$on('onReachBottom', () => { // 监听上拉加载
- console.log("到达底部,onReachBottom")
- this.scrollGet();
- })
- uni.$on('onPullDownRefresh', () => { // 监听下拉刷新
- console.log("进行了上拉刷新,onPullDownRefresh")
- })
- },
- mounted() {
- this.$set(this.queryParams, 'subId', this.subjectData.subId);
- this.laboratoryAppletPassOutCount();
- this.getList();
- },
- methods: {
- //滚动加载事件
- scrollGet() {
- if (this.total / this.queryParams.pageSize <= this.queryParams.page) {
- this.$set(this, 'getDataType', true);
- } else {
- this.queryParams.page += 1;
- this.$nextTick(() => {
- this.getList();
- })
- }
- },
- async laboratoryAppletPassOutCount() {
- let self = this;
- const {
- data
- } = await laboratoryAppletPassOutCount({subId:this.queryParams.subId});
- if (data.code == 200) {
- this.statisticsData[0].num = data.data.experimenters
- this.statisticsData[1].num = data.data.numberPeople
- this.statisticsData[2].num = data.data.monthNumberPeople
- }
- },
- async getList() {
- let self = this;
- let obj = JSON.parse(JSON.stringify(this.queryParams));
- const {
- data
- } = await laboratoryAppletPassOutList(obj);
- if (data.code == 200) {
- let list = [];
- if (this.queryParams.page != 1) {
- list = JSON.parse(JSON.stringify(this.dataList));
- }
- data.data.records.forEach((item) => {
- let num = 0;
- list.forEach((minItem) => {
- if (item.showInTime == minItem.showInTime) {
- num++
- minItem.list.push(item)
- }
- })
- if (num == 0) {
- list.push({
- showInTime: item.showInTime,
- list: [item]
- })
- }
- })
- this.$set(this, 'dataList', list);
- this.$set(this, 'total', data.data.total);
- if (data.data.total / this.queryParams.pageSize <= this.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- }
- },
- },
- }
- </script>
- <style lang="stylus" scoped>
- .accessRecord {
- width: 750rpx;
- .title {
- width: 750rpx;
- height: 160rpx;
- background: #fff;
- display: flex;
- justify-content: space-between;
- padding: 0 20rpx;
- box-sizing: border-box;
- >view {
- flex: 1;
- >view:nth-of-type(1) {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 36rpx;
- color: #0183FA;
- line-height: 30rpx;
- text-align: center;
- margin: 30rpx 0 34rpx 0;
- }
- >view:nth-of-type(2) {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 30rpx;
- color: #222222;
- line-height: 30rpx;
- text-align: center;
- border-right: 1rpx solid #E0E0E0;
- }
- }
- >view:last-child {
- >view:nth-of-type(2) {
- border-right: none;
- }
- }
- }
- .list {
- padding: 0 20rpx;
- box-sizing: border-box;
- .list-t {
- height: 80rpx;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 32rpx;
- color: #222222;
- line-height: 80rpx;
- }
- .list-b {
- margin-bottom: 20rpx;
- .list-b-t {
- background: #FFFFFF;
- border-radius: 20rpx 20rpx 0 0;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- padding: 30rpx 26rpx 16rpx 30rpx;
- box-sizing: border-box;
- >img {
- width: 70rpx;
- height: 70rpx;
- border-radius: 35rpx;
- }
- >view:nth-of-type(1) {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #333333;
- line-height: 30rpx;
- margin-left: 22rpx;
- }
- >view:nth-of-type(2) {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #333333;
- line-height: 30rpx;
- margin-left: 44rpx;
- }
- >view:nth-of-type(3) {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- line-height: 30rpx;
- flex: 1;
- text-align: right;
- }
- .color-A {
- color: #0183FA;
- }
- .color-B {
- color: #999999;
- }
- .color-C {
- color: #FFAE00;
- }
- }
- .list-b-img {
- width: 710rpx;
- height: 32rpx;
- }
- .list-b-b {
- background: #FFFFFF;
- border-radius: 0 0 20rpx 20rpx;
- padding-top: 32rpx;
- box-sizing: border-box;
- overflow: hidden;
- >view {
- margin: 0 0 26rpx 20rpx;
- }
- }
- }
- }
- }
- </style>
|