Commit 4e36583b authored by neo's avatar neo

[DEV] when approval agree and can add manual data

parent f017d515
...@@ -873,10 +873,6 @@ public class ReportServiceImpl { ...@@ -873,10 +873,6 @@ public class ReportServiceImpl {
public OperationResultDto addCellManualDataSource(ManualDataSourceDto data, String projectId) { public OperationResultDto addCellManualDataSource(ManualDataSourceDto data, String projectId) {
OperationResultDto operationResultDto = new OperationResultDto(); OperationResultDto operationResultDto = new OperationResultDto();
String status = periodApprovalMapper.getStatusByProjectIdAndPeriod(projectId, data.getPeriod());
MyAsserts.assertTrue(status == null || status.equals(Constant.APPROVAL_DISAGREED), Exceptions.REPORT_IN_PROCESS_OR_AGREED_EXCEPTION);
try { try {
if (data.getCellId() == null) { if (data.getCellId() == null) {
//todo: insert celldata for manual datasource //todo: insert celldata for manual datasource
......
...@@ -1493,35 +1493,41 @@ ...@@ -1493,35 +1493,41 @@
//单元格详细信息点击确定时执行 //单元格详细信息点击确定时执行
$scope.confirm = function () { $scope.confirm = function () {
$scope.handInputModel.name = $scope.taxCellDetail.inputMemo; vatApproveService.approvalStatus(vatSessionService.project.id,vatSessionService.project.period).success(function(result){
$scope.handInputModel.amount = $scope.taxCellDetail.inputValue; if(result&&result=='committed'){
$scope.handInputModel.description = $scope.taxCellDetail.inputMemo; SweetAlert.error('报表提审中!');
$scope.handInputModel.projectID = vatSessionService.project.id; }else{
$scope.handInputModel.serviceTypeID = vatSessionService.project.serviceTypeID; $scope.handInputModel.name = $scope.taxCellDetail.inputMemo;
$scope.handInputModel.period = vatSessionService.month; $scope.handInputModel.amount = $scope.taxCellDetail.inputValue;
$scope.handInputModel.description = $scope.taxCellDetail.inputMemo;
if ($scope.handInputModel.amount || $scope.handInputModel.name) { $scope.handInputModel.projectID = vatSessionService.project.id;
//日志对象 $scope.handInputModel.serviceTypeID = vatSessionService.project.serviceTypeID;
logDto.ID = PWC.newGuid(); $scope.handInputModel.period = vatSessionService.month;
logDto.CreateTime = new Date();
logDto.UpdateTime = new Date(); if ($scope.handInputModel.amount || $scope.handInputModel.name) {
logDto.OperationContent = "Amount: " + $scope.handInputModel.amount //日志对象
+ "; Description: " + $scope.handInputModel.description; logDto.ID = PWC.newGuid();
logDto.OperationName = $translate.instant('ManualInputDataSource'); logDto.CreateTime = new Date();
logDto.Comment = comment + "(Cell ID:" + $scope.handInputModel.cellID logDto.UpdateTime = new Date();
+ ", Cell Template ID:" + $scope.handInputModel.cellTemplateID + ")"; logDto.OperationContent = "Amount: " + $scope.handInputModel.amount
logDto.OperationType = enums.vatLogOperationTypeEnum.RV_ManualInput; + "; Description: " + $scope.handInputModel.description;
logDto.OperationName = $translate.instant('ManualInputDataSource');
// 前端保存数据 logDto.Comment = comment + "(Cell ID:" + $scope.handInputModel.cellID
return vatReportService.addCellManualData($scope.handInputModel, logDto).then(function (manualData) { + ", Cell Template ID:" + $scope.handInputModel.cellTemplateID + ")";
var obj = manualData.data.data; logDto.OperationType = enums.vatLogOperationTypeEnum.RV_ManualInput;
obj.dataSourceType = manualData.dataSourceType;
$scope.updateCellByManualChange(obj); // 前端保存数据
return $q.when(); return vatReportService.addCellManualData($scope.handInputModel, logDto).then(function (manualData) {
var obj = manualData.data.data;
obj.dataSourceType = manualData.dataSourceType;
$scope.updateCellByManualChange(obj);
return $q.when();
});
}
return $q.reject();
}); });
}
return $q.reject();
}; };
...@@ -2554,7 +2560,7 @@ ...@@ -2554,7 +2560,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!",
...@@ -2685,7 +2691,7 @@ ...@@ -2685,7 +2691,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{
var text= $(".li").find(".active").text(); var text= $(".li").find(".active").text();
$log.debug(text); $log.debug(text);
......
...@@ -96,13 +96,9 @@ ...@@ -96,13 +96,9 @@
data.dataSourceType = enums.cellDataSourceType.KeyIn; data.dataSourceType = enums.cellDataSourceType.KeyIn;
return $q.when(data); return $q.when(data);
},function (data) { },function (data) {
if(data.status==412){ logInfo.UpdateState = $translate.instant('ManualInputFail');
SweetAlert.error('报表提审中或审核已通过!'); SweetAlert.error($translate.instant('PleaseContactAdministrator'));
}else{ return vatOperationLogService.addOperationLog(logInfo);
logInfo.UpdateState = $translate.instant('ManualInputFail');
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
return vatOperationLogService.addOperationLog(logInfo);
}
}); });
}, },
deleteCellVoucher: function (voucherId, datasourceId) { deleteCellVoucher: function (voucherId, datasourceId) {
......
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