Commit d353e507 authored by Alina Habibulina's avatar Alina Habibulina

+ week score v3

parent 088145dd
...@@ -92,7 +92,6 @@ var portal = { ...@@ -92,7 +92,6 @@ var portal = {
}); });
var formExistance; var formExistance;
////формирование Пн и Вскр для формирования поискового запроса по форме ////формирование Пн и Вскр для формирования поискового запроса по форме
var cur_date = new Date(); var cur_date = new Date();
var StrPeriod = timeComputing(cur_date); //строка Пнд+" "+Вскр var StrPeriod = timeComputing(cur_date); //строка Пнд+" "+Вскр
...@@ -100,10 +99,10 @@ var portal = { ...@@ -100,10 +99,10 @@ var portal = {
var StrSunday = StrPeriod.substring(11); var StrSunday = StrPeriod.substring(11);
AS.FORMS.ApiUtils.simpleAsyncGet("rest/api/person/auth", function(userData){ AS.FORMS.ApiUtils.simpleAsyncGet("rest/api/person/auth", function(userData){
AS.FORMS.ApiUtils.simpleAsyncGet("rest/api/asforms/search?modifiedFrom="+StrMonday+"&modifiedTo="+StrSunday+"&formCode=timesheet&field=ts_author&type=partial&recordsCount=1&search="+userData.lastname, function(success){ ////rest/api/asforms/search?modifiedFrom=2018-02-12&modifiedTo=2018-02-18&formCode=timesheet&field=ts_author&type=partial&recordsCount=1&search=Хабибулина AS.FORMS.ApiUtils.simpleAsyncGet("rest/api/asforms/search?modifiedFrom="+StrMonday+"&modifiedTo="+StrSunday+"&formCode=timesheet&field=ts_author&type=partial&recordsCount=1&search="+userData.lastname, function(success){
AS.SERVICES.hideWaitWindow(); AS.SERVICES.hideWaitWindow();
portal.player.view.setEditable(true); portal.player.view.setEditable(true);
portal.player.showFormData("6af6bf3d-a093-4a33-990c-2ec98c15423a",1, success); portal.player.showFormData("097a00e2-430c-436d-92e5-c2ea8edc5b30", 1, success);
portal.player.view.appendTo($('#form_player_div')); portal.player.view.appendTo($('#form_player_div'));
ShowMessage("Документ успешно открыт!"); ShowMessage("Документ успешно открыт!");
var formExistance = true; var formExistance = true;
...@@ -118,10 +117,10 @@ var portal = { ...@@ -118,10 +117,10 @@ var portal = {
return; return;
} else { } else {
AS.SERVICES.hideWaitWindow(); AS.SERVICES.hideWaitWindow();
ShowMessage("Документ успешно создан!");
portal.player.view.setEditable(true); portal.player.view.setEditable(true);
portal.player.showFormData(result.documentID, 0, result.dataUUID); portal.player.showFormData(result.documentID, 0, result.dataUUID);
portal.player.view.appendTo($('#form_player_div')); portal.player.view.appendTo($('#form_player_div'));
ShowMessage("Документ успешно создан!");
} }
}, 'json'); }, 'json');
} }
...@@ -136,8 +135,6 @@ var portal = { ...@@ -136,8 +135,6 @@ var portal = {
return; return;
} }
countingScore();
var data = portal.player.model.asfDataId; var data = portal.player.model.asfDataId;
portal.player.saveFormData(function(data){ portal.player.saveFormData(function(data){
if(_.isUndefined(data)){ if(_.isUndefined(data)){
...@@ -157,12 +154,16 @@ var portal = { ...@@ -157,12 +154,16 @@ var portal = {
var StrSunday = period.substring(11); var StrSunday = period.substring(11);
portal.player.model.getModelWithId("ts_period_date_from").setValue(StrMonday); portal.player.model.getModelWithId("ts_period_date_from").setValue(StrMonday);
portal.player.model.getModelWithId("ts_period_date_to").setValue(StrSunday); portal.player.model.getModelWithId("ts_period_date_to").setValue(StrSunday);
portal.player.model.on("valueChange", function(){
countingScore();
});
} }
}; };
function countingScore(){ function countingScore(){
////Расчет итогового количества часов происходит при нажатии кнопки сохранения ////Расчет итогового количества часов происходит при нажатии кнопки сохранения
var table = portal.player.model.getModelWithId("ts_timesheet_table").getAsfData().findElement().data; var table = portal.player.model.getModelWithId("ts_timesheet_table").getAsfData().findElement().data;;
var score = 0, monday = 0, tuesday = 0, wednesday = 0, thursday = 0, friday = 0, saturday = 0, sunday = 0; var score = 0, monday = 0, tuesday = 0, wednesday = 0, thursday = 0, friday = 0, saturday = 0, sunday = 0;
for (var i = 10; i < table.length; i++){ for (var i = 10; i < table.length; i++){
var row = Number.parseInt(i/10); var row = Number.parseInt(i/10);
...@@ -251,7 +252,7 @@ var authFunc = function(){ ...@@ -251,7 +252,7 @@ var authFunc = function(){
AS.SERVICES.showWaitWindow(); AS.SERVICES.showWaitWindow();
AS.OPTIONS.login = $("input#login").val(); AS.OPTIONS.login = $("input#login").val();
AS.OPTIONS.password = $("input#password").val(); AS.OPTIONS.password = $("input#password").val();
portal.createPlayer(user); portal.createPlayer();
$(".form_player_container").show(); $(".form_player_container").show();
$(".login-form").remove(); $(".login-form").remove();
$(".saveBtn").show(); $(".saveBtn").show();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment