| | |
| | | <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button> |
| | | </div> |
| | | <div class="search_thing btns" style="padding-left: 30px;"> |
| | | <el-button size="small" type="primary" v-if="downPower">导 出</el-button> |
| | | <el-button size="small" type="primary" v-if="downPower" @click="handleDown" :loading="downLoading">导 出</el-button> |
| | | <el-button size="small" type="primary" @click="schedulingVisible = true" v-if="addPower">排 班</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="center" v-loading="pageLoading"> |
| | | <scroll-pagination @load="init" :finishLoding="finishLoding" v-show="query.month&&list.length>0" style="height: 100%;" :key="'123'"> |
| | | <scroll-pagination @load="init" :finishLoding="finishLoding" v-show="query.month&&list.length>0" style="height: 100%;" :key="'123'" :list="list"> |
| | | <div class="clearfix"> |
| | | <div class="fixed-left"> |
| | | <div class="content-title" style="padding-left: 16px;box-sizing: border-box;"> |
| | |
| | | <div class="user-pic">{{ item.name.charAt(0) }}</div> |
| | | <div class="user-info"> |
| | | <p style="font-size: 14px;color: #3A7BFA;line-height: 24px;">{{ item.name }}</p> |
| | | <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;overflow-x: show;">早: {{ item.day0 }}, 中: {{ item.day1 }}, 夜: {{ item.day2 }}, 休: {{ item.day3 }}, 假: {{ item.day4 }}</p> |
| | | <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;overflow-x: show;">早:{{ item.day0 }},中:{{ item.day1 }},夜:{{ item.day2 }},休:{{ item.day3 }},假:{{ item.day4 }},差:{{ item.day6 }}</p> |
| | | <p style="margin-top: 4px;"><span style="color: #999999;font-size: 12px;display: inline-block;transform: scale(0.8) translateX(-10px);">合计出勤: </span><span style="font-size: 16px; |
| | | color: #FF4902;">{{ query.month?item.monthlyAttendance |
| | | .totalAttendance:item.sidebarAnnualAttendance |
| | |
| | | <span class="month" style="position: absolute;top: 4px;" v-if="item.week=='周日'">{{ item.weekNum }}周</span> |
| | | <p style="height: 26px;position: absolute;bottom: 12px;"> |
| | | <span class="day">{{ item.day }}</span> |
| | | <span class="week">{{ item.week }}</span> |
| | | <span class="week">{{ item.week.charAt(1) }}</span> |
| | | </p> |
| | | </div> |
| | | </div> |
| | |
| | | v-on:mouseenter="onMouseEnter(index)" |
| | | v-on:mouseleave="currentUserIndex=null"> |
| | | <div class="content-body-item" v-for="(m,i) in item.list" :key="'d'+i" :class="{hoverType:currentUserIndex==index}"> |
| | | <div class="work-box" :class="{type0:m.shift==='0',type1:m.shift==='1',type2:m.shift==='2',type3:m.shift==='3',type4:m.shift==='4',}"> |
| | | <!-- <div class="work-box-left"> |
| | | <span>{{ getShiftByDic(m.shift) }}</span> |
| | | </div> --> |
| | | <el-dropdown trigger="click" placement="bottom" @command="e=>handleCommand(e,m)" :disabled="!downPower"> |
| | | <!-- <i class="el-icon-arrow-down el-icon--right" style="font-size: 20px;color: #fff;cursor: pointer;"></i> --> |
| | | <span style="cursor: pointer;">{{ getShiftByDic(m.shift) }}</span> |
| | | <el-dropdown trigger="click" placement="bottom" @command="e=>handleCommand(e,m)" :disabled="!upPower" style="width: 100%;height: 100%;cursor: pointer;"> |
| | | <div class="work-box" :class="{type0:m.shift==='0',type1:m.shift==='1',type2:m.shift==='2',type3:m.shift==='3',type4:m.shift==='4',type5:m.shift==='5',type6:m.shift==='6'}"> |
| | | <span style="cursor: pointer;" :style="`opacity: ${getShiftByDic(m.shift)=='无'?0:1};`">{{ getShiftByDic(m.shift) }}</span> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item v-for="(n,j) in classType" :key="'h'+j" :command="n.value">{{ n.label }}</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </scroll-pagination> |
| | | <scroll-pagination @load="initYear" :finishLoding="finishLoding" v-show="!query.month&&yearList.length>0" style="width: 100%;" :key="'111'"> |
| | | <scroll-pagination @load="initYear" :finishLoding="finishLoding" v-show="!query.month&&yearList.length>0" style="width: 100%;" :key="'111'" :list="yearList"> |
| | | <div class="clearfix year-table"> |
| | | <div class="fixed-left"> |
| | | <div class="content-title" style="padding-left: 16px;box-sizing: border-box;"> |
| | |
| | | <div class="user-pic">{{ item.name.charAt(0) }}</div> |
| | | <div class="user-info"> |
| | | <p style="font-size: 14px;color: #3A7BFA;line-height: 24px;">{{ item.name }}</p> |
| | | <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;overflow-x: show;">早: {{ item.day0 }}, 中: {{ item.day1 }}, 夜: {{ item.day2 }}, 休: {{ item.day3 }}, 假: {{ item.day4 }}</p> |
| | | <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;overflow-x: show;">早:{{ item.day0 }},中:{{ item.day1 }},夜:{{ item.day2 }},休:{{ item.day3 }},假:{{ item.day4 }},差:{{ item.day6 }}</p> |
| | | <p style="margin-top: 4px;"><span style="color: #999999;font-size: 12px;display: inline-block;transform: scale(0.8) translateX(-10px);">合计出勤: </span><span style="font-size: 16px; |
| | | color: #FF4902;">{{ item.work_time }}天</span></p> |
| | | </div> |
| | |
| | | <div class="content-body-item" v-for="(m,i) in item.monthList" :key="'d'+i" :class="{hoverType:currentUserIndex==index}"> |
| | | <p style="color:rgb(153, 153, 153);font-size: 12px;">合计出勤:<span style="font-size: 14px;color:#000">{{ m.totalMonthAttendance }}</span></p> |
| | | <p style="color:rgb(153, 153, 153);font-size: 12px;"> |
| | | 早: {{ m.day0 }}, 中: {{ m.day1 }}, 夜: {{ m.day2 }}, 休: {{ m.day3 }}, 假: {{ m.day4 }} |
| | | 早:{{ m.day0 }},中:{{ m.day1 }},夜:{{ m.day2 }},休:{{ m.day3 }},假:{{ m.day4 }},差:{{ m.day6 }} |
| | | </p> |
| | | </div> |
| | | </div> |
| | |
| | | pageLoading: false, // 组件loading的展示,默认为true |
| | | finishLoding: false, // 加载完成,显示已经没有更多了 |
| | | monthList:[], |
| | | yearList:[] |
| | | yearList:[], |
| | | downLoading:false, |
| | | keyMap:{}, |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | refresh(){ |
| | | this.list = []; |
| | | this.yearList = [] |
| | | this.keyMap = {}; |
| | | this.finishLoding = false; |
| | | this.currentPage = 1 |
| | | this.query = { |
| | | userName:'', |
| | |
| | | } |
| | | }, |
| | | refreshTable(){ |
| | | this.keyMap = {}; |
| | | this.currentPage = 1 |
| | | this.finishLoding = false; |
| | | if(this.query.month){ |
| | | this.list = []; |
| | | this.init() |
| | |
| | | } |
| | | }, |
| | | init(){ |
| | | const key = `_${this.currentPage}` |
| | | const value = this.keyMap[key] |
| | | // 如果value存在,表示缓存有值,那么阻止请求 |
| | | if(value) { |
| | | return |
| | | } |
| | | // value不存在,表示第一次请求,设置占位 |
| | | this.keyMap[key] = 'temp' |
| | | if(this.currentPage==1){ |
| | | this.pageLoading = true |
| | | } |
| | |
| | | }) |
| | | }, |
| | | initYear(){ |
| | | const key = `_${this.currentPage}` |
| | | const value = this.keyMap[key] |
| | | // 如果value存在,表示缓存有值,那么阻止请求 |
| | | if(value) { |
| | | return |
| | | } |
| | | // value不存在,表示第一次请求,设置占位 |
| | | this.keyMap[key] = 'temp' |
| | | // pageYear |
| | | if(this.currentPage==1){ |
| | | this.pageLoading = true |
| | |
| | | this.refresh() |
| | | }) |
| | | }, |
| | | handleDown(){ |
| | | let year = this.query.year.getFullYear() |
| | | let time = ''; |
| | | if(this.query.month){ |
| | | let month = this.query.month>9?this.query.month:'0'+this.query.month |
| | | time = year+'-'+month+'-01 00:00:00' |
| | | }else{ |
| | | time = year+'-01-01 00:00:00' |
| | | } |
| | | this.downLoading = true |
| | | this.$axios.get(this.$api.performanceShift.export+`?time=${time}&userName=${this.query.userName}&laboratory=${this.query.laboratory}&isMonth=${this.query.month?true:false}`,{responseType: 'blob'}).then(res => { |
| | | this.$message.success('下载成功') |
| | | this.downLoading = false |
| | | const blob = new Blob([res], { |
| | | type: 'application/force-download' |
| | | }) |
| | | let fileName=""; |
| | | if(this.query.month){ |
| | | fileName = year +'-'+this.query.month+' 班次信息' |
| | | }else{ |
| | | fileName = year+' 班次汇总' |
| | | } |
| | | const filename = decodeURI(fileName+'.xlsx') |
| | | // 创建一个超链接,将文件流赋进去,然后实现这个超链接的单击事件 |
| | | const elink = document.createElement('a') |
| | | elink.download = filename |
| | | elink.style.display = 'none' |
| | | elink.href = URL.createObjectURL(blob) |
| | | document.body.appendChild(elink) |
| | | elink.click() |
| | | URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | document.body.removeChild(elink) |
| | | }) |
| | | }, |
| | | selectEnumByCategory() { |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "班次类型" |
| | |
| | | if(obj){ |
| | | return obj.label |
| | | } |
| | | return '未排班' |
| | | return '无' |
| | | }, |
| | | scrollInit() { |
| | | // 获取要绑定事件的元素 |
| | | const nav = document.getElementById("nav") |
| | | var flag; // 鼠标按下 |
| | | var downX; // 鼠标点击的x下标 |
| | | var scrollLeft; // 当前元素滚动条的偏移量 |
| | | nav.addEventListener("mousedown", function(event) { |
| | | flag = true; |
| | | downX = event.clientX; // 获取到点击的x下标 |
| | | scrollLeft = this.scrollLeft; // 获取当前元素滚动条的偏移量 |
| | | }); |
| | | nav.addEventListener("mousemove", function(event) { |
| | | if (flag) { // 判断是否是鼠标按下滚动元素区域 |
| | | var moveX = event.clientX; // 获取移动的x轴 |
| | | var scrollX = moveX - downX; // 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离 |
| | | this.scrollLeft = scrollLeft - scrollX // 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离 |
| | | } |
| | | }); |
| | | // 鼠标抬起停止拖动 |
| | | nav.addEventListener("mouseup", function() { |
| | | flag = false; |
| | | }); |
| | | // 鼠标离开元素停止拖动 |
| | | nav.addEventListener("mouseleave", function(event) { |
| | | flag = false; |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | min-height: calc(100% - 10px); /* 视口高度 */ |
| | | margin-left: 220px; |
| | | overflow-x: scroll; |
| | | /* overflow-x: hidden; */ |
| | | } |
| | | |
| | | .content { |
| | |
| | | } |
| | | .content-title-item{ |
| | | height: 100%; |
| | | width: 60px; |
| | | width: 50px; |
| | | flex-shrink: 0; |
| | | border-bottom: 1px solid #EEEEEE; |
| | | box-sizing: border-box; |
| | |
| | | } |
| | | .content-body-item{ |
| | | height: 70px; |
| | | width: 60px; |
| | | width: 50px; |
| | | flex-shrink: 0; |
| | | font-size: 12px; |
| | | box-sizing: border-box; |
| | | padding: 4px; |
| | | border-right: 1px solid #EEEEEE; |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-around; |
| | | background: #F5F7FB; |
| | | background: #edeff2; |
| | | border-radius: 8px 8px 8px 8px; |
| | | color: #999; |
| | | font-size: 14px; |
| | |
| | | } |
| | | .work-box.type4 span{ |
| | | color: #F56C6C !important; |
| | | } |
| | | .work-box.type5{ |
| | | background: #ff46c145; |
| | | color: #ff46c0 !important; |
| | | } |
| | | .work-box.type5 span{ |
| | | color: #ff46c0 !important; |
| | | } |
| | | .work-box.type6{ |
| | | background: #00036418; |
| | | color: #000464 !important; |
| | | } |
| | | .work-box.type6 span{ |
| | | color: #000464 !important; |
| | | } |
| | | /* .el-icon-arrow-down::before{ |
| | | color: #c6c4c4; |
| | |
| | | margin-left: 10px; |
| | | } |
| | | .hoverType{ |
| | | background: rgba(58,123,250,0.05); |
| | | background: rgba(58,123,250,0.03); |
| | | } |
| | | .year-table{ |
| | | width: 100%; |