Поиск в кароточке
This commit is contained in:
1 parent
2e7c29c065
commit
52b78f5fcb
3 files changed
+17
-12
No files matched your search
Binary file not shown.
@@ -90,12 +90,12 @@ flat
|
||||
|
||||
<v-row class="bggrad">
|
||||
<v-col class="text-center text-black_and_white">
|
||||
<!-- {{result[0].pos}} -->
|
||||
{{t_dailyRound.position}}
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="pa-0 mb-3">
|
||||
<!-- <my-helper :pretext="t_dailyRound[0]"/> -->
|
||||
<!-- <my-helper :pretext="t_dailyRound.position"/> -->
|
||||
<v-textarea
|
||||
v-model="searchname"
|
||||
clearable
|
||||
@@ -209,10 +209,11 @@ export default {
|
||||
idpos.value=pos
|
||||
dialogDetailRound.value=!dialogDetailRound.value
|
||||
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`).then(data => {
|
||||
console.log(data, '-------------------data');
|
||||
|
||||
t_dailyRound.value = data.data
|
||||
|
||||
result.value=JSON.parse(JSON.stringify(data.data))
|
||||
result.value=JSON.parse(JSON.stringify(data.data.daily))
|
||||
|
||||
})
|
||||
}
|
||||
@@ -238,16 +239,18 @@ export default {
|
||||
|
||||
axiosApiInstance.get('api/general_vacation/dailyload/')
|
||||
.then(data => {
|
||||
t_daily.value = data.data
|
||||
t_daily.value = data.data.daily
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
const filterItems = (query) => {
|
||||
console.log(t_dailyRound.value['daily'], '----------t_dailyRound.value');
|
||||
|
||||
|
||||
result.value={}
|
||||
Object.keys(t_dailyRound.value).map(el1 => {
|
||||
let myarr = t_dailyRound.value[el1].filter((el) =>el.fio.toLowerCase().includes(query.toLowerCase()))
|
||||
Object.keys(t_dailyRound.value['daily']).map(el1 => {
|
||||
let myarr = t_dailyRound.value['daily'][el1].filter((el) =>el.fio.toLowerCase().includes(query.toLowerCase()))
|
||||
|
||||
if(myarr.length>0)
|
||||
{
|
||||
@@ -268,7 +271,7 @@ export default {
|
||||
|
||||
}
|
||||
else {
|
||||
result.value = JSON.parse(JSON.stringify(t_dailyRound.value))
|
||||
result.value = JSON.parse(JSON.stringify(t_dailyRound.value['daily']))
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -297,10 +297,11 @@ class DailyloadAPIView(APIView):
|
||||
|
||||
result={}
|
||||
|
||||
|
||||
|
||||
|
||||
if request.GET.__contains__('id'):
|
||||
df=df.loc[df['idpos']==int(request.GET.get("id"))]
|
||||
pos=df['pos'].unique()[0]
|
||||
if request.GET.__contains__('searchname'):
|
||||
|
||||
df = df.loc[df["fio"].str.contains(request.GET.get("searchname"))]
|
||||
@@ -312,17 +313,18 @@ class DailyloadAPIView(APIView):
|
||||
result[row['department']].append({'login':row['login'],'fio':row['fio'], 'post':row['post'], 'pos':row['pos']})
|
||||
else:
|
||||
result[row['department']]=[{'login':row['login'],'fio':row['fio'], 'post':row['post'], 'pos':row['pos']}]
|
||||
|
||||
|
||||
daily = result
|
||||
|
||||
|
||||
|
||||
else:
|
||||
|
||||
pos=''
|
||||
daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user'))
|
||||
except Exception as e:
|
||||
|
||||
pos=''
|
||||
daily=""
|
||||
return Response(daily)
|
||||
return Response({'daily':daily, 'position':pos})
|
||||
|
||||
class SearchUserAPIView(APIView):
|
||||
def post(self, request):
|
||||
|
||||
Reference in new issue
Block a user