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!",
...@@ -2701,6 +2701,12 @@ ...@@ -2701,6 +2701,12 @@
}; };
$scope.upLoadManual = function(){ $scope.upLoadManual = function(){
if(vatSessionService.month)
vatSessionService.project.period=vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
if(result&&result=='committed'){
SweetAlert.error('报表提审中!');
}else{
var text= $(".li").find(".active").text(); var text= $(".li").find(".active").text();
$log.debug(text); $log.debug(text);
if(text == '海关专用缴款书' || text =='代扣代缴税收通用缴款书取数'){ if(text == '海关专用缴款书' || text =='代扣代缴税收通用缴款书取数'){
...@@ -2709,12 +2715,20 @@ ...@@ -2709,12 +2715,20 @@
}else{ }else{
SweetAlert.warning("仅支持海关专用缴款书或代扣代缴税收通用缴款书取数"); SweetAlert.warning("仅支持海关专用缴款书或代扣代缴税收通用缴款书取数");
} }
}
});
}; };
$scope.loadMyExcel = function(){ $scope.loadMyExcel = function(){
if($scope.file){
if($scope.hasManualLoad){
SweetAlert.warning("已载入文件,如需重新载入请先清空!");
}else{
$scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1}); $scope.manualSpread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount: 1});
var excelIo = new GC.Spread.Excel.IO(); var excelIo = new GC.Spread.Excel.IO();
var excelFile = document.getElementById("fileDemo").files[0]; var excelFile = $scope.file;
excelIo.open(excelFile, function(json) { excelIo.open(excelFile, function(json) {
var workbookObj = json; var workbookObj = json;
$scope.manualSpread.fromJSON(workbookObj); $scope.manualSpread.fromJSON(workbookObj);
...@@ -2726,9 +2740,16 @@ ...@@ -2726,9 +2740,16 @@
}, { }, {
}); });
$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 = {};
if(cellString){
handInputModel = {
cellID: jsonTagInfo.cellID,
cellTemplateID: jsonTagInfo.cellTemplateID,
reportID: jsonTagInfo.reportID,
keyinData: cellString
};
}else{
handInputModel = {
cellID: jsonTagInfo.cellID, cellID: jsonTagInfo.cellID,
cellTemplateID: jsonTagInfo.cellTemplateID, cellTemplateID: jsonTagInfo.cellTemplateID,
reportID: jsonTagInfo.reportID, reportID: jsonTagInfo.reportID,
amount:cellValue 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();
...@@ -2799,7 +2833,13 @@ ...@@ -2799,7 +2833,13 @@
$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