1112
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -3,7 +3,7 @@
|
||||
instance
|
||||
venv/
|
||||
|
||||
__pychache__/
|
||||
__pychache__/*
|
||||
123
|
||||
|
||||
|
||||
@@ -12,3 +12,6 @@ project.db
|
||||
|
||||
|
||||
c*.txt
|
||||
|
||||
migrations/__pycache__/*
|
||||
migrations/versions/__pycache__/*
|
||||
26
app.py
26
app.py
@@ -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.
32
migrations/versions/885bdd7b5161_.py
Normal file
32
migrations/versions/885bdd7b5161_.py
Normal file
@@ -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.
BIN
migrations/versions/__pycache__/885bdd7b5161_.cpython-312.pyc
Normal file
BIN
migrations/versions/__pycache__/885bdd7b5161_.cpython-312.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -18,13 +18,21 @@ class Oboruds(db.Model):
|
||||
nazvanie=db.Column(db.String(500))
|
||||
raspologenie = db.Column(db.String(200))
|
||||
numberved = db.Column(db.String(100))
|
||||
<<<<<<< HEAD
|
||||
buhnumberpp = db.Column(db.String(100))
|
||||
kolichestvo = db.Column(db.Integer)
|
||||
balancenumber = db.Column(db.String(30))
|
||||
=======
|
||||
numberppasu = db.Column(db.String(100))
|
||||
kolichestvo = db.Column(db.Integer)
|
||||
|
||||
>>>>>>> dev
|
||||
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))
|
||||
|
||||
@@ -100,6 +100,15 @@ nav{
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.datatable{
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@media print {
|
||||
|
||||
*{
|
||||
|
||||
35
static/js/allmatc.js
Normal file
35
static/js/allmatc.js
Normal 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()
|
||||
})
|
||||
35
static/js/allmatcen.js
Normal file
35
static/js/allmatcen.js
Normal file
@@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -3,38 +3,34 @@
|
||||
|
||||
{% 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>
|
||||
<script src="{{url_for('static', filename='js/allmatc.js') }}"></script>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user