Подготовка к обновлению РБС (условная отрисовка журналов geoproc)
This commit is contained in:
parent
30a1a7fec2
commit
5edc068969
@ -4,135 +4,153 @@
|
||||
|
||||
|
||||
{% block header_link %}
|
||||
<link type="text/css" rel="stylesheet" href="{% static '/css/speedometer.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<link type="text/css" rel="stylesheet"
|
||||
href="{% static '/css/speedometer.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
{% endblock header_link %}
|
||||
|
||||
{% block info_title %}
|
||||
<h5>Система контроля геомеханических процессов</h5>
|
||||
<h5>Система контроля геомеханических процессов</h5>
|
||||
{% endblock info_title %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<section class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1>Система контроля геомеханических процессов</h1>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="/main/">Главная</a></li>
|
||||
<li class="breadcrumb-item active">Система контроля геомеханических процессов</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<!-- Main content -->
|
||||
<div class="invoice p-3 mb-3">
|
||||
<!-- title row -->
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<h4 style="color:green">
|
||||
Справочники
|
||||
</h4>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-6">
|
||||
<h4 style="color:green">
|
||||
Показания
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<!-- info row -->
|
||||
<div class="row">
|
||||
<div class="col-sm-6 invoice-col">
|
||||
<div class="col-sm-3 invoice-col">
|
||||
<a href="obstation/list/"><strong>Наблюдательные станции</strong></a>
|
||||
<br><p style="font-size:12px;fon">Список наблюдательных станций</p>
|
||||
</div>
|
||||
<div class="col-sm-3 invoice-col">
|
||||
<a href="point/list/"><strong>Реперы</strong></a>
|
||||
<br><p style="font-size:12px;fon">Список реперов</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 invoice-col">
|
||||
<div class="row">
|
||||
<div class="col invoice-col">
|
||||
<i class="fas fa-book"></i> <a href="monitoring/list/"><strong> Открыть</strong></a>
|
||||
<br><p style="font-size:12px;fon">Показания журнала наблюдательной станции</p>
|
||||
|
||||
</div>
|
||||
<div class="col invoice-col">
|
||||
<i class="fas fa-book"></i> <a href="monitoring/journal/"> <strong> Открыть</strong></a>
|
||||
<br><p style="font-size:12px;fon">Журнал визуальных наблюдений</p>
|
||||
|
||||
</div>
|
||||
<div class="col invoice-col">
|
||||
<i class="fas fa-book"></i><a href="monitoring/journal_m/"><strong> Открыть</strong></a>
|
||||
<br><p style="font-size:12px;fon">Журнал указаний и уведомлений</p>
|
||||
|
||||
</div>
|
||||
<div class="col invoice-col">
|
||||
<i class="fas fa-book"></i> <a href="monitoring/journal_obs/"><strong> Открыть</strong></a>
|
||||
<br><p style="font-size:12px;fon">Журнал наблюдений за состоянием бортов,траншей,уступов,откосов и отвалов</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<section class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1>Система контроля геомеханических процессов</h1>
|
||||
</div>
|
||||
<!-- /.invoice -->
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<!-- Main content -->
|
||||
<div class="invoice p-3 mb-3">
|
||||
<!-- title row -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h4 style="color:green">
|
||||
<i class="nav-icon fas fa-copy"></i> Отчеты
|
||||
</h4>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!-- info row -->
|
||||
<div class="row ">
|
||||
<div class="col-sm-2 invoice-col">
|
||||
<a href="/geoproc/report/j/"><strong>Журнал контроля</strong></a>
|
||||
<br><p style="font-size:12px;fon">Журнал контроля за деформациями</p>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-4 invoice-col">
|
||||
<a href="/geoproc/report/jc/"><strong>Открыть</strong></a>
|
||||
<br><p style="font-size:12px;fon">Контроль ведения журналов </p>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="/main/">Главная</a></li>
|
||||
<li class="breadcrumb-item active">Система контроля геомеханических процессов</li>
|
||||
</ol>
|
||||
</div>
|
||||
<!-- /.invoice -->
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
</div>
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<!-- Main content -->
|
||||
<div class="invoice p-3 mb-3">
|
||||
<!-- title row -->
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<h4 style="color:green">
|
||||
Справочники
|
||||
</h4>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-6">
|
||||
<h4 style="color:green">
|
||||
Показания
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<!-- info row -->
|
||||
<div class="row">
|
||||
<div class="col-sm-6 invoice-col">
|
||||
<div class="col-sm-3 invoice-col">
|
||||
<a href="obstation/list/"><strong>Наблюдательные станции</strong></a>
|
||||
<br>
|
||||
<p style="font-size:12px;fon">Список наблюдательных станций</p>
|
||||
</div>
|
||||
<div class="col-sm-3 invoice-col">
|
||||
<a href="point/list/"><strong>Реперы</strong></a>
|
||||
<br>
|
||||
<p style="font-size:12px;fon">Список реперов</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 invoice-col">
|
||||
<div class="row">
|
||||
{% if geoproc_show_monitoring_list %}
|
||||
<div class="col invoice-col">
|
||||
<i class="fas fa-book"></i>
|
||||
<a href="monitoring/list/"><strong>Открыть</strong></a><br>
|
||||
<p style="font-size:12px;">Показания журнала наблюдательной станции</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if geoproc_show_monitoring_journal %}
|
||||
<div class="col invoice-col">
|
||||
<i class="fas fa-book"></i>
|
||||
<a href="monitoring/journal/"><strong>Открыть</strong></a><br>
|
||||
<p style="font-size:12px;">Журнал визуальных наблюдений</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if geoproc_show_monitoring_journal_m %}
|
||||
<div class="col invoice-col">
|
||||
<i class="fas fa-book"></i>
|
||||
<a href="monitoring/journal_m/"><strong> Открыть</strong></a><br>
|
||||
<p style="font-size:12px;">Журнал указаний и уведомлений</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if geoproc_show_monitoring_journal_obs %}
|
||||
<div class="col invoice-col">
|
||||
<i class="fas fa-book"></i>
|
||||
<a href="monitoring/journal_obs/"><strong> Открыть</strong></a><br>
|
||||
<p style="font-size:12px;">Журнал наблюдений за состоянием
|
||||
бортов,траншей,уступов,откосов и отвалов</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.invoice -->
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<!-- Main content -->
|
||||
<div class="invoice p-3 mb-3">
|
||||
<!-- title row -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h4 style="color:green">
|
||||
<i class="nav-icon fas fa-copy"></i> Отчеты
|
||||
</h4>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!-- info row -->
|
||||
<div class="row ">
|
||||
<div class="col-sm-2 invoice-col">
|
||||
<a href="/geoproc/report/j/"><strong>Журнал контроля</strong></a>
|
||||
<br>
|
||||
<p style="font-size:12px;fon">Журнал контроля за деформациями</p>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-4 invoice-col">
|
||||
<a href="/geoproc/report/jc/"><strong>Открыть</strong></a>
|
||||
<br>
|
||||
<p style="font-size:12px;fon">Контроль ведения журналов </p>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.invoice -->
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block script_footer %}
|
||||
<script src="{% static 'js/gauge.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'js/speedometer.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script></script>
|
||||
<script src="{% static 'js/gauge.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'js/speedometer.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script></script>
|
||||
{% endblock script_footer %}
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
<th>Отметка об ознакомлении начальника участка</th>
|
||||
<th>Отметка проверяющего о выполнении распоряжения</th>
|
||||
<th style="text-align: center;vertical-align: middle;">Отметка об ознакомлении главного геолога</th>
|
||||
<th style="text-align: center;vertical-align: middle;">Отметка об ознакомлении главного технолога</th>
|
||||
<th style="text-align: center;vertical-align: middle;">Отметка об ознакомлении {{ coordinating_position }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody_journal">
|
||||
|
||||
@ -15,7 +15,7 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
from apps.general.views.settingsmodule import get_settings
|
||||
from apps.geoproc.models.model_journalobs import JournalObs
|
||||
from apps.geoproc.models.model_journalobs_table import JournalObsTable
|
||||
|
||||
@ -95,6 +95,7 @@ def monitoring_journal_edit(request):
|
||||
@never_cache
|
||||
def monitoring_journal_add(request):
|
||||
try:
|
||||
get_settings('coordinating_position', 'главного технолога')
|
||||
date = datetime.now()
|
||||
day = "0" if date.day < 10 else ""
|
||||
day += str(date.day)
|
||||
|
||||
@ -4,7 +4,6 @@ import os
|
||||
import io
|
||||
import json
|
||||
|
||||
|
||||
from django.shortcuts import render
|
||||
from django.http import HttpResponse
|
||||
from django.conf import settings
|
||||
@ -15,6 +14,7 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from apps.general.views import settingsmodule
|
||||
from apps.geoproc.models.model_obstation import ObStation
|
||||
from apps.geoproc.models.model_point import Point
|
||||
from apps.geoproc.forms.form_point import PointForm
|
||||
@ -29,8 +29,8 @@ from apps.util import generalmodule
|
||||
def point_edit(request):
|
||||
try:
|
||||
context = generalmodule.get_context_template()
|
||||
param_post=request.POST.dict()
|
||||
param_get=request.GET.dict()
|
||||
param_post = request.POST.dict()
|
||||
param_get = request.GET.dict()
|
||||
|
||||
if request.method == "GET":
|
||||
point = Point.objects.get(id=param_get['id'])
|
||||
@ -38,49 +38,51 @@ def point_edit(request):
|
||||
context.update({
|
||||
'form': form,
|
||||
'point': point,
|
||||
})
|
||||
return render(request, 'point_edit.html',context)
|
||||
})
|
||||
return render(request, 'point_edit.html', context)
|
||||
|
||||
if request.method == "POST":
|
||||
point = Point.objects.get(id=param_post['id'])
|
||||
form = PointForm(instance=point)
|
||||
context.update({
|
||||
'form':form,
|
||||
'point':point,
|
||||
'mt':'save',
|
||||
})
|
||||
return render(request, 'point_edit.html',context)
|
||||
'form': form,
|
||||
'point': point,
|
||||
'mt': 'save',
|
||||
})
|
||||
return render(request, 'point_edit.html', context)
|
||||
except Exception as err:
|
||||
logging.error(traceback.format_exc())
|
||||
|
||||
|
||||
@login_required(login_url='/')
|
||||
@never_cache
|
||||
def point_save(request):
|
||||
try:
|
||||
param=request.POST.dict()
|
||||
param = request.POST.dict()
|
||||
if request.method == "POST":
|
||||
if param['id'] =='':
|
||||
if param['id'] == '':
|
||||
form = PointForm(request.POST)
|
||||
else:
|
||||
point = Point.objects.get(id=param['id'])
|
||||
form = PointForm(request.POST,instance=point)
|
||||
form = PointForm(request.POST, instance=point)
|
||||
if form.is_valid():
|
||||
point = form.save(commit=False)
|
||||
point.save()
|
||||
context = generalmodule.get_context_template()
|
||||
context.update({
|
||||
'form':form,
|
||||
'mt':'edit',
|
||||
})
|
||||
'form': form,
|
||||
'mt': 'edit',
|
||||
})
|
||||
return redirect('/geoproc/point/list/')
|
||||
except Exception as err:
|
||||
logging.error(traceback.format_exc())
|
||||
|
||||
|
||||
@login_required(login_url='/')
|
||||
@never_cache
|
||||
def point_add(request):
|
||||
try:
|
||||
param=request.POST.dict()
|
||||
param = request.POST.dict()
|
||||
if request.method == "POST":
|
||||
form = PointForm(request.POST)
|
||||
if form.is_valid():
|
||||
@ -88,67 +90,70 @@ def point_add(request):
|
||||
client.save()
|
||||
return redirect('/geoproc/point/list/')
|
||||
else:
|
||||
form =PointForm()
|
||||
form = PointForm()
|
||||
context = generalmodule.get_context_template()
|
||||
context.update({
|
||||
'form':form,
|
||||
'mt':'add',
|
||||
})
|
||||
return render(request, 'point_edit.html',context)
|
||||
'form': form,
|
||||
'mt': 'add',
|
||||
})
|
||||
return render(request, 'point_edit.html', context)
|
||||
except Exception as err:
|
||||
logging.error(traceback.format_exc())
|
||||
|
||||
|
||||
@login_required(login_url='/')
|
||||
@never_cache
|
||||
def point_list(request):
|
||||
try:
|
||||
param=request.GET.dict()
|
||||
param = request.GET.dict()
|
||||
# catalog_list=Point.objects.order_by("obstation").all()
|
||||
catalog_list=ObStation.objects.prefetch_related('point_set').order_by("name")
|
||||
catalog_list = ObStation.objects.prefetch_related(
|
||||
'point_set').order_by("name")
|
||||
for catalog in catalog_list:
|
||||
catalog.sorted_points = sorted(catalog.point_set.all(),
|
||||
key=lambda point: natural_sort_key(point.name))
|
||||
key=lambda point: natural_sort_key(
|
||||
point.name))
|
||||
catalog_count = catalog_list.count()
|
||||
paginator = Paginator(catalog_list, 50)
|
||||
page_number = request.GET.get('page',1)
|
||||
page=paginator.get_page(page_number)
|
||||
num_pages=page.paginator.num_pages
|
||||
num_pages_krat = num_pages//30
|
||||
list_num = int(page_number)//30
|
||||
if list_num<int(page_number)/30:
|
||||
list_num=list_num+1
|
||||
page_list_end=(list_num*30)+1
|
||||
if page_list_end>num_pages:
|
||||
page_list_end=num_pages+1
|
||||
page_list_start=((list_num*30)-30)+1
|
||||
if page_list_start<1:
|
||||
page_list_start=1
|
||||
page_list=range(page_list_start,page_list_end)
|
||||
end_page_list=list_num*30
|
||||
start_page_list=(list_num*30)-29
|
||||
page_number = request.GET.get('page', 1)
|
||||
page = paginator.get_page(page_number)
|
||||
num_pages = page.paginator.num_pages
|
||||
num_pages_krat = num_pages // 30
|
||||
list_num = int(page_number) // 30
|
||||
if list_num < int(page_number) / 30:
|
||||
list_num = list_num + 1
|
||||
page_list_end = (list_num * 30) + 1
|
||||
if page_list_end > num_pages:
|
||||
page_list_end = num_pages + 1
|
||||
page_list_start = ((list_num * 30) - 30) + 1
|
||||
if page_list_start < 1:
|
||||
page_list_start = 1
|
||||
page_list = range(page_list_start, page_list_end)
|
||||
end_page_list = list_num * 30
|
||||
start_page_list = (list_num * 30) - 29
|
||||
if page.has_previous():
|
||||
perv_url='page={}'.format(page.previous_page_number())
|
||||
perv_url = 'page={}'.format(page.previous_page_number())
|
||||
else:
|
||||
perv_url=''
|
||||
perv_url = ''
|
||||
if page.has_next():
|
||||
next_url='page={}'.format(page.next_page_number())
|
||||
next_url = 'page={}'.format(page.next_page_number())
|
||||
else:
|
||||
next_url=''
|
||||
next_url = ''
|
||||
context = generalmodule.get_context_template()
|
||||
context.update({
|
||||
'page_object' : page,
|
||||
'is_paginated':page.has_other_pages(),
|
||||
'perv_url':perv_url,
|
||||
'next_url':next_url,
|
||||
'num_pages':num_pages,
|
||||
'menuopen':'menu-open',
|
||||
'puti':'Главная',
|
||||
'page_list':page_list,
|
||||
'end_page_list':end_page_list,
|
||||
'start_page_list':start_page_list,
|
||||
'clients_count':catalog_count,
|
||||
})
|
||||
return render(request,'point_list.html', context)
|
||||
'page_object': page,
|
||||
'is_paginated': page.has_other_pages(),
|
||||
'perv_url': perv_url,
|
||||
'next_url': next_url,
|
||||
'num_pages': num_pages,
|
||||
'menuopen': 'menu-open',
|
||||
'puti': 'Главная',
|
||||
'page_list': page_list,
|
||||
'end_page_list': end_page_list,
|
||||
'start_page_list': start_page_list,
|
||||
'clients_count': catalog_count,
|
||||
})
|
||||
return render(request, 'point_list.html', context)
|
||||
except Exception as err:
|
||||
logging.error(traceback.format_exc())
|
||||
|
||||
@ -158,8 +163,23 @@ def point_list(request):
|
||||
def main_index(request):
|
||||
try:
|
||||
context = generalmodule.get_context_template()
|
||||
show_monitoring_list = bool(int(settingsmodule.get_settings(
|
||||
'show_monitoring_list', '1')))
|
||||
show_monitoring_journal = bool(int(settingsmodule.get_settings(
|
||||
'show_monitoring_journal', '1'
|
||||
)))
|
||||
show_monitoring_journal_m = bool(int(settingsmodule.get_settings(
|
||||
'show_monitoring_journal_m', '1'
|
||||
)))
|
||||
show_monitoring_journal_obs = bool(int(settingsmodule.get_settings(
|
||||
'show_monitoring_journal_obs', '1'
|
||||
)))
|
||||
context.update({
|
||||
})
|
||||
return render(request,'geoproc_main.html', context)
|
||||
"geoproc_show_monitoring_list": show_monitoring_list,
|
||||
"geoproc_show_monitoring_journal": show_monitoring_journal,
|
||||
"geoproc_show_monitoring_journal_m": show_monitoring_journal_m,
|
||||
"geoproc_show_monitoring_journal_obs": show_monitoring_journal_obs
|
||||
})
|
||||
return render(request, 'geoproc_main.html', context)
|
||||
except Exception as err:
|
||||
logging.error(traceback.format_exc())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user