|
|
@@ -66,7 +66,7 @@
|
|
|
<!-- 环形图区域 -->
|
|
|
<view class="progress" v-if="current==0">
|
|
|
<view class="chart">
|
|
|
- <progressBar :progress_txt="progress_txt" :progress_total="progress_total" />
|
|
|
+ <progressBar v-if="showBar" :progress_txt="progress_txt" :progress_total="progress_total" />
|
|
|
</view>
|
|
|
|
|
|
<view class="look">
|
|
|
@@ -119,19 +119,26 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="e_list">
|
|
|
- <view class="e_box" v-for="item in errList" :key="item.id">
|
|
|
+ <view class="e_list" v-if="errList.length">
|
|
|
+ <view class="e_box" v-for="item in errList" :key="item.userId">
|
|
|
<view class="e_img">
|
|
|
- <img :src="item.peopleImg">
|
|
|
+ <img
|
|
|
+ :src="item.headImage||'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0'">
|
|
|
</view>
|
|
|
<view class="e_name">
|
|
|
{{item.name}}
|
|
|
</view>
|
|
|
<view class="e_msg">
|
|
|
- 未打卡{{item.num}}次
|
|
|
+ 未打卡{{item.times}}次
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
|
|
|
+ <view class="e_list2" v-else>
|
|
|
+ <img src="../../static/nodata.png">
|
|
|
+ <view class="info">
|
|
|
+ 暂无数据
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
@@ -167,66 +174,48 @@
|
|
|
}
|
|
|
],
|
|
|
// 考勤规则列表
|
|
|
- list2: [{
|
|
|
- id: 1,
|
|
|
- msg: "规则:课间操考勤打卡09:00 - 09:15",
|
|
|
- status: 0,
|
|
|
- time: "09:25:25"
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- msg: "规则:考勤打卡19:00 - 20:15",
|
|
|
- status: 1,
|
|
|
- time: "19:25:25"
|
|
|
- },
|
|
|
- ],
|
|
|
+ list2: [],
|
|
|
month: null,
|
|
|
items: ['团队统计', '我的统计'],
|
|
|
current: 1,
|
|
|
year: null,
|
|
|
month: null,
|
|
|
- errList: [{
|
|
|
- id: 1,
|
|
|
- peopleImg: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
|
|
|
- name: "程佳欢",
|
|
|
- num: 20
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- peopleImg: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
|
|
|
- name: "程欢",
|
|
|
- num: 10
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- peopleImg: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
|
|
|
- name: "张三",
|
|
|
- num: 30
|
|
|
- },
|
|
|
- {
|
|
|
- id: 4,
|
|
|
- peopleImg: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
|
|
|
- name: "李四",
|
|
|
- num: 30
|
|
|
- },
|
|
|
- ],
|
|
|
- progress_txt: 50,
|
|
|
- progress_total: 70,
|
|
|
+ day: null,
|
|
|
+ errList: [],
|
|
|
+ progress_txt: 0,
|
|
|
+ progress_total: 0,
|
|
|
// 当前时间
|
|
|
nowTime: "",
|
|
|
// 打卡异常次数
|
|
|
fail_count: 0,
|
|
|
// 打卡成功次数
|
|
|
- success_count: 0
|
|
|
+ success_count: 0,
|
|
|
+ page: 1,
|
|
|
+ total: 0,
|
|
|
+ page_my: 1,
|
|
|
+ total_my: 0,
|
|
|
+ showBar: true
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
+ this.getTime()
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ let flag = uni.getStorageSync("manager")
|
|
|
+ let flag2 = uni.getStorageSync("sub-administrator")
|
|
|
+ if (flag || flag2) {
|
|
|
+ this.flag = true
|
|
|
+ }
|
|
|
if (this.flag) {
|
|
|
this.current = 0
|
|
|
+ this.getMonthTimes_team()
|
|
|
+ this.getProportion()
|
|
|
+ this.getErrList()
|
|
|
+ } else {
|
|
|
+ this.current = 1
|
|
|
+ this.getMonthTimes()
|
|
|
+ this.getRulesList()
|
|
|
}
|
|
|
- this.getTime()
|
|
|
- this.getMonthTimes()
|
|
|
- this.getRulesList()
|
|
|
},
|
|
|
computed: {
|
|
|
comMonth() {
|
|
|
@@ -234,6 +223,39 @@
|
|
|
let month = this.month < 10 ? '0' + this.month : this.month
|
|
|
return month
|
|
|
}
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ progress_txt() {
|
|
|
+ this.showBar = false
|
|
|
+ this.showBar = true
|
|
|
+ },
|
|
|
+ progress_total() {
|
|
|
+ this.showBar = false
|
|
|
+ this.showBar = true
|
|
|
+ },
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.current == 0) {
|
|
|
+ if (this.errList.length < this.total) {
|
|
|
+ this.page++
|
|
|
+ this.getErrList()
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: "没有更多数据了",
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.list2.length < this.total_my) {
|
|
|
+ this.page_my++
|
|
|
+ this.getRulesList()
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: "没有更多数据了",
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -243,9 +265,10 @@
|
|
|
let year = date.getFullYear()
|
|
|
let month = date.getMonth() + 1
|
|
|
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
|
|
- this.nowTime = year + "-" + month + "-" + day + " " + "00:00:00"
|
|
|
this.year = year
|
|
|
this.month = month
|
|
|
+ this.day = day
|
|
|
+ this.nowTime = year + "-" + this.comMonth + "-" + day + " " + "00:00:00"
|
|
|
},
|
|
|
|
|
|
// 获取我的月打卡次数
|
|
|
@@ -263,38 +286,99 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ // 获取我的团队月打卡次数
|
|
|
+ async getMonthTimes_team() {
|
|
|
+ let res = await this.$myRequest({
|
|
|
+ url: "/attendance/api/sign/check/in/month/times/team",
|
|
|
+ data: {
|
|
|
+ time: this.nowTime
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.fail_count = res.data.fail
|
|
|
+ this.success_count = res.data.success
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取团队打卡每日完成占比
|
|
|
+ async getProportion() {
|
|
|
+ let res = await this.$myRequest({
|
|
|
+ url: "/attendance/api/sign/check/in/proportion",
|
|
|
+ data: {
|
|
|
+ time: this.nowTime
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.progress_txt = res.data.complete
|
|
|
+ this.progress_total = res.data.total
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取打卡异常人员名单
|
|
|
+ async getErrList() {
|
|
|
+ let res = await this.$myRequest({
|
|
|
+ url: "/attendance/api/sign/check/in/abnormal",
|
|
|
+ data: {
|
|
|
+ time: this.nowTime,
|
|
|
+ page: this.page,
|
|
|
+ size: 9
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.total = res.data.total
|
|
|
+ this.errList = [...this.errList, ...res.data.list]
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 获取打卡规则列表
|
|
|
async getRulesList() {
|
|
|
let name = uni.getStorageSync("userInfo").username
|
|
|
let res = await this.$myRequest({
|
|
|
url: "/attendance/api/sign/check/in/list",
|
|
|
data: {
|
|
|
- name: name ? name : "",
|
|
|
- size: 999,
|
|
|
- beginTimeBegin: this.nowTime
|
|
|
+ name: name ? name : "甘昱新",
|
|
|
+ page: this.page_my,
|
|
|
+ updateTimeBegin: this.nowTime
|
|
|
}
|
|
|
})
|
|
|
// console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
- this.list2 = res.data.list
|
|
|
+ this.list2 = [...this.list2, ...res.data.list]
|
|
|
+ this.total_my = res.data.total
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 点击日历日期回调
|
|
|
change(e) {
|
|
|
- console.log('change 返回:', e.fulldate)
|
|
|
+ // console.log('change 返回:', e.fulldate)
|
|
|
this.nowTime = e.fulldate + " " + "00:00:00"
|
|
|
- this.getRulesList()
|
|
|
+ if (this.current == 0) {
|
|
|
+ this.getProportion()
|
|
|
+ } else {
|
|
|
+ this.page_my = 1
|
|
|
+ this.getRulesList()
|
|
|
+ }
|
|
|
},
|
|
|
+ // 分段器点击回调
|
|
|
onClickItem(e) {
|
|
|
- console.log(e.currentIndex);
|
|
|
+ this.fail_count = ""
|
|
|
+ this.success_count = ""
|
|
|
+ this.list2 = []
|
|
|
+ this.errList = []
|
|
|
+ // console.log(e.currentIndex);
|
|
|
this.current = e.currentIndex
|
|
|
- // if (e.currentIndex == 0) {
|
|
|
- // this.list = this.list2
|
|
|
- // } else {
|
|
|
- // this.list = this.list3
|
|
|
- // }
|
|
|
+ if (e.currentIndex == 0) {
|
|
|
+ this.getMonthTimes_team()
|
|
|
+ this.getProportion()
|
|
|
+ this.getErrList()
|
|
|
+ } else {
|
|
|
+ this.getMonthTimes()
|
|
|
+ this.getRulesList()
|
|
|
+ }
|
|
|
},
|
|
|
+
|
|
|
// 跳转统计详情页面
|
|
|
goToDetail() {
|
|
|
if (this.current == 1) {
|
|
|
@@ -307,6 +391,8 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ // 往后选择年份回调
|
|
|
handleDoubleLeft() {
|
|
|
if (this.year <= 2000) {
|
|
|
uni.showToast({
|
|
|
@@ -315,8 +401,28 @@
|
|
|
})
|
|
|
} else {
|
|
|
this.year -= 1
|
|
|
+ this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
|
|
|
+ this.page = 1
|
|
|
+ this.errList = []
|
|
|
+ this.getErrList()
|
|
|
}
|
|
|
},
|
|
|
+ // 往前选择年份回调
|
|
|
+ handleDoubleRight() {
|
|
|
+ if (this.year >= 2025) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "不能选择2025年之后",
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.year += 1
|
|
|
+ this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
|
|
|
+ this.page = 1
|
|
|
+ this.errList = []
|
|
|
+ this.getErrList()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 往后选择月份回调
|
|
|
handleLeft() {
|
|
|
if (this.month <= 1) {
|
|
|
if (this.year <= 2000) {
|
|
|
@@ -327,12 +433,20 @@
|
|
|
} else {
|
|
|
this.year -= 1
|
|
|
this.month = 12
|
|
|
+ this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
|
|
|
+ this.page = 1
|
|
|
+ this.errList = []
|
|
|
+ this.getErrList()
|
|
|
}
|
|
|
} else {
|
|
|
this.month -= 1
|
|
|
+ this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
|
|
|
+ this.page = 1
|
|
|
+ this.errList = []
|
|
|
+ this.getErrList()
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ // 往前选择月份回调
|
|
|
handleRight() {
|
|
|
if (this.month >= 12) {
|
|
|
if (this.year >= 2025) {
|
|
|
@@ -343,21 +457,20 @@
|
|
|
} else {
|
|
|
this.year += 1
|
|
|
this.month = 1
|
|
|
+ this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
|
|
|
+ this.page = 1
|
|
|
+ this.errList = []
|
|
|
+ this.getErrList()
|
|
|
}
|
|
|
} else {
|
|
|
this.month += 1
|
|
|
+ this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
|
|
|
+ this.page = 1
|
|
|
+ this.errList = []
|
|
|
+ this.getErrList()
|
|
|
}
|
|
|
},
|
|
|
- handleDoubleRight() {
|
|
|
- if (this.year >= 2025) {
|
|
|
- uni.showToast({
|
|
|
- title: "不能选择2025年之后",
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.year += 1
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -673,6 +786,22 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .e_list2 {
|
|
|
+ margin: 0 auto;
|
|
|
+ margin-top: 200rpx;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 480rpx;
|
|
|
+ height: 508rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .info {
|
|
|
+ padding-bottom: 50rpx;
|
|
|
+ color: #5792F0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|