Сохранить
This commit is contained in:
1 parent
03f8d9cd65
commit
c1b7474137
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-col class="pt-0">
|
||||
<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-col>
|
||||
@@ -217,7 +217,7 @@
|
||||
// getfromserver(`api/general_vacation/dailyload/`, t_daily.value)
|
||||
axiosApiInstance.get('api/general_vacation/dailyload/')
|
||||
.then(data => {
|
||||
console.log(data.data);
|
||||
|
||||
t_daily.value = data.data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ class BasePosition(models.Model):
|
||||
|
||||
class DailyRoundUp(models.Model):
|
||||
todaysDate = models.DateField(verbose_name='Начало рабочего периода')
|
||||
user = models.CharField(max_length=100)
|
||||
position = models.ForeignKey(BasePosition, on_delete=models.PROTECT, verbose_name='Позиция')
|
||||
user = models.CharField(max_length=100, verbose_name='Логин')
|
||||
position = models.ForeignKey(BasePosition, on_delete=models.PROTECT, related_name="get_position", verbose_name='Позиция')
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Ежедневный обход"
|
||||
|
||||
@@ -211,6 +211,7 @@ class DailyRoundUpAPIView(APIView):
|
||||
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'id')
|
||||
dfuser = pd.DataFrame.from_records(user)
|
||||
# print(dfuser)
|
||||
try:
|
||||
file = request.data['dailyfiles']
|
||||
ed = pd.read_excel(file)
|
||||
df = pd.DataFrame(ed)
|
||||
@@ -252,7 +253,8 @@ 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})
|
||||
|
||||
except Exception as e:
|
||||
err = 'Файл не найден'
|
||||
|
||||
|
||||
# serializer_for_daily = DailyRoundUpSerializer(
|
||||
@@ -262,7 +264,7 @@ class DailyRoundUpAPIView(APIView):
|
||||
|
||||
|
||||
|
||||
return Response("")
|
||||
return Response(err)
|
||||
|
||||
|
||||
class DailyloadAPIView(APIView):
|
||||
@@ -271,9 +273,9 @@ class DailyloadAPIView(APIView):
|
||||
print(daily, '-----------------------------')
|
||||
|
||||
#
|
||||
# serializer_for_daily = DailyRoundUpSerializer(
|
||||
# instance=daily, # Передаём набор записей
|
||||
# many=True # Указываем, что на вход подаётся именно набор записей
|
||||
# )
|
||||
return Response('kkkk')
|
||||
serializer_for_daily = DailyRoundUpSerializer(
|
||||
instance=daily, # Передаём набор записей
|
||||
many=True # Указываем, что на вход подаётся именно набор записей
|
||||
)
|
||||
return Response(serializer_for_daily.data)
|
||||
# return Response({"Обход":serializer_for_daily})
|
||||
Reference in new issue
Block a user