Уксель
This commit is contained in:
1 parent
9e8f71d0fd
commit
407b98e206
4 files changed
+40
-27
No files matched your search
BIN
Binary file not shown.
@@ -51,7 +51,7 @@
|
|||||||
<v-col class="flex-column d-flex flex-grow-0 px-0" lg="2">
|
<v-col class="flex-column d-flex flex-grow-0 px-0" lg="2">
|
||||||
<v-row class="flex-grow-1 ma-0 mx-1">
|
<v-row class="flex-grow-1 ma-0 mx-1">
|
||||||
<v-col class="pt-0">
|
<v-col class="pt-0">
|
||||||
{{[t_daily.daily]}}
|
|
||||||
<v-card v-if="t_daily.length > 0" class="h-100 flex-column" >
|
<v-card v-if="t_daily.length > 0" class="h-100 flex-column" >
|
||||||
|
|
||||||
<v-row v-for="x in t_daily" :key="x" v-show="x.position!=6">
|
<v-row v-for="x in t_daily" :key="x" v-show="x.position!=6">
|
||||||
@@ -158,10 +158,10 @@
|
|||||||
height="500"
|
height="500"
|
||||||
flat
|
flat
|
||||||
>
|
>
|
||||||
<my-helper :pretext='t_dailyRound'/>
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<v-toolbar color="cyan-lighten-1">
|
<!-- <v-toolbar color="cyan-lighten-1">
|
||||||
<v-btn variant="text" icon="mdi-menu"></v-btn>
|
<v-btn variant="text" icon="mdi-menu"></v-btn>
|
||||||
|
|
||||||
<v-toolbar-title>Inbox</v-toolbar-title>
|
<v-toolbar-title>Inbox</v-toolbar-title>
|
||||||
@@ -169,10 +169,10 @@
|
|||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
|
|
||||||
<v-btn variant="text" icon="mdi-magnify"></v-btn>
|
<v-btn variant="text" icon="mdi-magnify"></v-btn>
|
||||||
</v-toolbar>
|
</v-toolbar> -->
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-for="(x, key) in t_dailyRound"
|
v-for="(x, key) in t_dailyRound.daily"
|
||||||
:key="key"
|
:key="key"
|
||||||
class="px-3" >
|
class="px-3" >
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,11 @@
|
|||||||
<v-col cols="6"
|
<v-col cols="6"
|
||||||
class="text-h6 text-grey text-center d-flex align-baseline align-self-center text--lighten-1 font-weight-light"
|
class="text-h6 text-grey text-center d-flex align-baseline align-self-center text--lighten-1 font-weight-light"
|
||||||
>
|
>
|
||||||
<!-- <v-btn
|
{{t_dailyRound}}
|
||||||
class="mr-2"
|
|
||||||
color="app_bar"
|
<v-btn @click="detailRound">
|
||||||
>
|
Тык
|
||||||
Excel
|
</v-btn>
|
||||||
</v-btn> -->
|
|
||||||
<!-- :href="`${baseURL}media/DailyRoundUp.xlsx`"
|
|
||||||
download -->
|
|
||||||
<v-btn
|
<v-btn
|
||||||
|
|
||||||
class="mr-2"
|
class="mr-2"
|
||||||
@@ -54,6 +51,8 @@ export default {
|
|||||||
setup(){
|
setup(){
|
||||||
const dailyfiles = ref('')
|
const dailyfiles = ref('')
|
||||||
const visiting = ref({})
|
const visiting = ref({})
|
||||||
|
const info = ref({})
|
||||||
|
const t_dailyRound = ref('')
|
||||||
const excelOp = () => {
|
const excelOp = () => {
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => {
|
axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => {
|
||||||
let link = document.createElement("a")
|
let link = document.createElement("a")
|
||||||
@@ -68,21 +67,35 @@ export default {
|
|||||||
|
|
||||||
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/`, sdata).then(result => {
|
axiosApiInstance.post(`api/general_vacation/dailyroundup/`, sdata).then(result => {
|
||||||
console.log(result.data, '----------------');
|
info.value = result.data
|
||||||
|
console.log(result.data, '----------------')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const detailRound = () => {
|
||||||
|
|
||||||
|
axiosApiInstance.get(`api/general_vacation/dailyload/?id=6`)
|
||||||
|
.then(data => {
|
||||||
|
console.log(data.data);
|
||||||
|
|
||||||
|
t_dailyRound.value = data.data
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
visiting,
|
visiting,
|
||||||
excelOp,
|
excelOp,
|
||||||
baseURL,
|
baseURL,
|
||||||
dailyfiles,
|
dailyfiles,
|
||||||
onPickFile,
|
onPickFile,
|
||||||
|
info,
|
||||||
|
detailRound,
|
||||||
|
t_dailyRound
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -214,7 +214,7 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
dfuser = pd.DataFrame.from_records(user)
|
dfuser = pd.DataFrame.from_records(user)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print(request.data['dailyfiles'], '============================================')
|
|
||||||
file = request.data['dailyfiles']
|
file = request.data['dailyfiles']
|
||||||
ed = pd.read_excel(file)
|
ed = pd.read_excel(file)
|
||||||
df = pd.DataFrame(ed)
|
df = pd.DataFrame(ed)
|
||||||
@@ -258,9 +258,15 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
base=BasePosition.objects.get(pk=keys)
|
base=BasePosition.objects.get(pk=keys)
|
||||||
DailyRoundUp.objects.update_or_create(todaysDate=datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'),
|
DailyRoundUp.objects.update_or_create(todaysDate=datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'),
|
||||||
user=df3['login'][ind], defaults={'position':base})
|
user=df3['login'][ind], defaults={'position':base})
|
||||||
print(df3, '-----------------------')
|
|
||||||
|
pos = DailyRoundUp.objects.values('position__name', 'position').filter(position=6,todaysDate=date.today()).annotate(Count('user'))
|
||||||
|
|
||||||
|
|
||||||
|
print('-------', pos)
|
||||||
|
mess = "Файл загружен"
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
err = 'Файл не найден'
|
mess = 'Файл не найден'
|
||||||
|
|
||||||
|
|
||||||
# serializer_for_daily = DailyRoundUpSerializer(
|
# serializer_for_daily = DailyRoundUpSerializer(
|
||||||
@@ -270,7 +276,7 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Response('')
|
return Response({"mess": mess, "pos": pos})
|
||||||
|
|
||||||
|
|
||||||
class DailyloadAPIView(APIView):
|
class DailyloadAPIView(APIView):
|
||||||
@@ -279,22 +285,16 @@ class DailyloadAPIView(APIView):
|
|||||||
if request.GET.__contains__('id'):
|
if request.GET.__contains__('id'):
|
||||||
|
|
||||||
daily = DailyRoundUp.objects.filter(position=request.GET.get("id"),todaysDate=date.today()).values_list('user', 'position__name')
|
daily = DailyRoundUp.objects.filter(position=request.GET.get("id"),todaysDate=date.today()).values_list('user', 'position__name')
|
||||||
print(daily,'0000000000000000000000000000000000000000000000000000000000000000000000000000000')
|
|
||||||
|
|
||||||
result = {}
|
|
||||||
# base=BasePosition.objects.get(pk=keys)
|
|
||||||
|
|
||||||
|
result = {}
|
||||||
u=DictEmployee.objects.using('user_directory').filter(login__in=[x[0] for x in daily])
|
u=DictEmployee.objects.using('user_directory').filter(login__in=[x[0] for x in daily])
|
||||||
for x in u:
|
for x in u:
|
||||||
|
|
||||||
if x.department in result.keys():
|
if x.department in result.keys():
|
||||||
result[x.department].append({'login':x.login,'fio':x.fio, 'post':x.post})
|
result[x.department].append({'login':x.login,'fio':x.fio, 'post':x.post})
|
||||||
else:
|
else:
|
||||||
result[x.department]=[{'login':x.login,'fio':x.fio, 'post':x.post}]
|
result[x.department]=[{'login':x.login,'fio':x.fio, 'post':x.post}]
|
||||||
# result['position'] = request.GET.get("id")
|
|
||||||
daily = result
|
daily = result
|
||||||
else:
|
else:
|
||||||
daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user'))
|
daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user'))
|
||||||
|
|
||||||
# return Response(daily)
|
|
||||||
return Response({'daily':daily, 'position':request.GET.get("id")})
|
return Response({'daily':daily, 'position':request.GET.get("id")})
|
||||||
Reference in new issue
Block a user