| | |
| | | }, |
| | | handleOut(){ |
| | | this.outLoading = true |
| | | this.$axios.post(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: 'blob'}).then(res => { |
| | | this.$axios.post(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: "blob"}).then(res => { |
| | | this.outLoading = false |
| | | this.$message.success('导出成功') |
| | | // let fileName="日工时汇总表"; |
| | | // const blob = new Blob([res], { |
| | | // type: 'application/force-download' |
| | | // }) |
| | | // 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) |
| | | const blob = new Blob([res], { |
| | | type: 'application/force-download' |
| | | }) |
| | | const link = document.createElement('a') |
| | | link.href = URL.createObjectURL(blob) |
| | | link.download = decodeURI('日工时汇总表'+'.xlsx') |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | window.setTimeout(function () { |
| | | URL.revokeObjectURL(blob) |
| | | document.body.removeChild(link) |
| | | }, 0) |
| | | const blob = new Blob([res.data]); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = '日工时汇总表.xlsx'; |
| | | link.click(); |
| | | }) |
| | | }, |
| | | } |
| | |
| | | <div class="search_label">日期:</div> |
| | | <div class="search_input" style="display: flex;align-items: center;"> |
| | | <el-date-picker |
| | | v-model="componentData.entity.laboratory" |
| | | v-model="componentData.entity.month" |
| | | type="month" |
| | | format="yyyy-MM-dd HH:mm:ss" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | format="yyyy-MM" |
| | | value-format="yyyy" |
| | | placeholder="选择月" size="small" style="width: 100%;"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">员工:</div> |
| | | <el-select v-model="componentData.entity.laboratory" placeholder="全部" size="small" @change="refreshTable()"> |
| | | <el-select v-model="componentData.entity.name" placeholder="全部" size="small" @change="refreshTable()"> |
| | | <el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </el-option> |
| | | </el-select> --> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="componentData.entity.department" @keyup.enter.native="refreshTable()"></el-input> |
| | | v-model="componentData.entity.departLims" @keyup.enter.native="refreshTable()"></el-input> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;width: 100px;"> |
| | |
| | | |
| | | <script> |
| | | import ValueTable from '../../tool/value-table.vue' |
| | | import { |
| | | getYearAndMonthAndDays |
| | | } from '../../../util/date' |
| | | export default { |
| | | components: { |
| | | ValueTable |
| | |
| | | return{ |
| | | componentData: { |
| | | entity: { |
| | | number: null, |
| | | department: null, |
| | | laboratory: null, |
| | | month: null, |
| | | name: null, |
| | | departLims: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'desc' |
| | |
| | | }, |
| | | componentData0: { |
| | | entity: { |
| | | number: null, |
| | | department: null, |
| | | laboratory: null, |
| | | month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1], |
| | | name: null, |
| | | departLims: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'desc' |
| | |
| | | requiredAdd: [], |
| | | requiredUp: [] |
| | | }, |
| | | entity:{}, |
| | | upIndex:0, |
| | | weekList:[], |
| | | personList:[], |
| | |
| | | this.getUsers() |
| | | }, |
| | | methods: { |
| | | getYearAndMonthAndDays(date){ |
| | | return getYearAndMonthAndDays(date) |
| | | }, |
| | | refresh(){}, |
| | | refreshTable(){}, |
| | | getUsers(){ |
| | |
| | | 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() |