加班导入

master
lion 6 months ago
parent e9641ae29c
commit a3a86a4e82

@ -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 {

@ -147,8 +147,8 @@
type="primary"
size="small"
@click="showExport"
>导出</el-button
>
>导出</el-button>
<!-- <el-button
v-if="$route.path === '/flow/list/todo'"
icon="el-icon-edit"
@ -556,7 +556,6 @@ import ListPopover from "./components/ListPopover.vue";
import MultiDeal from "./components/MultiDeal.vue"
import share from "./components/share.vue";
import payMx from "./components/payMx.vue";
import FieldExport from "./components/FieldExport.vue";
import { departmentListNoAuth } from "@/api/common"
export default {
@ -571,7 +570,6 @@ export default {
data() {
return {
isShowFieldExport: false,
todoTotal: [],
isShowMultiDeal: false,
multiDealFlows: [],
@ -718,6 +716,7 @@ export default {
};
},
methods: {
changeDatePicker(e){
console.log(e)
if(e){

Loading…
Cancel
Save