diff --git a/src/front/src/components/UI/event-calendar.vue b/src/front/src/components/UI/event-calendar.vue index 636c05af5..62633b3ac 100644 --- a/src/front/src/components/UI/event-calendar.vue +++ b/src/front/src/components/UI/event-calendar.vue @@ -56,7 +56,7 @@ - События + События на {{dayformat(selectedDate)}} - 1. Скачать файл ежедневной статистики + 1. Скачать файл ежедневной статистики {{info}} - 2. Загрузить данные на сервер + 2. Загрузить данные на сервер @@ -64,12 +64,12 @@ width = "500" position="fixed" class="bottom-alert" - :type='info.mess=="Файл загружен"?"success":"error"' - :title='info.mess=="Файл загружен"?"Успеssх!":"Упс!"' - :text="info.mess" + :type='info=="Файл загружен"?"success":"error"' + :title='info=="Файл загружен"?"Успех!":"Упс!"' + :text="info" v-model="alert" - :color='info.mess=="Файл загружен"?"teal-accent-4":"error"' + :color='info=="Файл загружен"?"teal-darken-2":"red-darken-2"' closable > @@ -94,7 +94,7 @@ export default { setup(){ const dailyfiles = ref([]) const visiting = ref({}) - const info = ref({}) + const info = ref('') const t_dailyRound = ref('') const alert = ref(false) @@ -114,18 +114,19 @@ export default { const onPickFile = (ex) => { - console.log(ex, 'sdata'); + const sdata = new FormData() sdata.append('dailyfiles', dailyfiles.value[0]) axiosApiInstance.post(`api/general_vacation/dailyroundup/?excel=${ex}`, sdata).then(result => { - info.value = result.data + info.value = result.data['mess'] console.log(info.value, '----------------result.data') }) showInfo.value = true dailyfiles.value = [] alert.value = true + } diff --git a/src/general_vacation/views.py b/src/general_vacation/views.py index dad330cf3..7bbd0fd0a 100644 --- a/src/general_vacation/views.py +++ b/src/general_vacation/views.py @@ -66,13 +66,12 @@ class DailyRoundUpAPIView(APIView): user = DictEmployee.objects.filter(deleted=0).values('login', 'id', 'fio') re = loadExcel(user, request.data['dailyfiles']) pos='' - + mess = 'Файл не найден' try: getattr(re, request.GET.get("excel"))() mess = 'Файл загружен' except Exception as e: - mess = 'Файл не найден' - + pass diff --git a/src/media/DailyRoundUp.xlsx b/src/media/DailyRoundUp.xlsx index 2caef6630..462c1e304 100644 Binary files a/src/media/DailyRoundUp.xlsx and b/src/media/DailyRoundUp.xlsx differ