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