| | |
| | | <label>统计维度:</label> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-radio-group v-model="reportType" size="mini" disabled> |
| | | <el-radio-group @change="()=>{this.reportDate = null}" v-model="reportType" size="mini"> |
| | | <el-radio label="YEAR">年度</el-radio> |
| | | <el-radio label="MONTH">月度</el-radio> |
| | | </el-radio-group> |
| | |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-date-picker |
| | | v-if="reportType==='YEAR'" |
| | | size="small" |
| | | v-model="reportDateRange" |
| | | v-model="reportDate" |
| | | style="width:100%" |
| | | @change="changeReportDateRange" |
| | | type="datetimerange" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | :default-time="['00:00:00','23:59:59']" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | type="year" |
| | | format="yyyy" |
| | | value-format="yyyy" |
| | | placeholder="请选择年份"> |
| | | </el-date-picker> |
| | | <el-date-picker |
| | | v-if="reportType==='MONTH'" |
| | | size="small" |
| | | v-model="reportDate" |
| | | style="width:100%" |
| | | type="month" |
| | | format="yyyy-MM" |
| | | value-format="yyyy-MM" |
| | | placeholder="请选择月份"> |
| | | </el-date-picker> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | reportDateRange:[], |
| | | reportDate: null, |
| | | reportType:"MONTH", |
| | | attendanceRecordVisible:false, |
| | | syncDateRange:[], |
| | |
| | | window.removeEventListener("resize",this.resizeHandler) |
| | | }, |
| | | methods: { |
| | | changeReportDateRange(val){ |
| | | //判断时间区间是否超过一个月 |
| | | if(val && val.length===2){ |
| | | const flag = isOverOneMonth(val[0],val[1]); |
| | | this.reportType = flag?'YEAR':'MONTH' |
| | | } |
| | | }, |
| | | openAttendanceRecordDialog (){ |
| | | this.reportDateRange = getTimeRange() |
| | | this.$nextTick(()=>{ |
| | | this.attendanceRecordVisible = true |
| | | }) |
| | | this.attendanceRecordVisible = true |
| | | }, |
| | | //导出考勤记录 |
| | | exportStaffAttendanceRecords(){ |
| | | this.exportLoading = true |
| | | let params = { |
| | | attendanceReportType:this.reportType, |
| | | } |
| | | if (this.reportDateRange && this.reportDateRange.length === 2) { |
| | | params.startDate = this.reportDateRange[0]; |
| | | params.endDate = this.reportDateRange[1]; |
| | | } else { |
| | | params.startDate = ""; |
| | | params.endDate = ""; |
| | | reportDate: this.reportDate, |
| | | keyword: this.queryParams.keyword |
| | | } |
| | | exportStaffAttendanceRecords({...params}).then(res=>{ |
| | | transformExcel(res, "中天耐丝质量考勤汇总.xlsx") |