Добавить смену даты
This commit is contained in:
1 parent
da0d0b4dcb
commit
70243dd690
4 files changed
+28
-14
No files matched your search
@@ -56,7 +56,7 @@
|
|||||||
<!-- todayButton -->
|
<!-- todayButton -->
|
||||||
|
|
||||||
<v-card class="h-100">
|
<v-card class="h-100">
|
||||||
<v-card-title class="text-center">События</v-card-title>
|
<v-card-title class="text-center">События на {{dayformat(selectedDate)}}</v-card-title>
|
||||||
<!-- <v-card-text>ddd</v-card-text> -->
|
<!-- <v-card-text>ddd</v-card-text> -->
|
||||||
<vue-cal
|
<vue-cal
|
||||||
locale="ru"
|
locale="ru"
|
||||||
@@ -158,13 +158,27 @@ export default {
|
|||||||
|
|
||||||
const selectedDate = ref(null)
|
const selectedDate = ref(null)
|
||||||
|
|
||||||
|
function dayformat(days) {
|
||||||
|
const d = new Date(days)
|
||||||
|
const mess= 'сегодня'
|
||||||
|
if (d.getFullYear() != '1970'){
|
||||||
|
mess = d.getDate()
|
||||||
|
}
|
||||||
|
|
||||||
|
// if d.getFullYear() == '1970': {
|
||||||
|
// console.log(d, 'ddddddddddddddddddddddd');
|
||||||
|
// }
|
||||||
|
|
||||||
|
return mess
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return { events, selectedDate, f_generalvacation }
|
return { events, selectedDate, f_generalvacation, dayformat }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<v-row class="flex-grow-0 align-self-end">
|
<v-row class="flex-grow-0 align-self-end">
|
||||||
<v-col class="d-flex">
|
<v-col class="d-flex">
|
||||||
<v-card-subtitle class="mt-2 align-self-end">
|
<v-card-subtitle class="mt-2 align-self-end">
|
||||||
1. Скачать файл ежедневной статистики
|
1. Скачать файл ежедневной статистики {{info}}
|
||||||
</v-card-subtitle>
|
</v-card-subtitle>
|
||||||
<v-icon
|
<v-icon
|
||||||
class="pt-2 pl-2"
|
class="pt-2 pl-2"
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-card-subtitle class="align-self-center ml-3">
|
<v-card-subtitle class="align-self-center ml-3">
|
||||||
2. Загрузить данные на сервер
|
2. Загрузить данные на сервер
|
||||||
</v-card-subtitle>
|
</v-card-subtitle>
|
||||||
<v-col class="pr-0">
|
<v-col class="pr-0">
|
||||||
|
|
||||||
@@ -64,12 +64,12 @@
|
|||||||
width = "500"
|
width = "500"
|
||||||
position="fixed"
|
position="fixed"
|
||||||
class="bottom-alert"
|
class="bottom-alert"
|
||||||
:type='info.mess=="Файл загружен"?"success":"error"'
|
:type='info=="Файл загружен"?"success":"error"'
|
||||||
:title='info.mess=="Файл загружен"?"Успеssх!":"Упс!"'
|
:title='info=="Файл загружен"?"Успех!":"Упс!"'
|
||||||
:text="info.mess"
|
:text="info"
|
||||||
v-model="alert"
|
v-model="alert"
|
||||||
|
|
||||||
:color='info.mess=="Файл загружен"?"teal-accent-4":"error"'
|
:color='info=="Файл загружен"?"teal-darken-2":"red-darken-2"'
|
||||||
closable
|
closable
|
||||||
></v-alert>
|
></v-alert>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -94,7 +94,7 @@ export default {
|
|||||||
setup(){
|
setup(){
|
||||||
const dailyfiles = ref([])
|
const dailyfiles = ref([])
|
||||||
const visiting = ref({})
|
const visiting = ref({})
|
||||||
const info = ref({})
|
const info = ref('')
|
||||||
const t_dailyRound = ref('')
|
const t_dailyRound = ref('')
|
||||||
const alert = ref(false)
|
const alert = ref(false)
|
||||||
|
|
||||||
@@ -114,18 +114,19 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
const onPickFile = (ex) => {
|
const onPickFile = (ex) => {
|
||||||
console.log(ex, 'sdata');
|
|
||||||
const sdata = new FormData()
|
const sdata = new FormData()
|
||||||
sdata.append('dailyfiles', dailyfiles.value[0])
|
sdata.append('dailyfiles', dailyfiles.value[0])
|
||||||
|
|
||||||
axiosApiInstance.post(`api/general_vacation/dailyroundup/?excel=${ex}`, sdata).then(result => {
|
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')
|
console.log(info.value, '----------------result.data')
|
||||||
})
|
})
|
||||||
showInfo.value = true
|
showInfo.value = true
|
||||||
dailyfiles.value = []
|
dailyfiles.value = []
|
||||||
alert.value = true
|
alert.value = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,13 +66,12 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
user = DictEmployee.objects.filter(deleted=0).values('login', 'id', 'fio')
|
user = DictEmployee.objects.filter(deleted=0).values('login', 'id', 'fio')
|
||||||
re = loadExcel(user, request.data['dailyfiles'])
|
re = loadExcel(user, request.data['dailyfiles'])
|
||||||
pos=''
|
pos=''
|
||||||
|
mess = 'Файл не найден'
|
||||||
try:
|
try:
|
||||||
getattr(re, request.GET.get("excel"))()
|
getattr(re, request.GET.get("excel"))()
|
||||||
mess = 'Файл загружен'
|
mess = 'Файл загружен'
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
mess = 'Файл не найден'
|
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user