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

108 lines
2.9 KiB
Vue
Raw Normal View History

2022-11-15 10:03:13 +00:00
<template>
<view class="pad-x120">
<!-- 头部 -->
2022-11-18 10:33:37 +00:00
<status-nav :ifReturn="false" navBarTitle="工人信息"></status-nav>
<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>
<text>录入时间{{item.created_at}}</text>
</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 class="state" :class="item.status==-1?'color-red':''" v-if="item.status==1 || item.status==-1">{{item.status_text}}</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
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() {
2022-11-18 10:33:37 +00:00
},
onShow() {
// 获取录入列表
this.getEnterList();
},
onReachBottom() {
if(this.enterList.length<this.total){
this.page++;
// 获取录入列表
this.getEnterList();
}
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:`/pagesA/enterDetail/enterDetail?id=${id}`,
})
},
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>