Commit 39d3f2b6 authored by sherlock's avatar sherlock

报表排序拆分

parent cba35824
......@@ -723,7 +723,7 @@
},
{
calculateCellValue: function(){
var formula = $scope.detail.config.formular;
var formula = $scope.detail.config.formula;
if(formula.indexOf('DFFS') > -1){
return '贷方发生';
} else if(formula.indexOf('JFFS') > -1){
......
......@@ -41,29 +41,46 @@
}
if ($scope.hasTaxReturnPermission && $scope.hasQueryTaxReturnPermission) {
var diffArr = ['会计数据统计','出口数据比对','进项税额差异分析表','收入差异分析表'];
// var templates = _.chain
// 获取 申报表 Report Template
var diffRtnGrp = {name:'差异分析表', children:[],orderIndex:1};
var taxRtnGrp = {
name: 'TaxReturn',
children: _.chain(result[1].data.data)
.sortBy(function(x){
return x.templateCode;
})
/*.map(function(x){
.map(function(x){
var nameIndex;
var tempName = x.templateName.substr(x.templateName.length - 4);
if(tempName.search("附表一") != -1){
// var tempName = x.templateName.substr(x.templateName.length - 4);
if(x.templateName == ('增值税纳税申报表')){
nameIndex = 0;
} else if(tempName.search("附表二") != -1){
} else if(x.templateName.search("一") != -1){
nameIndex = 1;
} else if(tempName.search("附表三") != -1){
} else if(x.templateName.search("二") != -1){
nameIndex = 2;
} else if(tempName.search("附表四") != -1){
} else if(x.templateName.search("三") != -1){
nameIndex = 3;
} else if(tempName.search("附表五") != -1){
} else if(x.templateName.search("四") != -1){
nameIndex = 4;
} else {
} else if(x.templateName.search("五") != -1){
nameIndex = 5;
} else if(x.templateName.search('代扣代缴') != -1){
nameIndex = 6;
} else if(x.templateName.search('海关专用') != -1){
nameIndex = 7;
} else if(x.templateName.search('增值税减免税申报明细表') != -1){
nameIndex = 8;
} else if(x.templateName.search('营改增') != -1){
nameIndex = 9;
} else if(x.templateName.search('附加税报表') != -1){
nameIndex = 10;
} else {
nameIndex = 20;
if($.inArray(x.templateName, diffArr) != -1){
diffRtnGrp.children.push(x);
}
}
return {
id:x.id,
......@@ -73,9 +90,12 @@
nameIndex:nameIndex
}
})
.filter(function(x){
return $.inArray(x.templateName, diffArr) == -1;
})
.sortBy(function(x){
return x.nameIndex;
})*/
})
.map(function (x) {
return {
reportId: x.id,
......@@ -86,11 +106,21 @@
}).value(),
orderIndex: grps.length
};
diffRtnGrp.children = _.chain(diffRtnGrp.children)
.map(function(x){
return {
reportId: x.id,
id: x.templateId,
name: x.templateName,
code: x.templateCode
};
}).value();
grps.push(taxRtnGrp);
grps.push(diffRtnGrp);
}
$scope.groups = _.chain(grps).sortBy(function (x) {
return x.orderIndex;
// return x.children.name;
}).map(function (x) {
......
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