building-sign/pagesA/wagesRecord/wagesRecord.vue

83 lines
2.3 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>
2023-01-14 08:13:24 +00:00
<text class="color-66" v-if="item.status==2">{{item.paid_amount}}</text>
<text :class="item.status==0?'color-blue':'color-66'" v-else>{{item.status==0?'':''}}</text>
2022-11-17 11:40:25 +00:00
</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>
<!-- 加载更多 -->
2022-11-18 10:33:37 +00:00
<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-18 10:33:37 +00:00
// 获取工资列表
2022-11-17 11:40:25 +00:00
this.getWagesList();
},
onReachBottom() {
if(this.wagesList.length<this.total){
this.page++;
2022-11-18 10:33:37 +00:00
// 获取工资列表
2022-11-17 11:40:25 +00:00
this.getWagesList();
}
2022-11-16 10:20:26 +00:00
},
2022-11-28 06:26:17 +00:00
onPullDownRefresh() {
this.page = 1;
// 获取工资列表
this.getWagesList();
// 关闭下拉刷新
uni.stopPullDownRefresh();
},
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>