Commit 55ad30f3 authored by neo's avatar neo

[BugFixed] fixed approval result undefind

parent 79b3576e
......@@ -31,6 +31,7 @@
//*************************************************************************************************
$scope.randomCounter = 0;
$scope.allResults = [];
$scope.queryResults = [];
$scope.checkedOrgs = {};
$scope.orgList = [];
$scope.orderYear = true;
......@@ -125,17 +126,14 @@
return _.contains(_.values($scope.checkedOrgs), i.organizationName);
});
}
if ($scope.serviceTypeId) {
temp = _.filter(temp, function (i) {
return $scope.serviceTypeId == i.serviceTypeID;
});
}
if (vatSessionService.year) {
if ($scope.serviceTypeId === enums.serviceType.VAT) {
temp = _.filter(temp, function (i) {
if (i.startPeriod <= vatSessionService.month && i.endPeriod >= vatSessionService.month && i.year == vatSessionService.year) {
if (i.period == vatSessionService.month) {
return i;
}
});
}
else if ($scope.serviceTypeId === enums.serviceType.CIT) {
......@@ -164,28 +162,6 @@
var counter = 0;
var setWarningToTrue = false;
temp.forEach(function (project) {
setWarningToTrue = false;
project.finalStatus = setLayoutStatusTitle(project.projectStatusList);
project.periodDate = $scope.currentSelectedYear + "." + $scope.currentSelectedMonth;
var oneDemoData = _.find(demoData, function (one) { return one.id === project.id });
if (project.serviceTypeID === enums.serviceType.VAT) {
if (project.projectStatusList !== null && project.projectStatusList[vatSessionService.month] !== undefined && project.projectStatusList[vatSessionService.month] !== 10 && oneDemoData!==undefined) {
project.taxAmount = oneDemoData.taxAmount;
project.prepadidTaxAmount = oneDemoData.prepadidTaxAmount;
project.taxRate = oneDemoData.taxRate;
project.hasWarning = oneDemoData.hasWarning;
}
}
counter++;
});
$scope.queryResults = temp;
$scope.projectMsg = $translate.instant('ProjectResultMsg').formatObj({ "ProjectNum": $scope.queryResults.length });
......@@ -283,15 +259,6 @@
};
$scope.changeStartDate = function (e) {
if (e&&e.date) {
var tempYear = e.date.getFullYear();
var tempMonth = e.date.getMonth() + 1;
$scope.currentSelectedStartMonth = tempMonth;
$scope.currentSelectedStartYear = tempYear;
}
};
$scope.changeDate = function (e) {
if (e && e.date) {
var isDateUpdated = false;
......@@ -308,15 +275,15 @@
$scope.currentSelectedYear = tempYear;
if (isDateUpdated) {
//$scope.$apply(function () {
// $scope.conditionChange = !$scope.conditionChange;
//});
$timeout(function () {
$scope.conditionChange = !$scope.conditionChange;
});
}
if ($scope.serviceTypeId !== enums.serviceType.AssetsManage) {
$scope.query();
}
}
};
......@@ -577,8 +544,18 @@
var loadApprovalFromDB = function () {
vatApproveService.approvalTasks().success(function (data) {
if (data) {
data.forEach(function (p) {
if (PWC.isHavePermissionForOrg(p.organizationId, vatSessionService.userPermission))
{
$scope.allResults.push(p);
}
});
$scope.queryResults = _.clone($scope.allResults);
$scope.gridOptions = {
dataSource: data,
bindingOptions: {
"dataSource": "queryResults"
},
keyExpr: "instanceId",
showBorders: true,
columns: [
......@@ -597,7 +574,15 @@
}
}
},
{ caption: '审批意见', width: '15%', dataField: "approvalResult"},
{ caption: '审批意见', width: '15%',
calculateCellValue: function(data) {
if(data.approvalResult == 'undefined'){
return '';
}else{
return data.approvalResult;
}
}
},
{ caption: '提审时间', width: '7.5%', dataField: "createTime"},
{ caption: '审批时间', width: '7.5%', dataField: "approvalTime"}
],
......
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