add raspologenie and vde numbers
This commit is contained in:
@@ -13,7 +13,7 @@ function getData(){
|
||||
},
|
||||
|
||||
success: function(response){
|
||||
console.log(response)
|
||||
|
||||
var data = response;
|
||||
const table = document.getElementById('datatable')
|
||||
table.innerHTML = ''
|
||||
@@ -29,7 +29,7 @@ function getData(){
|
||||
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 += '<td>' + '\n' + '</td>'
|
||||
|
||||
tr += '</tr>'
|
||||
});
|
||||
@@ -42,58 +42,84 @@ $("#searchbutton").click(function(){
|
||||
getData();
|
||||
})
|
||||
|
||||
function tableclick(x){
|
||||
let data = document.getElementById(x.rowIndex)
|
||||
$('#modalsavetodb').click(function(){
|
||||
|
||||
let datas = x.innerText.split('\t')
|
||||
let rasp = document.getElementById('modal_rapolog')
|
||||
let vedomost = document.getElementById('modal_vednumber')
|
||||
let invnom = document.getElementById('modal_invnom')
|
||||
let matcen = document.getElementById('modal_matcenn')
|
||||
|
||||
let changeddata = new Array()
|
||||
|
||||
changeddata[0] = invnom.text
|
||||
changeddata[1] = vedomost.value
|
||||
changeddata[2] = rasp.value
|
||||
|
||||
let sendData = changeddata.join(',')
|
||||
|
||||
changeddata = []
|
||||
$.ajax({
|
||||
|
||||
url: "/addraspved",
|
||||
type: "POST",
|
||||
contentType: "application/json;charset=utf-8",
|
||||
dataType: "json",
|
||||
data: sendData,
|
||||
|
||||
success: function(){
|
||||
/*
|
||||
rasp='',
|
||||
vedomost = '',
|
||||
invnom = '',
|
||||
matcen = '',
|
||||
|
||||
changeddata = []
|
||||
*/
|
||||
$('#getmodal').modal('hide').data( 'bs.modal', null );
|
||||
getData();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
function tableclick(tableRow){
|
||||
|
||||
let nomved = tableRow.childNodes[0].innerHTML;
|
||||
let invnomer = tableRow.childNodes[1].innerHTML;
|
||||
let nazvanie = tableRow.childNodes[2].innerHTML;
|
||||
let raspolog = tableRow.childNodes[4].innerHTML;
|
||||
|
||||
$('#getmodal').modal('show')
|
||||
|
||||
//let rasp = document.getElementById('rapolog')
|
||||
//let vedomost = document.getElementById('vednumber')
|
||||
let rasp = document.getElementById('modal_rapolog')
|
||||
let vedomost = document.getElementById('modal_vednumber')
|
||||
let invnom = document.getElementById('modal_invnom')
|
||||
//let matcen = document.getElementById('modal_matcenn')
|
||||
|
||||
invnom.innerText=datas[1]+"\t"
|
||||
matcen.innerText=datas[2].substring(0,15)
|
||||
let matcen = document.getElementById('modal_matcenn')
|
||||
|
||||
invnom.innerText = invnomer
|
||||
matcen.innerText = nazvanie.substring(0,15)
|
||||
|
||||
if (datas[4].length>0){
|
||||
rasp.value=datas[4];
|
||||
if (nomved.length >0){
|
||||
|
||||
vedomost.value = nomved
|
||||
}
|
||||
|
||||
if (datas[0].length>0){
|
||||
vedomost.value=datas[0]
|
||||
if(raspolog.length>0){
|
||||
rasp.value = raspolog
|
||||
}
|
||||
|
||||
$("#mimodal").on('hidden.bs.modal', function () {
|
||||
$(this).data('bs.modal', null);
|
||||
});
|
||||
|
||||
|
||||
$('#modalclose').click(function(){
|
||||
|
||||
$('#getmodal').modal('hide');
|
||||
$('#getmodal').modal('hide').data( 'bs.modal', null );
|
||||
|
||||
} )
|
||||
|
||||
$('#modalsavetodb').click(function(){
|
||||
$.ajax({
|
||||
|
||||
url: "/addraspved",
|
||||
type: "POST",
|
||||
contentType: "application/json;charset=utf-8",
|
||||
dataType: "json",
|
||||
data: {
|
||||
rasp: rasp.value,
|
||||
ved: vedomost.value,
|
||||
inv: datas[1]
|
||||
},
|
||||
success:function() {
|
||||
rasp.value = '';
|
||||
vedomost.value= '';
|
||||
data=[];
|
||||
rasp
|
||||
$('#getmodal').modal('hide');
|
||||
getData();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
47
static/js/tmp.js
Normal file
47
static/js/tmp.js
Normal file
@@ -0,0 +1,47 @@
|
||||
function tableclick(x){
|
||||
// let data = document.getElementById(x.rowIndex)
|
||||
|
||||
let datas = x.innerText.split('\t')
|
||||
|
||||
|
||||
|
||||
invnom.innerText=datas[1]+"\t"
|
||||
matcen.innerText=datas[2]
|
||||
|
||||
|
||||
if (datas[4].length>0){
|
||||
rasp.value=datas[4];
|
||||
}
|
||||
|
||||
if (datas[0].length>0){
|
||||
vedomost.value=datas[0]
|
||||
}
|
||||
|
||||
$('#modalclose').click(function(){
|
||||
|
||||
$('#getmodal').modal('hide');
|
||||
|
||||
} )
|
||||
|
||||
$('#modalsavetodb').click(function(){
|
||||
$.ajax({
|
||||
|
||||
url: "/addraspved",
|
||||
type: "POST",
|
||||
contentType: "application/json;charset=utf-8",
|
||||
dataType: "json",
|
||||
data: {
|
||||
rasp: rasp.value,
|
||||
ved: vedomost.value,
|
||||
inv: invnomer
|
||||
},
|
||||
success:function() {
|
||||
rasp.value = '';
|
||||
vedomost.value= '';
|
||||
data=[];
|
||||
rasp
|
||||
$('#getmodal').modal('hide');
|
||||
getData();
|
||||
}
|
||||
})
|
||||
})}
|
||||
Reference in New Issue
Block a user