95 lines
2.6 KiB
Vue
95 lines
2.6 KiB
Vue
<template>
|
|
|
|
<v-row class="justify-center">
|
|
|
|
<v-col cols="6"
|
|
class="text-h6 text-grey text-center d-flex align-baseline align-self-center text--lighten-1 font-weight-light"
|
|
>
|
|
<!-- <v-btn
|
|
class="mr-2"
|
|
color="app_bar"
|
|
>
|
|
Excel
|
|
</v-btn> -->
|
|
<!-- :href="`${baseURL}media/DailyRoundUp.xlsx`"
|
|
download -->
|
|
<v-btn
|
|
|
|
class="mr-2"
|
|
color="modal_btn"
|
|
@click="excelOp"
|
|
>
|
|
Скачать
|
|
</v-btn>
|
|
|
|
<!-- <v-spacer></v-spacer> -->
|
|
<v-file-input
|
|
:rules="[val => (!!val && val.length > 0) || 'Добавьте файл']"
|
|
accept=".xlsx"
|
|
v-model="dailyfiles"
|
|
variant="underlined"
|
|
density="compact"
|
|
label="Выберите файл"
|
|
class="mr-2"></v-file-input>
|
|
|
|
<!-- <v-spacer></v-spacer> -->
|
|
<v-btn
|
|
color="modal_btn"
|
|
@click="onPickFile">
|
|
Загрузить
|
|
</v-btn>
|
|
|
|
|
|
</v-col>
|
|
</v-row>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import { ref } from 'vue'
|
|
import { baseURL } from '@/utils/axios-api'
|
|
import {getfromserver} from '@/utils/universal_functions'
|
|
import { axiosApiInstance } from '@/utils/axios-api'
|
|
|
|
export default {
|
|
setup(){
|
|
const dailyfiles = ref('')
|
|
const visiting = ref({})
|
|
const excelOp = () => {
|
|
axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => {
|
|
let link = document.createElement("a")
|
|
link.href = baseURL+result.data.path
|
|
link.click()
|
|
link.remove()
|
|
})
|
|
}
|
|
|
|
|
|
const onPickFile = () => {
|
|
|
|
const sdata = new FormData()
|
|
sdata.append('dailyfiles', dailyfiles.value[0])
|
|
|
|
|
|
axiosApiInstance.post(`api/general_vacation/dailyroundup/`, sdata).then(result => {
|
|
console.log(result.data, '----------------');
|
|
})
|
|
|
|
|
|
}
|
|
|
|
return {
|
|
visiting,
|
|
excelOp,
|
|
baseURL,
|
|
dailyfiles,
|
|
onPickFile,
|
|
}
|
|
}
|
|
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style> |