| | |
| | | <template> |
| | | <div class="dashboard-container"> |
| | | <div class="dashboard-editor-container"> |
| | | <div style="text-align: right;"> |
| | | <el-date-picker v-model="yearMonth" type="month" placeholder="选择年月" @change="yearMonthChange" /> |
| | | </div> |
| | | <panel-group :user-info="userInfo" @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> |
| | |
| | | import dayGridPlugin from '@fullcalendar/daygrid' |
| | | import interactionPlugin from '@fullcalendar/interaction' |
| | | import timeGridPlugin from '@fullcalendar/timegrid' |
| | | import crudMeritWage from '@/api/treatment/meritWage' |
| | | import moment from 'moment' |
| | | |
| | | const lineChartData = { |
| | |
| | | } |
| | | }, |
| | | userInfo: {}, |
| | | meritWageList: [], |
| | | // 年月 |
| | | yearMonth: new Date() |
| | | } |
| | |
| | | calendarApi.today() |
| | | } |
| | | // this.calendarOptions.events = [{title: '上班打卡时间', color: 'red',start: '2023-01-28',date: '2023-01-28'}] |
| | | this.yearMonth = moment(calendarApi.view.currentStart).toString() |
| | | this.yearMonthChange() |
| | | this.getUserCalendarInfo(moment(calendarApi.view.currentStart).format('YYYY-MM-DD').toString()) |
| | | }, |
| | | // 获取打卡信息 |
| | |
| | | }, |
| | | // 获取用户信息 |
| | | getUserBaseInfo() { |
| | | this.meritWageList = [] |
| | | 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(dateStart) |
| | | crudUser.getUserBaseInfo(this.yearMonth).then(res => { |
| | | this.userInfo = res |
| | | crudMeritWage.getMeritWageDetail(this.userInfo.achievementsTime, new Date(this.yearMonth).getTime()).then(res => { |
| | | console.log(res) |
| | | for (var key in res) { |
| | | this.meritWageList.push('距离' + key + '级业绩标准还有:') |
| | | this.meritWageList.push(Number(res[key])) |
| | | this.meritWageList.push(dateObject.getTime()) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | // 年月变更 |