Сохранение
This commit is contained in:
1 parent
1bf6c58216
commit
2e7c29c065
4 files changed
+42
-23
No files matched your search
Binary file not shown.
@@ -44,7 +44,7 @@
|
|||||||
<v-row>
|
<v-row>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-file-input
|
<v-file-input
|
||||||
v-bind="props"
|
|
||||||
accept=".xlsx"
|
accept=".xlsx"
|
||||||
v-model="dailyfiles"
|
v-model="dailyfiles"
|
||||||
variant="underlined"
|
variant="underlined"
|
||||||
@@ -90,12 +90,12 @@ flat
|
|||||||
|
|
||||||
<v-row class="bggrad">
|
<v-row class="bggrad">
|
||||||
<v-col class="text-center text-black_and_white">
|
<v-col class="text-center text-black_and_white">
|
||||||
{{t_dailyRound.position}}
|
<!-- {{result[0].pos}} -->
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="pa-0 mb-3">
|
<v-col class="pa-0 mb-3">
|
||||||
<!-- <my-helper :pretext="t_dailyRound"/> -->
|
<!-- <my-helper :pretext="t_dailyRound[0]"/> -->
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="searchname"
|
v-model="searchname"
|
||||||
clearable
|
clearable
|
||||||
@@ -115,7 +115,7 @@ flat
|
|||||||
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-for="(x, key) in t_dailyRound.daily"
|
v-for="(x, key) in result"
|
||||||
:key="key"
|
:key="key"
|
||||||
class="px-3" >
|
class="px-3" >
|
||||||
|
|
||||||
@@ -191,12 +191,14 @@ export default {
|
|||||||
const t_daily = ref('')
|
const t_daily = ref('')
|
||||||
const idpos = ref('')
|
const idpos = ref('')
|
||||||
const dialogDetailRound = ref(false)
|
const dialogDetailRound = ref(false)
|
||||||
const t_dailyRound = ref('')
|
const t_dailyRound = ref({})
|
||||||
const dailyfiles = ref('')
|
const dailyfiles = ref([])
|
||||||
const info = ref({})
|
const info = ref({})
|
||||||
const searchname = ref('')
|
const searchname = ref('')
|
||||||
const menuGetUserDialog = ref(false)
|
const menuGetUserDialog = ref(false)
|
||||||
const iduser = ref('')
|
const iduser = ref('')
|
||||||
|
const result = ref({})
|
||||||
|
|
||||||
|
|
||||||
const getcard = async (idus) => {
|
const getcard = async (idus) => {
|
||||||
menuGetUserDialog.value = true
|
menuGetUserDialog.value = true
|
||||||
@@ -207,7 +209,11 @@ export default {
|
|||||||
idpos.value=pos
|
idpos.value=pos
|
||||||
dialogDetailRound.value=!dialogDetailRound.value
|
dialogDetailRound.value=!dialogDetailRound.value
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`).then(data => {
|
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`).then(data => {
|
||||||
|
|
||||||
t_dailyRound.value = data.data
|
t_dailyRound.value = data.data
|
||||||
|
|
||||||
|
result.value=JSON.parse(JSON.stringify(data.data))
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,27 +238,38 @@ export default {
|
|||||||
|
|
||||||
axiosApiInstance.get('api/general_vacation/dailyload/')
|
axiosApiInstance.get('api/general_vacation/dailyload/')
|
||||||
.then(data => {
|
.then(data => {
|
||||||
t_daily.value = data.data.daily
|
t_daily.value = data.data
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const filterItems = (query) => {
|
||||||
|
|
||||||
|
result.value={}
|
||||||
|
Object.keys(t_dailyRound.value).map(el1 => {
|
||||||
|
let myarr = t_dailyRound.value[el1].filter((el) =>el.fio.toLowerCase().includes(query.toLowerCase()))
|
||||||
|
|
||||||
|
if(myarr.length>0)
|
||||||
|
{
|
||||||
|
result.value[el1] = myarr
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
watch(()=> searchname.value,(newValue,oldValue)=>{
|
watch(()=> searchname.value,(newValue,oldValue)=>{
|
||||||
|
|
||||||
if(newValue){
|
if(newValue){
|
||||||
|
filterItems(newValue)
|
||||||
|
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${idpos.value}&searchname=${newValue}`)
|
|
||||||
.then(data => {
|
|
||||||
|
|
||||||
t_dailyRound.value = data.data
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${idpos.value}`)
|
result.value = JSON.parse(JSON.stringify(t_dailyRound.value))
|
||||||
.then(data => {
|
|
||||||
|
|
||||||
t_dailyRound.value = data.data
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}, {deep:true})
|
}, {deep:true})
|
||||||
@@ -275,7 +292,8 @@ export default {
|
|||||||
spravURL,
|
spravURL,
|
||||||
menuGetUserDialog,
|
menuGetUserDialog,
|
||||||
iduser,
|
iduser,
|
||||||
getcard
|
getcard,
|
||||||
|
result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -292,11 +292,12 @@ class DailyloadAPIView(APIView):
|
|||||||
df_user = pd.DataFrame.from_records(user)
|
df_user = pd.DataFrame.from_records(user)
|
||||||
df_daily = pd.DataFrame.from_records(dailyr)
|
df_daily = pd.DataFrame.from_records(dailyr)
|
||||||
df_daily.columns = ["login", "pos", "idpos"]
|
df_daily.columns = ["login", "pos", "idpos"]
|
||||||
|
|
||||||
df = pd.merge(df_user, df_daily, left_on= 'login', right_on="login")
|
df = pd.merge(df_user, df_daily, left_on= 'login', right_on="login")
|
||||||
|
|
||||||
result={}
|
result={}
|
||||||
|
|
||||||
pos=dailyr[0][1]
|
|
||||||
|
|
||||||
if request.GET.__contains__('id'):
|
if request.GET.__contains__('id'):
|
||||||
df=df.loc[df['idpos']==int(request.GET.get("id"))]
|
df=df.loc[df['idpos']==int(request.GET.get("id"))]
|
||||||
@@ -308,20 +309,20 @@ class DailyloadAPIView(APIView):
|
|||||||
|
|
||||||
for index, row in df.iterrows ():
|
for index, row in df.iterrows ():
|
||||||
if row['department'] in result.keys():
|
if row['department'] in result.keys():
|
||||||
result[row['department']].append({'login':row['login'],'fio':row['fio'], 'post':row['post']})
|
result[row['department']].append({'login':row['login'],'fio':row['fio'], 'post':row['post'], 'pos':row['pos']})
|
||||||
else:
|
else:
|
||||||
result[row['department']]=[{'login':row['login'],'fio':row['fio'], 'post':row['post']}]
|
result[row['department']]=[{'login':row['login'],'fio':row['fio'], 'post':row['post'], 'pos':row['pos']}]
|
||||||
|
|
||||||
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'))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pos=''
|
|
||||||
daily=""
|
daily=""
|
||||||
return Response({'daily':daily, 'position':pos})
|
return Response(daily)
|
||||||
|
|
||||||
class SearchUserAPIView(APIView):
|
class SearchUserAPIView(APIView):
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 MiB |
Reference in new issue
Block a user