lock——record

This commit is contained in:
shijing 2022-10-12 17:10:07 +08:00
parent e64d72623c
commit f34770181c
4 changed files with 214 additions and 0 deletions

View File

@ -36,6 +36,7 @@ const install = (Vue, vm) => {
let hrmUserInfo = (params = {}) => vm.$u.get('/hrm/employee/info/', params); //用户信息
let hrmCertificate = (params = {}) => vm.$u.get('/hrm/certificate/', params); //用户证书
let hrmClockRecord = (params = {}) => vm.$u.get('/hrm/clock_record/', params); //打卡记录
let hrmUpdateInfo = (data = {}) => vm.$u.post('/hrm/employee/improve_info/', data); //作业新建
let getTickets = (params = {}) => vm.$u.get('/wf/ticket/', params); //工单查询/wf/ticket/{id}/
@ -192,6 +193,7 @@ const install = (Vue, vm) => {
hrmUserInfo,
hrmCertificate,
hrmUpdateInfo,
hrmClockRecord,
areaLists,
areaDetail,

View File

@ -313,6 +313,14 @@
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/my/clock_in",
"style": {
"navigationBarTitleText": "打卡记录",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {

193
pages/my/clock_in.vue Normal file
View File

@ -0,0 +1,193 @@
<template>
<view class="clockInContainer">
<uni-nav-bar @clickLeft="goBack()" height="110rpx" leftWidth="200rpx" leftText="打卡记录" leftIcon="left" border
backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
<view class="tabbar-title">
<view :class="{'text-title':true, 'active':activeIndex}" @click="changeList(1)">本月</view>
<view style="display: flex;">
<view>选择月份</view>
<picker mode="date" :value="date" fields="month" @change="bindDateChange">
<view class="uni-input">{{date}}</view>
</picker>
</view>
</view>
<view class="content">
<view class="item-wrap" v-for="(val,index) in lists" :key="val.id">
<view class="clock_in_-item">
<view class="center-info">
<view class="info-details">打卡人员{{val.detail.personName}} </view>
<view class="info-details">所在岗位{{val.employee_.post_name}}</view>
<view class="info-details">所在部门{{val.detail.deptName}}</view>
<view class="info-details">触发模式{{val.detail.openTypeStr}}</view>
<view class="info-details">打卡类型<text v-if="val.type==10">上班打卡</text><text v-else>下班打卡</text></view>
<view class="info-details">其他信息{{val.detail.deviceName}}</view>
<view class="info-details">打卡时间{{val.update_time}}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'ticket',
data() {
return {
params: {
employee: '',
pageSize: 10,
pageNum: 1,
month: '',
year:''
},
totalNum: 0,
activeIndex:true,//
lists: [],
currentMonth:'',
currentYear:'',
date:'选择其他月',
}
},
//
onReachBottom() {
const totalPage = Math.ceil(this.totalNum / this.params.pageSize);
if (this.params.pageNum < totalPage) {
this.params.pageNum += 1;
} else {
uni.showToast({
title: "已全部加载",
icon: 'none'
})
}
},
onShow() {
let that = this;
let now = new Date()
var year = now.getFullYear(); //
var month = now.getMonth() + 1; //
if(month < 10) {
month = '0' + month;
}
that.params.month = that.currentMonth = month;
that.params.year = that.currentYear = year;
that.date = year+'-'+month;
that.$u.api.hrmUserInfo().then(res => {
if(res.err_msg){}else{
that.params.employee = res.id;
that.getLists();
}
})
},
//
onPullDownRefresh() {
this.params.pageNum = 1;
this.lists = [];
this.getLists();
},
methods: {
bindDateChange(e){
this.date = e.target.value;
this.params.month = this.date.split('-')[1];
this.params.year = this.date.split('-')[0];
let current = this.currentYear+'-'+this.currentMonth;
if(this.date==current){
this.activeIndex=true;
}else{
this.activeIndex=false;
}
this.lists = [];
this.getLists();
},
getLists() {
let that = this;
that.$u.api.hrmClockRecord(that.params).then(res => {
that.lists = that.lists.concat(res.results);
this.totalNum = res.count;
})
},
changeList(index){
let that = this;
that.activeIndex = index;
that.resetSearch();
},
goBack() {
uni.navigateBack({
delta: 1
})
},
searchHandle() {
this.params.pageNum = 1;
this.lists = [];
this.getLists()
},
resetSearch() {
this.params.pageNum = 1;
this.params.search = "";
this.lists = [];
this.getLists();
},
}
}
</script>
<style scoped>
.empty-view {
height: 120rpx;
}
>>>.uni-navbar__header,
>>>.uni-status-bar,
.search-wrap {
background-image: linear-gradient(270deg,
#0ca7ee 0%,
#005aff 100%,
#2a8cff 100%,
#54bdff 100%),
linear-gradient(#e60012,
#e60012);
}
.tabbar-title{
display: flex;
justify-content: space-between;
}
.clockInContainer {
background-color: #f3fbff;
}
.clockInContainer>>>.uni-navbar-btn-text text {
font-size: 32rpx !important;
}
.content {
padding: 14rpx;
padding-top: 10upx;
}
.item-wrap {
margin-bottom: 14rpx;
}
.clock_in_-item {
width: 720rpx;
background-color: #ffffff;
border-radius: 10rpx;
margin: 0 auto;
padding: 24rpx 21rpx;
box-sizing: border-box;
}
.info-details {
font-size: 28rpx;
line-height: 40rpx;
color: #5b5b5b;
}
</style>

View File

@ -40,6 +40,12 @@
<text class="title-text">我的资料</text>
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
</view>
<view class="enter-item" @click="goInto('clockIn')">
<image style="width: 34rpx;height: 30rpx;" class="left-icon" src="../../static/my/wodeziliao.png"
mode=""></image>
<text class="title-text">我的打卡记录</text>
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
</view>
</view>
<view class="sign-out">
<button type="default" @click="signoutFn" class="sign-out-btn">退出</button>
@ -86,6 +92,11 @@
url: '/pages/my/myInfoChange'
})
}
if (type == "clockIn") {
uni.navigateTo({
url: '/pages/my/clock_in'
})
}
},
getUserInfo() {
var promise;