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 {
" pa.APPROVAL_TIME AS approvalTime, " +
" pa.REPORT_PATHS AS reportPaths," +
" pa.REPORT_IDS as reportIds, " +
" pa.TEMPLATE_IDS as templateIds" +
" pa.TEMPLATE_IDS as templateIds " +
"FROM " +
" PERIOD_APPROVE pa " +
" INNER JOIN PROJECT p ON pa.PROJECT_ID = p.ID " +
......
......@@ -17,6 +17,10 @@
return $http.get('/approval/tasks/'+assignee, apiConfig.createVat());
},
getApprovalTemplateInfo:function(templateId){
return $http.get('/approval/templateInfo/'+templateId, apiConfig.createVat());
},
getExportOutputInvoiceList: function (param) {
return $http.post('/outputInvoiceImport/getExportOutputInvoiceList', {
PageInfo: param.pageInfo,
......
......@@ -161,7 +161,6 @@
})
}
var demoData = $scope.demoDataWithStateSaved(temp);
var counter = 0;
var setWarningToTrue = false;
......@@ -220,52 +219,6 @@
$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 = {
isHaveOrganizationPermission: function (orgID) {
......@@ -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 () {
vatApproveService.approvalTasks().success(function (data) {
if (data) {
......@@ -635,25 +581,6 @@
dataSource: data,
keyExpr: "instanceId",
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: [
{ caption: '项目名称', width: '12%', dataField: "projectName"},
{ caption: '期间', width: '7%', dataField: "period"},
......@@ -661,12 +588,10 @@
{ caption: '审批人', width: '10%', dataField: "approvalBy"},
{ caption: '审批状态', width: '10%', dataField: "status"},
{ caption: '审批意见', width: '15%', dataField: "approvalResult"},
{ caption: '创建时间', width: '7.5%', dataField: "createTime"},
{ caption: '审批时间', width: '7.5%', dataField: "approvalTime"}
{ caption: '创建时间', width: '7.5%', dataField: "createTime"}
],
onRowClick: function (e) {
$scope.newProductModalInstance = ackUibModal($scope, 'liucheng.html', 'liucheng', '.app-overview ', 'static')
$scope.newProductModalInstance.open();
$scope.goToService(e.data);
}
};
......@@ -674,10 +599,24 @@
});
};
$scope.cancel = function () {
$scope.newProductModalInstance.cancel();
};
$scope.goToService = function (approvalInfo) {
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() {
initDatePickers();
......
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
, vatSessionService, vatCommonService, vatWorkflowService, application, enums, $uibModal, vatApproveService) {
, vatSessionService, vatCommonService, vatWorkflowService, application, enums, $uibModal, ) {
'use strict';
$log.debug('VatLayoutController.ctor()...');
$scope.dateFormat = $translate.instant('dateFormat4YearMonth');
$scope.showSubMenu = true;
$scope.projectName = vatSessionService.project.organizationName + '(' + vatSessionService.project.year + ')';
if(vatSessionService.project.projectName){
$scope.projectName = vatSessionService.project.projectName;
}else{
$scope.projectName = vatSessionService.project.organizationName + '(' + vatSessionService.project.year + ')';
}
$scope.selectedDate = new Date(vatSessionService.project.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(vatSessionService.project.year, 0, 1);
......@@ -433,7 +438,7 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
var approveParam={};
approveParam.projectId = vatSessionService.project.id;
approveParam.periodDate = vatSessionService.project.periodDate;
vatApproveService.commitNewApproval(approveParam);
.commitNewApproval(approveParam);
}
$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