Merge branch 'dev'
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -12,3 +12,5 @@ project.db
|
|||||||
|
|
||||||
|
|
||||||
c*.txt
|
c*.txt
|
||||||
|
__pycache__/app.cpython-312.pyc
|
||||||
|
__pycache__/models.cpython-312.pyc
|
||||||
|
|||||||
26
app.py
26
app.py
@@ -114,20 +114,26 @@ def addoborudtodb():
|
|||||||
|
|
||||||
@app.route('/all')
|
@app.route('/all')
|
||||||
def alloborud():
|
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'])
|
@app.route('/updateduplicate', methods=['GET', 'POST'])
|
||||||
def updateduplicate():
|
def updateduplicate():
|
||||||
|
|||||||
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 ###
|
||||||
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.
@@ -19,10 +19,13 @@ class Oboruds(db.Model):
|
|||||||
balancenumber = db.Column(db.String(30))
|
balancenumber = db.Column(db.String(30))
|
||||||
raspologenie = db.Column(db.String(200))
|
raspologenie = db.Column(db.String(200))
|
||||||
numberved = db.Column(db.String(100))
|
numberved = db.Column(db.String(100))
|
||||||
|
kolichestvo = db.Column(db.Integer)
|
||||||
aud_id = db.Column(db.Integer, db.ForeignKey(Auditory.id))
|
aud_id = db.Column(db.Integer, db.ForeignKey(Auditory.id))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Zametki(db.Model):
|
class Zametki(db.Model):
|
||||||
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
||||||
txtzam=db.Column(db.String(10000))
|
txtzam=db.Column(db.String(10000))
|
||||||
|
|||||||
@@ -100,6 +100,15 @@ nav{
|
|||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.datatable{
|
||||||
|
background-color: whitesmoke;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media print {
|
@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,37 +3,32 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row col-12">
|
||||||
<div class="card col-md-10 col-10">
|
<div class=" card col-11">
|
||||||
<div class="card-body">
|
<h3 class=" no-print"> Все мат. ценности </h3>
|
||||||
|
|
||||||
<form>
|
</div>
|
||||||
<h3 class=" no-print card-title"> Все мат. ценности </h3>
|
<div class="row col-12">
|
||||||
<button id="printallbutton"> Печать </button>
|
<button class="button" id="printallbutton"> Печать </button>
|
||||||
<table class="table pagebreak" col-md-10>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="card col-md-11" >
|
||||||
|
<table id="datable" class="datable table pagebreak" >
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<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>
|
||||||
|
<th scope="col">Счёт</th>
|
||||||
<th scope="col">Аудитория</th>
|
<th scope="col">Аудитория</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</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>
|
</table>
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -10,3 +10,4 @@
|
|||||||
<script src="{{url_for('static', filename='js/searchonaud.js') }}"></script>
|
<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/print.js') }}"></script>
|
||||||
<script src="{{url_for('static', filename='js/modal.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