Commit 61bb997b authored by neo's avatar neo

[Bugfix] fixed some bugs

parent 300673ff
...@@ -2574,7 +2574,7 @@ ...@@ -2574,7 +2574,7 @@
vatSessionService.project.period=vatSessionService.month; vatSessionService.project.period=vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){ vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
if(result&&result=='committed'){ if(result&&result=='committed'){
SweetAlert.error('报表提审中或审核已通过!'); SweetAlert.error('报表提审中!');
}else{ }else{
SweetAlert.swal({ SweetAlert.swal({
title: "warning!", title: "warning!",
...@@ -2700,35 +2700,56 @@ ...@@ -2700,35 +2700,56 @@
$scope.voucherFileID = evidence.fileID; $scope.voucherFileID = evidence.fileID;
}; };
$scope.upLoadManual = function(){ $scope.upLoadManual = function(){
var text= $(".li").find(".active").text(); if(vatSessionService.month)
$log.debug(text); vatSessionService.project.period=vatSessionService.month;
if(text == '海关专用缴款书' || text =='代扣代缴税收通用缴款书取数'){ vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
var excelIo = new GC.Spread.Excel.IO(); if(result&&result=='committed'){
$("#importExcellFile").modal('show'); SweetAlert.error('报表提审中!');
}else{ }else{
SweetAlert.warning("仅支持海关专用缴款书或代扣代缴税收通用缴款书取数"); var text= $(".li").find(".active").text();
} $log.debug(text);
if(text == '海关专用缴款书' || text =='代扣代缴税收通用缴款书取数'){
var excelIo = new GC.Spread.Excel.IO();
$("#importExcellFile").modal('show');
}else{
SweetAlert.warning("仅支持海关专用缴款书或代扣代缴税收通用缴款书取数");
}
}
});
}; };
$scope.loadMyExcel = function(){ $scope.loadMyExcel = function(){
$scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1}); if($scope.file){
var excelIo = new GC.Spread.Excel.IO(); if($scope.hasManualLoad){
var excelFile = document.getElementById("fileDemo").files[0]; SweetAlert.warning("已载入文件,如需重新载入请先清空!");
excelIo.open(excelFile, function(json) { }else{
var workbookObj = json; $scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1});
$scope.manualSpread.fromJSON(workbookObj); var excelIo = new GC.Spread.Excel.IO();
}, function(e) { var excelFile = $scope.file;
alert(e.errorMessage); excelIo.open(excelFile, function(json) {
if (e.errorCode === 2 /*noPassword*/ || e.errorCode === 3 /*invalidPassword*/ ) { var workbookObj = json;
document.getElementById('password').onselect = null; $scope.manualSpread.fromJSON(workbookObj);
}, function(e) {
alert(e.errorMessage);
if (e.errorCode === 2 /*noPassword*/ || e.errorCode === 3 /*invalidPassword*/ ) {
document.getElementById('password').onselect = null;
}
}, {
});
$scope.hasManualLoad = true;
} }
}, { }else{
SweetAlert.warning("请先选择文件!");
}); }
}; };
$scope.multiWrite = function(){ $scope.multiWrite = function(){
if($scope.hasManualLoad){
var manualSheet = $scope.manualSpread.getActiveSheet(); var manualSheet = $scope.manualSpread.getActiveSheet();
var currentSheet = $scope.spread.getActiveSheet() var currentSheet = $scope.spread.getActiveSheet()
currentSheet.options.isProtected=false; currentSheet.options.isProtected=false;
...@@ -2740,30 +2761,43 @@ ...@@ -2740,30 +2761,43 @@
if (jsonTagInfo.isReadOnly) if (jsonTagInfo.isReadOnly)
continue; continue;
var cellValue= manualSheet.getValue(rowIndex,columnIndex); var cellValue= manualSheet.getValue(rowIndex,columnIndex);
var cellString='';
if(typeof(cellValue) == "string") cellValue = cellValue.trim(); if(typeof(cellValue) == "string") cellValue = cellValue.trim();
var r = /^00\d*|^\.\d+|\.$/; var r = /^00\d*|^\.\d+|\.$/;
if (typeof cellValue == "undefined" || cellValue == null || cellValue == "" || cellValue == "NaN")continue; if (typeof cellValue == "undefined" || cellValue == null || cellValue == "" || cellValue == "NaN")continue;
if (cellValue && (isNaN(cellValue) || r.test(cellValue))) { if (cellValue && (isNaN(cellValue) || r.test(cellValue))) {
SweetAlert.warning($translate.instant('CheckInputValueFormat')); cellString=cellValue;
return;
} else if (cellValue && parseFloat(cellValue).toFixed(2) > 9999999999999) { } else if (cellValue && parseFloat(cellValue).toFixed(2) > 9999999999999) {
SweetAlert.warning($translate.instant('CheckInputValueLength')); SweetAlert.warning($translate.instant('CheckInputValueLength'));
return; return;
} }
cellValue = jsonTagInfo.dataType === 5 ? parseInt(cellValue): parseFloat(cellValue).toFixed(2); cellValue = jsonTagInfo.dataType === 5 ? parseInt(cellValue): parseFloat(cellValue).toFixed(2);
var handInputModel = { var handInputModel = {};
cellID: jsonTagInfo.cellID, if(cellString){
cellTemplateID: jsonTagInfo.cellTemplateID, handInputModel = {
reportID: jsonTagInfo.reportID, cellID: jsonTagInfo.cellID,
amount:cellValue cellTemplateID: jsonTagInfo.cellTemplateID,
}; reportID: jsonTagInfo.reportID,
keyinData: cellString
};
}else{
handInputModel = {
cellID: jsonTagInfo.cellID,
cellTemplateID: jsonTagInfo.cellTemplateID,
reportID: jsonTagInfo.reportID,
amount: cellValue
};
}
$scope.myConfirm(handInputModel); $scope.myConfirm(handInputModel);
} }
} }
} }
}else{
SweetAlert.warning("文件未载入!");
}
}; };
...@@ -2772,7 +2806,7 @@ ...@@ -2772,7 +2806,7 @@
handInputModel.serviceTypeID = vatSessionService.project.serviceTypeID; handInputModel.serviceTypeID = vatSessionService.project.serviceTypeID;
handInputModel.period = vatSessionService.month; handInputModel.period = vatSessionService.month;
if (handInputModel.amount || handInputModel.name) { if (handInputModel.amount || handInputModel.name || handInputModel.keyinData) {
//日志对象 //日志对象
logDto.ID = PWC.newGuid(); logDto.ID = PWC.newGuid();
logDto.CreateTime = new Date(); logDto.CreateTime = new Date();
...@@ -2796,10 +2830,16 @@ ...@@ -2796,10 +2830,16 @@
return $q.reject(); return $q.reject();
}; };
$scope.cleanManual = function(){ $scope.cleanManual = function(){
$scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1}); $scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1});
$('#ss').html(''); $('#ss').html('');
document.getElementById("fileDemo").value=""; $scope.hasManualLoad = false;
$scope.file = null;
};
$scope.closeManualModal = function () {
$scope.cleanManual();
$scope.modalInstance.dismiss('cancel');
}; };
......
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