| | |
| | | size="small" |
| | | format="yyyy" |
| | | placeholder="选择年" |
| | | @change="refreshTable()" |
| | | style="width: 140px;" |
| | | :clearable="false"> |
| | | </el-date-picker> |
| | |
| | | clearable |
| | | placeholder="选择月" |
| | | style="width: 140px;margin-left: 16px;" |
| | | size="small"> |
| | | size="small" |
| | | @change="refreshTable()"> |
| | | <el-option |
| | | v-for="item in monthOptions" |
| | | :key="item.value" |
| | |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input v-model="query.userName" placeholder="请输入人员名称" size="small" style="width: 140px;margin: 0 16px;" clearable ></el-input> |
| | | <el-select v-model="query.laboratory" placeholder="请选择实验室" style="width: 140px;" size="small" clearable > |
| | | <el-input v-model="query.userName" placeholder="请输入人员名称" size="small" style="width: 140px;margin: 0 16px;" clearable @keyup.enter.native="refreshTable()"></el-input> |
| | | <el-select v-model="query.laboratory" placeholder="请选择实验室" style="width: 140px;" size="small" clearable @change="refreshTable()"> |
| | | <el-option |
| | | v-for="item in laboratory" |
| | | :key="item.value" |
| | |
| | | <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"> |
| | | <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&&list.length>0" style="width: 100%;"> |
| | | <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> |
| | |
| | | </div> |
| | | </div> |
| | | </scroll-pagination> |
| | | <span style="color:#909399;font-size:14px;position: absolute;left:50%;top: 50%;transform: translate(-59%,-50%);" v-if="list.length==0">暂无数据</span> |
| | | <span style="color:#909399;font-size:14px;position: absolute;left:50%;top: 50%;transform: translate(-59%,-50%);" v-if="(query.month&&list.length==0)||(!query.month&&yearList.length==0)">暂无数据</span> |
| | | </div> |
| | | <el-dialog title="排班" :visible.sync="schedulingVisible" width="400px"> |
| | | <div class="search_thing"> |
| | | <div class="search_label" style="width:90px">周次:</div> |
| | | <div class="search_input"> |
| | | <div class="search_label" style="width:90px"><span style="color: red;margin-right: 4px;">*</span>周次:</div> |
| | | <div class="search_input" style="width: calc(100% - 90px);"> |
| | | <el-date-picker |
| | | v-model="schedulingQuery.week" |
| | | type="week" |
| | | format="yyyy 第 WW 周" |
| | | placeholder="选择周次" style="width: 203px;"> |
| | | placeholder="选择周次" style="width: 100%"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label" style="width:90px">人员名称:</div> |
| | | <div class="search_input"> |
| | | <div class="search_label" style="width:90px"><span style="color: red;margin-right: 4px;">*</span>人员名称:</div> |
| | | <div class="search_input" style="width: calc(100% - 90px);"> |
| | | <el-select v-model="schedulingQuery.userId" placeholder="请选择" style="width: 100%;" multiple clearable collapse-tags > |
| | | <el-option |
| | | v-for="item in personList" |
| | |
| | | </div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label" style="width:90px">班次:</div> |
| | | <div class="search_input"> |
| | | <div class="search_label" style="width:90px"><span style="color: red;margin-right: 4px;">*</span>班次:</div> |
| | | <div class="search_input" style="width: calc(100% - 90px);"> |
| | | <el-select v-model="schedulingQuery.shift" placeholder="请选择" style="width: 100%;"> |
| | | <el-option |
| | | v-for="item in classType" |
| | |
| | | pageLoading: false, // 组件loading的展示,默认为true |
| | | finishLoding: false, // 加载完成,显示已经没有更多了 |
| | | monthList:[], |
| | | yearList:[] |
| | | yearList:[], |
| | | downLoading:false, |
| | | keyMap:{}, |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | // } |
| | | // this.monthList.reverse() |
| | | // }, |
| | | 'query.month'(val){ |
| | | if(!val){ |
| | | this.currentPage = 1; |
| | | this.yearList = [] |
| | | this.initYear() |
| | | } |
| | | } |
| | | // 'query.month'(val){ |
| | | // if(!val){ |
| | | // this.currentPage = 1; |
| | | // this.yearList = [] |
| | | // this.initYear() |
| | | // } |
| | | // } |
| | | }, |
| | | mounted(){ |
| | | this.selectEnumByCategory() |
| | |
| | | refresh(){ |
| | | this.list = []; |
| | | this.yearList = [] |
| | | this.keyMap = {}; |
| | | this.finishLoding = false; |
| | | this.currentPage = 1 |
| | | this.query = { |
| | | userName:'', |
| | |
| | | } |
| | | }, |
| | | refreshTable(){ |
| | | this.list = []; |
| | | this.yearList = [] |
| | | this.keyMap = {}; |
| | | this.currentPage = 1 |
| | | this.finishLoding = false; |
| | | if(this.query.month){ |
| | | this.list = []; |
| | | this.init() |
| | | }else{ |
| | | this.yearList = [] |
| | | this.initYear() |
| | | } |
| | | }, |
| | | 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 |
| | |
| | | let obj = {} |
| | | for (let key in item.month[m]) { |
| | | let type = this.getDayByDic(key) |
| | | console.log(type) |
| | | if(type!=undefined||type!=null){ |
| | | obj[`day${type}`] = item.month[m][key] |
| | | } |
| | |
| | | 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; |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | .center { |
| | | width: 100%; |
| | | height: calc(100% - 40px ); |
| | | height: calc(100% - 50px ); |
| | | background-color: #fff; |
| | | overflow-y: auto; |
| | | display: flex; |
| | | } |
| | | >>>.scroll-pagination{ |
| | | overflow-y: scroll; |
| | | scrollbar-width: none; /* 对于 Firefox 和 IE 的兼容写法 */ |
| | | scrollbar-width: none; |
| | | } |
| | | >>>.scroll-pagination::-webkit-scrollbar { |
| | | display: none; /* 对于 Chrome, Safari 和 Opera 的写法 */ |
| | | display: none; |
| | | } |
| | | .fixed-left { |
| | | float: left; |
| | |
| | | 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%; |