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

fix confirm bug---Ken

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