Commit e09cb805 authored by neo's avatar neo

[Bugfix] fixed sql error for query approval list

parent 99b8cb6b
...@@ -122,7 +122,7 @@ public interface PeriodApproveMapper extends MyVatMapper { ...@@ -122,7 +122,7 @@ public interface PeriodApproveMapper extends MyVatMapper {
" pa.APPROVAL_TIME AS approvalTime, " + " pa.APPROVAL_TIME AS approvalTime, " +
" pa.REPORT_PATHS AS reportPaths," + " pa.REPORT_PATHS AS reportPaths," +
" pa.REPORT_IDS as reportIds, " + " pa.REPORT_IDS as reportIds, " +
" pa.TEMPLATE_IDS as templateIds" + " pa.TEMPLATE_IDS as templateIds " +
"FROM " + "FROM " +
" PERIOD_APPROVE pa " + " PERIOD_APPROVE pa " +
" INNER JOIN PROJECT p ON pa.PROJECT_ID = p.ID " + " INNER JOIN PROJECT p ON pa.PROJECT_ID = p.ID " +
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
return $http.get('/approval/tasks/'+assignee, apiConfig.createVat()); return $http.get('/approval/tasks/'+assignee, apiConfig.createVat());
}, },
getApprovalTemplateInfo:function(templateId){
return $http.get('/approval/templateInfo/'+templateId, apiConfig.createVat());
},
getExportOutputInvoiceList: function (param) { getExportOutputInvoiceList: function (param) {
return $http.post('/outputInvoiceImport/getExportOutputInvoiceList', { return $http.post('/outputInvoiceImport/getExportOutputInvoiceList', {
PageInfo: param.pageInfo, PageInfo: param.pageInfo,
......
...@@ -161,7 +161,6 @@ ...@@ -161,7 +161,6 @@
}) })
} }
var demoData = $scope.demoDataWithStateSaved(temp);
var counter = 0; var counter = 0;
var setWarningToTrue = false; var setWarningToTrue = false;
...@@ -220,52 +219,6 @@ ...@@ -220,52 +219,6 @@
$scope.ongoingNum = $scope.queryResults.length - $scope.notBeginNum - $scope.completedNum; $scope.ongoingNum = $scope.queryResults.length - $scope.notBeginNum - $scope.completedNum;
}; };
$scope.demoDataWithStateSaved = function (temp) {
var demoData = [];
var data;
var demoDataComposedByLocalStorage = $scope.serviceTypeId + "_" + vatSessionService.year + "_" + vatSessionService.month;
data = localStorageService.get(demoDataComposedByLocalStorage);
if (data === null || data.length === 0) {
var counter = 0;
var everyXnumberToSetTrue = 3;
var dData;
// Set State:
temp.forEach(function (item) {
dData = new Object();
//generate random data
dData.id = item.id;
dData.taxAmount = randomXToY(10000, 99999999, 2);
dData.prepadidTaxAmount = randomXToY(10000, 99999999, 2);
dData.taxRate = randomXToY(1, 35, 0);
dData.hasWarning = false;
if (counter >= everyXnumberToSetTrue && (counter % everyXnumberToSetTrue === 0))
dData.hasWarning = true;
demoData.push(dData);
counter++;
});
localStorageService.set(demoDataComposedByLocalStorage, demoData);
}
else {
// Get from State:
demoData = localStorageService.get(demoDataComposedByLocalStorage);
}
return demoData;
};
var thisDataService = { var thisDataService = {
isHaveOrganizationPermission: function (orgID) { isHaveOrganizationPermission: function (orgID) {
...@@ -621,13 +574,6 @@ ...@@ -621,13 +574,6 @@
} }
} }
//function to get random number upto m
function randomXToY(minVal, maxVal, floatVal) {
var randVal = minVal + (Math.random() * (maxVal - minVal));
return typeof floatVal == 'undefined' ? Math.round(randVal) : randVal.toFixed(floatVal);
}
var loadApprovalFromDB = function () { var loadApprovalFromDB = function () {
vatApproveService.approvalTasks().success(function (data) { vatApproveService.approvalTasks().success(function (data) {
if (data) { if (data) {
...@@ -635,25 +581,6 @@ ...@@ -635,25 +581,6 @@
dataSource: data, dataSource: data,
keyExpr: "instanceId", keyExpr: "instanceId",
showBorders: true, showBorders: true,
editing: {
mode: "form",
allowUpdating: true,
form: {
items:[
{dataField: "projectName", editorOptions: { disabled: true}},
{dataField: "period", editorOptions: { disabled: true}},
{dataField: "createBy", editorOptions: { disabled: true}},
{dataField: "createTime", editorOptions: { disabled: true}},
{dataField: "status", editorOptions: { disabled: true}},
{dataField: "result",
editorType: 'dxRadioGroup',
label: { text: '审核结果', location: 'left' },
editorOptions: { dataSource: [{ text: "通过", value: 'agreed' }, { text: "不通过", value: 'disagreed' }],layout: "horizontal"}
},
{dataField: "approvalResult", editorType: "dxTextArea",editorOptions: {height: 50}}
]
}
},
columns: [ columns: [
{ caption: '项目名称', width: '12%', dataField: "projectName"}, { caption: '项目名称', width: '12%', dataField: "projectName"},
{ caption: '期间', width: '7%', dataField: "period"}, { caption: '期间', width: '7%', dataField: "period"},
...@@ -661,12 +588,10 @@ ...@@ -661,12 +588,10 @@
{ caption: '审批人', width: '10%', dataField: "approvalBy"}, { caption: '审批人', width: '10%', dataField: "approvalBy"},
{ caption: '审批状态', width: '10%', dataField: "status"}, { caption: '审批状态', width: '10%', dataField: "status"},
{ caption: '审批意见', width: '15%', dataField: "approvalResult"}, { caption: '审批意见', width: '15%', dataField: "approvalResult"},
{ caption: '创建时间', width: '7.5%', dataField: "createTime"}, { caption: '创建时间', width: '7.5%', dataField: "createTime"}
{ caption: '审批时间', width: '7.5%', dataField: "approvalTime"}
], ],
onRowClick: function (e) { onRowClick: function (e) {
$scope.newProductModalInstance = ackUibModal($scope, 'liucheng.html', 'liucheng', '.app-overview ', 'static') $scope.goToService(e.data);
$scope.newProductModalInstance.open();
} }
}; };
...@@ -674,10 +599,24 @@ ...@@ -674,10 +599,24 @@
}); });
}; };
$scope.cancel = function () { $scope.goToService = function (approvalInfo) {
$scope.newProductModalInstance.cancel(); projectService.getProjectByID(approvalInfo.projectId).success(function(result){
}; vatSessionService.project = result;
vatSessionService.project.projectName = approvalInfo.projectName;
vatSessionService.project.month = approvalInfo.period;
vatSessionService.month = approvalInfo.period;
vatApproveService.getApprovalTemplateInfo(approvalInfo.templateIds.split(",")[0]).success(function(result){
$state.go('vat.generateReport.reportView',{
id: approvalInfo.reportIds.split(",")[0],
templateid: result.templateId,
name: result.name,
templatecode: result.code
});
});
});
};
(function initialize() { (function initialize() {
initDatePickers(); initDatePickers();
......
vatModule.controller('VatLayoutController', ['$scope', '$rootScope', '$q', '$log', '$timeout', '$state', '$translate', 'projectService', 'SweetAlert', 'loginContext' vatModule.controller('VatLayoutController', ['$scope', '$rootScope', '$q', '$log', '$timeout', '$state', '$translate', 'projectService', 'SweetAlert', 'loginContext'
, 'vatSessionService', 'vatCommonService', 'vatWorkflowService', 'application', 'enums', '$uibModal','vatApproveService', , 'vatSessionService', 'vatCommonService', 'vatWorkflowService', 'application', 'enums', '$uibModal',' ',
function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectService, SweetAlert, loginContext function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectService, SweetAlert, loginContext
, vatSessionService, vatCommonService, vatWorkflowService, application, enums, $uibModal, vatApproveService) { , vatSessionService, vatCommonService, vatWorkflowService, application, enums, $uibModal, ) {
'use strict'; 'use strict';
$log.debug('VatLayoutController.ctor()...'); $log.debug('VatLayoutController.ctor()...');
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4YearMonth');
$scope.showSubMenu = true; $scope.showSubMenu = true;
if(vatSessionService.project.projectName){
$scope.projectName = vatSessionService.project.projectName;
}else{
$scope.projectName = vatSessionService.project.organizationName + '(' + vatSessionService.project.year + ')'; $scope.projectName = vatSessionService.project.organizationName + '(' + vatSessionService.project.year + ')';
}
$scope.selectedDate = new Date(vatSessionService.project.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.project.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(vatSessionService.project.year, 0, 1); $scope.startDate = new Date(vatSessionService.project.year, 0, 1);
...@@ -433,7 +438,7 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer ...@@ -433,7 +438,7 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
var approveParam={}; var approveParam={};
approveParam.projectId = vatSessionService.project.id; approveParam.projectId = vatSessionService.project.id;
approveParam.periodDate = vatSessionService.project.periodDate; approveParam.periodDate = vatSessionService.project.periodDate;
vatApproveService.commitNewApproval(approveParam); .commitNewApproval(approveParam);
} }
$scope.showProjectStatus = function () { $scope.showProjectStatus = function () {
......
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