This commit is contained in:
iriska-gri committed 2023-11-01 11:41:36 +03:00
1 parent 1c07236ddf
commit 3853ca0d72
7 files changed
+139 -72

No files matched your search

BIN
View File
Binary file not shown.
+5
View File
@@ -48,4 +48,9 @@ import {useAccountStore} from '@/store/AccountStore'
.pointer {
cursor:pointer
}
.bggrad {
background: linear-gradient(to top right, rgba(19,84,122,.8), rgba(128,208,199,.8));
}
</style>
+1 -1
View File
@@ -88,7 +88,7 @@ export default {
const menuAuthDialog = ref(false)
const anon=reactive({
username:"9966-00-125",
username:"9966-00-",
password:""
})
@@ -24,7 +24,7 @@
:to="'/'" />
<template v-slot:image>
<v-img gradient="to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)" />
<v-img class="bggrad" />
</template>
<template v-slot:append>
<template v-if="accountStore.cod2user">
+2 -2
View File
@@ -30,8 +30,8 @@ export function bgimage(filecheck){
export function checkremote(filecheck){
return "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg"
// return filecheck
return process.env.NODE_ENV == 'development'? "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg":filecheck
// try{
// let http = new XMLHttpRequest();
// http.open('HEAD', filecheck, false);
+99 -40
View File
@@ -85,18 +85,48 @@
v-else class="h-100 d-flex justify-center"
:image="imageLenta"
>
<v-card-text class="align-self-center flex-column">
<v-file-input
v-bind="props"
accept=".xlsx"
v-model="dailyfiles"
variant="underlined"
density="compact"
label="Выберите файл"
hide-details
/>
<v-card-text class="align-self-center flex-column mt-8">
<v-row>
<v-col>
<v-file-input
v-bind="props"
accept=".xlsx"
v-model="dailyfiles"
variant="underlined"
density="compact"
label="Выберите файл"
hide-details
/>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn
icon="mdi-download"
size="x-large"
variant="text"
color="teal-darken-4"
:disabled="dailyfiles==0?true:false"
@click="onPickFile"
/>
<!-- <v-icon
icon="mdi-download"
color="teal-darken-4"
/> -->
<!-- <v-btn
append-icon="mdi-note-plus"
size="small"
color="teal-darken-4"
variant="text"
v-bind="props"
>
Загрузить
</v-btn> -->
</v-col>
</v-row>
</v-card-text>
@@ -177,7 +207,7 @@
</v-btn>
</v-col>
</v-row>
<!-- <my-helper :pretext="t_daily.length"/> -->
<my-helper :pretext="t_daily"/>
</v-card>
</v-col>
</v-row>
@@ -221,6 +251,7 @@
>
<v-card class="bg-white pa-3 px-0" width="550"
height="600">
<v-card
class="mx-auto overflow-auto mx-0 px-3"
width="550"
@@ -229,41 +260,39 @@
>
<v-card-title class="fixed-bar bg-white">
<v-toolbar class="bg-teal-lighten-2 ">
<v-row class="ma-0">
<v-col class="pa-3 align-self-center">
<v-toolbar-title>{{t_dailyRound.position}}</v-toolbar-title>
<!-- <v-toolbar class="bg-teal-lighten-2 flex-column d-flex"> -->
<v-row class="bggrad">
<v-col class="text-center">
{{t_dailyRound.position}}
</v-col>
</v-row>
<v-row >
<v-col class="pa-0 mb-3">
<v-textarea
v-model="searchname"
clearable
prepend-inner-icon="mdi-magnify"
hide-details
class="mx-0"
label="Поиск"
rows="1"
no-resize
/>
</v-col>
<v-col lg=7 class="pa-0"> <v-textarea
v-model="searchname"
clearable
prepend-inner-icon="mdi-magnify"
hide-details
class="mx-2"
label="Поиск"
rows="1"
></v-textarea></v-col>
</v-row>
<!-- <v-btn variant="text" icon="mdi-magnify"></v-btn> -->
</v-toolbar>
<!-- <v-divider class="mt-4"/> -->
</v-card-title>
<div
v-for="(x, key) in t_dailyRound.daily"
:key="key"
class="px-3" >
<v-list>
<v-list class="py-0">
<v-list-subheader>{{key}} </v-list-subheader>
</v-list>
@@ -284,6 +313,17 @@
</div>
</v-card>
<v-divider/>
<v-card-actions class="align-self-end pb-0">
<v-btn
color="more_details_btn"
variant="text"
@click="dialogDetailRound=!dialogDetailRound"
>
Закрыть
</v-btn>
</v-card-actions>
</v-card>
@@ -385,12 +425,12 @@
}
function dailyfun(){
// if (t_daily.value.length>0){
axiosApiInstance.get('api/general_vacation/dailyload/')
axiosApiInstance.get('api/general_vacation/dailyload/')
.then(data => {
t_daily.value = data.data.daily
})
// }
@@ -415,6 +455,22 @@
return new URL(`/src/assets/bg-for-number-carousel.png`, import.meta.url).href;
})
const onPickFile = () => {
const sdata = new FormData()
sdata.append('dailyfiles', dailyfiles.value[0])
axiosApiInstance.post(`api/general_vacation/dailyroundup/`, sdata).then(result => {
info.value = result.data
})
console.log('----------------')
dailyfiles.value = ''
// dailyfun()
}
return {
accountStore,
model,
@@ -433,7 +489,8 @@
iduser,
imageLenta,
dialoground,
dailyfiles
dailyfiles,
onPickFile
}
}
@@ -471,5 +528,7 @@
top: 0em;
z-index: 2;
}
</style>
+31 -28
View File
@@ -284,37 +284,40 @@ class DailyRoundUpAPIView(APIView):
class DailyloadAPIView(APIView):
def get(self, request):
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'department', 'fio', 'post')
dailyr = DailyRoundUp.objects.filter(todaysDate=date.today()).values_list('user', 'position__name', 'position')
df_user = pd.DataFrame.from_records(user)
df_daily = pd.DataFrame.from_records(dailyr)
df_daily.columns = ["login", "pos", "idpos"]
df = pd.merge(df_user, df_daily, left_on= 'login', right_on="login")
result={}
pos=dailyr[0][1]
if request.GET.__contains__('id'):
df=df.loc[df['idpos']==int(request.GET.get("id"))]
if request.GET.__contains__('searchname'):
df = df.loc[df["fio"].str.contains(request.GET.get("searchname"))]
try:
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'department', 'fio', 'post')
dailyr = DailyRoundUp.objects.filter(todaysDate=date.today()).values_list('user', 'position__name', 'position')
df_user = pd.DataFrame.from_records(user)
df_daily = pd.DataFrame.from_records(dailyr)
df_daily.columns = ["login", "pos", "idpos"]
df = pd.merge(df_user, df_daily, left_on= 'login', right_on="login")
for index, row in df.iterrows ():
if row['department'] in result.keys():
result[row['department']].append({'login':row['login'],'fio':row['fio'], 'post':row['post']})
else:
result[row['department']]=[{'login':row['login'],'fio':row['fio'], 'post':row['post']}]
print(result, '111111111111111111111')
daily = result
result={}
pos=dailyr[0][1]
else:
if request.GET.__contains__('id'):
df=df.loc[df['idpos']==int(request.GET.get("id"))]
if request.GET.__contains__('searchname'):
df = df.loc[df["fio"].str.contains(request.GET.get("searchname"))]
for index, row in df.iterrows ():
if row['department'] in result.keys():
result[row['department']].append({'login':row['login'],'fio':row['fio'], 'post':row['post']})
else:
result[row['department']]=[{'login':row['login'],'fio':row['fio'], 'post':row['post']}]
print(result, '111111111111111111111')
daily = result
else:
pos=''
daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user'))
except Exception as e:
pos=''
daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user'))
daily=""
return Response({'daily':daily, 'position':pos})
class SearchUserAPIView(APIView):