1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
function affectation_1_0(numOF_Coche, codComp) {
//alert(numOF_Coche + codComp);
var numOF = numOF_Coche[0];
var codeComp = codComp[0];
var numHU_Entiere = "";
var tabHU_SameComp = new Array();
$("#tabD .tabD_composant").each(function () {
//alert($(this).text());
var codeCompHU = $(this).text();
codeCompHU = codeCompHU.substring(0, codeCompHU.indexOf(" "));
if (codeCompHU == codeComp) {
var numHU = $(this).attr('id').replace('tabD_composant','');
tabHU_SameComp.push(numHU);
}
});
numHU_Entiere = tabHU_SameComp.join(";");
var popUp_BesoinT = "";
var popUp_DejaAss = "";
var popUp_Restant = "";
var numLastHU = "";
// on lance l'appel au serveur
$.ajax({
type: "POST",
data: "{ numOF : " + JSON.stringify(numOF) + " , codeComp : " + JSON.stringify(codeComp) + ", listeHU : " + JSON.stringify(numHU_Entiere) + "}",
url: "Assignation.aspx/doAssignation",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
var res = new Array();
res = msg.d.split(';');
//alert(msg.d);
//alert(res[0]);
popUp_BesoinT = res[0];
popUp_DejaAss = res[1];
popUp_Restant = res[2];
numLastHU = res[3];
alert(popUp_BesoinT);
alert(popUp_DejaAss);
alert(popUp_Restant);
alert(numLastHU);
},
error: function () {
alert("BAD");
}
});
var popUp_NumOF = numOF;
var popUp_SeqOF = $("#seqOF"+numOF).text();
var popUp_Ref = $("#art" + numOF).text();
var popUp_QteP = $("#qteP" + numOF).text();
var popUp_QteR = $("#qteR" + numOF).text();
alert("test");
$("#tbPopUpAffectation_EnCours_NumOF").val(popUp_NumOF);
$("#tbPopUpAffectation_EnCours_SeqOF").val(popUp_SeqOF);
$("#tbPopUpAffectation_EnCours_Reference").val(popUp_Ref);
$("#tbPopUpAffectation_EnCours_QteP").val(popUp_QteP);
$("#tbPopUpAffectation_EnCours_QteR").val(popUp_QteR);
$("#tbPopUpAffectation_Composant_BesoinT").val(popUp_BesoinT);
$("#tbPopUpAffectation_Composant_DejaAss").val(popUp_DejaAss);
$("#tbPopUpAffectation_Composant_Restant").val(popUp_Restant);
// dialog() permet de spécifier les options de la fenêtre pop-up concernée
// modal signifie que la pop up aura la main et que les autres éléments de la page ne pourront être accessibles
$("#popUpAffectation").dialog({
dialogClass: "popUpAffectation",
autoOpen: false,
width: 500,
height: 650,
show: {
effect: "drop",
duration: 800
},
hide: {
effect: "drop",
direction: "right",
duration: 800
},
modal: true,
buttons: {
"OK": function () {
// on ferme la pop up
$("#popUpAffectation").dialog("close");
// on récupère les données du formulaire
var selectedValue = $("#rbtnlstAction input:checked").val();
PageMethods.StartImport(selectedValue);
return true;
},
"Annuler": function () {
$("#popUpAffectation").dialog("close");
}
}
});
$("#popUpAffectation").dialog("open");
} |
Partager