Сохранить
This commit is contained in:
1 parent
30f0dee390
commit
5e592bd562
4 files changed
+14
-12
No files matched your search
BIN
Binary file not shown.
@@ -52,8 +52,8 @@
|
|||||||
<v-row class="flex-grow-1 ma-0 mx-1">
|
<v-row class="flex-grow-1 ma-0 mx-1">
|
||||||
<v-col class="pt-0">
|
<v-col class="pt-0">
|
||||||
<v-card class="h-100 flex-column">
|
<v-card class="h-100 flex-column">
|
||||||
{{t_daily}} kk
|
|
||||||
<!-- <my-helper :pretext = ''/> -->
|
<my-helper :pretext = 't_daily'/>
|
||||||
<v-row v-for="x in stat" :key="x">
|
<v-row v-for="x in stat" :key="x">
|
||||||
|
|
||||||
<v-col>
|
<v-col>
|
||||||
@@ -217,7 +217,7 @@
|
|||||||
// getfromserver(`api/general_vacation/dailyload/`, t_daily.value)
|
// getfromserver(`api/general_vacation/dailyload/`, t_daily.value)
|
||||||
axiosApiInstance.get('api/general_vacation/dailyload/')
|
axiosApiInstance.get('api/general_vacation/dailyload/')
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log(data.data);
|
|
||||||
t_daily.value = data.data
|
t_daily.value = data.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ class BasePosition(models.Model):
|
|||||||
|
|
||||||
class DailyRoundUp(models.Model):
|
class DailyRoundUp(models.Model):
|
||||||
todaysDate = models.DateField(verbose_name='Начало рабочего периода')
|
todaysDate = models.DateField(verbose_name='Начало рабочего периода')
|
||||||
user = models.CharField(max_length=100)
|
user = models.CharField(max_length=100, verbose_name='Логин')
|
||||||
position = models.ForeignKey(BasePosition, on_delete=models.PROTECT, verbose_name='Позиция')
|
position = models.ForeignKey(BasePosition, on_delete=models.PROTECT, related_name="get_position", verbose_name='Позиция')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Ежедневный обход"
|
verbose_name = "Ежедневный обход"
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'id')
|
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'id')
|
||||||
dfuser = pd.DataFrame.from_records(user)
|
dfuser = pd.DataFrame.from_records(user)
|
||||||
# print(dfuser)
|
# print(dfuser)
|
||||||
|
try:
|
||||||
file = request.data['dailyfiles']
|
file = request.data['dailyfiles']
|
||||||
ed = pd.read_excel(file)
|
ed = pd.read_excel(file)
|
||||||
df = pd.DataFrame(ed)
|
df = pd.DataFrame(ed)
|
||||||
@@ -252,7 +253,8 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
base=BasePosition.objects.get(pk=keys)
|
base=BasePosition.objects.get(pk=keys)
|
||||||
DailyRoundUp.objects.update_or_create(todaysDate=datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'),
|
DailyRoundUp.objects.update_or_create(todaysDate=datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'),
|
||||||
user=df3['login'][ind], defaults={'position':base})
|
user=df3['login'][ind], defaults={'position':base})
|
||||||
|
except Exception as e:
|
||||||
|
err = 'Файл не найден'
|
||||||
|
|
||||||
|
|
||||||
# serializer_for_daily = DailyRoundUpSerializer(
|
# serializer_for_daily = DailyRoundUpSerializer(
|
||||||
@@ -262,7 +264,7 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Response("")
|
return Response(err)
|
||||||
|
|
||||||
|
|
||||||
class DailyloadAPIView(APIView):
|
class DailyloadAPIView(APIView):
|
||||||
@@ -271,9 +273,9 @@ class DailyloadAPIView(APIView):
|
|||||||
print(daily, '-----------------------------')
|
print(daily, '-----------------------------')
|
||||||
|
|
||||||
#
|
#
|
||||||
# serializer_for_daily = DailyRoundUpSerializer(
|
serializer_for_daily = DailyRoundUpSerializer(
|
||||||
# instance=daily, # Передаём набор записей
|
instance=daily, # Передаём набор записей
|
||||||
# many=True # Указываем, что на вход подаётся именно набор записей
|
many=True # Указываем, что на вход подаётся именно набор записей
|
||||||
# )
|
)
|
||||||
return Response('kkkk')
|
return Response(serializer_for_daily.data)
|
||||||
# return Response({"Обход":serializer_for_daily})
|
# return Response({"Обход":serializer_for_daily})
|
||||||
Reference in new issue
Block a user