building-sign/pagesA/wagesRecord/wagesRecord.vue

78 lines
2.0 KiB
Vue
Raw Normal View History

2022-11-16 10:20:26 +00:00
<template>
<view class="pad-x120">
<!-- 头部 -->
<status-nav navBarTitle="工资记录"></status-nav>
<view class="content" :style="{'padding-top':statusHeight+50+'px'}">
2022-11-17 11:40:25 +00:00
<!-- 工资记录 -->
<view class="sign-record sign-record-other bg-white">
<view class="item font26" v-for="(item,index) in wagesList" :key="index">
<view class="info info-other">
<text>{{item.date}}</text>
<text :class="item.status==0?'color-blue':'color-66'">{{item.status_text}}</text>
</view>
<view class="wages-info">
<view class="text">基本工资{{item.base_amount}}</view>
<view class="text">加班工资{{item.overtime_amount}}</view>
<view class="text">合计<text class="font32">{{item.amount}}</text></view>
</view>
</view>
</view>
<!-- 加载更多 -->
<view class="more-tips font24">{{wagesList.length==total?'没有更多了':'下滑获取更多'}}</view>
2022-11-16 10:20:26 +00:00
</view>
<!-- 尾部 -->
<tabbar :userType="userType" current="2"></tabbar>
</view>
</template>
<script>
import tabbar from '@/components/tabbar/tabbar';
export default {
components:{
tabbar
},
data() {
return {
statusHeight:uni.getSystemInfoSync().statusBarHeight, //状态栏高度
userType:'worker', //账户类型 工人worker 负责人director
2022-11-17 11:40:25 +00:00
wagesList:[], //加班列表
page:1,
size:10,
total:0,
2022-11-16 10:20:26 +00:00
}
},
onLoad() {
2022-11-17 11:40:25 +00:00
},
onShow() {
// 获取打卡列表
this.getWagesList();
},
onReachBottom() {
if(this.wagesList.length<this.total){
this.page++;
// 获取打卡列表
this.getWagesList();
}
2022-11-16 10:20:26 +00:00
},
methods: {
2022-11-17 11:40:25 +00:00
// 获取工资列表
getWagesList(){
let params = {
page:this.page,
size:this.size,
}
if(this.page==1) this.wagesList = [];
this.$requst.post('/api/v1/worker/pay-list',params).then(res=>{
if(res.code==0){
console.log(res,'工资记录');
this.total = res.data.total;
this.wagesList = this.wagesList.concat(res.data.list);
}
})
},
2022-11-16 10:20:26 +00:00
}
}
</script>
<style scoped>
</style>