building-sign/pagesA/wagesRecord/wagesRecord.vue

91 lines
2.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view class="pad-x120">
<!-- 头部 -->
<status-nav navBarTitle="工资记录"></status-nav>
<view class="content" :style="{'padding-top':statusHeight+50+'px'}">
<!-- 工资记录 -->
<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>
</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
wagesList:[], //加班列表
page:1,
size:10,
total:0,
}
},
onLoad() {
// 获取工资列表
this.getWagesList();
},
onReachBottom() {
if(this.wagesList.length<this.total){
this.page++;
//
this.getWagesList();
}
},
onPullDownRefresh() {
this.page = 1;
//
this.getWagesList();
//
uni.stopPullDownRefresh();
},
onShareAppMessage(res) {
let shareObj = {
title:'工地打卡',
path: '/pages/pagehome/pagehome',
imageUrl:'/static/share-logo.jpg',
}
// shareObj
return shareObj;
},
methods: {
//
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);
}
})
},
}
}
</script>
<style scoped>
</style>