Compare commits
9
Commits
87c4ebe33e
...
4c6166c907
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c6166c907 | ||
|
|
2c51bdc695 | ||
|
|
c2f3f10c9b | ||
|
|
f1c755c6ec | ||
|
|
d2b01f56ec | ||
|
|
34ea972560 | ||
|
|
3a3e62a375 | ||
|
|
bf93bf0fdb | ||
|
|
027b1dc855 |
@@ -12,3 +12,5 @@ project.db
|
||||
|
||||
|
||||
c*.txt
|
||||
__pycache__/app.cpython-312.pyc
|
||||
__pycache__/models.cpython-312.pyc
|
||||
|
||||
@@ -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,
|
||||
'balancenumber': oborud.balancenumber,
|
||||
'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():
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 885bdd7b5161
|
||||
Revises: be7c94c549e5
|
||||
Create Date: 2024-04-02 23:03:59.401369
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '885bdd7b5161'
|
||||
down_revision = 'be7c94c549e5'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('oboruds', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('kolichestvo', sa.Integer(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('oboruds', schema=None) as batch_op:
|
||||
batch_op.drop_column('kolichestvo')
|
||||
|
||||
# ### end Alembic commands ###
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -18,13 +18,19 @@ class Oboruds(db.Model):
|
||||
nazvanie=db.Column(db.String(500))
|
||||
raspologenie = db.Column(db.String(200))
|
||||
numberved = db.Column(db.String(100))
|
||||
<<<<<<< HEAD
|
||||
kolichestvo = db.Column(db.Integer)
|
||||
=======
|
||||
buhnumberpp = db.Column(db.String(100))
|
||||
kolichestvo = db.Column(db.Integer)
|
||||
balancenumber = db.Column(db.String(30))
|
||||
>>>>>>> 87c4ebe33e69ec19b443f976557a6f5fa2905476
|
||||
aud_id = db.Column(db.Integer, db.ForeignKey(Auditory.id))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Zametki(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
||||
txtzam=db.Column(db.String(10000))
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
from waitress import serve
|
||||
from app import app
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
serve(app, port='3800')
|
||||
@@ -100,6 +100,15 @@ nav{
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.datatable{
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@media print {
|
||||
|
||||
*{
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
@@ -0,0 +1,35 @@
|
||||
function getData(){
|
||||
|
||||
const audid = document.getElementById('auditory')
|
||||
$.ajax({
|
||||
|
||||
url: "/getall",
|
||||
type: "get",
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
|
||||
success: function(response){
|
||||
|
||||
var data = response;
|
||||
const table = document.getElementById('datatable')
|
||||
table.innerHTML = ''
|
||||
var headTable = '<tr> <td >Номер в Инв. вед</td> <td id="invnomer">Инв. номер</td><td>Название</td><td class="no-print aud">Аудитория</td> <td >Расположение</td> <td id="proverka"class="hidden-column"> Проверено</td> </tr>'
|
||||
table.innerHTML += headTable
|
||||
var tr =""
|
||||
|
||||
|
||||
data.forEach(element => {
|
||||
tr += '<tr onclick="tableclick(this)">'
|
||||
tr += '<td>' + element.num_ved + '</td>'
|
||||
tr += '<td clas="inv">' + element.inv_number + '</td>'
|
||||
tr += '<td>' + element.oboruds_id + '</td>'
|
||||
tr += '<td class="no-print">' + element.auditory_name + '</td>'
|
||||
tr += '<td class="rasp">' +element.raspolog + '</td>'
|
||||
tr += '<td>' + '\n' + '</td>'
|
||||
|
||||
tr += '</tr>'
|
||||
});
|
||||
table.innerHTML += tr
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -16,9 +16,9 @@ function getData(){
|
||||
|
||||
var data = response;
|
||||
const table = document.getElementById('datatable')
|
||||
table.innerHTML = ''
|
||||
|
||||
var headTable = '<tr> <td >Номер в Инв. вед</td> <td id="invnomer">Инв. номер</td><td>Название</td><td class="no-print aud">Аудитория</td> <td >Расположение</td> <td id="proverka"class="hidden-column"> Проверено</td> </tr>'
|
||||
table.innerHTML += headTable
|
||||
|
||||
var tr =""
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ function getData(){
|
||||
|
||||
tr += '</tr>'
|
||||
});
|
||||
table.innerHTML += tr
|
||||
table.innerHTML = headTable + tr
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+24
-29
@@ -3,37 +3,32 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row col-12">
|
||||
<div class=" card col-11">
|
||||
<h3 class=" no-print"> Все мат. ценности </h3>
|
||||
|
||||
</div>
|
||||
<div class="row col-12">
|
||||
<button class="button" id="printallbutton"> Печать </button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="card col-md-10 col-10">
|
||||
<div class="card-body">
|
||||
<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>
|
||||
</table>
|
||||
|
||||
<form>
|
||||
<h3 class=" no-print card-title"> Все мат. ценности </h3>
|
||||
<button id="printallbutton"> Печать </button>
|
||||
<table class="table pagebreak" col-md-10>
|
||||
<thead>
|
||||
<tr>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user