building-sign/pages/director/enter/enter.vue

125 lines
3.3 KiB
Vue
Raw Normal View History

2022-11-15 10:03:13 +00:00
<template>
<view class="pad-x120">
<!-- 头部 -->
<status-nav :ifReturn="false" :ifHome="true" navBarTitle="工人信息"></status-nav>
2022-11-18 10:33:37 +00:00
<view class="content" :style="{'padding-top':statusHeight+50+'px'}">
<!-- 导航 -->
<view class="pull-nav" :style="{'top':statusHeight+50+'px'}">
<sub-nav @changeEv="changeEv"></sub-nav>
</view>
<!-- 全选 -->
<view class="choose-all-bg"></view>
<!-- 工人列表 -->
<view class="sign-record sign-record-other bg-white">
<view class="item font26" v-for="(item,index) in enterList" :key="index">
<view class="info enter-info">
<text>姓名{{item.real_name}}</text>
<text>技术岗位{{item.position_name}}</text>
2022-11-23 08:46:52 +00:00
<text>录入时间{{item.created_at}}</text>
2022-11-28 06:26:17 +00:00
<text v-if="item.status==-1"><text class="color-red">已退回</text></text>
2022-11-18 10:33:37 +00:00
</view>
<!-- 待确认 -->
<view class="examine-btns font24">
<view class="btn color-blue" v-if="status==0" @tap="toDetail(item.id)"></view>
<view class="btn btn-other color-99" v-if="status==1" @tap="toDetail(item.id)"></view>
</view>
</view>
</view>
<!-- 加载更多 -->
<view class="more-tips font24">{{enterList.length==total?'没有更多数据了':'下滑获取更多'}}</view>
</view>
2022-11-15 10:03:13 +00:00
<!-- 尾部 -->
<tabbar :userType="userType" current="2"></tabbar>
</view>
</template>
<script>
2022-11-18 10:33:37 +00:00
import subNav from '@/components/sub-nav/sub-nav.vue';
2022-11-15 10:03:13 +00:00
import tabbar from '@/components/tabbar/tabbar';
export default {
components:{
2022-11-18 10:33:37 +00:00
subNav,
2022-11-15 10:03:13 +00:00
tabbar
},
data() {
return {
statusHeight:uni.getSystemInfoSync().statusBarHeight, //状态栏高度
userType:'director', //账户类型 工人worker 负责人director 工作台workbench
2022-11-18 10:33:37 +00:00
enterList:[], //打卡列表
page:1,
size:10,
status:0,
total:0,
isAll:false, //是否全选
ids:'', //选中的id
2022-11-15 10:03:13 +00:00
}
},
onLoad(op) {
if(op.userType){
this.userType = op.userType;
}
2022-11-18 10:33:37 +00:00
},
onShow() {
// 获取录入列表
this.getEnterList();
},
onReachBottom() {
if(this.enterList.length<this.total){
this.page++;
// 获取录入列表
this.getEnterList();
}
2022-11-28 06:26:17 +00:00
},
onPullDownRefresh() {
this.page = 1;
// 获取录入列表
this.getEnterList();
// 关闭下拉刷新
uni.stopPullDownRefresh();
2022-11-28 09:44:22 +00:00
},
onShareAppMessage(res) {
let shareObj = {
title:'工地打卡',
path: '/pages/pagehome/pagehome',
imageUrl:'/static/share-logo.jpg',
}
// 返回shareObj
return shareObj;
2022-11-15 10:03:13 +00:00
},
methods: {
2022-11-18 10:33:37 +00:00
// 选择栏目
changeEv(index){
this.status = index;
this.page = 1;
// 获取录入列表
this.getEnterList();
},
// 去确认&查看详情
toDetail(id){
uni.navigateTo({
url:`/pagesB/enterDetail/enterDetail?id=${id}&userType=workbench`,
2022-11-18 10:33:37 +00:00
})
},
2022-11-15 10:03:13 +00:00
2022-11-18 10:33:37 +00:00
// 获取录入列表
getEnterList(){
let params = {
page:this.page,
size:this.size,
status:this.status
}
if(this.page==1) this.enterList = [];
this.$requst.post('/api/v1/manager/check-list',params).then(res=>{
if(res.code==0){
console.log(res,'录入列表');
this.total = res.data.total;
this.enterList = this.enterList.concat(res.data.list);
}
})
},
2022-11-15 10:03:13 +00:00
}
}
</script>
<style scoped>
</style>