Commit 22f66510 authored by neo's avatar neo

[Bugfix] cannot stop timer when updateconfig is error

parent bc10900c
...@@ -549,20 +549,17 @@ ...@@ -549,20 +549,17 @@
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
}; };
var updateTasksStatus = function(job){ var updateTasksStatus = function(job){
if(job.currentStep == 'UpdateConfig'){
$scope.tasks[0].items[0].status = 'processing';
$scope.tasks[0].items[0].text= $translate.instant('processing');
}else{
$scope.tasks[0].items[0].status = 'completed';
$scope.tasks[0].items[0].text= $translate.instant('completed');
var items = $scope.tasks[1].items; var items = $scope.tasks[1].items;
if(job.jobStatus == 'End'){ if(job.jobStatus == 'End'){
items.forEach(function(item,index){ items.forEach(function(item,index){
item.status = 'completed'; item.status = 'completed';
item.task = $translate.instant('completed');
}); });
$scope.tasks[0].items[0].status = 'completed';
$scope.tasks[0].items[0].text= $translate.instant('completed');
if($scope.timer){ if($scope.timer){
$interval.cancel($scope.timer); $interval.cancel($scope.timer);
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Generated vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Generated
...@@ -571,6 +568,17 @@ ...@@ -571,6 +568,17 @@
}else if(job.jobStatus=='Running'|| job.jobStatus=='Error'){ }else if(job.jobStatus=='Running'|| job.jobStatus=='Error'){
var tasks = JSON.parse(job.status) var tasks = JSON.parse(job.status)
var updateConfig = tasks[0];
if(updateConfig.status == 'Error'){
$scope.tasks[0].items[0].status = 'error';
}else if(updateConfig.status == 'End'){
$scope.tasks[0].items[0].status = 'completed';
}else if(updateConfig.status == 'Begin'){
$scope.tasks[0].items[0].status = 'processing';
}
$scope.tasks[0].items[0].text= $translate.instant($scope.tasks[0].items[0].status);
items.forEach(function(item,index){ items.forEach(function(item,index){
tasks.forEach(function(task){ tasks.forEach(function(task){
if(task.code==item.code){ if(task.code==item.code){
...@@ -591,7 +599,6 @@ ...@@ -591,7 +599,6 @@
} }
} }
} }
}
var getInitTaskStatus = function(){ var getInitTaskStatus = function(){
vatReportService.getRunningJob(vatSessionService.project.id,vatSessionService.month).then(function (result) { vatReportService.getRunningJob(vatSessionService.project.id,vatSessionService.month).then(function (result) {
......
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