| | |
| | | <template> |
| | | <div class="dashboard-container"> |
| | | <div class="dashboard-editor-container"> |
| | | <panel-group :user-info="userInfo" :merit-wage-list="meritWageList" @handleSetLineChartData="handleSetLineChartData" /> |
| | | <panel-group |
| | | :user-info="userInfo" |
| | | :merit-wage-list="meritWageList" |
| | | @handleSetLineChartData="handleSetLineChartData" |
| | | /> |
| | | <el-row style="background: #fff; padding: 16px;"> |
| | | <FullCalendar ref="fullCalendar" :options="calendarOptions" /> |
| | | </el-row> |
| | |
| | | } else { |
| | | calendarApi.today() |
| | | } |
| | | // this.calendarOptions.events = [{title: '上班打卡时间', color: 'red',start: '2023-01-28',date: '2023-01-28'}] |
| | | this.yearMonth = moment(calendarApi.view.currentStart).toString() |
| | | console.log('变化变化:' + this.yearMonth) |
| | | |
| | | const date = moment(calendarApi.view.currentStart).toDate() |
| | | date.setMonth(date.getMonth() + 1) |
| | | date.setDate(0) |
| | | date.setHours(23, 59, 59, 999) |
| | | this.yearMonth = date |
| | | |
| | | this.yearMonthChange() |
| | | this.getUserCalendarInfo(moment(calendarApi.view.currentStart).format('YYYY-MM-DD').toString()) |
| | | this.getUserCalendarInfo( |
| | | moment(calendarApi.view.currentStart) |
| | | .format('YYYY-MM-DD') |
| | | .toString() |
| | | ) |
| | | }, |
| | | // 获取打卡信息 |
| | | getUserCalendarInfo(month) { |
| | | crudUser.getUserCalendarInfo(month).then(res => { |
| | | console.log('res', res) |
| | | this.calendarOptions.events = res.map(function(obj) { |
| | | // obj.start = obj.date |
| | | obj.color = obj.isOk ? 'green' : 'red' |
| | | // obj.date1 = obj.date |
| | | return obj |
| | | crudUser |
| | | .getUserCalendarInfo(month) |
| | | .then(res => { |
| | | this.calendarOptions.events = res.map(function(obj) { |
| | | // obj.start = obj.date |
| | | obj.color = obj.isOk ? 'green' : 'red' |
| | | // obj.date1 = obj.date |
| | | return obj |
| | | }) |
| | | setTimeout(() => { |
| | | // console.log(this.calendarOptions.events); |
| | | }, 1000) |
| | | }) |
| | | setTimeout(() => { |
| | | console.log(this.calendarOptions.events) |
| | | }, 1000) |
| | | }).catch(() => { |
| | | this.calendarOptions.events = [] |
| | | }) |
| | | .catch(() => { |
| | | this.calendarOptions.events = [] |
| | | }) |
| | | }, |
| | | // 日期点击 |
| | | handleDateClick(selectInfo) { |
| | | console.log('handleDateClick.info:', selectInfo) |
| | | // console.log("handleDateClick.info:", selectInfo); |
| | | }, |
| | | // 日程点击信息展示 |
| | | handleEventClick(info) { |
| | |
| | | query: { date: info.event._def.extendedProps.date1 } |
| | | }) |
| | | } else { |
| | | this.$router.push({ path: '/task/taskDaliy', query: { date: info.event._def.extendedProps.date1 }}) |
| | | this.$router.push({ |
| | | path: '/task/taskDaliy', |
| | | query: { date: info.event._def.extendedProps.date1 } |
| | | }) |
| | | } |
| | | }, |
| | | // 获取用户信息 |
| | | getUserBaseInfo() { |
| | | // var date = new Date() |
| | | // date.setDate(1) |
| | | // var dateStart = date.getFullYear() + '-' + (date.getMonth() + 2) + '-' + date.getDate() |
| | | // if (dateStart.split('-')[1] > 12) { |
| | | // dateStart = date.getFullYear() + 1 + '-1-1' |
| | | // } |
| | | var dateObject = new Date(this.yearMonth) |
| | | crudUser.getUserBaseInfo(this.yearMonth).then(res => { |
| | | this.userInfo = res |
| | | this.meritWageList = [] |
| | | crudMeritWage.getMeritWageDetail(this.userInfo.achievementsTime, new Date(this.yearMonth).getTime()).then(res => { |
| | | for (var key in res) { |
| | | this.meritWageList.push('距离' + key + '级业绩标准还有:') |
| | | this.meritWageList.push(Number(res[key])) |
| | | this.meritWageList.push(dateObject.getTime()) |
| | | this.meritWageList.push(res.money + '元') |
| | | } |
| | | }) |
| | | crudMeritWage |
| | | .getMeritWageDetail( |
| | | this.userInfo.achievementsTime, |
| | | new Date(this.yearMonth).getTime() |
| | | ) |
| | | .then(res => { |
| | | for (var key in res) { |
| | | this.meritWageList.push('距离' + key + '级业绩标准还有:') |
| | | this.meritWageList.push(Number(res[key])) |
| | | this.meritWageList.push(dateObject.getTime()) |
| | | this.meritWageList.push(res.money + '元') |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | // 年月变更 |
| | |
| | | </script> |
| | | |
| | | <style rel="stylesheet/scss" lang="scss" scoped> |
| | | .dashboard-editor-container { |
| | | padding: 32px; |
| | | background-color: rgb(240, 242, 245); |
| | | position: relative; |
| | | .dashboard-editor-container { |
| | | padding: 32px; |
| | | background-color: rgb(240, 242, 245); |
| | | position: relative; |
| | | |
| | | .github-corner { |
| | | position: absolute; |
| | | top: 0; |
| | | border: 0; |
| | | right: 0; |
| | | } |
| | | |
| | | .search-wrapper { |
| | | text-align: right; |
| | | } |
| | | |
| | | .chart-wrapper { |
| | | background: #fff; |
| | | padding: 16px 16px 0; |
| | | margin-bottom: 32px; |
| | | overflow: auto; |
| | | } |
| | | .github-corner { |
| | | position: absolute; |
| | | top: 0; |
| | | border: 0; |
| | | right: 0; |
| | | } |
| | | |
| | | @media (max-width:1024px) { |
| | | .chart-wrapper { |
| | | padding: 8px; |
| | | } |
| | | .search-wrapper { |
| | | text-align: right; |
| | | } |
| | | |
| | | .chart-wrapper { |
| | | background: #fff; |
| | | padding: 16px 16px 0; |
| | | margin-bottom: 32px; |
| | | overflow: auto; |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 1024px) { |
| | | .chart-wrapper { |
| | | padding: 8px; |
| | | } |
| | | } |
| | | </style> |