add new fictures

This commit is contained in:
2024-04-02 22:50:36 +03:00
parent 294d646bb6
commit 34ea972560
6 changed files with 89 additions and 41 deletions

2
.gitignore vendored
View File

@@ -12,3 +12,5 @@ project.db
c*.txt
__pycache__/app.cpython-312.pyc
__pycache__/models.cpython-312.pyc

26
app.py
View File

@@ -114,20 +114,26 @@ def addoborudtodb():
@app.route('/all')
def alloborud():
return render_template('all.html')
result = db.session.query(Oboruds).order_by(Oboruds.invNumber).all()
res = []
@app.route('/getall')
def getall():
oboruds = Oboruds.query.all()
oboruds_json = [{
'id': oborud.id,
'invNumber': oborud.invNumber,
'nazvanie': oborud.nazvanie,
'raspologenie': oborud.raspologenie,
'numberved': oborud.numberved,
'buhnumberpp': oborud.buhnumberpp,
'kolichestvo': oborud.kolichestvo,
'balancenumber': oborud.balancenumber,
'aud_id': oborud.aud_id
} for oborud in oboruds]
for ob in result:
if ob.aud_id is not None:
aud = db.session.query(Auditory).filter_by(id=ob.aud_id).first()
res.append([ob.invNumber, ob.nazvanie, aud.audnazvanie])
else:
res.append([ob.invNumber, ob.nazvanie])
return render_template('all.html', res=res)
return jsonify(oboruds_json)
@app.route('/updateduplicate', methods=['GET', 'POST'])
def updateduplicate():

View File

@@ -100,6 +100,15 @@ nav{
margin-left: 20px;
}
.datatable{
background-color: whitesmoke;
}
@media print {
*{

35
static/js/allmatc.js Normal file
View File

@@ -0,0 +1,35 @@
function getAllData(){
$.ajax({
url: "/getall",
type: "get",
contentType: 'application/json',
dataType: 'json',
success: function(response){
console.log(response)
let data = response;
$('#datatable tbody').empty();
$.each(response, function(index, item) {
$('#datatable tbody').append(
'<tr>' +
'<td>' + item.invNumber + '</td>' +
'<td>' + item.nazvanie + '</td>' +
'<td>' + item.raspologenie + '</td>' +
'<td>' + item.numberved + '</td>' +
'<td>' + item.buhnumberpp + '</td>' +
'<td>' + item.kolichestvo + '</td>' +
'<td>' + item.balancenumber + '</td>' +
'</tr>'
);
})
},
})
}
$(document).ready(function(){
getAllData()
})

View File

@@ -3,37 +3,32 @@
{% block content %}
<div class="row">
<div class="card col-md-10 col-10">
<div class="card-body">
<div class="row col-12">
<div class=" card col-11">
<h3 class=" no-print"> Все мат. ценности </h3>
<form>
<h3 class=" no-print card-title"> Все мат. ценности </h3>
<button id="printallbutton"> Печать </button>
<table class="table pagebreak" col-md-10>
</div>
<div class="row col-12">
<button class="button" id="printallbutton"> Печать </button>
</div>
</div>
<div class="row">
<div class="card col-md-11" >
<table id="datable" class="datable table pagebreak" >
<thead>
<tr>
<th scope="col">№ п/п</th>
<th scope="col">№ п/п вед</th>
<th scope="col">Инв. номер</th>
<th scope="col">Название</th>
<th scope="col">Кол-во</th>
<th scope="col">Счёт</th>
<th scope="col">Аудитория</th>
</tr>
</thead>
{% for item in res: %}
<tr>
<td> <input type="hidden" name="invnomer" value="{{ item[0] }}"> {{ item[0] }} </td>
<td> {{ item[1] }} </td>
<td>
{{ item[2] }}
</td>
</tr>
{% endfor %}
</table>
</form>
</div>
</div>
</div>

View File

@@ -10,3 +10,4 @@
<script src="{{url_for('static', filename='js/searchonaud.js') }}"></script>
<script src="{{url_for('static', filename='js/print.js') }}"></script>
<script src="{{url_for('static', filename='js/modal.js') }}"></script>
<script src="{{url_for('static', filename='js/allmatc.js') }}"></script>