| | |
| | | page:"/performanceShift/page",//绩效管理-班次-分页查询 |
| | | update:"/performanceShift/update",//绩效管理-班次-班次状态修改 |
| | | pageYear:"/performanceShift/pageYear",//绩效管理-班次-年份分页查询 |
| | | export:"/performanceShift/export",//绩效管理-班次-导出 |
| | | } |
| | | |
| | | const auxiliaryWorkingHours = { |
| | |
| | | const mySet1 = new Set(); |
| | | this.tableLists = this.currentSample.insProduct.filter(m => { |
| | | let num0 = mySet1.size; |
| | | if (m.templateId != null) { |
| | | if (m.templateId != null&&m.template != null) { |
| | | mySet1.add(JSON.stringify({ |
| | | template: m.template, |
| | | templateId: m.templateId |
| | |
| | | children:[] |
| | | }, |
| | | { |
| | | value:'额外类型', |
| | | label:'额外类型', |
| | | value:'报告类型', |
| | | label:'报告类型', |
| | | children:null |
| | | }, |
| | | ], |
| | |
| | | } |
| | | |
| | | .product_table .el-table { |
| | | height: 100%; |
| | | height: calc(100% - 35px) !important; |
| | | } |
| | | |
| | | .sort { |
| | |
| | | </el-table> |
| | | </el-row> |
| | | <el-row class="product_table" v-loading="tableLoad2"> |
| | | <el-table :data="productList" ref="productTable" style="width: 100%;" height="100%" tooltip-effect="dark" stripe |
| | | :fit="true" border @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" |
| | | <el-table :data="pagedData" ref="productTable" style="width: 100%;" height="100%" tooltip-effect="dark" stripe |
| | | :fit="true" border |
| | | @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" |
| | | @select="upProductSelect" @select-all="handleAll"> |
| | | <el-table-column type="selection" width="65"> |
| | | </el-table-column> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination |
| | | style="position: absolute;right: 16px;bottom: 1px;" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-size="pageSize" |
| | | layout="total, prev, pager, next, jumper" |
| | | :total="total"> |
| | | </el-pagination> |
| | | </el-row> |
| | | </div> |
| | | <el-dialog title="分类添加" :visible.sync="addDia" width="400px"> |
| | |
| | | sectionLoad: false, |
| | | sectionRow: null, |
| | | sectionList: [], |
| | | templateList: [] |
| | | templateList: [], |
| | | total:0, |
| | | pageSize:100, |
| | | currentPage:1, |
| | | } |
| | | }, |
| | | computed: { |
| | | pagedData() { |
| | | const start = (this.currentPage - 1) * this.pageSize; |
| | | const end = start + this.pageSize; |
| | | return this.productList.slice(start, end); |
| | | }, |
| | | }, |
| | | watch:{ |
| | | pagedData:{ |
| | | deep:true, |
| | | handler(val){ |
| | | setTimeout(() => { |
| | | val.forEach(a => { |
| | | if (a.state == 1) this.toggleSelection(a) |
| | | }) |
| | | }, 300) |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | tree: this.selectTree |
| | | }).then(res => { |
| | | this.productList = res.data |
| | | setTimeout(() => { |
| | | this.productList.forEach(a => { |
| | | if (a.state == 1) this.toggleSelection(a) |
| | | }) |
| | | }, 300) |
| | | this.total = this.productList.length; |
| | | // setTimeout(() => { |
| | | // this.productList.forEach(a => { |
| | | // if (a.state == 1) this.toggleSelection(a) |
| | | // }) |
| | | // }, 300) |
| | | this.tableLoad2 = false |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | handleAll(e) { |
| | | if (e.length > 0) { |
| | | this.productList.map(m => { |
| | | this.productList = this.productList.map(m => { |
| | | m.state = 0 |
| | | this.upProductSelect(null, m) |
| | | return m |
| | | }) |
| | | } else { |
| | | this.productList.map(m => { |
| | | this.productList = this.productList.map(m => { |
| | | m.state = 1 |
| | | this.upProductSelect(null, m) |
| | | return m |
| | |
| | | this.templateList = res.data |
| | | }) |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.currentPage = val; |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <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> |
| | |
| | | pageLoading: false, // 组件loading的展示,默认为true |
| | | finishLoding: false, // 加载完成,显示已经没有更多了 |
| | | monthList:[], |
| | | yearList:[] |
| | | yearList:[], |
| | | downLoading:false, |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | 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: "班次类型" |
| | |
| | | pageSize: 8, // 一页7条 |
| | | total: null, |
| | | listLoading: true, // 组件loading的展示,默认为true |
| | | finishLoding: false // 加载完成,显示已经没有更多了 |
| | | finishLoding: false, // 加载完成,显示已经没有更多了 |
| | | timer:null |
| | | } |
| | | }, |
| | | watch:{ |
| | |
| | | setInterval(() => { |
| | | this.nowTime() |
| | | }, 1000) |
| | | this.init(); |
| | | this.weekdays = this.getWeekdaysForNextWeek() |
| | | this.getScheduleByMe() |
| | | this.init(); |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.getList(); |
| | | this.getScheduleByMe() |
| | | this.timer&&clearInterval(this.timer) |
| | | this.timer = setInterval(() => { |
| | | this.init(); |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.getList(); |
| | | this.getScheduleByMe() |
| | | },1000*60*10) |
| | | }, |
| | | methods: { |
| | | getList(){ |
| | |
| | | let weekdays = []; |
| | | for (let i = 0; i < 7; i++) { |
| | | let date = new Date(); |
| | | date.setDate(date.getDate() + i); // 今天之后的日子 |
| | | date.setDate(date.getDate() - i); // 今天之后的日子 |
| | | let day = date.getDay(); // 0-6 代表星期日到星期六 |
| | | weekdays.push(day); |
| | | } |
| | | weekdays.reverse() |
| | | weekdays = weekdays.map(m=>{ |
| | | let day ='' |
| | | switch (m) { |
| | |
| | | }) |
| | | }, |
| | | }, |
| | | deactivated(){ |
| | | this.timer&&clearInterval(this.timer) |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <div class="notice-detail-page"> |
| | | <div class="notice-detail-head"> |
| | | <h4 style="margin-bottom: 16px;">{{ noticeInfo.theme }} <el-tag style="margin-left: 10px;" :type="options.find(m=>m.value==noticeInfo.messageType).type" v-if="options.find(m=>m.value==noticeInfo.messageType)">{{ options.find(m=>m.value==noticeInfo.messageType).label }}</el-tag></h4> |
| | | <h4 style="margin-bottom: 16px;" v-if="noticeInfo.theme">{{ noticeInfo.theme }} <el-tag style="margin-left: 10px;" :type="options.find(m=>m.value==noticeInfo.messageType).type" v-if="options.find(m=>m.value==noticeInfo.messageType)">{{ options.find(m=>m.value==noticeInfo.messageType).label }}</el-tag></h4> |
| | | <p style="font-size: 12px;color: #999;margin-bottom: 20px;"> |
| | | <!-- <span>消息类型:审批 </span> --> |
| | | <span>发送人:{{ noticeInfo.createUser }} </span> |
| | |
| | | options:[] |
| | | } |
| | | }, |
| | | created(){ |
| | | this.noticeInfo = JSON.parse(sessionStorage.getItem("noticeInfo")); |
| | | }, |
| | | mounted(){ |
| | | this.noticeInfo = JSON.parse(sessionStorage.getItem("noticeInfo")); |
| | | this.noticeInfo = JSON.parse(localStorage.getItem("noticeInfo")); |
| | | this.$bus.$on("change", (msg) => { |
| | | this.noticeInfo = JSON.parse(msg); |
| | | console.log(this.noticeInfo); |
| | | sessionStorage.setItem("noticeInfo", msg); |
| | | localStorage.setItem("noticeInfo", msg); |
| | | }); |
| | | this.getTypeDicts() |
| | | }, |
| | |
| | | <style scoped> |
| | | .notice-detail-page{ |
| | | height: calc(100% - 30px); |
| | | overflow-y: auto; |
| | | padding: 16px 0; |
| | | } |
| | | .notice-detail-page::-webkit-scrollbar { |
| | | width: 0; |
| | | } |
| | | .notice-detail-head{ |
| | | background: #fff; |
| | |
| | | box-sizing: border-box; |
| | | padding: 8px 20px 20px; |
| | | background: rgba(0,0,0, 0.03); |
| | | box-shadow: 0 0 10px 10px #fff; |
| | | /* box-shadow: 0 0 10px 10px #fff; */ |
| | | border-radius: 4px; |
| | | height: calc(100% - 192px - 22px); |
| | | min-height: calc(100% - 192px - 22px); |
| | | } |
| | | .notice-detail-head-content div{ |
| | | border-radius: 8px; |
| | |
| | | } |
| | | |
| | | .notice-content{ |
| | | height: 100%; |
| | | height: 600px; |
| | | } |
| | | </style> |
| | |
| | | <el-button type="primary" @click="handleEdit">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <notice ref="notice" /> |
| | | <notice ref="notice" @goNoticeDetail="checkForUnreadData()" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | <scroll-pagination @load="refresh" :finishLoding="finishLoding"> |
| | | <div class="notice-content-item" v-for="(m,i) in list" :key="i"> |
| | | <div class="btns" v-if="m"> |
| | | <el-dropdown style="margin-right: 20px;" trigger="click" @command="e=>handleDropdown(e,m)" v-if="m.messageType==2||m.messageType==3"> |
| | | <!-- v-if="m.messageType==2||m.messageType==3" --> |
| | | <el-dropdown style="margin-right: 20px;" trigger="click" @command="e=>handleDropdown(e,m)" v-if="false"> |
| | | <span class="el-dropdown-link"> |
| | | <span class="more" style="line-height: 26px;display: inline-block;">···</span> |
| | | </span> |
| | |
| | | this.list = []; |
| | | this.currentPage = 1; |
| | | this.refresh(); |
| | | this.$emit('goNoticeDetail') |
| | | }) |
| | | }, |
| | | handleDropdown(e,row){ |
| | |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | // 滚动触底加载 |
| | | scrollFn() { |
| | | let clientHeight = document.documentElement.clientHeight - 18; //可视区域 |
| | | let scrollHeight = document.body.scrollHeight; // 滚动文档高度 |
| | | let scrollTop = parseInt(document.documentElement.scrollTop); // 已滚动的高度 |
| | | let height = 300; |
| | | if ( |
| | | scrollTop + clientHeight >= scrollHeight - height && |
| | | scrollHeight != 0 |
| | | ) { |
| | | if (!this.finishLoding&&this.currentPage*this.pageSize<this.total) { |
| | | this.currentPage = this.currentPage + 1; |
| | | this.refresh(); |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | throttle(fn, wait) { |
| | | // 封装函数进行节流 |
| | | var timer = null; |
| | | return function () { |
| | | var context = this; |
| | | var args = arguments; |
| | | if (!timer) { |
| | | timer = setTimeout(function () { |
| | | fn.apply(context, args); |
| | | timer = null; |
| | | }, wait); |
| | | } |
| | | }; |
| | | }, |
| | | handleType(){ |
| | | this.list = []; |
| | | this.currentPage = 1; |
| | |
| | | this.refresh(); |
| | | }) |
| | | } |
| | | }, |
| | | destroyed() { |
| | | window.removeEventListener("scroll", this.throttle(), false); |
| | | }, |
| | | } |
| | | </script> |