Commit 6ab4e563 authored by ken.q.you's avatar ken.q.you

fix confirm bug---Ken

parent b8857a0e
...@@ -381,7 +381,9 @@ ...@@ -381,7 +381,9 @@
var year=now.getFullYear(); var year=now.getFullYear();
var vatMonth=vatSessionService.month; var vatMonth=vatSessionService.month;
if(vatSessionService.year==year){ if(vatSessionService.year==year){
if(vatMonth<month-1){ if(vatMonth===month-1){
return false;
}else{
return true; return true;
} }
} }
...@@ -390,35 +392,44 @@ ...@@ -390,35 +392,44 @@
} }
return true; return true;
} }
var startCaculate3 = function () {
var bool=checkYearMonthCaculate2(); var confirmWithContinue=function (title, text, customClass) {
if(bool){ var deferred = $q.defer();
swal({ SweetAlert.swal({
title: "warning!", title: title,
text: $translate.instant('IsConfirmTimeNotSame'), text: text,
type: "warning", html: true,
showCancelButton: true, type: "warning",
confirmButtonColor: "#dd6b55", customClass: customClass || '',
confirmButtonText: $translate.instant('Yes'), showCancelButton: true,
cancelButtonText: $translate.instant('No'), confirmButtonColor: "#dd6b55",
closeOnConfirm: true, allowOutsideClick: false,
closeOnCancel: true confirmButtonText: $translate.instant('Yes'),
}, cancelButtonText: $translate.instant('No'),
function (isConfirm) { closeOnConfirm: false,
if(isConfirm){ closeOnCancel: true
startCaculate2(); },
}else{ function (isConfirm) {
return ; deferred.resolve(isConfirm);
} });
})
return deferred.promise;
}
var startCaculate4=function(){
if(checkYearMonthCaculate2()){
confirmWithContinue($translate.instant('IsConfirmTimeNotSame')).then(function (isConfirm) {
if(isConfirm){
startCaculate2();
}
})
}else{ }else{
startCaculate2(); startCaculate2();
} }
} }
var startCaculate2 = function () { var startCaculate2 = function () {
if (vatSessionService.project.projectStatusList[vatSessionService.month] >= constant.ProjectStatusEnum.Generated) { if (vatSessionService.project.projectStatusList[vatSessionService.month] >= constant.ProjectStatusEnum.Generated) {
swal({ swal({
title: "warning!", title: "warning!",
...@@ -727,7 +738,7 @@ ...@@ -727,7 +738,7 @@
$scope.resolveRef = []; $scope.resolveRef = [];
initTasks(); initTasks();
$scope.startCaculate = startCaculate; $scope.startCaculate = startCaculate;
$scope.startCaculate3 = startCaculate3; $scope.startCaculate4 = startCaculate4;
$scope.$on('$destroy',function(){ $scope.$on('$destroy',function(){
if($scope.timer)$interval.cancel($scope.timer); if($scope.timer)$interval.cancel($scope.timer);
}); });
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="vat-caculate-data-title" ng-if="tasks.length > 0"> <div class="vat-caculate-data-title" ng-if="tasks.length > 0">
<!--<span translate="vatCaculateDataDesc"></span>--> <!--<span translate="vatCaculateDataDesc"></span>-->
<!--<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate()"></button>--> <!--<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate()"></button>-->
<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate3()"></button> <button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate4()"></button>
<span ng-click="showOperateLogPop()"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'Remarks' | translate}}</span> <span ng-click="showOperateLogPop()"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'Remarks' | translate}}</span>
</div> </div>
......
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