First commit
This commit is contained in:
parent
cf97b64877
commit
cc69770608
1468 changed files with 265316 additions and 128 deletions
123
www/admin/tessutoConfig/_js/tex-armatura.js
Normal file
123
www/admin/tessutoConfig/_js/tex-armatura.js
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
return Ab.validateForm('descrizione','Descrizione','R');
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//var f = document.main;
|
||||
//if (f.ckFlgValido.checked) f.flgValido.value="S";else f.flgValido.value="N";
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
/*var f = document.main;
|
||||
|
||||
if(f.rbFlgPagata[0].checked)
|
||||
f.flgPagata.value=f.rbFlgPagata[0].value;
|
||||
else
|
||||
if(f.rbFlgPagata[1].checked)
|
||||
f.flgPagata.value=f.rbFlgPagata[1].value;
|
||||
else
|
||||
f.flgPagata.value="";
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
$(document).on('click', '.cell', function(e) {
|
||||
$(this).toggleClass("pieno");
|
||||
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
//console.log($(this).attr("class"));
|
||||
});
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
// SALVATAGGIO DEL BEAN
|
||||
///////////////////////////////////////////////////
|
||||
function saveCommandArmatura(postProcess,async)
|
||||
{
|
||||
console.log("aaaaa");
|
||||
|
||||
if (checkFields())
|
||||
{
|
||||
normalizzaArmatura();
|
||||
|
||||
if(typeof checkBoxes != "undefined"){
|
||||
checkBoxes();
|
||||
}
|
||||
formSaveCommand();
|
||||
if(postProcess==null){
|
||||
if($("#imgFile").length>0 && $("#imgFile").val()!="" || $("#cmd2").val()=="delImg")
|
||||
$("#main").submit();
|
||||
else{
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Ab.submitAj("main", null, null,postProcess,async);
|
||||
//submitSaveAj(postProcess,async)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function normalizzaArmatura()
|
||||
{
|
||||
var colpi = $("#numColpi").val(),
|
||||
obj = [],
|
||||
i = 1;
|
||||
|
||||
// normalizzo i dati
|
||||
$("td").each(function(k, v) {
|
||||
if ($(v).attr("class").indexOf("cell_")>=0) {
|
||||
console.log($(v).attr("class"));
|
||||
|
||||
var classe = $(v).attr("class").replace("cell cell_", ""),
|
||||
coord = classe.split("_"),
|
||||
val = "0";
|
||||
|
||||
if ($(v).hasClass("pieno"))
|
||||
{
|
||||
val = "1";
|
||||
}
|
||||
|
||||
if (obj[coord[0]])
|
||||
{
|
||||
obj[coord[0]] += val;
|
||||
}
|
||||
else
|
||||
{
|
||||
obj[coord[0]] = val;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// creo o modifico i dati da passare alla servlet
|
||||
obj.forEach(function(item) {
|
||||
console.log($("#riga_"+i).val());
|
||||
|
||||
if ($("#riga_"+i).val())
|
||||
{
|
||||
$("#riga_"+i).val(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#main").append("<input type='text' name='riga_"+i+"' id='riga_"+i+"' value='"+item+"' />");
|
||||
}
|
||||
i++;
|
||||
});
|
||||
|
||||
//console.log(obj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue