Уксель
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-row class="flex-grow-1 ma-0 mx-1">
|
||||
<v-col class="pt-0">
|
||||
{{[t_daily.daily]}}
|
||||
|
||||
<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">
|
||||
@@ -158,10 +158,10 @@
|
||||
height="500"
|
||||
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-toolbar-title>Inbox</v-toolbar-title>
|
||||
@@ -169,10 +169,10 @@
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn variant="text" icon="mdi-magnify"></v-btn>
|
||||
</v-toolbar>
|
||||
</v-toolbar> -->
|
||||
|
||||
<div
|
||||
v-for="(x, key) in t_dailyRound"
|
||||
v-for="(x, key) in t_dailyRound.daily"
|
||||
:key="key"
|
||||
class="px-3" >
|
||||
|
||||
|
||||
@@ -5,14 +5,11 @@
|
||||
<v-col cols="6"
|
||||
class="text-h6 text-grey text-center d-flex align-baseline align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
<!-- <v-btn
|
||||
class="mr-2"
|
||||
color="app_bar"
|
||||
>
|
||||
Excel
|
||||
</v-btn> -->
|
||||
<!-- :href="`${baseURL}media/DailyRoundUp.xlsx`"
|
||||
download -->
|
||||
{{t_dailyRound}}
|
||||
|
||||
<v-btn @click="detailRound">
|
||||
Тык
|
||||
</v-btn>
|
||||
<v-btn
|
||||
|
||||
class="mr-2"
|
||||
@@ -54,6 +51,8 @@ export default {
|
||||
setup(){
|
||||
const dailyfiles = ref('')
|
||||
const visiting = ref({})
|
||||
const info = ref({})
|
||||
const t_dailyRound = ref('')
|
||||
const excelOp = () => {
|
||||
axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => {
|
||||
let link = document.createElement("a")
|
||||
@@ -68,21 +67,35 @@ export default {
|
||||
|
||||
const sdata = new FormData()
|
||||
sdata.append('dailyfiles', dailyfiles.value[0])
|
||||
|
||||
|
||||
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 {
|
||||
visiting,
|
||||
excelOp,
|
||||
baseURL,
|
||||
dailyfiles,
|
||||
onPickFile,
|
||||
info,
|
||||
detailRound,
|
||||
t_dailyRound
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -214,7 +214,7 @@ class DailyRoundUpAPIView(APIView):
|
||||
dfuser = pd.DataFrame.from_records(user)
|
||||
|
||||
try:
|
||||
print(request.data['dailyfiles'], '============================================')
|
||||
|
||||
file = request.data['dailyfiles']
|
||||
ed = pd.read_excel(file)
|
||||
df = pd.DataFrame(ed)
|
||||
@@ -258,9 +258,15 @@ class DailyRoundUpAPIView(APIView):
|
||||
base=BasePosition.objects.get(pk=keys)
|
||||
DailyRoundUp.objects.update_or_create(todaysDate=datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'),
|
||||
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:
|
||||
err = 'Файл не найден'
|
||||
mess = 'Файл не найден'
|
||||
|
||||
|
||||
# serializer_for_daily = DailyRoundUpSerializer(
|
||||
@@ -270,7 +276,7 @@ class DailyRoundUpAPIView(APIView):
|
||||
|
||||
|
||||
|
||||
return Response('')
|
||||
return Response({"mess": mess, "pos": pos})
|
||||
|
||||
|
||||
class DailyloadAPIView(APIView):
|
||||
@@ -279,22 +285,16 @@ class DailyloadAPIView(APIView):
|
||||
if request.GET.__contains__('id'):
|
||||
|
||||
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])
|
||||
for x in u:
|
||||
|
||||
if x.department in result.keys():
|
||||
result[x.department].append({'login':x.login,'fio':x.fio, 'post':x.post})
|
||||
else:
|
||||
result[x.department]=[{'login':x.login,'fio':x.fio, 'post':x.post}]
|
||||
# result['position'] = request.GET.get("id")
|
||||
daily = result
|
||||
else:
|
||||
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")})
|
||||
Reference in new issue
Block a user