Поиск
This commit is contained in:
1 parent
f07fd09ae1
commit
df5d962413
5 files changed
+82
-47
No files matched your search
BIN
Binary file not shown.
@@ -149,26 +149,42 @@
|
|||||||
v-model="dialogDetailRound"
|
v-model="dialogDetailRound"
|
||||||
width="500"
|
width="500"
|
||||||
>
|
>
|
||||||
<v-card class="bg-white pa-3 px-0" width="450"
|
<v-card class="bg-white pa-3 px-0" width="550"
|
||||||
height="500">
|
height="600">
|
||||||
<v-card
|
<v-card
|
||||||
class="mx-auto overflow-auto mx-0 px-3"
|
class="mx-auto overflow-auto mx-0 px-3"
|
||||||
width="450"
|
width="550"
|
||||||
height="500"
|
height="600"
|
||||||
flat
|
flat
|
||||||
>
|
>
|
||||||
|
|
||||||
<!-- -->
|
<v-card-title class="fixed-bar bg-white">
|
||||||
|
<v-toolbar class="bg-teal-lighten-2 ">
|
||||||
|
<!-- <my-helper :pretext="t_dailyRound"/> -->
|
||||||
|
<v-row class="ma-0">
|
||||||
|
<v-col class="pa-3 align-self-center">
|
||||||
|
<v-toolbar-title>{{t_dailyRound.position}}</v-toolbar-title>
|
||||||
|
</v-col>
|
||||||
|
<v-col lg=7 class="pa-0"> <v-textarea
|
||||||
|
v-model="searchname"
|
||||||
|
append-inner-icon="mdi-magnify"
|
||||||
|
hide-details
|
||||||
|
class="mx-2"
|
||||||
|
label="Поиск"
|
||||||
|
rows="1"
|
||||||
|
></v-textarea></v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
<!-- <v-toolbar color="cyan-lighten-1">
|
|
||||||
<v-btn variant="text" icon="mdi-menu"></v-btn>
|
|
||||||
|
|
||||||
<v-toolbar-title>Inbox</v-toolbar-title>
|
|
||||||
|
|
||||||
<v-spacer></v-spacer>
|
|
||||||
|
|
||||||
<v-btn variant="text" icon="mdi-magnify"></v-btn>
|
|
||||||
</v-toolbar> -->
|
<!-- <v-btn variant="text" icon="mdi-magnify"></v-btn> -->
|
||||||
|
</v-toolbar>
|
||||||
|
|
||||||
|
</v-card-title>
|
||||||
|
{{ searchname}}
|
||||||
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-for="(x, key) in t_dailyRound.daily"
|
v-for="(x, key) in t_dailyRound.daily"
|
||||||
@@ -187,44 +203,15 @@
|
|||||||
:prepend-avatar="checkremote(`${spravURL}${item.login}.jpg`)"
|
:prepend-avatar="checkremote(`${spravURL}${item.login}.jpg`)"
|
||||||
:title="item.fio"
|
:title="item.fio"
|
||||||
:subtitle="item.post"
|
:subtitle="item.post"
|
||||||
variant="text" @click="getcard"
|
variant="text"
|
||||||
>
|
>
|
||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
|
<!-- @click="getcard" -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-card>
|
</v-card>
|
||||||
<!-- <v-card class="pa-5">
|
|
||||||
<v-divider class="my-6"/>
|
|
||||||
<v-table
|
|
||||||
v-for="(x, key) in t_dailyRound"
|
|
||||||
:key="key"
|
|
||||||
density="compact"
|
|
||||||
|
|
||||||
>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="text-left">
|
|
||||||
{{key}}
|
|
||||||
</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr
|
|
||||||
v-for="item in x"
|
|
||||||
:key="item.name"
|
|
||||||
>
|
|
||||||
<td>{{ item.fio }}</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
<v-divider class="my-6"/>
|
|
||||||
</v-table>
|
|
||||||
</v-card> -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -234,7 +221,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted,watch } from 'vue'
|
||||||
import {useAppStore} from '@/store/app'
|
import {useAppStore} from '@/store/app'
|
||||||
import {useAccountStore} from '@/store/AccountStore'
|
import {useAccountStore} from '@/store/AccountStore'
|
||||||
import {pagecounter} from '@/utils/universal_functions'
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
@@ -262,6 +249,8 @@ import {checkremote} from '@/utils/universal_functions'
|
|||||||
const t_daily = ref('')
|
const t_daily = ref('')
|
||||||
const t_dailyRound = ref('')
|
const t_dailyRound = ref('')
|
||||||
const dialogDetailRound = ref(false)
|
const dialogDetailRound = ref(false)
|
||||||
|
const searchname = ref('')
|
||||||
|
const idpos = ref('')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -276,7 +265,15 @@ import {checkremote} from '@/utils/universal_functions'
|
|||||||
const model= null
|
const model= null
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore()
|
||||||
|
|
||||||
|
watch(()=> searchname.value,(newValue,oldValue)=>{
|
||||||
|
if(newValue){
|
||||||
|
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${idpos.value}&searchname=${newValue}`)
|
||||||
|
.then(data => {
|
||||||
|
console.log(newValue);
|
||||||
|
// t_daily.value = data.data.daily
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, {deep:true})
|
||||||
|
|
||||||
|
|
||||||
function proba(){
|
function proba(){
|
||||||
@@ -297,6 +294,7 @@ import {checkremote} from '@/utils/universal_functions'
|
|||||||
}
|
}
|
||||||
|
|
||||||
const detailRound = (pos) => {
|
const detailRound = (pos) => {
|
||||||
|
idpos.value=pos
|
||||||
dialogDetailRound.value=!dialogDetailRound.value
|
dialogDetailRound.value=!dialogDetailRound.value
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`)
|
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
@@ -316,7 +314,8 @@ import {checkremote} from '@/utils/universal_functions'
|
|||||||
detailRound,
|
detailRound,
|
||||||
dialogDetailRound,
|
dialogDetailRound,
|
||||||
checkremote,
|
checkremote,
|
||||||
spravURL
|
spravURL,
|
||||||
|
searchname
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -350,4 +349,11 @@ import {checkremote} from '@/utils/universal_functions'
|
|||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixed-bar {
|
||||||
|
position: sticky;
|
||||||
|
position: -webkit-sticky; /* for Safari */
|
||||||
|
top: 0em;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -6,4 +6,5 @@ urlpatterns = [
|
|||||||
path('generalvacation/', GeneralVacationAPIView.as_view(), name='generalvacation'),
|
path('generalvacation/', GeneralVacationAPIView.as_view(), name='generalvacation'),
|
||||||
path('dailyroundup/', DailyRoundUpAPIView.as_view(), name='dailyroundup'),
|
path('dailyroundup/', DailyRoundUpAPIView.as_view(), name='dailyroundup'),
|
||||||
path('dailyload/', DailyloadAPIView.as_view(), name='dailyload'),
|
path('dailyload/', DailyloadAPIView.as_view(), name='dailyload'),
|
||||||
|
path('searchuser/', SearchUserAPIView.as_view(), name='searchuser'),
|
||||||
]
|
]
|
||||||
@@ -281,13 +281,33 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
|
|
||||||
class DailyloadAPIView(APIView):
|
class DailyloadAPIView(APIView):
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'department', 'familyname', 'name', 'parentname')
|
||||||
|
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")
|
||||||
|
print(df, 'df_user---------------------------')
|
||||||
|
# print(df_daily , 'df_daily---------------------------')
|
||||||
|
|
||||||
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')
|
||||||
|
|
||||||
result = {}
|
if request.GET.__contains__('searchname'):
|
||||||
|
# daily1 = DictEmployee.objects.using('user_directory').filter(login__in=[x[0] for x in daily])
|
||||||
|
# daily1 = daily1.filter(fio__icontains=request.GET.get("searchname"))
|
||||||
|
u= DictEmployee.objects.using('user_directory').values('familyname').filter(fio__icontains=request.GET.get("searchname"))
|
||||||
|
print(daily, '-----------------------------')
|
||||||
|
else:
|
||||||
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])
|
||||||
|
print('1111111111111111111111111111111111111111111')
|
||||||
|
pos=daily[0][1]
|
||||||
|
|
||||||
|
result = {}
|
||||||
|
|
||||||
|
|
||||||
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})
|
||||||
@@ -295,6 +315,14 @@ class DailyloadAPIView(APIView):
|
|||||||
result[x.department]=[{'login':x.login,'fio':x.fio, 'post':x.post}]
|
result[x.department]=[{'login':x.login,'fio':x.fio, 'post':x.post}]
|
||||||
daily = result
|
daily = result
|
||||||
else:
|
else:
|
||||||
|
pos=''
|
||||||
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':daily, 'position':request.GET.get("id")})
|
return Response({'daily':daily, 'position':pos})
|
||||||
|
|
||||||
|
class SearchUserAPIView(APIView):
|
||||||
|
def post(self, request):
|
||||||
|
f= DictEmployee.objects.using('user_directory').values('familyname').filter(fio__icontains=request.data['searchname'])
|
||||||
|
print(f, '-----------------------------')
|
||||||
|
return Response('')
|
||||||
|
|
||||||
Binary file not shown.
Reference in new issue
Block a user