|
|
|
|
@ -11,7 +11,32 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 15px;"
|
|
|
|
|
@click="getList">搜索</el-button>
|
|
|
|
|
@click="getList">搜索</el-button>
|
|
|
|
|
<el-popover
|
|
|
|
|
v-if="is_bgs"
|
|
|
|
|
placement="bottom-start"
|
|
|
|
|
title="导入加班"
|
|
|
|
|
width="400"
|
|
|
|
|
trigger="click">
|
|
|
|
|
<template #reference>
|
|
|
|
|
<el-button style="margin-left: 10px;" type="primary" size="small" icon="el-icon-upload">导入加班</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<template #default>
|
|
|
|
|
<el-upload
|
|
|
|
|
ref="upload"
|
|
|
|
|
:action="action"
|
|
|
|
|
:on-success="uploadSuccess"
|
|
|
|
|
accept=".xls,.xlsx"
|
|
|
|
|
:headers="{
|
|
|
|
|
'Authorization': 'Bearer ' + getToken()
|
|
|
|
|
}"
|
|
|
|
|
:auto-upload="false">
|
|
|
|
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
|
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="uploadData">上传到服务器</el-button>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</template>
|
|
|
|
|
</el-popover>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-toolbar>
|
|
|
|
|
<vxe-table ref="table" stripe :border='true' style="margin-top: 10px;border:1px solid #333" :loading="loading" :max-height="1400"
|
|
|
|
|
@ -53,12 +78,15 @@
|
|
|
|
|
import {
|
|
|
|
|
departmentListNoAuth
|
|
|
|
|
} from "@/api/common.js"
|
|
|
|
|
import store from "@/store/modules/user.js"
|
|
|
|
|
import store from "@/store/modules/user.js"
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
loading: false,
|
|
|
|
|
tableData: [],
|
|
|
|
|
tableData: [],
|
|
|
|
|
action: `${process.env.VUE_APP_BASE_API}/api/oa/statistics/import-overtime`, // 导入加班
|
|
|
|
|
|
|
|
|
|
select: {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
@ -73,7 +101,27 @@
|
|
|
|
|
dName: '全部科室'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
methods: {
|
|
|
|
|
// 导入加班
|
|
|
|
|
getToken,
|
|
|
|
|
uploadData() {
|
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
|
},
|
|
|
|
|
uploadSuccess(response) {
|
|
|
|
|
console.log(response)
|
|
|
|
|
let arr = response.data
|
|
|
|
|
let str = ''
|
|
|
|
|
if(arr.err.length>0){
|
|
|
|
|
arr.err.map(item=>{
|
|
|
|
|
str+=`${item},`
|
|
|
|
|
})
|
|
|
|
|
this.$message.error(`${str}导入失败`)
|
|
|
|
|
this.getList(true)
|
|
|
|
|
}else{
|
|
|
|
|
this.$message.success(`导入成功`)
|
|
|
|
|
this.getList(true)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
try {
|
|
|
|
|
|