Вывод на экран
This commit is contained in:
1 parent
b437bfa7b0
commit
30f0dee390
7 files changed
+56
-27
No files matched your search
BIN
Binary file not shown.
@@ -52,7 +52,10 @@
|
||||
<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 = ''/> -->
|
||||
<v-row v-for="x in stat" :key="x">
|
||||
|
||||
<v-col>
|
||||
<v-card
|
||||
|
||||
@@ -62,7 +65,7 @@
|
||||
elevation="0"
|
||||
|
||||
>
|
||||
|
||||
|
||||
<v-card class="h-100 text-center g text-numeral bg-main_theme">
|
||||
<v-card-title class="statstyle py-0 text-overline font-weight-bold bg-main_theme">
|
||||
{{x.status}}
|
||||
@@ -153,7 +156,7 @@
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
import CalendarFull from '@/components/UI/Calendar-full.vue'
|
||||
import NewsListHome from '@/components/news-list-home.vue'
|
||||
|
||||
import {getfromserver} from '@/utils/universal_functions'
|
||||
export default {
|
||||
|
||||
components: {
|
||||
@@ -166,12 +169,14 @@
|
||||
|
||||
setup(){
|
||||
const t_baseCriteria = ref([])
|
||||
const t_daily = ref('')
|
||||
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
proba()
|
||||
proba(),
|
||||
dailyfun()
|
||||
})
|
||||
|
||||
const appStore = useAppStore()
|
||||
@@ -204,7 +209,19 @@
|
||||
.then(data => {
|
||||
t_baseCriteria.value = data.data.results
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
function dailyfun(){
|
||||
// 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
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
accountStore,
|
||||
stat,
|
||||
@@ -212,6 +229,7 @@
|
||||
onlines,
|
||||
appStore,
|
||||
proba,
|
||||
t_daily
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class DailyRoundUp(models.Model):
|
||||
verbose_name_plural = "Ежедневный обход"
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
return str(self.position)
|
||||
|
||||
class GeneralVacation(models.Model):
|
||||
CHOICES = (
|
||||
|
||||
@@ -11,4 +11,11 @@ class PlanCalendarSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = PlanCalendar
|
||||
fields ='__all__'
|
||||
fields ='__all__'
|
||||
|
||||
class DailyRoundUpSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = DailyRoundUp
|
||||
fields ='__all__'
|
||||
|
||||
@@ -5,4 +5,5 @@ from .views import *
|
||||
urlpatterns = [
|
||||
path('generalvacation/', GeneralVacationAPIView.as_view(), name='generalvacation'),
|
||||
path('dailyroundup/', DailyRoundUpAPIView.as_view(), name='dailyroundup'),
|
||||
path('dailyload/', DailyloadAPIView.as_view(), name='dailyload'),
|
||||
]
|
||||
+25
-22
@@ -1,4 +1,4 @@
|
||||
import datetime
|
||||
from datetime import datetime
|
||||
import os
|
||||
from openpyxl import load_workbook
|
||||
import openpyxl
|
||||
@@ -196,30 +196,15 @@ class DailyRoundUpAPIView(APIView):
|
||||
ws.cell(row = k+3, column=8).value = f"=F{k+1}-H{k+1}-J{k+1}-L{k+1}"
|
||||
ws.cell(row = k+3, column=8).font = Font(name='Times New Roman', size=14, bold=True)
|
||||
|
||||
# print(ws.write(k+3, col, 'hhh'), '-------------------1')
|
||||
|
||||
|
||||
wb.save(file_path)
|
||||
|
||||
# urllib.request.urlretrieve(file_path, 'Пупка.xlsx')
|
||||
|
||||
# file_path = 'media/DailyRoundUp.xlsx'
|
||||
|
||||
|
||||
return Response(file_path)
|
||||
|
||||
# with ExcelWriter(file_path, mode="a" if os.path.exists(file_path) else "w" , if_sheet_exists='replace') as writer:
|
||||
# #
|
||||
# for i in df['department'].unique():
|
||||
# for i in df['department'].unique():
|
||||
# k = pd.DataFrame(df[(df.department==i)][['tabel', 'familyname', 'name', 'parentname']])
|
||||
# # k.to_excel(writer,header=None,index=None)
|
||||
# print(i)
|
||||
# print(k)
|
||||
# return Response('')
|
||||
#
|
||||
#
|
||||
# df.to_excel(table)
|
||||
|
||||
|
||||
def post(self, request):
|
||||
@@ -236,7 +221,7 @@ class DailyRoundUpAPIView(APIView):
|
||||
|
||||
# DailyRoundUp.objects.update_or_create(todaysDate=datetime.datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'), defaults={'user':self.request.user, 'position':base})
|
||||
df.columns = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"]
|
||||
df=df.iloc[6:, ]
|
||||
df=df.iloc[6:]
|
||||
df= df[df.b.notna()]
|
||||
df= df[df.a.notna()]
|
||||
df['b']=df['b'].str[-3:]
|
||||
@@ -253,7 +238,6 @@ class DailyRoundUpAPIView(APIView):
|
||||
df3=df3[['login', 'f', 'h', 'j','l']]
|
||||
|
||||
|
||||
# base=BasePosition.objects.get(pk=keys)
|
||||
|
||||
for ind in df3.index:
|
||||
keys = ''
|
||||
@@ -266,11 +250,30 @@ class DailyRoundUpAPIView(APIView):
|
||||
else:
|
||||
keys = 6
|
||||
base=BasePosition.objects.get(pk=keys)
|
||||
DailyRoundUp.objects.update_or_create(todaysDate=datetime.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})
|
||||
|
||||
print(base)
|
||||
|
||||
|
||||
|
||||
# serializer_for_daily = DailyRoundUpSerializer(
|
||||
# instance=daily, # Передаём набор записей
|
||||
# many=True # Указываем, что на вход подаётся именно набор записей
|
||||
# )
|
||||
|
||||
|
||||
|
||||
return Response('')
|
||||
return Response("")
|
||||
|
||||
|
||||
class DailyloadAPIView(APIView):
|
||||
def get(self, request):
|
||||
daily = DailyRoundUp.objects.filter(todaysDate=datetime.now())
|
||||
print(daily, '-----------------------------')
|
||||
|
||||
#
|
||||
# serializer_for_daily = DailyRoundUpSerializer(
|
||||
# instance=daily, # Передаём набор записей
|
||||
# many=True # Указываем, что на вход подаётся именно набор записей
|
||||
# )
|
||||
return Response('kkkk')
|
||||
# return Response({"Обход":serializer_for_daily})
|
||||
Binary file not shown.
Reference in new issue
Block a user