| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687 |
- <template>
- <view class="container">
- <!-- 顶部分段器区域 -->
- <view class="control" v-if="flag">
- <uni-segmented-control :current="current" :values="items" styleType="text" @clickItem="onClickItem"
- activeColor="#0082FC"></uni-segmented-control>
- </view>
- <!-- 头部月份区域 -->
- <view class="header">
- <view class="title">
- <view class="month">
- {{month}}月汇总
- </view>
- <view class="right" @click="goToDetail">
- <img src="../../static/right.png" alt="">
- </view>
- </view>
- <view class="state">
- <view class="err">
- <view class="number">
- {{fail_count}}
- </view>
- <view class="mes">
- 异常次数(次)
- </view>
- </view>
- <view class="success">
- <view class="number">
- {{success_count}}
- </view>
- <view class="mes">
- 打卡成功(次)
- </view>
- </view>
- </view>
- </view>
- <!-- 日历区域 -->
- <view class="calendar">
- <view class="calendar_title">
- 每日记录
- <span>({{month}}月)</span>
- </view>
- <view class="calendar_body">
- <uni-calendar :showMonth="false" @change="change" :selected="list" />
- </view>
- <view class="calendar_foot" v-if="current==1">
- <!-- 每一条记录区域 -->
- <view class="foot_item" v-for="item in list2" :key="item.id">
- <view>
- 规则:{{item.ruleName}} {{item.timeRange}}
- </view>
- <view class="box">
- <view class="circular" v-if="item.finish"></view>
- <view class="circular color" v-else></view>
- {{item.finish?"已打卡":"未打卡"}}
- <span v-if="item.finish">{{item.updateTime}}</span>
- </view>
- </view>
- </view>
- <!-- 环形图区域 -->
- <view class="progress" v-if="current==0">
- <view class="chart">
- <progressBar :progress_txt="progress_txt" :progress_total="progress_total" />
- </view>
- <view class="look">
- <view class="info">
- 查看明细
- </view>
- <img src="../../static/right.png">
- </view>
- </view>
- </view>
- <!-- 异常人员名单区域 -->
- <view class="errPeople" v-if="current==0">
- <!-- 标题区域 -->
- <view class="e_header">
- <view class="left">
- 异常人员名单
- </view>
- <view class="right">
- <view class="icon">
- <img src="../../static/notice.png">
- </view>
- <view class="info">
- 通知
- </view>
- </view>
- </view>
- <!-- 选择时间区域 -->
- <view class="e_calendar">
- <!-- 双左箭头区域 -->
- <view class="double" @click="handleDoubleLeft">
- <img src="../../static/double_left.png">
- </view>
- <!-- 左箭头区域区域 -->
- <view class="single" @click="handleLeft">
- <img src="../../static/left.png">
- </view>
- <!-- 时间区域 -->
- <view class="time">
- {{year}}-{{comMonth}}
- </view>
- <!-- 双右箭头区域 -->
- <view class="single2" @click="handleRight">
- <img src="../../static/right2.png">
- </view>
- <!-- 右箭头区域 -->
- <view class="double" @click="handleDoubleRight">
- <img src="../../static/double_right.png">
- </view>
- </view>
- <view class="e_list">
- <view class="e_box" v-for="item in errList" :key="item.id">
- <view class="e_img">
- <img :src="item.peopleImg">
- </view>
- <view class="e_name">
- {{item.name}}
- </view>
- <view class="e_msg">
- 未打卡{{item.num}}次
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import progressBar from '../../components/chocolate-progress-bar/chocolate-progress-bar.vue'
- export default {
- components: {
- progressBar
- },
- data() {
- return {
- flag: false,
- // 有标记点的数组日期
- list: [{
- date: "2022-12-20",
- info: ''
- },
- {
- date: "2022-12-21",
- info: '',
- data: {
- custom: '自定义信息',
- name: '自定义消息头'
- }
- },
- {
- date: "2022-12-22",
- info: ''
- }
- ],
- // 考勤规则列表
- 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"
- },
- ],
- 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,
- // 当前时间
- nowTime: "",
- // 打卡异常次数
- fail_count: 0,
- // 打卡成功次数
- success_count: 0
- };
- },
- onLoad() {
- if (this.flag) {
- this.current = 0
- }
- this.getTime()
- this.getMonthTimes()
- this.getRulesList()
- },
- computed: {
- comMonth() {
- if (this.month) {
- let month = this.month < 10 ? '0' + this.month : this.month
- return month
- }
- }
- },
- methods: {
- // 获取当前年 月 日
- getTime() {
- let date = new Date()
- 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
- },
- // 获取我的月打卡次数
- async getMonthTimes() {
- let res = await this.$myRequest({
- url: "/attendance/api/sign/check/in/month/times",
- data: {
- time: this.nowTime
- }
- })
- // console.log(res);
- if (res.code == 200) {
- this.fail_count = res.data.fail
- this.success_count = res.data.success
- }
- },
- // 获取打卡规则列表
- 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
- }
- })
- // console.log(res);
- if (res.code == 200) {
- this.list2 = res.data.list
- }
- },
- // 点击日历日期回调
- change(e) {
- console.log('change 返回:', e.fulldate)
- this.nowTime = e.fulldate + " " + "00:00:00"
- this.getRulesList()
- },
- onClickItem(e) {
- console.log(e.currentIndex);
- this.current = e.currentIndex
- // if (e.currentIndex == 0) {
- // this.list = this.list2
- // } else {
- // this.list = this.list3
- // }
- },
- // 跳转统计详情页面
- goToDetail() {
- if (this.current == 1) {
- uni.navigateTo({
- url: `/pages/statDetail/statDetail?month=${this.month}`
- })
- } else {
- uni.navigateTo({
- url: "/pages/particulars/particulars"
- })
- }
- },
- handleDoubleLeft() {
- if (this.year <= 2000) {
- uni.showToast({
- title: "不能选择2000年之前",
- icon: 'none'
- })
- } else {
- this.year -= 1
- }
- },
- handleLeft() {
- if (this.month <= 1) {
- if (this.year <= 2000) {
- uni.showToast({
- title: "不能选择2000年之前",
- icon: 'none'
- })
- } else {
- this.year -= 1
- this.month = 12
- }
- } else {
- this.month -= 1
- }
- },
- handleRight() {
- if (this.month >= 12) {
- if (this.year >= 2025) {
- uni.showToast({
- title: "不能选择2025年之后",
- icon: 'none'
- })
- } else {
- this.year += 1
- this.month = 1
- }
- } else {
- this.month += 1
- }
- },
- handleDoubleRight() {
- if (this.year >= 2025) {
- uni.showToast({
- title: "不能选择2025年之后",
- icon: 'none'
- })
- } else {
- this.year += 1
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- padding-top: 20rpx;
- .control {
- margin-bottom: 20rpx;
- width: 750rpx;
- height: 90rpx;
- background-color: #fff;
- }
- .header {
- margin: 0 auto;
- width: 690rpx;
- height: 236rpx;
- background-color: #fff;
- .title {
- display: flex;
- height: 92rpx;
- .month {
- flex: 8;
- margin: 30rpx 0 0 30rpx;
- font-size: 32rpx;
- font-weight: 500
- }
- .right {
- display: flex;
- justify-content: center;
- align-items: center;
- flex: 1;
- img {
- width: 15rpx;
- height: 30rpx
- }
- }
- }
- .state {
- display: flex;
- height: 144rpx;
- .err {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .number {
- font-size: 46rpx;
- font-weight: 700;
- }
- .mes {
- font-size: 28rpx;
- color: #999999;
- }
- }
- .success {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .number {
- font-size: 46rpx;
- font-weight: 700;
- }
- .mes {
- font-size: 28rpx;
- color: #999999;
- }
- }
- }
- }
- .calendar {
- margin: 0 auto;
- margin-top: 30rpx;
- width: 693rpx;
- background-color: #fff;
- .calendar_title {
- padding-left: 30rpx;
- height: 100rpx;
- line-height: 100rpx;
- font-size: 32rpx;
- font-weight: 500;
- span {
- font-size: 26rpx;
- color: #999999
- }
- }
- .calendar_body {
- height: 690rpx;
- background-color: skyblue;
- }
- .calendar_foot {
- padding: 0 30rpx;
- .foot_item {
- box-sizing: border-box;
- padding: 30rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- height: 130rpx;
- font-size: 24rpx;
- color: #808080;
- .box {
- display: flex;
- align-items: center;
- .circular {
- margin-right: 18rpx;
- width: 12rpx;
- height: 12rpx;
- border-radius: 6rpx;
- background-color: #31C20E;
- }
- .color {
- background-color: #999999;
- }
- span {
- margin-left: 18rpx;
- }
- }
- }
- }
- .progress {
- position: relative;
- display: flex;
- justify-content: center;
- padding: 0 30rpx;
- height: 121px;
- .chart {
- margin-top: 20rpx;
- width: 170px;
- height: 100%;
- }
- .look {
- position: absolute;
- top: 40rpx;
- right: 36rpx;
- display: flex;
- align-items: center;
- width: 150rpx;
- height: 42rpx;
- .info {
- margin-right: 15rpx;
- font-size: 28rpx;
- color: #A6A6A6;
- }
- img {
- width: 16rpx;
- height: 24rpx;
- }
- }
- }
- }
- .errPeople {
- margin: 0 auto;
- margin-top: 32rpx;
- width: 690rpx;
- border-radius: 7rpx;
- background-color: #fff;
- .e_header {
- display: flex;
- align-items: center;
- width: 690rpx;
- height: 121rpx;
- .left {
- flex: 1;
- margin-left: 30rpx;
- font-size: 32rpx;
- font-weight: 500;
- }
- .right {
- flex: 1;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- margin-right: 32rpx;
- .icon {
- margin-right: 10rpx;
- width: 26rpx;
- height: 26rpx;
- line-height: 26rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .info {
- width: 56rpx;
- height: 41rpx;
- font-size: 28rpx;
- color: #2A82E4;
- }
- }
- }
- .e_calendar {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- .double {
- margin-right: 30rpx;
- width: 40rpx;
- height: 40rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .single {
- width: 40rpx;
- height: 40rpx;
- img {
- width: 80%;
- height: 70%;
- }
- }
- .single2 {
- margin-right: 30rpx;
- width: 40rpx;
- height: 40rpx;
- img {
- width: 100%;
- height: 70%;
- }
- }
- .time {
- width: 180rpx;
- height: 44rpx;
- font-size: 32rpx;
- text-align: center;
- }
- }
- .e_list {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-evenly;
- align-items: center;
- margin-top: 20rpx;
- padding: 30rpx;
- width: 630rpx;
- .e_box {
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- align-items: center;
- margin-bottom: 20rpx;
- width: 180rpx;
- height: 190rpx;
- .e_img {
- width: 100rpx;
- height: 100rpx;
- img {
- width: 100%;
- height: 100%;
- border-radius: 50%;
- }
- }
- .e_name {
- font-size: 28rpx;
- }
- .e_msg {
- font-size: 24rpx;
- color: #808080;
- }
- }
- }
- }
- }
- // 修改选中日期盒子圆角
- ::v-deep .uni-calendar-item--isDay {
- border-radius: 50rpx;
- }
- ::v-deep .uni-calendar-item--checked {
- border-radius: 50rpx;
- }
- </style>
|