add bug
This commit is contained in:
12
app.py
12
app.py
@@ -189,23 +189,21 @@ def addraspved():
|
||||
if request.method == 'POST':
|
||||
#b'rasp=asndhaslkj&ved=1111111&inv=18124'
|
||||
query_string = request.get_data().decode()
|
||||
un_query_string = unquote(unquote(query_string))
|
||||
un_query_string = unquote(unquote(query_string)).split('&')
|
||||
|
||||
print(un_query_string.split('&'))
|
||||
query_dict = {}
|
||||
for pair in un_query_string.split('&'):
|
||||
for pair in un_query_string:
|
||||
key, value = pair.split("=")
|
||||
query_dict[key] = value
|
||||
|
||||
print(query_dict)
|
||||
ob = db.session.query(Oboruds).filter_by(invNumber=query_dict['inv']).first()
|
||||
print(ob)
|
||||
ob.raspologenie=query_dict['rasp']
|
||||
ob.numberved = query_dict['ved']
|
||||
db.session.commit()
|
||||
db.session.close()
|
||||
|
||||
|
||||
|
||||
return jsonify({'success': True}, 200, {'ContentType': 'application/json'})
|
||||
return jsonify({'success': True}, 200, {'ContentType': 'application/json'})
|
||||
|
||||
|
||||
# ==================================================================================
|
||||
|
||||
@@ -47,15 +47,12 @@ function tableclick(x){
|
||||
|
||||
let datas = x.innerText.split('\t')
|
||||
|
||||
|
||||
|
||||
|
||||
$('#getmodal').modal('show')
|
||||
|
||||
let rasp = document.getElementById('rapolog')
|
||||
let vedomost = document.getElementById('vednumber')
|
||||
//let rasp = document.getElementById('rapolog')
|
||||
//let vedomost = document.getElementById('vednumber')
|
||||
let invnom = document.getElementById('modal_invnom')
|
||||
let matcen = document.getElementById('modal_matcenn')
|
||||
//let matcen = document.getElementById('modal_matcenn')
|
||||
|
||||
invnom.innerText=datas[1]+"\t"
|
||||
matcen.innerText=datas[2].substring(0,15)
|
||||
@@ -76,8 +73,6 @@ function tableclick(x){
|
||||
} )
|
||||
|
||||
$('#modalsavetodb').click(function(){
|
||||
|
||||
|
||||
$.ajax({
|
||||
|
||||
url: "/addraspved",
|
||||
@@ -89,16 +84,15 @@ function tableclick(x){
|
||||
ved: vedomost.value,
|
||||
inv: datas[1]
|
||||
},
|
||||
|
||||
success:function() {
|
||||
rasp.value = '';
|
||||
vedomost.value= '';
|
||||
data=[];
|
||||
rasp
|
||||
$('#getmodal').modal('hide');
|
||||
getData();
|
||||
}
|
||||
})
|
||||
rasp.value = '';
|
||||
vedomost.value= '';
|
||||
|
||||
datas = [];
|
||||
|
||||
$('#getmodal').modal('hide');
|
||||
|
||||
getData();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-body" id="textarea">
|
||||
<div class="row">
|
||||
<a id="modal_invnom"> 111 </a> <a id="modal_matcenn">2222</a>
|
||||
<a id="modal_invnom"> </a><a id="modal_matcenn"></a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user