instrumenten koppelen in beheer
This commit is contained in:
@@ -63,7 +63,6 @@ ls.initBeheerModel = function(){
|
||||
$("#pagScores").hide().show("slide", {direction:"right"} ,200)
|
||||
break;
|
||||
case "instrumentencp":
|
||||
console.log('bij het goede tabblad')
|
||||
mh.initInstrumentenCPModel();
|
||||
$("#pagInstrumentenCompactSop").hide().show("slide", {direction:"right"} ,200)
|
||||
break;
|
||||
|
||||
@@ -5,11 +5,12 @@ $(function(){
|
||||
|
||||
function fAddModule(p){
|
||||
this.sysnr = p.sysnr;
|
||||
this.sopID = ko.observable(p.sopID);
|
||||
this.cluster = p.cluster
|
||||
this.instrument = p.instrument;
|
||||
this.inSOP = ko.observable(p.insop === 'T');
|
||||
this.sopnaam = ko.observable(p.sopnaam);
|
||||
this.blokjesnaam = ko.observable(p.blokjesnaam);
|
||||
this.inSOP = ko.observable(p.insop == 'T');
|
||||
this.sopnaam = ko.observable(p.sopnaam ? p.sopnaam : '');
|
||||
this.blokjesnaam = ko.observable(p.blokjesnaam ? p.blokjesnaam : '');
|
||||
|
||||
}
|
||||
|
||||
@@ -44,18 +45,90 @@ $(function(){
|
||||
|
||||
},
|
||||
|
||||
fToggleInSop: function(){
|
||||
var self = mh.InstrumentenCPModel;
|
||||
this.inSOP(!this.inSOP);
|
||||
fSaveInSop: function(){
|
||||
var dit = this;
|
||||
|
||||
|
||||
if(this.inSOP()){
|
||||
if(this.sopnaam().length < 3 || this.blokjesnaam() < 3){
|
||||
apprise("vul eerst een (korte) naam in.");
|
||||
this.inSOP(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var sd ={
|
||||
'sopID': this.sopID(),
|
||||
'sysnr': this.sysnr,
|
||||
'inSOP': this.inSOP() ? 'T ': 'F'
|
||||
|
||||
};
|
||||
$.post("index.php/monpas/beheer/moduleinsop/",sd, function(result) {
|
||||
if(result){
|
||||
dit.sopID(result);
|
||||
}
|
||||
|
||||
},'json');
|
||||
return true;
|
||||
},
|
||||
|
||||
fChangeSopnaam: function(){
|
||||
var self = mh.InstrumentenCPModel;
|
||||
fSaveSopnaam: function(){
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
timeout = null;
|
||||
}
|
||||
var dit = this;
|
||||
console.log(this, "this")
|
||||
timeout = setTimeout(function () {
|
||||
|
||||
var submitData = {
|
||||
'sopID': dit.sopID(),
|
||||
'sysnr': dit.sysnr,
|
||||
'sopnaam': dit.sopnaam()
|
||||
|
||||
};
|
||||
console.log(submitData, "sopnaam")
|
||||
|
||||
$.post("index.php/monpas/beheer/savesopnaam", submitData, function (result) {
|
||||
if(result){
|
||||
if(result){
|
||||
dit.sopID(result);
|
||||
}
|
||||
}
|
||||
}, 'json');
|
||||
}, 600);
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
fChangeBlokjesnaam: function(){
|
||||
var self = mh.InstrumentenCPModel;
|
||||
fSaveBlokjesnaam: function(){
|
||||
console.log("nu hier")
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
timeout = null;
|
||||
}
|
||||
var dit = this;
|
||||
console.log(this, "this")
|
||||
timeout = setTimeout(function () {
|
||||
|
||||
|
||||
var submitData = {
|
||||
'sopID': dit.sopID(),
|
||||
'sysnr': dit.sysnr,
|
||||
'blokjesnaam': dit.blokjesnaam()
|
||||
};
|
||||
|
||||
console.log(submitData, 'data' );
|
||||
|
||||
$.post("index.php/monpas/beheer/saveblokjesnaam", submitData, function (result) {
|
||||
if(result){
|
||||
if(result){
|
||||
dit.sopID(result);
|
||||
}
|
||||
}
|
||||
}, 'json');
|
||||
}, 600);
|
||||
},
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user